diff --git a/.github/contributing.md b/.github/contributing.md index ad67718eef..6bc7b5a005 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -92,7 +92,7 @@ Before creating a suggestion, please check [this list](#before-submitting-a-sugg #### Before Submitting a Feature Request -* **Check the [Marlin website](http://marlinfw.org/)** for tips — you might discover that the feature is already included. Most importantly, check if you're using [the latest version of Marlin](https://github.com/MarlinFirmware/Marlin/releases) and if you can get the desired behavior by changing [Marlin's config settings](http://marlinfw.org/docs/configuration/configuration.html). +* **Check the [Marlin website](https://marlinfw.org/)** for tips — you might discover that the feature is already included. Most importantly, check if you're using [the latest version of Marlin](https://github.com/MarlinFirmware/Marlin/releases) and if you can get the desired behavior by changing [Marlin's config settings](https://marlinfw.org/docs/configuration/configuration.html). * **Perform a [cursory search](https://github.com/MarlinFirmware/Marlin/issues?q=is%3Aissue)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. #### How Do I Submit A (Good) Feature Request? @@ -116,12 +116,12 @@ Unsure where to begin contributing to Marlin? You can start by looking through t ### Pull Requests -Pull Requests should always be targeted to working branches (e.g., `bugfix-1.1.x` and/or `bugfix-2.0.x`) and never to release branches (e.g., `1.1.x`). If this is your first Pull Request, please read our [Guide to Pull Requests](http://marlinfw.org/docs/development/getting_started_pull_requests.html) and Github's [Pull Request](https://help.github.com/articles/creating-a-pull-request/) documentation. +Pull Requests should always be targeted to working branches (e.g., `bugfix-1.1.x` and/or `bugfix-2.0.x`) and never to release branches (e.g., `1.1.x`). If this is your first Pull Request, please read our [Guide to Pull Requests](https://marlinfw.org/docs/development/getting_started_pull_requests.html) and Github's [Pull Request](https://help.github.com/articles/creating-a-pull-request/) documentation. * Fill in [the required template](pull_request_template.md). * Don't include issue numbers in the PR title. * Include pictures, diagrams, and links to videos in your Pull Request to demonstrate your changes, if needed. -* Follow the [Coding Standards](http://marlinfw.org/docs/development/coding_standards.html) posted on our website. +* Follow the [Coding Standards](https://marlinfw.org/docs/development/coding_standards.html) posted on our website. * Document new code with clear and concise comments. * End all files with a newline. @@ -136,7 +136,7 @@ Pull Requests should always be targeted to working branches (e.g., `bugfix-1.1.x ### C++ Coding Standards -* Please read and follow the [Coding Standards](http://marlinfw.org/docs/development/coding_standards.html) posted on our website. Failure to follow these guidelines will delay evaluation and acceptance of Pull Requests. +* Please read and follow the [Coding Standards](https://marlinfw.org/docs/development/coding_standards.html) posted on our website. Failure to follow these guidelines will delay evaluation and acceptance of Pull Requests. ### Documentation diff --git a/.github/issue_template.md b/.github/issue_template.md index f45bd71d09..a211ca5e27 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -1,16 +1,11 @@ # NO SUPPORT REQUESTS PLEASE -Support Requests posted here will be automatically closed! +Do you want to ask a question? Are you looking for support? Please don't post here. Support Requests posted here will be automatically closed! -This Issue Queue is for Marlin bug reports and development-related issues, and we prefer not to handle user-support questions here. See https://github.com/MarlinFirmware/Marlin/blob/1.1.x/.github/contributing.md#i-dont-want-to-read-this-whole-thing-i-just-have-a-question. +Instead use one of the following options: -For best results getting help with configuration and troubleshooting, please use the following resources: +- The Marlin Firmware forum at https://reprap.org/forum/list.php?415 +- The MarlinFirmware Facebook Group at https://www.facebook.com/groups/1049718498464482/ +- The MarlinFirmware Discord Server at https://discord.gg/n5NJ59y. -- RepRap.org Marlin Forum http://forums.reprap.org/list.php?415 -- Tom's 3D Forums https://discuss.toms3d.org/ -- Facebook Group "Marlin Firmware" https://www.facebook.com/groups/1049718498464482/ -- Facebook Group "Marlin Firmware for 3D Printers" https://www.facebook.com/groups/3Dtechtalk/ -- Marlin Configuration https://www.youtube.com/results?search_query=marlin+configuration on YouTube -- Marlin Discord server. Join link: https://discord.gg/n5NJ59y - -After seeking help from the community, if the consensus points to to a bug in Marlin, then you should post a Bug Report at https://github.com/MarlinFirmware/Marlin/issues/new/choose). +Before filing an issue be sure to test the latest "bugfix" branch to see whether the issue is already addressed. diff --git a/.github/lock.yml b/.github/lock.yml new file mode 100644 index 0000000000..c5ceff66b0 --- /dev/null +++ b/.github/lock.yml @@ -0,0 +1,40 @@ +# +# Configuration for Lock Threads - https://github.com/dessant/lock-threads-app +# + +# Number of days of inactivity before a closed issue or pull request is locked +daysUntilLock: 60 + +# Skip issues and pull requests created before a given timestamp. Timestamp must +# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable +skipCreatedBefore: false + +# Issues and pull requests with these labels will be ignored. Set to `[]` to disable +exemptLabels: [ 'no-locking' ] + +# Label to add before locking, such as `outdated`. Set to `false` to disable +lockLabel: false + +# Comment to post before locking. Set to `false` to disable +lockComment: > + This thread has been automatically locked since there has not been + any recent activity after it was closed. Please open a new issue for + related bugs. + +# Assign `resolved` as the reason for locking. Set to `false` to disable +setLockReason: true + +# Limit to only `issues` or `pulls` +# only: issues + +# Optionally, specify configuration settings just for `issues` or `pulls` +# issues: +# exemptLabels: +# - help-wanted +# lockLabel: outdated + +# pulls: +# daysUntilLock: 30 + +# Repository to extend settings from +# _extends: repo diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index 54c0de98ee..4dd483499b 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -58,14 +58,25 @@ jobs: - STM32F103RE_btt - STM32F103RE_btt_USB - STM32F103RC_fysetc + - STM32F103RC_meeb - jgaurora_a5s_a1 - STM32F103VE_longer - STM32F407VE_black + - STM32F401VE_STEVAL + - BIGTREE_BTT002 - BIGTREE_SKR_PRO - BIGTREE_GTR_V1_0 - mks_robin - ARMED - FYSETC_S6 + - STM32F070RB_malyan + - malyan_M300 + - mks_robin_lite + - FLYF407ZG + - rumba32 + - mks_robin_pro + - STM32F103RET6_creality + - LERDGEX # Put lengthy tests last @@ -78,12 +89,9 @@ jobs: #- STM32F7 # Non-working environment tests - - #- BIGTREE_BTT002 #- at90usb1286_cdc #- at90usb1286_dfu #- STM32F103CB_malyan - #- mks_robin_lite #- mks_robin_mini #- mks_robin_nano @@ -97,7 +105,7 @@ jobs: - name: Install PlatformIO run: | - pip install -U https://github.com/platformio/platformio-core/archive/master.zip + pip install -U https://github.com/platformio/platformio-core/archive/develop.zip platformio update - name: Check out the PR @@ -106,8 +114,7 @@ jobs: - name: Run ${{ matrix.test-platform }} Tests run: | # Inline tests script - [[ "$GITHUB_REPOSITORY" == "MarlinFirmware/Marlin" ]] || exit 0 chmod +x buildroot/bin/* - chmod +x buildroot/share/tests/* - export PATH=./buildroot/bin/:./buildroot/share/tests/:${PATH} + chmod +x buildroot/tests/* + export PATH=./buildroot/bin/:./buildroot/tests/:${PATH} run_tests . ${{ matrix.test-platform }} diff --git a/.gitignore b/.gitignore index 80c76ee1e4..c163d339df 100755 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # # Our automatic versioning scheme generates the following file diff --git a/LICENSE b/LICENSE index 7d917cf3d8..4ad6d9b1e2 100644 --- a/LICENSE +++ b/LICENSE @@ -3,7 +3,7 @@ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (c) 2007 Free Software Foundation, Inc. + 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. @@ -647,7 +647,7 @@ the "copyright" line and a pointer to where the full notice is found. GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. @@ -666,12 +666,12 @@ 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/Configuration.h b/Marlin/Configuration.h index 2efe284ac3..a01571c422 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -36,7 +36,7 @@ * Advanced settings can be found in Configuration_adv.h * */ -#define CONFIGURATION_H_VERSION 020005 +#define CONFIGURATION_H_VERSION 020006 //=========================================================================== //============================= Getting Started ============================= @@ -45,13 +45,13 @@ /** * Here are some standard links for getting your machine calibrated: * - * http://reprap.org/wiki/Calibration - * http://youtu.be/wAL9d7FgInk + * https://reprap.org/wiki/Calibration + * https://youtu.be/wAL9d7FgInk * http://calculator.josefprusa.cz - * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide - * http://www.thingiverse.com/thing:5573 + * https://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * https://www.thingiverse.com/thing:5573 * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap - * http://www.thingiverse.com/thing:298812 + * https://www.thingiverse.com/thing:298812 */ //=========================================================================== @@ -135,21 +135,28 @@ //#define CUSTOM_MACHINE_NAME "3D Printer" // 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 +// Choose your own or use a service like https://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, 7, 8] +// :[0, 1, 2, 3, 4, 5, 6, 7, 8] #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 3.0 +#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75 // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// Save and restore temperature and fan speed on tool-change. +// Set standby for the unselected tool with M104/106/109 T... +#if ENABLED(SINGLENOZZLE) + //#define SINGLENOZZLE_STANDBY_TEMP + //#define SINGLENOZZLE_STANDBY_FAN +#endif + /** * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. * @@ -326,7 +333,7 @@ #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 PSU_POWERUP_DELAY 250 // (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) @@ -364,8 +371,9 @@ * 202 : 200k thermistor - Copymaster 3D * 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) + * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan, J-Head, and E3D) (4.7k pullup) * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 502 : 100K Zonestar Thermistor used by hot bed in Zonestar Prusa P802M * 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) @@ -373,13 +381,15 @@ * 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) + * 11 : 100k beta 3950 1% thermistor (Used in Keenovo AC silicone mats and most Wanhao i3 machines) (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 with 5v excitation (AVR) * 21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v excitation (STM32 \ LPC176x....) + * 22 : 100k (hotend) with 4.7k pullup to 3.3V and 220R to analog input (as in GTM32 Pro vB) + * 23 : 100k (bed) with 4.7k pullup to 3.3v and 220R to analog input (as in GTM32 Pro vB) * 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 @@ -395,7 +405,7 @@ * 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 + * 1047 : Pt1000 with 4k7 pullup (E3D) * 1010 : Pt1000 with 1k pullup (non standard) * 147 : Pt100 with 4k7 pullup * 110 : Pt100 with 1k pullup (non standard) @@ -470,16 +480,12 @@ #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. Use 'M303 D' to toggle activation. - //#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 @@ -548,6 +554,14 @@ // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. #endif // PIDTEMPBED +#if EITHER(PIDTEMP, PIDTEMPBED) + //#define PID_DEBUG // Sends debug data to the serial port. Use 'M303 D' to toggle activation. + //#define PID_OPENLOOP // 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_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. +#endif + // @section extruder /** @@ -697,7 +711,7 @@ * 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. + * - To fix noise install a 100nF ceramic capacitor in parallel 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. * @@ -705,6 +719,9 @@ */ //#define ENDSTOP_NOISE_THRESHOLD 2 +// Check for stuck or disconnected endstops during homing moves. +//#define DETECT_BROKEN_ENDSTOP + //============================================================================= //============================== Movement Settings ============================ //============================================================================= @@ -798,10 +815,12 @@ * * See: * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + * https://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 + #define JD_HANDLE_SMALL_SEGMENTS // Use curvature estimation instead of just the junction angle + // for small segments (< 1mm) with large junction angles (> 135°). #endif /** @@ -820,16 +839,19 @@ // @section probes // -// See http://marlinfw.org/docs/configuration/probes.html +// See https://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. + * Enable this option for a probe connected to the Z-MIN pin. + * The probe replaces the Z-MIN endstop and is used for Z homing. + * (Automatically enables USE_PROBE_FOR_Z_HOMING.) */ #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN +// Force the use of the probe for Z-axis homing +//#define USE_PROBE_FOR_Z_HOMING + /** * Z_MIN_PROBE_PIN * @@ -886,6 +908,11 @@ */ //#define BLTOUCH +/** + * Pressure sensor with a BLTouch-like interface + */ +//#define CREALITY_TOUCH + /** * Touch-MI Probe by hotends.fr * @@ -960,7 +987,7 @@ // Most probes should stay away from the edges of the bed, but // with NOZZLE_AS_PROBE this can be negative for a wider probing area. -#define MIN_PROBE_EDGE 10 +#define PROBING_MARGIN 10 // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 @@ -1138,12 +1165,11 @@ * * 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_STATE LOW // Pin state indicating that filament is NOT present. #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. @@ -1335,7 +1361,6 @@ */ //#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) @@ -1353,14 +1378,14 @@ // // - 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). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing. // - Prevent Z homing when the Z probe is outside bed area. // //#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_X_POINT X_CENTER // X point for Z homing + #define Z_SAFE_HOMING_Y_POINT Y_CENTER // Y point for Z homing #endif // Homing speeds (mm/m) @@ -1499,8 +1524,11 @@ #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_X_ONLY // X move only is required to park + //#define NOZZLE_PARK_Y_ONLY // Y move only is required to park + #define NOZZLE_PARK_Z_RAISE_MIN 2 // (mm) Always raise Z by at least this distance #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) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) #endif /** @@ -1567,6 +1595,10 @@ // Enable for a purge/clean station that's always at the gantry height (thus no Z move) //#define NOZZLE_CLEAN_NO_Z + + // Explicit wipe G-code script applies to a G12 with no arguments. + //#define WIPE_SEQUENCE_COMMANDS "G1 X-17 Y25 Z10 F4000\nG1 Z1\nM114\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 Z15\nM400\nG0 X-10.0 Y-9.0" + #endif /** @@ -1611,10 +1643,10 @@ * * 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, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, hu, it, + * jp_kana, ko_KR, nl, pl, pt, pt_br, ro 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' } + * :{ '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', 'hu':'Hungarian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ro':'Romanian', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1636,7 +1668,7 @@ * - 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 + * See https://marlinfw.org/docs/development/lcd_language.html * * :['JAPANESE', 'WESTERN', 'CYRILLIC'] */ @@ -1763,7 +1795,7 @@ // // RepRapDiscount Smart Controller. -// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// https://reprap.org/wiki/RepRapDiscount_Smart_Controller // // Note: Usually sold with a white PCB. // @@ -1787,13 +1819,13 @@ // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) -// http://reprap.org/wiki/PanelOne +// https://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 +// https://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel // // Note: Usually sold with a blue PCB. // @@ -1880,7 +1912,7 @@ // // 2-wire Non-latching LCD SR from https://goo.gl/aJJ4sH -// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// LCD configuration: https://reprap.org/wiki/SAV_3D_LCD // //#define SAV_3DLCD @@ -1902,10 +1934,12 @@ // IMPORTANT: The U8glib library is required for Graphical Display! // https://github.com/olikraus/U8glib_Arduino // +// NOTE: If the LCD is unresponsive you may need to reverse the plugs. +// // // RepRapDiscount FULL GRAPHIC Smart Controller -// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller +// https://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller // //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER @@ -1918,20 +1952,20 @@ // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD -// http://panucatt.com +// https://www.panucatt.com // //#define VIKI2 //#define miniVIKI // // MakerLab Mini Panel with graphic -// controller and SD support - http://reprap.org/wiki/Mini_panel +// controller and SD support - https://reprap.org/wiki/Mini_panel // //#define MINIPANEL // // MaKr3d Makr-Panel with graphic controller and SD support. -// http://reprap.org/wiki/MaKr3d_MaKrPanel +// https://reprap.org/wiki/MaKr3d_MaKrPanel // //#define MAKRPANEL @@ -1970,6 +2004,12 @@ // //#define MKS_MINI_12864 +// +// MKS LCD12864A/B with graphic controller and SD support. Follows MKS_MINI_12864 pinout. +// https://www.aliexpress.com/item/33018110072.html +// +//#define MKS_LCD12864 + // // FYSETC variant of the MINI12864 graphic controller with SD support // https://wiki.fysetc.com/Mini12864_Panel/ @@ -2011,7 +2051,7 @@ // // Silvergate GLCD controller -// http://github.com/android444/Silvergate +// https://github.com/android444/Silvergate // //#define SILVER_GATE_GLCD_CONTROLLER @@ -2040,7 +2080,7 @@ // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER -// http://reprap.org/wiki/MKS_12864OLED +// https://reprap.org/wiki/MKS_12864OLED // // Tiny, but very sharp OLED display // @@ -2057,19 +2097,26 @@ // //#define OVERLORD_OLED +// +// FYSETC OLED 2.42" 128 × 64 FULL GRAPHICS CONTROLLER with WS2812 RGB +// Where to find : https://www.aliexpress.com/item/4000345255731.html +//#define FYSETC_242_OLED_12864 // Uses the SSD1309 controller + //============================================================================= //========================== Extensible UI Displays =========================== //============================================================================= // // DGUS Touch Display with DWIN OS. (Choose one.) +// ORIGIN : https://www.aliexpress.com/item/32993409517.html +// FYSETC : https://www.aliexpress.com/item/32961471929.html // //#define DGUS_LCD_UI_ORIGIN //#define DGUS_LCD_UI_FYSETC //#define DGUS_LCD_UI_HIPRECY // -// Touch-screen LCD for Malyan M200 printers +// Touch-screen LCD for Malyan M200/M300 printers // //#define MALYAN_LCD @@ -2085,19 +2132,45 @@ // //#define EXTENSIBLE_UI +#if ENABLED(EXTENSIBLE_UI) + //#define EXTUI_LOCAL_BEEPER // Enables use of local Beeper pin with external display +#endif + //============================================================================= //=============================== Graphical TFTs ============================== //============================================================================= // // FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// Upscaled 128x64 Marlin UI // //#define FSMC_GRAPHICAL_TFT +// +// TFT LVGL UI +// +// Using default MKS icons and fonts from: https://git.io/JJvzK +// Just copy the 'assets' folder from the build directory to the +// root of your SD card, together with the compiled firmware. +// +//#define TFT_LVGL_UI_FSMC // Robin nano v1.2 uses FSMC +//#define TFT_LVGL_UI_SPI // Robin nano v2.0 uses SPI + +// +// Anycubic Mega TFT (AI3M) +// +//#define ANYCUBIC_TFT_MODEL +//#define ANYCUBIC_TFT_DEBUG + //============================================================================= //============================ Other Controllers ============================ //============================================================================= +// +// Ender-3 v2 OEM display. A DWIN display with Rotary Encoder. +// +//#define DWIN_CREALITY_LCD + // // ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // @@ -2114,7 +2187,7 @@ // // RepRapWorld REPRAPWORLD_KEYPAD v1.1 -// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// https://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 @@ -2151,7 +2224,7 @@ // 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 +// SkeinForge sends the wrong arc G-codes when using Arc Point as fillet procedure //#define SF_ARC_FIX // Support for the BariCUDA Paste Extruder @@ -2164,7 +2237,6 @@ //#define PCA9632 // Support for PCA9533 PWM LED driver -// https://github.com/mikeshub/SailfishRGB_LED //#define PCA9533 /** diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 00f89662c7..3f097c09e3 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -31,14 +31,27 @@ * Basic settings can be found in Configuration.h * */ -#define CONFIGURATION_ADV_H_VERSION 020005 +#define CONFIGURATION_ADV_H_VERSION 020006 // @section temperature //=========================================================================== -//=============================Thermal Settings ============================ +//============================= Thermal Settings ============================ //=========================================================================== +/** + * Thermocouple sensors are quite sensitive to noise. Any noise induced in + * the sensor wires, such as by stepper motor wires run in parallel to them, + * may result in the thermocouple sensor reporting spurious errors. This + * value is the number of errors which can occur in a row before the error + * is reported. This allows us to ignore intermittent error conditions while + * still detecting an actual failure, which should result in a continuous + * stream of errors from the sensor. + * + * Set this value to 0 to fail on the first error to occur. + */ +#define THERMOCOUPLE_MAX_ERRORS 15 + // // Custom Thermistor 1000 parameters // @@ -206,7 +219,7 @@ // 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 DEFAULT_Kc (100) // heating power = Kc * e_speed #define LPQ_MAX_LEN 50 #endif @@ -262,25 +275,30 @@ #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 + * Automatic Temperature Mode + * + * Dynamically adjust the hotend target temperature based on planned E moves. + * + * (Contrast with PID_EXTRUSION_SCALING, which tracks E movement and adjusts PID + * behavior using an additional kC value.) + * + * Autotemp is calculated by (mintemp + factor * mm_per_sec), capped to maxtemp. + * + * Enable Autotemp Mode with M104/M109 F S B. + * Disable by sending M104/M109 with no F parameter (or F0 with AUTOTEMP_PROPORTIONAL). */ #define AUTOTEMP #if ENABLED(AUTOTEMP) - #define AUTOTEMP_OLDWEIGHT 0.98 + #define AUTOTEMP_OLDWEIGHT 0.98 + // Turn on AUTOTEMP on M104/M109 by default using proportions set here + //#define AUTOTEMP_PROPORTIONAL + #if ENABLED(AUTOTEMP_PROPORTIONAL) + #define AUTOTEMP_MIN_P 0 // (°C) Added to the target temperature + #define AUTOTEMP_MAX_P 5 // (°C) Added to the target temperature + #define AUTOTEMP_FACTOR_P 1 // Apply this F parameter by default (overridden by M104/M109 F) + #endif #endif -// Extra options for the M114 "Current Position" report -//#define M114_DETAIL // Use 'M114` for details to check planner calculations -//#define M114_REALTIME // Real current position based on forward kinematics -//#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed. - // Show Temperature ADC value // Enable for M105 to include ADC values read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES @@ -325,6 +343,18 @@ #define EXTRUDER_RUNOUT_EXTRUDE 5 // (mm) #endif +/** + * Hotend Idle Timeout + * Prevent filament in the nozzle from charring and causing a critical jam. + */ +//#define HOTEND_IDLE_TIMEOUT +#if ENABLED(HOTEND_IDLE_TIMEOUT) + #define HOTEND_IDLE_TIMEOUT_SEC (5*60) // (seconds) Time without extruder movement to trigger protection + #define HOTEND_IDLE_MIN_TRIGGER 180 // (°C) Minimum temperature to enable hotend protection + #define HOTEND_IDLE_NOZZLE_TARGET 0 // (°C) Safe temperature for the nozzle after timeout + #define HOTEND_IDLE_BED_TARGET 0 // (°C) Safe temperature for the bed after timeout +#endif + // @section temperature // Calibration for AD595 / AD8495 sensor to adjust temperature measurements. @@ -340,12 +370,12 @@ * * The fan turns on automatically whenever any driver is enabled and turns * off (or reduces to idle speed) shortly after drivers 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 CONTROLLER_FAN_USE_Z_ONLY // With this option only the Z axis is considered + //#define CONTROLLER_FAN_IGNORE_Z // Ignore Z stepper. Useful when stepper timeout is disabled. #define CONTROLLERFAN_SPEED_MIN 0 // (0-255) Minimum speed. (If set below this value the fan is turned off.) #define CONTROLLERFAN_SPEED_ACTIVE 255 // (0-255) Active speed, used when any motor is enabled #define CONTROLLERFAN_SPEED_IDLE 0 // (0-255) Idle speed, used when motors are disabled @@ -426,6 +456,8 @@ #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 #define E5_AUTO_FAN_PIN -1 +#define E6_AUTO_FAN_PIN -1 +#define E7_AUTO_FAN_PIN -1 #define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 @@ -581,8 +613,7 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 - -#endif // DUAL_X_CARRIAGE +#endif // 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. @@ -590,19 +621,24 @@ // @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 +/** + * Homing Procedure + * Homing (G28) does an indefinite move towards the endstops to establish + * the position of the toolhead relative to the workspace. + */ -// When G28 is called, this option will make Y home before X -//#define HOME_Y_BEFORE_X +//#define SENSORLESS_BACKOFF_MM { 2, 2 } // (mm) Backoff from endstops before sensorless homing -// Enable this if X or Y can't home without homing the other axis first. -//#define CODEPENDENT_XY_HOMING +#define HOMING_BUMP_MM { 5, 5, 2 } // (mm) Backoff from endstops after first bump +#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) + +//#define HOMING_BACKOFF_POST_MM { 2, 2, 2 } // (mm) Backoff from endstops after homing + +//#define QUICK_HOME // If G28 contains XY do a diagonal move first +//#define HOME_Y_BEFORE_X // If G28 contains XY home Y before X +//#define CODEPENDENT_XY_HOMING // If X/Y can't home without homing Y/X first + +// @section bltouch #if ENABLED(BLTOUCH) /** @@ -610,8 +646,8 @@ * 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 probe is not deploying, do a "Reset" and "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" @@ -671,6 +707,8 @@ #endif // BLTOUCH +// @section extras + /** * Z Steppers Auto-Alignment * Add the G34 command to align multiple Z steppers using a bed probe. @@ -730,6 +768,34 @@ #define HOME_AFTER_G34 #endif +// +// Add the G35 command to read bed corners to help adjust screws. +// +//#define ASSISTED_TRAMMING +#if ENABLED(ASSISTED_TRAMMING) + + // Define positions for probing points, use the hotend as reference not the sensor. + #define TRAMMING_POINT_XY { { 20, 20 }, { 200, 20 }, { 200, 200 }, { 20, 200 } } + + // Define positions names for probing points. + #define TRAMMING_POINT_NAME_1 "Front-Left" + #define TRAMMING_POINT_NAME_2 "Front-Right" + #define TRAMMING_POINT_NAME_3 "Back-Right" + #define TRAMMING_POINT_NAME_4 "Back-Left" + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G35 + + /** + * Screw thread: + * M3: 30 = Clockwise, 31 = Counter-Clockwise + * M4: 40 = Clockwise, 41 = Counter-Clockwise + * M5: 50 = Clockwise, 51 = Counter-Clockwise + */ + #define TRAMMING_SCREW_THREAD 30 + +#endif + // @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -758,7 +824,7 @@ //#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) +#define DEFAULT_MINSEGMENTTIME 20000 // (µs) // Slow down the machine if the look ahead buffer is (by default) half full. // Increase the slowdown divisor for larger buffer sizes. @@ -767,10 +833,16 @@ #define SLOWDOWN_DIVISOR 2 #endif -// Frequency limit -// See nophead's blog for more info -// Not working O -//#define XY_FREQUENCY_LIMIT 15 +/** + * XY Frequency limit + * Reduce resonance by limiting the frequency of small zigzag infill moves. + * See https://hydraraptor.blogspot.com/2010/12/frequency-limit.html + * Use M201 F G to change limits at runtime. + */ +//#define XY_FREQUENCY_LIMIT 10 // (Hz) Maximum frequency of small zigzag infill moves. Set with M201 F. +#ifdef XY_FREQUENCY_LIMIT + #define XY_FREQUENCY_MIN_PERCENT 5 // (percent) Minimum FR percentage to apply. Set with M201 G. +#endif // 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 @@ -826,6 +898,9 @@ //#define CALIBRATION_GCODE #if ENABLED(CALIBRATION_GCODE) + //#define CALIBRATION_SCRIPT_PRE "M117 Starting Auto-Calibration\nT0\nG28\nG12\nM117 Calibrating..." + //#define CALIBRATION_SCRIPT_POST "M500\nM117 Calibration data saved" + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m @@ -882,7 +957,7 @@ //#define MICROSTEP16 LOW,LOW,HIGH //#define MICROSTEP32 HIGH,LOW,HIGH -// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +// Microstep settings (Requires a board with pins named X_MS1, X_MS2, etc.) #define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] /** @@ -909,9 +984,20 @@ //#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) +/** + * I2C-based DIGIPOTs (e.g., Azteeg X3 Pro) + */ +//#define DIGIPOT_MCP4018 // Requires https://github.com/stawel/SlowSoftI2CMaster +//#define DIGIPOT_MCP4451 +#if EITHER(DIGIPOT_MCP4018, DIGIPOT_MCP4451) + #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT:4 AZTEEG_X3_PRO:8 MKS_SBASE:5 MIGHTYBOARD_REVE: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 + + //#define DIGIPOT_USE_RAW_VALUES // Use DIGIPOT_MOTOR_CURRENT raw wiper values (instead of A4988 motor currents) + /** * Common slave addresses: * @@ -922,16 +1008,10 @@ * 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 + //#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=========================== //=========================================================================== @@ -1036,8 +1116,12 @@ // Enable this option and set to HIGH if your SD cards are incorrectly detected. //#define SD_DETECT_STATE HIGH - #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. + //#define SDCARD_READONLY // Read-only SD card (to save over 2K of flash) + + #define SD_PROCEDURE_DEPTH 1 // Increase if you need more nested M32 calls + + #define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD Print is finished + #define SD_FINISHED_RELEASECOMMAND "M84" // Use "M84XYE" to keep 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. @@ -1060,9 +1144,6 @@ * 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. - * - * If the machine reboots when resuming a print you may need to replace or - * reformat the SD card. (Bad sectors delay startup triggering the watchdog.) */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) @@ -1109,7 +1190,7 @@ #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_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. @@ -1232,7 +1313,8 @@ // 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 + // Save many cycles by drawing a hollow frame or no frame on the Info Screen + //#define XYZ_NO_FRAME #define XYZ_HOLLOW_FRAME // Enable to save many cycles by drawing a hollow frame on Menu Screens @@ -1346,6 +1428,7 @@ //#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 + //#define LCD_FYSETC_TFT81050 // FYSETC with 5" (800x480) // Correct the resolution if not using the stock TFT panel. //#define TOUCH_UI_320x240 @@ -1353,10 +1436,11 @@ //#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 S6_TFT_PINMAP // FYSETC S6 pin mapping + //#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 S6_TFT_PINMAP // FYSETC S6 pin mapping + //#define F6_TFT_PINMAP // FYSETC F6 pin mapping //#define OTHER_PIN_LAYOUT // Define pins manually below #if ENABLED(OTHER_PIN_LAYOUT) @@ -1440,7 +1524,7 @@ // ADC Button Debounce // #if HAS_ADC_BUTTONS - #define ADC_BUTTON_DEBOUNCE_DELAY 16 // (ms) Increase if buttons bounce or repeat too fast + #define ADC_BUTTON_DEBOUNCE_DELAY 16 // Increase if buttons bounce or repeat too fast #endif // @section safety @@ -1474,8 +1558,9 @@ //#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 BABYSTEP_MILLIMETER_UNITS // Specify BABYSTEP_MULTIPLICATOR_(XY|Z) in mm instead of micro-steps + #define BABYSTEP_MULTIPLICATOR_Z 1 // (steps or mm) Steps or millimeter distance for each Z babystep + #define BABYSTEP_MULTIPLICATOR_XY 1 // (steps or mm) Steps or millimeter distance for each XY babystep //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1512,14 +1597,14 @@ * 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. + * See https://marlinfw.org/docs/features/lin_advance.html for full instructions. */ //#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. + //#define EXPERIMENTAL_SCURVE // Enable this option to permit S-Curve Acceleration #endif // @section leveling @@ -1538,7 +1623,9 @@ #endif /** - * Override MIN_PROBE_EDGE for each side of the build plate + * Probing Margins + * + * Override PROBING_MARGIN 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. With NOZZLE_AS_PROBE negative values are @@ -1555,10 +1642,10 @@ * 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 + //#define PROBING_MARGIN_LEFT PROBING_MARGIN + //#define PROBING_MARGIN_RIGHT PROBING_MARGIN + //#define PROBING_MARGIN_FRONT PROBING_MARGIN + //#define PROBING_MARGIN_BACK PROBING_MARGIN #endif #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) @@ -1600,22 +1687,46 @@ // Add additional compensation depending on hotend temperature // Note: this values cannot be calibrated and have to be set manually #if ENABLED(PROBE_TEMP_COMPENSATION) - // Max temperature that can be reached by heated bed. - // This is required only for the calibration process. - #define PTC_MAX_BED_TEMP BED_MAXTEMP - // Park position to wait for probe cooldown - #define PTC_PARK_POS_X 0.0F - #define PTC_PARK_POS_Y 0.0F - #define PTC_PARK_POS_Z 100.0F + #define PTC_PARK_POS { 0, 0, 100 } // Probe position to probe and wait for probe to reach target temperature - #define PTC_PROBE_POS_X 90.0F - #define PTC_PROBE_POS_Y 100.0F + #define PTC_PROBE_POS { 90, 100 } // Enable additional compensation using hotend temperature // Note: this values cannot be calibrated automatically but have to be set manually //#define USE_TEMP_EXT_COMPENSATION + + // Probe temperature calibration generates a table of values starting at PTC_SAMPLE_START + // (e.g. 30), in steps of PTC_SAMPLE_RES (e.g. 5) with PTC_SAMPLE_COUNT (e.g. 10) samples. + + //#define PTC_SAMPLE_START 30.0f + //#define PTC_SAMPLE_RES 5.0f + //#define PTC_SAMPLE_COUNT 10U + + // Bed temperature calibration builds a similar table. + + //#define BTC_SAMPLE_START 60.0f + //#define BTC_SAMPLE_RES 5.0f + //#define BTC_SAMPLE_COUNT 10U + + // The temperature the probe should be at while taking measurements during bed temperature + // calibration. + //#define BTC_PROBE_TEMP 30.0f + + // Height above Z=0.0f to raise the nozzle. Lowering this can help the probe to heat faster. + // Note: the Z=0.0f offset is determined by the probe offset which can be set using M851. + //#define PTC_PROBE_HEATING_OFFSET 0.5f + + // Height to raise the Z-probe between heating and taking the next measurement. Some probes + // may fail to untrigger if they have been triggered for a long time, which can be solved by + // increasing the height the probe is raised to. + //#define PTC_PROBE_RAISE 15U + + // If the probe is outside of the defined range, use linear extrapolation using the closest + // point and the PTC_LINEAR_EXTRAPOLATION'th next point. E.g. if set to 4 it will use data[0] + // and data[4] to perform linear extrapolation for values below PTC_SAMPLE_START. + //#define PTC_LINEAR_EXTRAPOLATION 4 #endif #endif @@ -1643,6 +1754,16 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT +/** + * Direct Stepping + * + * Comparable to the method used by Klipper, G6 direct stepping significantly + * reduces motion calculations, increases top printing speeds, and results in + * less step aliasing by calculating all motions in advance. + * Preparing your G-code: https://github.com/colinrgodsey/step-daemon + */ +//#define DIRECT_STEPPING + /** * G38 Probe Target * @@ -1711,14 +1832,16 @@ //================================= Buffers ================================= //=========================================================================== -// @section hidden +// @section motion -// 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 +// The number of linear moves that can be in the planner at once. +// The value of BLOCK_BUFFER_SIZE must be a power of 2 (e.g. 8, 16, 32) +#if BOTH(SDSUPPORT, DIRECT_STEPPING) + #define BLOCK_BUFFER_SIZE 8 +#elif ENABLED(SDSUPPORT) + #define BLOCK_BUFFER_SIZE 16 #else - #define BLOCK_BUFFER_SIZE 16 // maximize block buffer + #define BLOCK_BUFFER_SIZE 16 #endif // @section serial @@ -1761,10 +1884,14 @@ //#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! +/** + * Emergency Command Parser + * + * Add a low-level parser to intercept certain commands as they + * enter the serial receive buffer, so they cannot be blocked. + * Currently handles M108, M112, M410, M876 + * NOTE: Not yet implemented for all platforms. + */ //#define EMERGENCY_PARSER // Bad Serial-connections can miss a received command by sending an 'ok' @@ -1780,6 +1907,9 @@ // This option inserts short delays between lines of serial output. #define SERIAL_OVERRUN_PROTECTION +// For serial echo, the number of digits after the decimal point +//#define SERIAL_FLOAT_PRECISION 4 + // @section extras /** @@ -1832,19 +1962,55 @@ */ #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 + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_ZRAISE_BEFORE_RETRACT // Apply raise before swap retraction (if enabled) + //#define TOOLCHANGE_NO_RETURN // Never return to previous position on tool-change #if ENABLED(TOOLCHANGE_NO_RETURN) - //#define EVENT_GCODE_AFTER_TOOLCHANGE "G12X" // G-code to run after tool-change is complete + //#define EVENT_GCODE_AFTER_TOOLCHANGE "G12X" // Extra G-code to run after tool-change #endif - // Retract and prime filament on tool-change + /** + * Retract and prime filament on tool-change to reduce + * ooze and stringing and to get cleaner transitions. + */ //#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) + // Load / Unload + #define TOOLCHANGE_FS_LENGTH 12 // (mm) Load / Unload length + #define TOOLCHANGE_FS_EXTRA_RESUME_LENGTH 0 // (mm) Extra length for better restart, fine tune by LCD/Gcode) + #define TOOLCHANGE_FS_RETRACT_SPEED (50*60) // (mm/m) (Unloading) + #define TOOLCHANGE_FS_UNRETRACT_SPEED (25*60) // (mm/m) (On SINGLENOZZLE or Bowden loading must be slowed down) + + // Longer prime to clean out a SINGLENOZZLE + #define TOOLCHANGE_FS_EXTRA_PRIME 0 // (mm) Extra priming length + #define TOOLCHANGE_FS_PRIME_SPEED (4.6*60) // (mm/m) Extra priming feedrate + #define TOOLCHANGE_FS_WIPE_RETRACT 0 // (mm/m) Retract before cooling for less stringing, better wipe, etc. + + // Cool after prime to reduce stringing + #define TOOLCHANGE_FS_FAN -1 // Fan index or -1 to skip + #define TOOLCHANGE_FS_FAN_SPEED 255 // 0-255 + #define TOOLCHANGE_FS_FAN_TIME 10 // (seconds) + + // Swap uninitialized extruder with TOOLCHANGE_FS_PRIME_SPEED for all lengths (recover + prime) + // (May break filament if not retracted beforehand.) + //#define TOOLCHANGE_FS_INIT_BEFORE_SWAP + + // Prime on the first T0 (If other, TOOLCHANGE_FS_INIT_BEFORE_SWAP applied) + // Enable it (M217 V[0/1]) before printing, to avoid unwanted priming on host connect + //#define TOOLCHANGE_FS_PRIME_FIRST_USED + + /** + * Tool Change Migration + * This feature provides G-code and LCD options to switch tools mid-print. + * All applicable tool properties are migrated so the print can continue. + * Tools must be closely matching and other restrictions may apply. + * Useful to: + * - Change filament color without interruption + * - Switch spools automatically on filament runout + * - Switch to a different nozzle on an extruder jam + */ + #define TOOLCHANGE_MIGRATION_FEATURE + #endif /** @@ -1855,8 +2021,10 @@ #if ENABLED(TOOLCHANGE_PARK) #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + //#define TOOLCHANGE_PARK_X_ONLY // X axis only move + //#define TOOLCHANGE_PARK_Y_ONLY // Y axis only move #endif -#endif +#endif // EXTRUDERS > 1 /** * Advanced Pause @@ -1907,7 +2075,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change + //#define HOME_BEFORE_FILAMENT_CHANGE // If needed, home before 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) @@ -2248,6 +2416,7 @@ * CHOPPER_DEFAULT_19V * CHOPPER_DEFAULT_24V * CHOPPER_DEFAULT_36V + * CHOPPER_09STEP_24V // 0.9 degree steppers (24V) * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 * @@ -2257,11 +2426,11 @@ #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. + * Monitor Trinamic drivers + * for error conditions like overtemperature and short to ground. + * To manage over-temp Marlin can decrease the driver current until the error condition clears. * Other detected conditions can be used to stop the current print. - * Relevant g-codes: + * 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. @@ -2315,7 +2484,7 @@ * 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. + * It is recommended to set HOMING_BUMP_MM to { 0, 0, 0 }. * * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** * Poll the driver through SPI to determine load when homing. @@ -2331,11 +2500,27 @@ #define X_STALL_SENSITIVITY 8 #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 + #define Y2_STALL_SENSITIVITY Y_STALL_SENSITIVITY //#define Z_STALL_SENSITIVITY 8 + //#define Z2_STALL_SENSITIVITY Z_STALL_SENSITIVITY + //#define Z3_STALL_SENSITIVITY Z_STALL_SENSITIVITY + //#define Z4_STALL_SENSITIVITY Z_STALL_SENSITIVITY //#define SPI_ENDSTOPS // TMC2130 only //#define IMPROVE_HOMING_RELIABILITY #endif + /** + * TMC Homing stepper phase. + * + * Improve homing repeatability by homing to stepper coil's nearest absolute + * phase position. Trinamic drivers use a stepper phase table with 1024 values + * spanning 4 full steps with 256 positions each (ergo, 1024 positions). + * Full step positions (128, 384, 640, 896) have the highest holding torque. + * + * Values from 0..1023, -1 to disable homing phase for that axis. + */ + //#define TMC_HOME_PHASE { 896, 896, 896 } + /** * Beta feature! * Create a 50/50 square wave step pulse optimal for stepper drivers. @@ -2536,7 +2721,7 @@ * 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: + * 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 @@ -2613,11 +2798,11 @@ //#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/ + // Data from: https://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/ + // https://captain-slow.dk/2014/03/09/3d-printing-timelapses/ //#define CHDK_PIN 4 // Optional second move with delay to trigger the camera shutter @@ -2654,39 +2839,138 @@ * 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. + * See https://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 + #define SPINDLE_LASER_PWM_INVERT false // Set to "true" if the speed/power goes up when you want it to go slower + + #define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR and LPC) + + /** + * Speed / Power can be set ('M3 S') and displayed in terms of: + * - PWM255 (S0 - S255) + * - PERCENT (S0 - S100) + * - RPM (S0 - S50000) Best for use with a spindle + */ + #define CUTTER_POWER_UNIT PWM255 + + /** + * Relative Cutter Power + * Normally, 'M3 O' sets + * OCR power is relative to the range SPEED_POWER_MIN...SPEED_POWER_MAX. + * so input powers of 0...255 correspond to SPEED_POWER_MIN...SPEED_POWER_MAX + * instead of normal range (0 to SPEED_POWER_MAX). + * Best used with (e.g.) SuperPID router controller: S0 = 5,000 RPM and S255 = 30,000 RPM + */ + //#define CUTTER_POWER_RELATIVE // Set speed proportional to [SPEED_POWER_MIN...SPEED_POWER_MAX] #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 + #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 + /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * M3/M4 Power Equation * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 + * Each tool uses different value ranges for speed / power control. + * These parameters are used to convert between tool power units and PWM. * - * set the following for your controller (ALL MUST BE SET) + * Speed/Power = (PWMDC / 255 * 100 - SPEED_POWER_INTERCEPT) / SPEED_POWER_SLOPE + * PWMDC = (spdpwr - SPEED_POWER_MIN) / (SPEED_POWER_MAX - SPEED_POWER_MIN) / SPEED_POWER_SLOPE */ - #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_INTERCEPT 0 // (%) 0-100 i.e., Minimum power percentage + #define SPEED_POWER_MIN 5000 // (RPM) + #define SPEED_POWER_MAX 30000 // (RPM) SuperPID router controller 0 - 30,000 RPM + #define SPEED_POWER_STARTUP 25000 // (RPM) M3/M4 speed/power default (with no arguments) + #else - #define SPEED_POWER_SLOPE 0.3922 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 10 - #define SPEED_POWER_MAX 100 // 0-100% + + #define SPEED_POWER_INTERCEPT 0 // (%) 0-100 i.e., Minimum power percentage + #define SPEED_POWER_MIN 0 // (%) 0-100 + #define SPEED_POWER_MAX 100 // (%) 0-100 + #define SPEED_POWER_STARTUP 80 // (%) M3/M4 speed/power default (with no arguments) + + /** + * Enable inline laser power to be handled in the planner / stepper routines. + * Inline power is specified by the I (inline) flag in an M3 command (e.g., M3 S20 I) + * or by the 'S' parameter in G0/G1/G2/G3 moves (see LASER_MOVE_POWER). + * + * This allows the laser to keep in perfect sync with the planner and removes + * the powerup/down delay since lasers require negligible time. + */ + #define LASER_POWER_INLINE + + #if ENABLED(LASER_POWER_INLINE) + /** + * Scale the laser's power in proportion to the movement rate. + * + * - Sets the entry power proportional to the entry speed over the nominal speed. + * - Ramps the power up every N steps to approximate the speed trapezoid. + * - Due to the limited power resolution this is only approximate. + */ + #define LASER_POWER_INLINE_TRAPEZOID + + /** + * Continuously calculate the current power (nominal_power * current_rate / nominal_rate). + * Required for accurate power with non-trapezoidal acceleration (e.g., S_CURVE_ACCELERATION). + * This is a costly calculation so this option is discouraged on 8-bit AVR boards. + * + * LASER_POWER_INLINE_TRAPEZOID_CONT_PER defines how many step cycles there are between power updates. If your + * board isn't able to generate steps fast enough (and you are using LASER_POWER_INLINE_TRAPEZOID_CONT), increase this. + * Note that when this is zero it means it occurs every cycle; 1 means a delay wait one cycle then run, etc. + */ + //#define LASER_POWER_INLINE_TRAPEZOID_CONT + + /** + * Stepper iterations between power updates. Increase this value if the board + * can't keep up with the processing demands of LASER_POWER_INLINE_TRAPEZOID_CONT. + * Disable (or set to 0) to recalculate power on every stepper iteration. + */ + //#define LASER_POWER_INLINE_TRAPEZOID_CONT_PER 10 + + /** + * Include laser power in G0/G1/G2/G3/G5 commands with the 'S' parameter + */ + //#define LASER_MOVE_POWER + + #if ENABLED(LASER_MOVE_POWER) + // Turn off the laser on G0 moves with no power parameter. + // If a power parameter is provided, use that instead. + //#define LASER_MOVE_G0_OFF + + // Turn off the laser on G28 homing. + //#define LASER_MOVE_G28_OFF + #endif + + /** + * Inline flag inverted + * + * WARNING: M5 will NOT turn off the laser unless another move + * is done (so G-code files must end with 'M5 I'). + */ + //#define LASER_POWER_INLINE_INVERT + + /** + * Continuously apply inline power. ('M3 S3' == 'G1 S3' == 'M3 S3 I') + * + * The laser might do some weird things, so only enable this + * feature if you understand the implications. + */ + //#define LASER_POWER_INLINE_CONTINUOUS + + #else + + #define SPINDLE_LASER_POWERUP_DELAY 50 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 50 // (ms) Delay to allow the spindle to stop + + #endif #endif #endif @@ -2738,6 +3022,24 @@ //#define FILAMENT_LCD_DISPLAY #endif +/** + * Power Monitor + * Monitor voltage (V) and/or current (A), and -when possible- power (W) + * + * Read and configure with M430 + * + * The current sensor feeds DC voltage (relative to the measured current) to an analog pin + * The voltage sensor feeds DC voltage (relative to the measured voltage) to an analog pin + */ +//#define POWER_MONITOR_CURRENT // Monitor the system current +//#define POWER_MONITOR_VOLTAGE // Monitor the system voltage +#if EITHER(POWER_MONITOR_CURRENT, POWER_MONITOR_VOLTAGE) + #define POWER_MONITOR_VOLTS_PER_AMP 0.05000 // Input voltage to the MCU analog pin per amp - DO NOT apply more than ADC_VREF! + #define POWER_MONITOR_CURRENT_OFFSET -1 // Offset value for current sensors with linear function output + #define POWER_MONITOR_VOLTS_PER_VOLT 0.11786 // Input voltage to the MCU analog pin per volt - DO NOT apply more than ADC_VREF! + #define POWER_MONITOR_FIXED_VOLTAGE 13.6 // Voltage for a current sensor with no voltage sensor (for power display) +#endif + /** * CNC Coordinate Systems * @@ -2755,6 +3057,9 @@ * Include capabilities in M115 output */ #define EXTENDED_CAPABILITIES_REPORT +#if ENABLED(EXTENDED_CAPABILITIES_REPORT) + //#define M115_GEOMETRY_REPORT +#endif /** * Expected Printer Check @@ -2774,9 +3079,21 @@ * 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. + * M200 D0 to disable, M200 Dn to set a new diameter (and enable volumetric). + * M200 S0/S1 to disable/enable volumetric extrusion. */ //#define VOLUMETRIC_DEFAULT_ON + + //#define VOLUMETRIC_EXTRUDER_LIMIT + #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) + /** + * Default volumetric extrusion limit in cubic mm per second (mm^3/sec). + * This factory setting applies to all extruders. + * Use 'M200 [T] L' to override and 'M502' to reset. + * A non-zero value activates Volume-based Extrusion Limiting. + */ + #define DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT 0.00 // (mm^3/sec) + #endif #endif /** @@ -2788,6 +3105,13 @@ */ //#define NO_WORKSPACE_OFFSETS +// Extra options for the M114 "Current Position" report +//#define M114_DETAIL // Use 'M114` for details to check planner calculations +//#define M114_REALTIME // Real current position based on forward kinematics +//#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed. + +//#define REPORT_FAN_CHANGE // Report the new fan speed when changed by M106 (and others) + /** * 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. @@ -2808,6 +3132,8 @@ //#define GCODE_CASE_INSENSITIVE // Accept G-code sent to the firmware in lowercase +//#define REPETIER_GCODE_M360 // Add commands originally from Repetier FW + /** * CNC G-code options * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. @@ -2898,11 +3224,11 @@ * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. * - * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Wiki: https://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/ + * Supplier: https://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: https://reliabuild3d.com/ * * Reliabuild encoders have been modified to improve reliability. */ @@ -3090,7 +3416,7 @@ // 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 }, \ + { 7.2, 1145 }, \ { 14.4, 871 }, \ { 36.0, 1393 }, \ { 14.4, 871 }, \ @@ -3108,6 +3434,45 @@ { 10.0, 700 }, \ { -10.0, 400 }, \ { -50.0, 2000 } + #endif + + /** + * MMU Extruder Sensor + * + * Support for a Prusa (or other) IR Sensor to detect filament near the extruder + * and make loading more reliable. Suitable for an extruder equipped with a filament + * sensor less than 38mm from the gears. + * + * During loading the extruder will stop when the sensor is triggered, then do a last + * move up to the gears. If no filament is detected, the MMU2 can make some more attempts. + * If all attempts fail, a filament runout will be triggered. + */ + //#define MMU_EXTRUDER_SENSOR + #if ENABLED(MMU_EXTRUDER_SENSOR) + #define MMU_LOADING_ATTEMPTS_NR 5 //max. number of attempts to load filament if first load fail + #endif + + /** + * Using a sensor like the MMU2S + * This mode requires a MK3S extruder with a sensor at the extruder idler, like the MMU2S. + * See https://help.prusa3d.com/en/guide/3b-mk3s-mk2-5s-extruder-upgrade_41560, step 11 + */ + //#define PRUSA_MMU2_S_MODE + #if ENABLED(PRUSA_MMU2_S_MODE) + #define MMU2_C0_RETRY 5 // Number of retries (total time = timeout*retries) + + #define MMU2_CAN_LOAD_FEEDRATE 800 // (mm/m) + #define MMU2_CAN_LOAD_SEQUENCE \ + { 0.1, MMU2_CAN_LOAD_FEEDRATE }, \ + { 60.0, MMU2_CAN_LOAD_FEEDRATE }, \ + { -52.0, MMU2_CAN_LOAD_FEEDRATE } + + #define MMU2_CAN_LOAD_RETRACT 6.0 // (mm) Keep under the distance between Load Sequence values + #define MMU2_CAN_LOAD_DEVIATION 0.8 // (mm) Acceptable deviation + + #define MMU2_CAN_LOAD_INCREMENT 0.2 // (mm) To reuse within MMU2 module + #define MMU2_CAN_LOAD_INCREMENT_SEQUENCE \ + { -MMU2_CAN_LOAD_INCREMENT, MMU2_CAN_LOAD_FEEDRATE } #endif diff --git a/Marlin/Makefile b/Marlin/Makefile index 0a9b3a45d7..95135ab594 100644 --- a/Marlin/Makefile +++ b/Marlin/Makefile @@ -14,7 +14,7 @@ # 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 +# contains the Arduino installation (for example, under macOS, this # might be /Applications/Arduino.app/Contents/Resources/Java). # # 2. Modify the line containing "UPLOAD_PORT" to refer to the filename @@ -98,7 +98,7 @@ NEOPIXEL ?= 0 ############ # Try to automatically determine whether RELOC_WORKAROUND is needed based # on GCC versions: -# http://www.avrfreaks.net/comment/1789106#comment-1789106 +# https://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\ ) @@ -170,105 +170,110 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1100) else ifeq ($(HARDWARE_MOTHERBOARD),1101) # Velleman K8400 Controller (derived from 3Drag Controller) else ifeq ($(HARDWARE_MOTHERBOARD),1102) -# 2PrintBeta BAM&DICE with STK drivers +# Velleman K8600 Controller (derived from 3Drag Controller) else ifeq ($(HARDWARE_MOTHERBOARD),1103) -# 2PrintBeta BAM&DICE Due with STK drivers +# 2PrintBeta BAM&DICE with STK drivers else ifeq ($(HARDWARE_MOTHERBOARD),1104) -# MKS BASE v1.0 +# 2PrintBeta BAM&DICE Due with STK drivers else ifeq ($(HARDWARE_MOTHERBOARD),1105) -# MKS v1.4 with A4982 stepper drivers +# MKS BASE v1.0 else ifeq ($(HARDWARE_MOTHERBOARD),1106) -# MKS v1.5 with Allegro A4982 stepper drivers +# MKS v1.4 with A4982 stepper drivers else ifeq ($(HARDWARE_MOTHERBOARD),1107) -# MKS v1.6 with Allegro A4982 stepper drivers +# MKS v1.5 with Allegro A4982 stepper drivers else ifeq ($(HARDWARE_MOTHERBOARD),1108) - -# MKS BASE 1.0 with Heroic HR4982 stepper drivers +# MKS v1.6 with Allegro A4982 stepper drivers else ifeq ($(HARDWARE_MOTHERBOARD),1109) -# MKS GEN v1.3 or 1.4 +# MKS BASE 1.0 with Heroic HR4982 stepper drivers else ifeq ($(HARDWARE_MOTHERBOARD),1110) -# MKS GEN L +# MKS GEN v1.3 or 1.4 else ifeq ($(HARDWARE_MOTHERBOARD),1111) -# zrib V2.0 control board (Chinese knock off RAMPS replica) +# MKS GEN L else ifeq ($(HARDWARE_MOTHERBOARD),1112) -# BigTreeTech or BIQU KFB2.0 +# zrib V2.0 control board (Chinese knock off RAMPS replica) else ifeq ($(HARDWARE_MOTHERBOARD),1113) -# Felix 2.0+ Electronics Board (RAMPS like) +# BigTreeTech or BIQU KFB2.0 else ifeq ($(HARDWARE_MOTHERBOARD),1114) -# Invent-A-Part RigidBoard +# Felix 2.0+ Electronics Board (RAMPS like) else ifeq ($(HARDWARE_MOTHERBOARD),1115) -# Invent-A-Part RigidBoard V2 +# Invent-A-Part RigidBoard else ifeq ($(HARDWARE_MOTHERBOARD),1116) -# Sainsmart 2-in-1 board +# Invent-A-Part RigidBoard V2 else ifeq ($(HARDWARE_MOTHERBOARD),1117) -# Ultimaker +# Sainsmart 2-in-1 board else ifeq ($(HARDWARE_MOTHERBOARD),1118) -# Ultimaker (Older electronics. Pre 1.5.4. This is rare) +# Ultimaker else ifeq ($(HARDWARE_MOTHERBOARD),1119) +# Ultimaker (Older electronics. Pre 1.5.4. This is rare) +else ifeq ($(HARDWARE_MOTHERBOARD),1120) MCU ?= atmega1280 # Azteeg X3 -else ifeq ($(HARDWARE_MOTHERBOARD),1120) -# Azteeg X3 Pro else ifeq ($(HARDWARE_MOTHERBOARD),1121) -# Ultimainboard 2.x (Uses TEMP_SENSOR 20) +# Azteeg X3 Pro else ifeq ($(HARDWARE_MOTHERBOARD),1122) -# Rumba +# Ultimainboard 2.x (Uses TEMP_SENSOR 20) else ifeq ($(HARDWARE_MOTHERBOARD),1123) -# Raise3D Rumba +# Rumba else ifeq ($(HARDWARE_MOTHERBOARD),1124) -# Rapide Lite RL200 Rumba +# Raise3D Rumba else ifeq ($(HARDWARE_MOTHERBOARD),1125) -# Formbot T-Rex 2 Plus +# Rapide Lite RL200 Rumba else ifeq ($(HARDWARE_MOTHERBOARD),1126) -# Formbot T-Rex 3 +# Formbot T-Rex 2 Plus else ifeq ($(HARDWARE_MOTHERBOARD),1127) -# Formbot Raptor +# Formbot T-Rex 3 else ifeq ($(HARDWARE_MOTHERBOARD),1128) -# Formbot Raptor 2 +# Formbot Raptor else ifeq ($(HARDWARE_MOTHERBOARD),1129) -# bq ZUM Mega 3D +# Formbot Raptor 2 else ifeq ($(HARDWARE_MOTHERBOARD),1130) -# MakeBoard Mini v2.1.2 is a control board sold by MicroMake +# bq ZUM Mega 3D else ifeq ($(HARDWARE_MOTHERBOARD),1131) -# TriGorilla Anycubic version 1.3 based on RAMPS EFB +# MakeBoard Mini v2.1.2 is a control board sold by MicroMake else ifeq ($(HARDWARE_MOTHERBOARD),1132) -# TriGorilla Anycubic version 1.4 based on RAMPS EFB +# TriGorilla Anycubic version 1.3 based on RAMPS EFB else ifeq ($(HARDWARE_MOTHERBOARD),1133) -# TriGorilla Anycubic version 1.4 Rev 1.1 +# TriGorilla Anycubic version 1.4 based on RAMPS EFB else ifeq ($(HARDWARE_MOTHERBOARD),1134) -# Creality: Ender-4, CR-8 +# TriGorilla Anycubic version 1.4 Rev 1.1 else ifeq ($(HARDWARE_MOTHERBOARD),1135) -# Creality: CR10S, CR20, CR-X +# Creality: Ender-4, CR-8 else ifeq ($(HARDWARE_MOTHERBOARD),1136) -# Dagoma F5 +# Creality: CR10S, CR20, CR-X else ifeq ($(HARDWARE_MOTHERBOARD),1137) -# FYSETC F6 1.3 +# Dagoma F5 else ifeq ($(HARDWARE_MOTHERBOARD),1138) -# FYSETC F6 1.5 +# FYSETC F6 1.3 else ifeq ($(HARDWARE_MOTHERBOARD),1139) -# Duplicator i3 Plus +# FYSETC F6 1.5 else ifeq ($(HARDWARE_MOTHERBOARD),1140) -# VORON +# Duplicator i3 Plus else ifeq ($(HARDWARE_MOTHERBOARD),1141) -# TRONXY V3 1.0 +# VORON else ifeq ($(HARDWARE_MOTHERBOARD),1142) -# Z-Bolt X Series +# TRONXY V3 1.0 else ifeq ($(HARDWARE_MOTHERBOARD),1143) -# TT OSCAR +# Z-Bolt X Series else ifeq ($(HARDWARE_MOTHERBOARD),1144) -# Overlord/Overlord Pro +# TT OSCAR else ifeq ($(HARDWARE_MOTHERBOARD),1145) -# ADIMLab Gantry v1 +# Overlord/Overlord Pro else ifeq ($(HARDWARE_MOTHERBOARD),1146) -# ADIMLab Gantry v2 +# ADIMLab Gantry v1 else ifeq ($(HARDWARE_MOTHERBOARD),1147) -# BIQU Tango V1 +# ADIMLab Gantry v2 else ifeq ($(HARDWARE_MOTHERBOARD),1148) -# MKS GEN L V2 +# BIQU Tango V1 else ifeq ($(HARDWARE_MOTHERBOARD),1149) -# Copymaster 3D +# MKS GEN L V2 else ifeq ($(HARDWARE_MOTHERBOARD),1150) +# Copymaster 3D +else ifeq ($(HARDWARE_MOTHERBOARD),1151) +# Ortur 4 +else ifeq ($(HARDWARE_MOTHERBOARD),1152) +# Tenlog D3 Hero +else ifeq ($(HARDWARE_MOTHERBOARD),1153) # # RAMBo and derivatives @@ -361,34 +366,38 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1501) else ifeq ($(HARDWARE_MOTHERBOARD),1502) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega644p -# Melzi with ATmega1284 (MaKr3d version) +# Melzi V2.0 else ifeq ($(HARDWARE_MOTHERBOARD),1503) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega1284p -# Melzi Creality3D board (for CR-10 etc) +# Melzi with ATmega1284 (MaKr3d version) else ifeq ($(HARDWARE_MOTHERBOARD),1504) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega1284p -# Melzi Malyan M150 board +# Melzi Creality3D board (for CR-10 etc) else ifeq ($(HARDWARE_MOTHERBOARD),1505) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega1284p -# Tronxy X5S +# Melzi Malyan M150 board else ifeq ($(HARDWARE_MOTHERBOARD),1506) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega1284p -# STB V1.1 +# Tronxy X5S else ifeq ($(HARDWARE_MOTHERBOARD),1507) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega1284p -# Azteeg X1 +# STB V1.1 else ifeq ($(HARDWARE_MOTHERBOARD),1508) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega1284p -# Anet 1.0 (Melzi clone) +# Azteeg X1 else ifeq ($(HARDWARE_MOTHERBOARD),1509) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega1284p +# Anet 1.0 (Melzi clone) +else ifeq ($(HARDWARE_MOTHERBOARD),1510) + HARDWARE_VARIANT ?= Sanguino + MCU ?= atmega1284p # # Other ATmega644P, ATmega644, ATmega1284P @@ -686,7 +695,7 @@ ifeq ($(HARDWARE_VARIANT), Teensy) 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_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) diff --git a/Marlin/Marlin.ino b/Marlin/Marlin.ino index 9bfb2881be..57c825445f 100644 --- a/Marlin/Marlin.ino +++ b/Marlin/Marlin.ino @@ -1,9 +1,8 @@ -/* -================================================================================ +/*============================================================================== Marlin Firmware - (c) 2011-2019 MarlinFirmware + (c) 2011-2020 MarlinFirmware Portions of Marlin are (c) by their respective authors. All code complies with GPLv2 and/or GPLv3 @@ -12,25 +11,28 @@ 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. +located in the root 'Marlin' folder. Check our Configurations repository 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/ + - https://marlinfw.org/ The official Marlin Firmware website contains the most up-to-date documentation. Contributions are always welcome! Configuration + - https://github.com/MarlinFirmware/Configurations + Example configurations for several printer models. + - 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 + - https://marlinfw.org/docs/configuration/configuration.html Marlin's configuration options are explained in more detail here. Getting Help @@ -45,9 +47,11 @@ Getting Help Contributing - - http://marlinfw.org/docs/development/contributing.html + - https://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 + - https://marlinfw.org/docs/development/coding_standards.html Before submitting code get to know the Coding Standards. -*/ + + +------------------------------------------------------------------------------*/ diff --git a/Marlin/Version.h b/Marlin/Version.h index 1f65f4d49c..723ccef700 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -34,7 +34,7 @@ * 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)" +//#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION /** * The STRING_DISTRIBUTION_DATE represents when the binary file was built, @@ -65,12 +65,12 @@ * 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" +//#define WEBSITE_URL "https://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 +//#define USB_DEVICE_VENDOR_ID 0x0000 +//#define USB_DEVICE_PRODUCT_ID 0x0000 +//#define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL diff --git a/Marlin/lib/readme.txt b/Marlin/lib/readme.txt index dbadc3d630..5ec60aa858 100644 --- a/Marlin/lib/readme.txt +++ b/Marlin/lib/readme.txt @@ -33,4 +33,4 @@ 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 +- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/Marlin/src/HAL/AVR/HAL.cpp b/Marlin/src/HAL/AVR/HAL.cpp index 317d13a540..58d57c8ee5 100644 --- a/Marlin/src/HAL/AVR/HAL.cpp +++ b/Marlin/src/HAL/AVR/HAL.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __AVR__ #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/HAL/AVR/HAL.h b/Marlin/src/HAL/AVR/HAL.h index 0255169819..b0e0674c73 100644 --- a/Marlin/src/HAL/AVR/HAL.h +++ b/Marlin/src/HAL/AVR/HAL.h @@ -14,7 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #pragma once @@ -50,7 +50,11 @@ // Defines // ------------------------ -//#define analogInputToDigitalPin(IO) IO +// AVR PROGMEM extension for sprintf_P +#define S_FMT "%S" + +// AVR PROGMEM extension for string define +#define PGMSTR(NAM,STR) const char NAM[] PROGMEM = STR #ifndef CRITICAL_SECTION_START #define CRITICAL_SECTION_START() unsigned char _sreg = SREG; cli() @@ -60,16 +64,10 @@ #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 @@ -142,220 +140,6 @@ extern "C" { } #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<. + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/AVR/MarlinSerial.cpp b/Marlin/src/HAL/AVR/MarlinSerial.cpp index 350d0f302d..f41ef20114 100644 --- a/Marlin/src/HAL/AVR/MarlinSerial.cpp +++ b/Marlin/src/HAL/AVR/MarlinSerial.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -43,6 +43,10 @@ #include "MarlinSerial.h" #include "../../MarlinCore.h" + #if ENABLED(DIRECT_STEPPING) + #include "../../feature/direct_stepping.h" + #endif + 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; @@ -131,6 +135,18 @@ static EmergencyParser::State emergency_state; // = EP_RESET + // 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 ENABLED(DIRECT_STEPPING) + if (page_manager.maybe_store_rxd_char(c)) return; + #endif + // 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. @@ -142,14 +158,6 @@ // 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 diff --git a/Marlin/src/HAL/AVR/MarlinSerial.h b/Marlin/src/HAL/AVR/MarlinSerial.h index cd7aad90a9..1182d86ac5 100644 --- a/Marlin/src/HAL/AVR/MarlinSerial.h +++ b/Marlin/src/HAL/AVR/MarlinSerial.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -299,12 +299,12 @@ template struct MarlinInternalSerialCfg { static constexpr int PORT = serial; - static constexpr unsigned int RX_SIZE = 128; - static constexpr unsigned int TX_SIZE = 48; + static constexpr unsigned int RX_SIZE = DGUS_RX_BUFFER_SIZE; + static constexpr unsigned int TX_SIZE = DGUS_TX_BUFFER_SIZE; static constexpr bool XONOFF = false; static constexpr bool EMERGENCYPARSER = false; static constexpr bool DROPPED_RX = false; - static constexpr bool RX_OVERRUNS = HAS_DGUS_LCD && ENABLED(DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS); + static constexpr bool RX_OVERRUNS = BOTH(HAS_DGUS_LCD, DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS); static constexpr bool RX_FRAMING_ERRORS = false; static constexpr bool MAX_RX_QUEUED = false; }; diff --git a/Marlin/src/HAL/AVR/Servo.cpp b/Marlin/src/HAL/AVR/Servo.cpp index 02c131bd44..66ed993c6f 100644 --- a/Marlin/src/HAL/AVR/Servo.cpp +++ b/Marlin/src/HAL/AVR/Servo.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -59,7 +59,6 @@ #include -#include "../shared/Marduino.h" #include "../shared/servo.h" #include "../shared/servo_private.h" diff --git a/Marlin/src/HAL/AVR/ServoTimers.h b/Marlin/src/HAL/AVR/ServoTimers.h index 86007fd102..564714df6e 100644 --- a/Marlin/src/HAL/AVR/ServoTimers.h +++ b/Marlin/src/HAL/AVR/ServoTimers.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/AVR/eeprom.cpp b/Marlin/src/HAL/AVR/eeprom.cpp index ee416b7a12..c7906985eb 100644 --- a/Marlin/src/HAL/AVR/eeprom.cpp +++ b/Marlin/src/HAL/AVR/eeprom.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #ifdef __AVR__ @@ -25,9 +25,18 @@ #if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE) +/** + * PersistentStore for Arduino-style EEPROM interface + * with implementations supplied by the framework. + */ + #include "../shared/eeprom_api.h" -bool PersistentStore::access_start() { return true; } +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE size_t(E2END + 1) +#endif +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +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) { @@ -46,7 +55,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui crc16(crc, &v, 1); pos++; value++; - }; + } return false; } @@ -61,7 +70,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t 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/src/HAL/AVR/endstop_interrupts.h b/Marlin/src/HAL/AVR/endstop_interrupts.h index 8f89c69baf..ae9a605acc 100644 --- a/Marlin/src/HAL/AVR/endstop_interrupts.h +++ b/Marlin/src/HAL/AVR/endstop_interrupts.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/AVR/fast_pwm.cpp b/Marlin/src/HAL/AVR/fast_pwm.cpp index 42e7cc3f10..29866bccf9 100644 --- a/Marlin/src/HAL/AVR/fast_pwm.cpp +++ b/Marlin/src/HAL/AVR/fast_pwm.cpp @@ -16,14 +16,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #ifdef __AVR__ #include "../../inc/MarlinConfigPre.h" -#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_PWM +#if NEEDS_HARDWARE_PWM // Specific meta-flag for features that mandate PWM #include "HAL.h" @@ -274,9 +274,9 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255 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 + _SET_OCRnQ(timer.OCRnQ, timer.q, v * float(top) / float(v_size)); // Scale 8/16-bit v to top value } } -#endif // FAST_PWM_FAN || SPINDLE_LASER_PWM +#endif // NEEDS_HARDWARE_PWM #endif // __AVR__ diff --git a/Marlin/src/HAL/AVR/fastio.cpp b/Marlin/src/HAL/AVR/fastio.cpp index 9f70b50f71..b51d7f9768 100644 --- a/Marlin/src/HAL/AVR/fastio.cpp +++ b/Marlin/src/HAL/AVR/fastio.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -234,5 +234,55 @@ uint8_t extDigitalRead(const int8_t pin) { } } +#if 0 +/** + * Set Timer 5 PWM frequency in Hz, from 3.8Hz up to ~16MHz + * with a minimum resolution of 100 steps. + * + * DC values -1.0 to 1.0. Negative duty cycle inverts the pulse. + */ +uint16_t set_pwm_frequency_hz(const float &hz, const float dca, const float dcb, const float dcc) { + float count = 0; + if (hz > 0 && (dca || dcb || dcc)) { + count = float(F_CPU) / hz; // 1x prescaler, TOP for 16MHz base freq. + uint16_t prescaler; // Range of 30.5Hz (65535) 64.5KHz (>31) + + if (count >= 255. * 256.) { prescaler = 1024; SET_CS(5, PRESCALER_1024); } + else if (count >= 255. * 64.) { prescaler = 256; SET_CS(5, PRESCALER_256); } + else if (count >= 255. * 8.) { prescaler = 64; SET_CS(5, PRESCALER_64); } + else if (count >= 255.) { prescaler = 8; SET_CS(5, PRESCALER_8); } + else { prescaler = 1; SET_CS(5, PRESCALER_1); } + + count /= float(prescaler); + const float pwm_top = round(count); // Get the rounded count + + ICR5 = (uint16_t)pwm_top - 1; // Subtract 1 for TOP + OCR5A = pwm_top * ABS(dca); // Update and scale DCs + OCR5B = pwm_top * ABS(dcb); + OCR5C = pwm_top * ABS(dcc); + _SET_COM(5, A, dca ? (dca < 0 ? COM_SET_CLEAR : COM_CLEAR_SET) : COM_NORMAL); // Set compare modes + _SET_COM(5, B, dcb ? (dcb < 0 ? COM_SET_CLEAR : COM_CLEAR_SET) : COM_NORMAL); + _SET_COM(5, C, dcc ? (dcc < 0 ? COM_SET_CLEAR : COM_CLEAR_SET) : COM_NORMAL); + + SET_WGM(5, FAST_PWM_ICRn); // Fast PWM with ICR5 as TOP + + //SERIAL_ECHOLNPGM("Timer 5 Settings:"); + //SERIAL_ECHOLNPAIR(" Prescaler=", prescaler); + //SERIAL_ECHOLNPAIR(" TOP=", ICR5); + //SERIAL_ECHOLNPAIR(" OCR5A=", OCR5A); + //SERIAL_ECHOLNPAIR(" OCR5B=", OCR5B); + //SERIAL_ECHOLNPAIR(" OCR5C=", OCR5C); + } + else { + // Restore the default for Timer 5 + SET_WGM(5, PWM_PC_8); // PWM 8-bit (Phase Correct) + SET_COMS(5, NORMAL, NORMAL, NORMAL); // Do nothing + SET_CS(5, PRESCALER_64); // 16MHz / 64 = 250KHz + OCR5A = OCR5B = OCR5C = 0; + } + return round(count); +} +#endif + #endif // FASTIO_EXT_START #endif // __AVR__ diff --git a/Marlin/src/HAL/AVR/fastio.h b/Marlin/src/HAL/AVR/fastio.h index 787275271a..bd6935aaf0 100644 --- a/Marlin/src/HAL/AVR/fastio.h +++ b/Marlin/src/HAL/AVR/fastio.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/AVR/fastio/fastio_1280.h b/Marlin/src/HAL/AVR/fastio/fastio_1280.h index b62156caa7..f482f823e8 100644 --- a/Marlin/src/HAL/AVR/fastio/fastio_1280.h +++ b/Marlin/src/HAL/AVR/fastio/fastio_1280.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/AVR/fastio/fastio_1281.h b/Marlin/src/HAL/AVR/fastio/fastio_1281.h index 7552540ffe..e0bc5e2995 100644 --- a/Marlin/src/HAL/AVR/fastio/fastio_1281.h +++ b/Marlin/src/HAL/AVR/fastio/fastio_1281.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/AVR/fastio/fastio_168.h b/Marlin/src/HAL/AVR/fastio/fastio_168.h index 549e0246d5..8cfdd1e8f8 100644 --- a/Marlin/src/HAL/AVR/fastio/fastio_168.h +++ b/Marlin/src/HAL/AVR/fastio/fastio_168.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/AVR/fastio/fastio_644.h b/Marlin/src/HAL/AVR/fastio/fastio_644.h index 3a48c109e9..f4a9427e0a 100644 --- a/Marlin/src/HAL/AVR/fastio/fastio_644.h +++ b/Marlin/src/HAL/AVR/fastio/fastio_644.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h b/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h index 23d16a20e5..51d400b705 100644 --- a/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h +++ b/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/AVR/inc/Conditionals_LCD.h b/Marlin/src/HAL/AVR/inc/Conditionals_LCD.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/AVR/inc/Conditionals_LCD.h +++ b/Marlin/src/HAL/AVR/inc/Conditionals_LCD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/AVR/inc/Conditionals_adv.h b/Marlin/src/HAL/AVR/inc/Conditionals_adv.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/AVR/inc/Conditionals_adv.h +++ b/Marlin/src/HAL/AVR/inc/Conditionals_adv.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/AVR/inc/Conditionals_post.h b/Marlin/src/HAL/AVR/inc/Conditionals_post.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/AVR/inc/Conditionals_post.h +++ b/Marlin/src/HAL/AVR/inc/Conditionals_post.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/AVR/inc/SanityCheck.h b/Marlin/src/HAL/AVR/inc/SanityCheck.h index 1c7c68f216..e55e45b73b 100644 --- a/Marlin/src/HAL/AVR/inc/SanityCheck.h +++ b/Marlin/src/HAL/AVR/inc/SanityCheck.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,16 +25,6 @@ * 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 */ @@ -51,15 +41,17 @@ #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 +#elif defined(SPINDLE_LASER_FREQUENCY) + #error "SPINDLE_LASER_FREQUENCY requires SPINDLE_LASER_PWM." #endif /** * The Trinamic library includes SoftwareSerial.h, leading to a compile error. */ -#if HAS_TRINAMIC_CONFIG && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) +#if BOTH(HAS_TRINAMIC_CONFIG, ENDSTOP_INTERRUPTS_FEATURE) #error "TMCStepper includes SoftwareSerial.h which is incompatible with ENDSTOP_INTERRUPTS_FEATURE. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #endif -#if HAS_TMC_SW_SERIAL && ENABLED(MONITOR_DRIVER_STATUS) +#if BOTH(HAS_TMC_SW_SERIAL, MONITOR_DRIVER_STATUS) #error "MONITOR_DRIVER_STATUS causes performance issues when used with SoftwareSerial-connected drivers. Disable MONITOR_DRIVER_STATUS or use hardware serial to continue." #endif diff --git a/Marlin/src/HAL/AVR/math.h b/Marlin/src/HAL/AVR/math.h index e8be0a04bc..7ede4accc0 100644 --- a/Marlin/src/HAL/AVR/math.h +++ b/Marlin/src/HAL/AVR/math.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/AVR/pinsDebug.h b/Marlin/src/HAL/AVR/pinsDebug.h index fbd2e084fa..d73f520d14 100644 --- a/Marlin/src/HAL/AVR/pinsDebug.h +++ b/Marlin/src/HAL/AVR/pinsDebug.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/AVR/pinsDebug_Teensyduino.h b/Marlin/src/HAL/AVR/pinsDebug_Teensyduino.h index f6da077743..051972a861 100644 --- a/Marlin/src/HAL/AVR/pinsDebug_Teensyduino.h +++ b/Marlin/src/HAL/AVR/pinsDebug_Teensyduino.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/AVR/pinsDebug_plus_70.h b/Marlin/src/HAL/AVR/pinsDebug_plus_70.h index 6e7b8fbaa9..46c03088d2 100644 --- a/Marlin/src/HAL/AVR/pinsDebug_plus_70.h +++ b/Marlin/src/HAL/AVR/pinsDebug_plus_70.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/AVR/spi_pins.h b/Marlin/src/HAL/AVR/spi_pins.h index daaebb76d7..f3fa78e2bf 100644 --- a/Marlin/src/HAL/AVR/spi_pins.h +++ b/Marlin/src/HAL/AVR/spi_pins.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/AVR/timers.h b/Marlin/src/HAL/AVR/timers.h new file mode 100644 index 0000000000..6c40d32209 --- /dev/null +++ b/Marlin/src/HAL/AVR/timers.h @@ -0,0 +1,259 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 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 + +// ------------------------ +// Types +// ------------------------ + +typedef uint16_t hal_timer_t; +#define HAL_TIMER_TYPE_MAX 0xFFFF + +// ------------------------ +// Defines +// ------------------------ + +#define HAL_TIMER_RATE ((F_CPU) / 8) // i.e., 2MHz or 2.5MHz + +#ifndef STEP_TIMER_NUM + #define STEP_TIMER_NUM 1 +#endif +#ifndef PULSE_TIMER_NUM + #define PULSE_TIMER_NUM STEP_TIMER_NUM +#endif +#ifndef TEMP_TIMER_NUM + #define TEMP_TIMER_NUM 0 +#endif + +#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 */ +#ifndef HAL_STEP_TIMER_ISR + +#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<. + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/AVR/watchdog.cpp b/Marlin/src/HAL/AVR/watchdog.cpp index e35a70f2cc..3f10c4adff 100644 --- a/Marlin/src/HAL/AVR/watchdog.cpp +++ b/Marlin/src/HAL/AVR/watchdog.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __AVR__ #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/HAL/AVR/watchdog.h b/Marlin/src/HAL/AVR/watchdog.h index 57dfcfc0bf..a16c88b35e 100644 --- a/Marlin/src/HAL/AVR/watchdog.h +++ b/Marlin/src/HAL/AVR/watchdog.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/DUE/DebugMonitor.cpp b/Marlin/src/HAL/DUE/DebugMonitor.cpp index 3ed9873e66..79759151d8 100644 --- a/Marlin/src/HAL/DUE/DebugMonitor.cpp +++ b/Marlin/src/HAL/DUE/DebugMonitor.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef ARDUINO_ARCH_SAM #include "../../core/macros.h" diff --git a/Marlin/src/HAL/DUE/HAL.cpp b/Marlin/src/HAL/DUE/HAL.cpp index cb381ff4bb..f2bf4ebbf5 100644 --- a/Marlin/src/HAL/DUE/HAL.cpp +++ b/Marlin/src/HAL/DUE/HAL.cpp @@ -14,7 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ /** diff --git a/Marlin/src/HAL/DUE/HAL.h b/Marlin/src/HAL/DUE/HAL.h index 42f6f175fb..31409c76dd 100644 --- a/Marlin/src/HAL/DUE/HAL.h +++ b/Marlin/src/HAL/DUE/HAL.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -30,11 +30,11 @@ #define CPU_32_BIT #include "../shared/Marduino.h" +#include "../shared/eeprom_if.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" #include "fastio.h" #include "watchdog.h" -#include "timers.h" #include @@ -130,14 +130,6 @@ 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 // @@ -151,8 +143,9 @@ extern uint16_t HAL_adc_result; // result of last ADC conversion inline void HAL_adc_init() {}//todo -#define HAL_START_ADC(ch) HAL_adc_start_conversion(ch) +#define HAL_ADC_VREF 3.3 #define HAL_ADC_RESOLUTION 10 +#define HAL_START_ADC(ch) HAL_adc_start_conversion(ch) #define HAL_READ_ADC() HAL_adc_result #define HAL_ADC_READY() true diff --git a/Marlin/src/HAL/DUE/HAL_SPI.cpp b/Marlin/src/HAL/DUE/HAL_SPI.cpp index 97a6fa05a1..6d8f7ef819 100644 --- a/Marlin/src/HAL/DUE/HAL_SPI.cpp +++ b/Marlin/src/HAL/DUE/HAL_SPI.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/DUE/InterruptVectors.cpp b/Marlin/src/HAL/DUE/InterruptVectors.cpp index 7964f2d1f6..e4e0ce99f2 100644 --- a/Marlin/src/HAL/DUE/InterruptVectors.cpp +++ b/Marlin/src/HAL/DUE/InterruptVectors.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/DUE/InterruptVectors.h b/Marlin/src/HAL/DUE/InterruptVectors.h index 534cd17f42..6faeb34b7a 100644 --- a/Marlin/src/HAL/DUE/InterruptVectors.h +++ b/Marlin/src/HAL/DUE/InterruptVectors.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/DUE/MarlinSerial.cpp b/Marlin/src/HAL/DUE/MarlinSerial.cpp index d114c75989..c9a372eeb1 100644 --- a/Marlin/src/HAL/DUE/MarlinSerial.cpp +++ b/Marlin/src/HAL/DUE/MarlinSerial.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/DUE/MarlinSerial.h b/Marlin/src/HAL/DUE/MarlinSerial.h index fa6a2c7d15..dfafa15141 100644 --- a/Marlin/src/HAL/DUE/MarlinSerial.h +++ b/Marlin/src/HAL/DUE/MarlinSerial.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/DUE/MarlinSerialUSB.cpp b/Marlin/src/HAL/DUE/MarlinSerialUSB.cpp index 7a020bbaf0..a41dbfeb7a 100644 --- a/Marlin/src/HAL/DUE/MarlinSerialUSB.cpp +++ b/Marlin/src/HAL/DUE/MarlinSerialUSB.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -73,9 +73,7 @@ int MarlinSerialUSB::peek() { pending_char = udi_cdc_getc(); - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.update(emergency_state, (char)pending_char); - #endif + TERN_(EMERGENCY_PARSER, emergency_parser.update(emergency_state, (char)pending_char)); return pending_char; } @@ -97,9 +95,7 @@ int MarlinSerialUSB::read() { int c = udi_cdc_getc(); - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.update(emergency_state, (char)c); - #endif + TERN_(EMERGENCY_PARSER, emergency_parser.update(emergency_state, (char)c)); return c; } diff --git a/Marlin/src/HAL/DUE/MarlinSerialUSB.h b/Marlin/src/HAL/DUE/MarlinSerialUSB.h index 9aece901b1..2e3622e553 100644 --- a/Marlin/src/HAL/DUE/MarlinSerialUSB.h +++ b/Marlin/src/HAL/DUE/MarlinSerialUSB.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/DUE/Servo.cpp b/Marlin/src/HAL/DUE/Servo.cpp index 266158bbc6..5524aa9cef 100644 --- a/Marlin/src/HAL/DUE/Servo.cpp +++ b/Marlin/src/HAL/DUE/Servo.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -44,7 +44,6 @@ #if HAS_SERVOS -#include "../shared/Marduino.h" #include "../shared/servo.h" #include "../shared/servo_private.h" diff --git a/Marlin/src/HAL/DUE/Tone.cpp b/Marlin/src/HAL/DUE/Tone.cpp index 44bb52b421..9beb602223 100644 --- a/Marlin/src/HAL/DUE/Tone.cpp +++ b/Marlin/src/HAL/DUE/Tone.cpp @@ -18,7 +18,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -31,7 +31,6 @@ #include "../../inc/MarlinConfig.h" #include "HAL.h" -#include "timers.h" static pin_t tone_pin; volatile static int32_t toggles; diff --git a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp index 0fb8a782e5..2ef7011b1c 100644 --- a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp +++ b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp index 01320ba9b9..47060d6a5b 100644 --- a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp +++ b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp index c4816c3db5..54c244d4f6 100644 --- a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp +++ b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp index 96b7a1f61e..960df1bd86 100644 --- a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp +++ b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h index e0f15bfd81..f076c503ca 100644 --- a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h +++ b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/DUE/EepromEmulation.cpp b/Marlin/src/HAL/DUE/eeprom_flash.cpp similarity index 88% rename from Marlin/src/HAL/DUE/EepromEmulation.cpp rename to Marlin/src/HAL/DUE/eeprom_flash.cpp index 66af50cfd2..d98f06039f 100644 --- a/Marlin/src/HAL/DUE/EepromEmulation.cpp +++ b/Marlin/src/HAL/DUE/eeprom_flash.cpp @@ -1,9 +1,10 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * Copyright (c) 2020 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 @@ -16,9 +17,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ +#ifdef ARDUINO_ARCH_SAM + +#include "../../inc/MarlinConfig.h" + +#if ENABLED(FLASH_EEPROM_EMULATION) /* EEPROM emulation over flash with reduced wear * @@ -50,14 +56,7 @@ * */ -#ifdef ARDUINO_ARCH_SAM - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(FLASH_EEPROM_EMULATION) - -#include "../shared/Marduino.h" -#include "../shared/eeprom_api.h" +//#define EE_EMU_DEBUG #define EEPROMSize 4096 #define PagesPerGroup 128 @@ -134,15 +133,18 @@ 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) { +#define DEBUG_OUT ENABLED(EE_EMU_DEBUG) +#include "../../core/debug_out.h" + +static void ee_Dump(const int page, const void* data) { + + #ifdef EE_EMU_DEBUG 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); + DEBUG_ECHO(buffer); char* p = &buffer[0]; for (int i = 0; i< PageSize; ++i) { @@ -152,12 +154,16 @@ static uint8_t buffer[256] = {0}, // The RAM buffer to accumulate writes if ((i & 0xF) == 0xF) { *p++ = '\n'; *p = 0; - SERIAL_ECHO(buffer); + DEBUG_ECHO(buffer); p = &buffer[0]; } } - } -#endif + + #else + UNUSED(page); + UNUSED(data); + #endif +} /* Flash Writing Protection Key */ #define FWP_KEY 0x5Au @@ -170,17 +176,16 @@ static uint8_t buffer[256] = {0}, // The RAM buffer to accumulate writes #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) { +static bool ee_PageWrite(uint16_t page, const void* data) { uint16_t i; - uint32_t addrflash = ((uint32_t)getFlashStorage(page)); + uint32_t addrflash = uint32_t(getFlashStorage(page)); // Read the flash contents uint32_t pageContents[PageSize>>2]; @@ -195,13 +200,11 @@ static bool ee_PageWrite(uint16_t page,const void* data) { 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 + DEBUG_ECHO_START(); + DEBUG_ECHOLNPAIR("EEPROM PageWrite ", page); + DEBUG_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash); + DEBUG_ECHOLNPAIR(" base address ", (uint32_t)getFlashStorage(0)); + DEBUG_FLUSH(); // Get the page relative to the start of the EFC controller, and the EFC controller to use Efc *efc; @@ -243,10 +246,8 @@ static bool ee_PageWrite(uint16_t page,const void* data) { // Reenable interrupts __enable_irq(); - #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Unlock failure for page ", page); - #endif + DEBUG_ECHO_START(); + DEBUG_ECHOLNPAIR("EEPROM Unlock failure for page ", page); return false; } @@ -270,10 +271,9 @@ static bool ee_PageWrite(uint16_t page,const void* data) { // Reenable interrupts __enable_irq(); - #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Write failure for page ", page); - #endif + DEBUG_ECHO_START(); + DEBUG_ECHOLNPAIR("EEPROM Write failure for page ", page); + return false; } @@ -287,11 +287,11 @@ static bool ee_PageWrite(uint16_t page,const void* data) { if (memcmp(getFlashStorage(page),data,PageSize)) { #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Verify Write failure for page ", page); + DEBUG_ECHO_START(); + DEBUG_ECHOLNPAIR("EEPROM Verify Write failure for page ", page); - ee_Dump( page,(uint32_t *) addrflash); - ee_Dump(-page,data); + ee_Dump( page, (uint32_t *)addrflash); + ee_Dump(-page, data); // Calculate count of changed bits uint32_t* p1 = (uint32_t*)addrflash; @@ -307,7 +307,7 @@ static bool ee_PageWrite(uint16_t page,const void* data) { } } } - SERIAL_ECHOLNPAIR("--> Differing bits: ", count); + DEBUG_ECHOLNPAIR("--> Differing bits: ", count); #endif return false; @@ -324,15 +324,13 @@ __attribute__ ((long_call, section (".ramfunc"))) static bool ee_PageErase(uint16_t page) { uint16_t i; - uint32_t addrflash = ((uint32_t)getFlashStorage(page)); + 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 + DEBUG_ECHO_START(); + DEBUG_ECHOLNPAIR("EEPROM PageErase ", page); + DEBUG_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash); + DEBUG_ECHOLNPAIR(" base address ", (uint32_t)getFlashStorage(0)); + DEBUG_FLUSH(); // Get the page relative to the start of the EFC controller, and the EFC controller to use Efc *efc; @@ -373,10 +371,9 @@ static bool ee_PageErase(uint16_t page) { // Reenable interrupts __enable_irq(); - #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Unlock failure for page ",page); - #endif + DEBUG_ECHO_START(); + DEBUG_ECHOLNPAIR("EEPROM Unlock failure for page ",page); + return false; } @@ -398,10 +395,9 @@ static bool ee_PageErase(uint16_t page) { // Reenable interrupts __enable_irq(); - #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Erase failure for page ",page); - #endif + DEBUG_ECHO_START(); + DEBUG_ECHOLNPAIR("EEPROM Erase failure for page ",page); + return false; } @@ -415,20 +411,17 @@ static bool ee_PageErase(uint16_t page) { 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 + DEBUG_ECHO_START(); + DEBUG_ECHOLNPAIR("EEPROM Verify Erase failure for page ",page); + ee_Dump(page, (uint32_t *)addrflash); return false; } } return true; } -static uint8_t ee_Read(uint32_t address, bool excludeRAMBuffer = false) { + +static uint8_t ee_Read(uint32_t address, bool excludeRAMBuffer=false) { uint32_t baddr; uint32_t blen; @@ -511,7 +504,7 @@ static uint8_t ee_Read(uint32_t address, bool excludeRAMBuffer = false) { return 0xFF; } -static uint32_t ee_GetAddrRange(uint32_t address, bool excludeRAMBuffer = false) { +static uint32_t ee_GetAddrRange(uint32_t address, bool excludeRAMBuffer=false) { uint32_t baddr, blen, nextAddr = 0xFFFF, @@ -603,7 +596,7 @@ static bool ee_IsPageClean(int page) { return true; } -static bool ee_Flush(uint32_t overrideAddress = 0xFFFFFFFF, uint8_t overrideData = 0xFF) { +static bool ee_Flush(uint32_t overrideAddress = 0xFFFFFFFF, uint8_t overrideData=0xFF) { // Check if RAM buffer has something to be written bool isEmpty = true; @@ -929,11 +922,9 @@ static void ee_Init() { // 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 + DEBUG_ECHO_START(); + DEBUG_ECHOLNPAIR("EEPROM Current Group: ",curGroup); + DEBUG_FLUSH(); // Now, validate that all the other group pages are empty for (int grp = 0; grp < GroupCount; grp++) { @@ -941,11 +932,9 @@ static void ee_Init() { 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 + DEBUG_ECHO_START(); + DEBUG_ECHOLNPAIR("EEPROM Page ", page, " not clean on group ", grp); + DEBUG_FLUSH(); ee_PageErase(grp * PagesPerGroup + page); } } @@ -955,66 +944,69 @@ static void ee_Init() { // 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 + ee_Dump(curGroup * PagesPerGroup + curPage, getFlashStorage(curGroup * PagesPerGroup + curPage)); break; } } - #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Active page: ", curPage); - SERIAL_FLUSH(); - #endif + DEBUG_ECHO_START(); + DEBUG_ECHOLNPAIR("EEPROM Active page: ", curPage); + DEBUG_FLUSH(); // 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 + DEBUG_ECHO_START(); + DEBUG_ECHOLNPAIR("EEPROM Page ", page, " not clean on active group ", curGroup); + DEBUG_FLUSH(); + ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page)); ee_PageErase(curGroup * PagesPerGroup + page); } } } -uint8_t eeprom_read_byte(uint8_t* addr) { - ee_Init(); - return ee_Read((uint32_t)addr); -} +/* PersistentStore -----------------------------------------------------------*/ -void eeprom_write_byte(uint8_t* addr, uint8_t value) { - ee_Init(); - ee_Write((uint32_t)addr, value); -} +#include "../shared/eeprom_api.h" -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; +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +bool PersistentStore::access_start() { ee_Init(); return true; } +bool PersistentStore::access_finish() { ee_Flush(); 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 != ee_Read(uint32_t(p))) { + ee_Write(uint32_t(p), v); + delay(2); + if (ee_Read(uint32_t(p)) != v) { + SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE); + return true; + } + } + crc16(crc, &v, 1); + pos++; + value++; } + return false; } -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(); +bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { + do { + uint8_t c = ee_Read(uint32_t(pos)); + if (writing) *value = c; + crc16(crc, &c, 1); + pos++; + value++; + } while (--size); + return false; } #endif // FLASH_EEPROM_EMULATION -#endif // ARDUINO_ARCH_AVR +#endif // ARDUINO_ARCH_SAM diff --git a/Marlin/src/HAL/DUE/eeprom.cpp b/Marlin/src/HAL/DUE/eeprom_wired.cpp similarity index 76% rename from Marlin/src/HAL/DUE/eeprom.cpp rename to Marlin/src/HAL/DUE/eeprom_wired.cpp index ec9ef51ffc..4599d6a7cd 100644 --- a/Marlin/src/HAL/DUE/eeprom.cpp +++ b/Marlin/src/HAL/DUE/eeprom_wired.cpp @@ -17,32 +17,29 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #ifdef ARDUINO_ARCH_SAM -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(EEPROM_SETTINGS) - #include "../../inc/MarlinConfig.h" + +#if USE_WIRED_EEPROM + +/** + * PersistentStore for Arduino-style EEPROM interface + * with simple implementations supplied by Marlin. + */ + +#include "../shared/eeprom_if.h" #include "../shared/eeprom_api.h" -#if !defined(E2END) && ENABLED(FLASH_EEPROM_EMULATION) - #define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp) +#ifndef MARLIN_EEPROM_SIZE + #error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM." #endif - -extern void eeprom_flush(); - -bool PersistentStore::access_start() { return true; } - -bool PersistentStore::access_finish() { - #if ENABLED(FLASH_EEPROM_EMULATION) - eeprom_flush(); - #endif - return true; -} +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +bool PersistentStore::access_start() { eeprom_init(); 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--) { @@ -61,7 +58,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui crc16(crc, &v, 1); pos++; value++; - }; + } return false; } @@ -76,7 +73,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t return false; } -size_t PersistentStore::capacity() { return E2END + 1; } - -#endif // EEPROM_SETTINGS +#endif // USE_WIRED_EEPROM #endif // ARDUINO_ARCH_SAM diff --git a/Marlin/src/HAL/DUE/endstop_interrupts.h b/Marlin/src/HAL/DUE/endstop_interrupts.h index f81d9055d5..999ada5127 100644 --- a/Marlin/src/HAL/DUE/endstop_interrupts.h +++ b/Marlin/src/HAL/DUE/endstop_interrupts.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -47,43 +47,21 @@ void 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_Z4_MAX - _ATTACH(Z4_MAX_PIN); - #endif - #if HAS_Z4_MIN - _ATTACH(Z4_MIN_PIN); - #endif - #if HAS_Z_MIN_PROBE_PIN - _ATTACH(Z_MIN_PROBE_PIN); - #endif + TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN)); + TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN)); + TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN)); + TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN)); + TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN)); + TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN)); + TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN)); + TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN)); + TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN)); + TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN)); + TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN)); + TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN)); + TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN)); + TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN)); + TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN)); + TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN)); + TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN)); } diff --git a/Marlin/src/HAL/DUE/fastio.h b/Marlin/src/HAL/DUE/fastio.h index ba801b5b79..286319302d 100644 --- a/Marlin/src/HAL/DUE/fastio.h +++ b/Marlin/src/HAL/DUE/fastio.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -174,7 +174,7 @@ #define IS_OUTPUT(IO) ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) != 0) // Shorthand -#define OUT_WRITE(IO,V) { SET_OUTPUT(IO); WRITE(IO,V); } +#define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0) // digitalRead/Write wrappers #define extDigitalRead(IO) digitalRead(IO) diff --git a/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp b/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp index 672932f56c..1682faea66 100644 --- a/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp +++ b/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/DUE/fastio/G2_PWM.h b/Marlin/src/HAL/DUE/fastio/G2_PWM.h index a94c1c5276..dc4edffff8 100644 --- a/Marlin/src/HAL/DUE/fastio/G2_PWM.h +++ b/Marlin/src/HAL/DUE/fastio/G2_PWM.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/DUE/fastio/G2_pins.h b/Marlin/src/HAL/DUE/fastio/G2_pins.h index 44b9cb35ee..80c87bd392 100644 --- a/Marlin/src/HAL/DUE/fastio/G2_pins.h +++ b/Marlin/src/HAL/DUE/fastio/G2_pins.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/DUE/inc/Conditionals_LCD.h b/Marlin/src/HAL/DUE/inc/Conditionals_LCD.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/DUE/inc/Conditionals_LCD.h +++ b/Marlin/src/HAL/DUE/inc/Conditionals_LCD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/DUE/inc/Conditionals_adv.h b/Marlin/src/HAL/DUE/inc/Conditionals_adv.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/DUE/inc/Conditionals_adv.h +++ b/Marlin/src/HAL/DUE/inc/Conditionals_adv.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/DUE/inc/Conditionals_post.h b/Marlin/src/HAL/DUE/inc/Conditionals_post.h index 8a305009ce..ce6d3fdde2 100644 --- a/Marlin/src/HAL/DUE/inc/Conditionals_post.h +++ b/Marlin/src/HAL/DUE/inc/Conditionals_post.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once #if USE_FALLBACK_EEPROM - #undef SRAM_EEPROM_EMULATION - #undef SDCARD_EEPROM_EMULATION #define FLASH_EEPROM_EMULATION +#elif EITHER(I2C_EEPROM, SPI_EEPROM) + #define USE_SHARED_EEPROM 1 #endif diff --git a/Marlin/src/HAL/DUE/inc/SanityCheck.h b/Marlin/src/HAL/DUE/inc/SanityCheck.h index 0f7be7955f..cdea34436e 100644 --- a/Marlin/src/HAL/DUE/inc/SanityCheck.h +++ b/Marlin/src/HAL/DUE/inc/SanityCheck.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/DUE/pinsDebug.h b/Marlin/src/HAL/DUE/pinsDebug.h index 448c2391d3..28687ff267 100644 --- a/Marlin/src/HAL/DUE/pinsDebug.h +++ b/Marlin/src/HAL/DUE/pinsDebug.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/DUE/spi_pins.h b/Marlin/src/HAL/DUE/spi_pins.h index a205540bcd..e28eaf8270 100644 --- a/Marlin/src/HAL/DUE/spi_pins.h +++ b/Marlin/src/HAL/DUE/spi_pins.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/DUE/timers.cpp b/Marlin/src/HAL/DUE/timers.cpp index 74ae882843..795cdad66a 100644 --- a/Marlin/src/HAL/DUE/timers.cpp +++ b/Marlin/src/HAL/DUE/timers.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -34,8 +34,6 @@ #include "../../inc/MarlinConfig.h" #include "HAL.h" -#include "timers.h" - // ------------------------ // Local defines // ------------------------ diff --git a/Marlin/src/HAL/DUE/timers.h b/Marlin/src/HAL/DUE/timers.h index 5144660116..9defe39a0a 100644 --- a/Marlin/src/HAL/DUE/timers.h +++ b/Marlin/src/HAL/DUE/timers.h @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -40,11 +40,17 @@ typedef uint32_t hal_timer_t; #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 + #define STEP_TIMER_NUM 2 // Timer Index for Stepper +#endif +#ifndef PULSE_TIMER_NUM + #define PULSE_TIMER_NUM STEP_TIMER_NUM +#endif +#ifndef TEMP_TIMER_NUM + #define TEMP_TIMER_NUM 4 // Timer Index for Temperature +#endif +#ifndef TONE_TIMER_NUM + #define TONE_TIMER_NUM 6 // index of timer to use for beeper tones #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 @@ -66,8 +72,12 @@ typedef uint32_t hal_timer_t; #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() +#ifndef HAL_TEMP_TIMER_ISR + #define HAL_TEMP_TIMER_ISR() void TC4_Handler() +#endif +#ifndef HAL_TONE_TIMER_ISR + #define HAL_TONE_TIMER_ISR() void TC6_Handler() +#endif // ------------------------ // Types diff --git a/Marlin/src/HAL/DUE/upload_extra_script.py b/Marlin/src/HAL/DUE/upload_extra_script.py new file mode 100644 index 0000000000..06c2b914f5 --- /dev/null +++ b/Marlin/src/HAL/DUE/upload_extra_script.py @@ -0,0 +1,18 @@ +# +# Set upload_command +# +# Windows: bossac.exe +# Other: leave unchanged +# + +import platform +current_OS = platform.system() + +if current_OS == 'Windows': + + Import("env") + + # Use bossac.exe on Windows + env.Replace( + UPLOADCMD="bossac --info --unlock --write --verify --reset --erase -U false --boot" + ) diff --git a/Marlin/src/HAL/DUE/usb/conf_usb.h b/Marlin/src/HAL/DUE/usb/conf_usb.h index 697314212c..4de9e347e2 100644 --- a/Marlin/src/HAL/DUE/usb/conf_usb.h +++ b/Marlin/src/HAL/DUE/usb/conf_usb.h @@ -78,10 +78,6 @@ //! 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) diff --git a/Marlin/src/HAL/DUE/watchdog.cpp b/Marlin/src/HAL/DUE/watchdog.cpp index c245633d76..0f46971830 100644 --- a/Marlin/src/HAL/DUE/watchdog.cpp +++ b/Marlin/src/HAL/DUE/watchdog.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef ARDUINO_ARCH_SAM #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/HAL/DUE/watchdog.h b/Marlin/src/HAL/DUE/watchdog.h index 7d9665f20e..5725a10007 100644 --- a/Marlin/src/HAL/DUE/watchdog.h +++ b/Marlin/src/HAL/DUE/watchdog.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/ESP32/FlushableHardwareSerial.cpp b/Marlin/src/HAL/ESP32/FlushableHardwareSerial.cpp index 4d70d34edb..d4b2f42c53 100644 --- a/Marlin/src/HAL/ESP32/FlushableHardwareSerial.cpp +++ b/Marlin/src/HAL/ESP32/FlushableHardwareSerial.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/ESP32/FlushableHardwareSerial.h b/Marlin/src/HAL/ESP32/FlushableHardwareSerial.h index 703bcbeb73..b43caea13c 100644 --- a/Marlin/src/HAL/ESP32/FlushableHardwareSerial.h +++ b/Marlin/src/HAL/ESP32/FlushableHardwareSerial.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/ESP32/HAL.cpp b/Marlin/src/HAL/ESP32/HAL.cpp index d9afa13ab8..1e00df5177 100644 --- a/Marlin/src/HAL/ESP32/HAL.cpp +++ b/Marlin/src/HAL/ESP32/HAL.cpp @@ -16,21 +16,18 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef ARDUINO_ARCH_ESP32 -#include "HAL.h" -#include "timers.h" +#include "../../inc/MarlinConfig.h" + #include #include #include #include -#include "../../inc/MarlinConfigPre.h" - #if ENABLED(WIFISUPPORT) #include #include "wifi.h" @@ -97,9 +94,7 @@ void HAL_init_board() { esp3dlib.init(); #elif ENABLED(WIFISUPPORT) wifi_init(); - #if ENABLED(OTASUPPORT) - OTA_init(); - #endif + TERN_(OTASUPPORT, OTA_init()); #if ENABLED(WEBSUPPORT) spiffs_init(); web_init(); @@ -133,9 +128,7 @@ void HAL_idletask() { #if BOTH(WIFISUPPORT, OTASUPPORT) OTA_handle(); #endif - #if ENABLED(ESP3D_WIFISUPPORT) - esp3dlib.idletask(); - #endif + TERN_(ESP3D_WIFISUPPORT, esp3dlib.idletask()); } void HAL_clear_reset_source() { } @@ -176,39 +169,17 @@ void HAL_adc_init() { 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_TEMP_ADC_6 - adc2_set_attenuation(get_channel(TEMP_6_PIN), ADC_ATTEN_11db); - #endif - #if HAS_TEMP_ADC_7 - adc3_set_attenuation(get_channel(TEMP_7_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 + TERN_(HAS_TEMP_ADC_0, adc1_set_attenuation(get_channel(TEMP_0_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_ADC_1, adc1_set_attenuation(get_channel(TEMP_1_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_ADC_2, adc1_set_attenuation(get_channel(TEMP_2_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_ADC_3, adc1_set_attenuation(get_channel(TEMP_3_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_ADC_4, adc1_set_attenuation(get_channel(TEMP_4_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_ADC_5, adc1_set_attenuation(get_channel(TEMP_5_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_ADC_6, adc2_set_attenuation(get_channel(TEMP_6_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_ADC_7, adc3_set_attenuation(get_channel(TEMP_7_PIN), ADC_ATTEN_11db)); + TERN_(HAS_HEATED_BED, adc1_set_attenuation(get_channel(TEMP_BED_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_CHAMBER, adc1_set_attenuation(get_channel(TEMP_CHAMBER_PIN), ADC_ATTEN_11db)); + TERN_(FILAMENT_WIDTH_SENSOR, adc1_set_attenuation(get_channel(FILWIDTH_PIN), ADC_ATTEN_11db)); // 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. diff --git a/Marlin/src/HAL/ESP32/HAL.h b/Marlin/src/HAL/ESP32/HAL.h index a04343b69e..c91f9efff0 100644 --- a/Marlin/src/HAL/ESP32/HAL.h +++ b/Marlin/src/HAL/ESP32/HAL.h @@ -14,7 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #pragma once @@ -34,8 +34,6 @@ #include "watchdog.h" #include "i2s.h" -#include "timers.h" - #if ENABLED(WIFISUPPORT) #include "WebSocketSerial.h" #endif @@ -109,19 +107,14 @@ int freeMemory(); 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_VREF 3.3 #define HAL_ADC_RESOLUTION 10 +#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) #define HAL_READ_ADC() HAL_adc_result #define HAL_ADC_READY() true diff --git a/Marlin/src/HAL/ESP32/HAL_SPI.cpp b/Marlin/src/HAL/ESP32/HAL_SPI.cpp index 981d9b49c1..8e5875fc38 100644 --- a/Marlin/src/HAL/ESP32/HAL_SPI.cpp +++ b/Marlin/src/HAL/ESP32/HAL_SPI.cpp @@ -17,19 +17,17 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 "../../inc/MarlinConfig.h" -#include "../../core/macros.h" +#include "../shared/HAL_SPI.h" + +#include +#include // ------------------------ // Public Variables diff --git a/Marlin/src/HAL/ESP32/Servo.cpp b/Marlin/src/HAL/ESP32/Servo.cpp index 68ee3d9098..fcf5848581 100644 --- a/Marlin/src/HAL/ESP32/Servo.cpp +++ b/Marlin/src/HAL/ESP32/Servo.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #ifdef ARDUINO_ARCH_ESP32 @@ -61,9 +61,7 @@ void Servo::move(const int value) { if (attach(0) >= 0) { write(value); safe_delay(servo_delay[channel]); - #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - detach(); - #endif + TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach()); } } #endif // HAS_SERVOS diff --git a/Marlin/src/HAL/ESP32/Servo.h b/Marlin/src/HAL/ESP32/Servo.h index 3f575150eb..b0d9294527 100644 --- a/Marlin/src/HAL/ESP32/Servo.h +++ b/Marlin/src/HAL/ESP32/Servo.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/ESP32/WebSocketSerial.cpp b/Marlin/src/HAL/ESP32/WebSocketSerial.cpp index c7ee6951e1..533f873e4f 100644 --- a/Marlin/src/HAL/ESP32/WebSocketSerial.cpp +++ b/Marlin/src/HAL/ESP32/WebSocketSerial.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #ifdef ARDUINO_ARCH_ESP32 diff --git a/Marlin/src/HAL/ESP32/WebSocketSerial.h b/Marlin/src/HAL/ESP32/WebSocketSerial.h index e76a2bc68e..7a25c6dc5e 100644 --- a/Marlin/src/HAL/ESP32/WebSocketSerial.h +++ b/Marlin/src/HAL/ESP32/WebSocketSerial.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/ESP32/eeprom_impl.cpp b/Marlin/src/HAL/ESP32/eeprom.cpp similarity index 77% rename from Marlin/src/HAL/ESP32/eeprom_impl.cpp rename to Marlin/src/HAL/ESP32/eeprom.cpp index dbfee14055..1bf687c6fe 100644 --- a/Marlin/src/HAL/ESP32/eeprom_impl.cpp +++ b/Marlin/src/HAL/ESP32/eeprom.cpp @@ -16,29 +16,25 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef ARDUINO_ARCH_ESP32 #include "../../inc/MarlinConfig.h" -#if ENABLED(EEPROM_SETTINGS) && DISABLED(FLASH_EEPROM_EMULATION) +#if ENABLED(EEPROM_SETTINGS) #include "../shared/eeprom_api.h" -#include "EEPROM.h" +#include -#define EEPROM_SIZE 4096 +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } -bool PersistentStore::access_start() { - return EEPROM.begin(EEPROM_SIZE); -} - -bool PersistentStore::access_finish() { - EEPROM.end(); - return true; -} +bool PersistentStore::access_start() { return EEPROM.begin(MARLIN_EEPROM_SIZE); } +bool PersistentStore::access_finish() { EEPROM.end(); 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++) { @@ -57,7 +53,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t return false; } -size_t PersistentStore::capacity() { return EEPROM_SIZE; } - #endif // EEPROM_SETTINGS #endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin/src/HAL/ESP32/endstop_interrupts.h b/Marlin/src/HAL/ESP32/endstop_interrupts.h index 2da1cc7477..743ccd99c9 100644 --- a/Marlin/src/HAL/ESP32/endstop_interrupts.h +++ b/Marlin/src/HAL/ESP32/endstop_interrupts.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -42,43 +42,21 @@ 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_Z4_MAX - _ATTACH(Z4_MAX_PIN); - #endif - #if HAS_Z4_MIN - _ATTACH(Z4_MIN_PIN); - #endif - #if HAS_Z_MIN_PROBE_PIN - _ATTACH(Z_MIN_PROBE_PIN); - #endif + TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN)); + TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN)); + TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN)); + TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN)); + TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN)); + TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN)); + TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN)); + TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN)); + TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN)); + TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN)); + TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN)); + TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN)); + TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN)); + TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN)); + TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN)); + TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN)); + TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN)); } diff --git a/Marlin/src/HAL/ESP32/fastio.h b/Marlin/src/HAL/ESP32/fastio.h index 09930194d6..2ded3a5f62 100644 --- a/Marlin/src/HAL/ESP32/fastio.h +++ b/Marlin/src/HAL/ESP32/fastio.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/ESP32/i2s.cpp b/Marlin/src/HAL/ESP32/i2s.cpp index d80c3c24e1..99b2f755e5 100644 --- a/Marlin/src/HAL/ESP32/i2s.cpp +++ b/Marlin/src/HAL/ESP32/i2s.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #ifdef ARDUINO_ARCH_ESP32 diff --git a/Marlin/src/HAL/ESP32/i2s.h b/Marlin/src/HAL/ESP32/i2s.h index 63a579a184..573b983837 100644 --- a/Marlin/src/HAL/ESP32/i2s.h +++ b/Marlin/src/HAL/ESP32/i2s.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/ESP32/inc/Conditionals_LCD.h b/Marlin/src/HAL/ESP32/inc/Conditionals_LCD.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/ESP32/inc/Conditionals_LCD.h +++ b/Marlin/src/HAL/ESP32/inc/Conditionals_LCD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/ESP32/inc/Conditionals_adv.h b/Marlin/src/HAL/ESP32/inc/Conditionals_adv.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/ESP32/inc/Conditionals_adv.h +++ b/Marlin/src/HAL/ESP32/inc/Conditionals_adv.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/ESP32/inc/Conditionals_post.h b/Marlin/src/HAL/ESP32/inc/Conditionals_post.h index 11603c9ef4..5f1c4b1601 100644 --- a/Marlin/src/HAL/ESP32/inc/Conditionals_post.h +++ b/Marlin/src/HAL/ESP32/inc/Conditionals_post.h @@ -16,12 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once - -// If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation -#if ENABLED(EEPROM_SETTINGS) && NONE(USE_WIRED_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION) - #define SDCARD_EEPROM_EMULATION -#endif diff --git a/Marlin/src/HAL/ESP32/inc/SanityCheck.h b/Marlin/src/HAL/ESP32/inc/SanityCheck.h index b6ad7a3c4b..7653f6fe7f 100644 --- a/Marlin/src/HAL/ESP32/inc/SanityCheck.h +++ b/Marlin/src/HAL/ESP32/inc/SanityCheck.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/ESP32/ota.cpp b/Marlin/src/HAL/ESP32/ota.cpp index 34a2482c9b..7cf65ed2d3 100644 --- a/Marlin/src/HAL/ESP32/ota.cpp +++ b/Marlin/src/HAL/ESP32/ota.cpp @@ -14,7 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #ifdef ARDUINO_ARCH_ESP32 diff --git a/Marlin/src/HAL/ESP32/ota.h b/Marlin/src/HAL/ESP32/ota.h index 1780fb32c1..7f9b237aa6 100644 --- a/Marlin/src/HAL/ESP32/ota.h +++ b/Marlin/src/HAL/ESP32/ota.h @@ -14,7 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #pragma once diff --git a/Marlin/src/HAL/ESP32/servotimers.h b/Marlin/src/HAL/ESP32/servotimers.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/ESP32/servotimers.h +++ b/Marlin/src/HAL/ESP32/servotimers.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/ESP32/spi_pins.h b/Marlin/src/HAL/ESP32/spi_pins.h index 0e67615a2b..15f8f2ab6b 100644 --- a/Marlin/src/HAL/ESP32/spi_pins.h +++ b/Marlin/src/HAL/ESP32/spi_pins.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/ESP32/spiffs.cpp b/Marlin/src/HAL/ESP32/spiffs.cpp index 0013dd6093..a0e713bff0 100644 --- a/Marlin/src/HAL/ESP32/spiffs.cpp +++ b/Marlin/src/HAL/ESP32/spiffs.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef ARDUINO_ARCH_ESP32 #include "../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/HAL/ESP32/spiffs.h b/Marlin/src/HAL/ESP32/spiffs.h index b9cbb23bda..64ec7dd11e 100644 --- a/Marlin/src/HAL/ESP32/spiffs.h +++ b/Marlin/src/HAL/ESP32/spiffs.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/ESP32/timers.cpp b/Marlin/src/HAL/ESP32/timers.cpp index ef181a438c..3300aea8a8 100644 --- a/Marlin/src/HAL/ESP32/timers.cpp +++ b/Marlin/src/HAL/ESP32/timers.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef ARDUINO_ARCH_ESP32 #include @@ -28,9 +27,7 @@ #include #include -#include "HAL.h" - -#include "timers.h" +#include "../../inc/MarlinConfig.h" // ------------------------ // Local defines diff --git a/Marlin/src/HAL/ESP32/timers.h b/Marlin/src/HAL/ESP32/timers.h index bc4306be20..d722670f33 100644 --- a/Marlin/src/HAL/ESP32/timers.h +++ b/Marlin/src/HAL/ESP32/timers.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -38,10 +38,18 @@ 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 +#ifndef STEP_TIMER_NUM + #define STEP_TIMER_NUM 0 // Timer Index for Stepper +#endif +#ifndef PULSE_TIMER_NUM + #define PULSE_TIMER_NUM STEP_TIMER_NUM +#endif +#ifndef TEMP_TIMER_NUM + #define TEMP_TIMER_NUM 1 // Timer Index for Temperature +#endif +#ifndef PWM_TIMER_NUM + #define PWM_TIMER_NUM 2 // index of timer to use for PWM outputs +#endif #define HAL_TIMER_RATE APB_CLK_FREQ // frequency of timer peripherals @@ -79,9 +87,15 @@ typedef uint64_t hal_timer_t; #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) -#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler() -#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler() -#define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler() +#ifndef HAL_TEMP_TIMER_ISR + #define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler() +#endif +#ifndef HAL_STEP_TIMER_ISR + #define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler() +#endif +#ifndef HAL_PWM_TIMER_ISR + #define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler() +#endif extern "C" void tempTC_Handler(); extern "C" void stepTC_Handler(); diff --git a/Marlin/src/HAL/ESP32/watchdog.cpp b/Marlin/src/HAL/ESP32/watchdog.cpp index 9f681e6095..f6fcfa3182 100644 --- a/Marlin/src/HAL/ESP32/watchdog.cpp +++ b/Marlin/src/HAL/ESP32/watchdog.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef ARDUINO_ARCH_ESP32 #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/HAL/ESP32/watchdog.h b/Marlin/src/HAL/ESP32/watchdog.h index 7e07990865..b6c169e347 100644 --- a/Marlin/src/HAL/ESP32/watchdog.h +++ b/Marlin/src/HAL/ESP32/watchdog.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/ESP32/web.cpp b/Marlin/src/HAL/ESP32/web.cpp index b795efe3c5..7a27707a3e 100644 --- a/Marlin/src/HAL/ESP32/web.cpp +++ b/Marlin/src/HAL/ESP32/web.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef ARDUINO_ARCH_ESP32 #include "../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/HAL/ESP32/web.h b/Marlin/src/HAL/ESP32/web.h index 8dbefd8eef..60023ac636 100644 --- a/Marlin/src/HAL/ESP32/web.h +++ b/Marlin/src/HAL/ESP32/web.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/ESP32/wifi.cpp b/Marlin/src/HAL/ESP32/wifi.cpp index 9203dd62e7..f4cf5a606a 100644 --- a/Marlin/src/HAL/ESP32/wifi.cpp +++ b/Marlin/src/HAL/ESP32/wifi.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef ARDUINO_ARCH_ESP32 #include "../../core/serial.h" diff --git a/Marlin/src/HAL/ESP32/wifi.h b/Marlin/src/HAL/ESP32/wifi.h index 580c6c87f4..759a73b252 100644 --- a/Marlin/src/HAL/ESP32/wifi.h +++ b/Marlin/src/HAL/ESP32/wifi.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/HAL.h b/Marlin/src/HAL/HAL.h index fa2782cfcb..29702f2d2b 100644 --- a/Marlin/src/HAL/HAL.h +++ b/Marlin/src/HAL/HAL.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -27,8 +27,20 @@ #define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION) +#ifndef I2C_ADDRESS + #define I2C_ADDRESS(A) (A) +#endif + +// Needed for AVR sprintf_P PROGMEM extension +#ifndef S_FMT + #define S_FMT "%s" +#endif + +// String helper +#ifndef PGMSTR + #define PGMSTR(NAM,STR) constexpr char NAM[] = STR +#endif + inline void watchdog_refresh() { - #if ENABLED(USE_WATCHDOG) - HAL_watchdog_refresh(); - #endif + TERN_(USE_WATCHDOG, HAL_watchdog_refresh()); } diff --git a/Marlin/src/HAL/LINUX/HAL.cpp b/Marlin/src/HAL/LINUX/HAL.cpp index d38644f1a5..d7d7c2d2b4 100644 --- a/Marlin/src/HAL/LINUX/HAL.cpp +++ b/Marlin/src/HAL/LINUX/HAL.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __PLAT_LINUX__ #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/HAL/LINUX/HAL.h b/Marlin/src/HAL/LINUX/HAL.h index 0475c953c3..96e121d915 100644 --- a/Marlin/src/HAL/LINUX/HAL.h +++ b/Marlin/src/HAL/LINUX/HAL.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -56,7 +56,6 @@ uint8_t _getc(); #include "../shared/HAL_SPI.h" #include "fastio.h" #include "watchdog.h" -#include "timers.h" #include "serial.h" #define SHARED_SERVOS HAS_SERVOS @@ -87,9 +86,10 @@ int freeMemory(); #pragma GCC diagnostic pop // ADC +#define HAL_ADC_VREF 5.0 +#define HAL_ADC_RESOLUTION 10 #define HAL_ANALOG_SELECT(ch) HAL_adc_enable_channel(ch) #define HAL_START_ADC(ch) HAL_adc_start_conversion(ch) -#define HAL_ADC_RESOLUTION 10 #define HAL_READ_ADC() HAL_adc_get_result() #define HAL_ADC_READY() true @@ -106,3 +106,8 @@ inline uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; } FORCE_INLINE static void DELAY_CYCLES(uint64_t x) { Clock::delayCycles(x); } + +// Add strcmp_P if missing +#ifndef strcmp_P + #define strcmp_P(a, b) strcmp((a), (b)) +#endif diff --git a/Marlin/src/HAL/LINUX/arduino.cpp b/Marlin/src/HAL/LINUX/arduino.cpp index 008db15592..4b56d02a38 100644 --- a/Marlin/src/HAL/LINUX/arduino.cpp +++ b/Marlin/src/HAL/LINUX/arduino.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __PLAT_LINUX__ #include @@ -76,20 +75,6 @@ uint16_t analogRead(pin_t adc_pin) { 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); diff --git a/Marlin/src/HAL/LINUX/eeprom_impl.cpp b/Marlin/src/HAL/LINUX/eeprom.cpp similarity index 86% rename from Marlin/src/HAL/LINUX/eeprom_impl.cpp rename to Marlin/src/HAL/LINUX/eeprom.cpp index 4745f05673..967ca851ab 100644 --- a/Marlin/src/HAL/LINUX/eeprom_impl.cpp +++ b/Marlin/src/HAL/LINUX/eeprom.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __PLAT_LINUX__ #include "../../inc/MarlinConfig.h" @@ -29,10 +28,15 @@ #include "../shared/eeprom_api.h" #include -#define LINUX_EEPROM_SIZE (E2END + 1) -uint8_t buffer[LINUX_EEPROM_SIZE]; +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB of Emulated EEPROM +#endif + +uint8_t buffer[MARLIN_EEPROM_SIZE]; char filename[] = "eeprom.dat"; +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } + bool PersistentStore::access_start() { const char eeprom_erase_value = 0xFF; FILE * eeprom_file = fopen(filename, "rb"); @@ -41,8 +45,8 @@ bool PersistentStore::access_start() { 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); + if (file_size < MARLIN_EEPROM_SIZE) { + memset(buffer + file_size, eeprom_erase_value, MARLIN_EEPROM_SIZE - file_size); } else { fseek(eeprom_file, 0L, SEEK_SET); @@ -96,7 +100,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin 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/src/HAL/LINUX/fastio.h b/Marlin/src/HAL/LINUX/fastio.h index 08dca77805..4567c62a51 100644 --- a/Marlin/src/HAL/LINUX/fastio.h +++ b/Marlin/src/HAL/LINUX/fastio.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LINUX/hardware/Clock.cpp b/Marlin/src/HAL/LINUX/hardware/Clock.cpp index 8265fedbf0..1984a4a44e 100644 --- a/Marlin/src/HAL/LINUX/hardware/Clock.cpp +++ b/Marlin/src/HAL/LINUX/hardware/Clock.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __PLAT_LINUX__ #include "../../../inc/MarlinConfig.h" diff --git a/Marlin/src/HAL/LINUX/hardware/Clock.h b/Marlin/src/HAL/LINUX/hardware/Clock.h index 17c2fd9501..072eacfd73 100644 --- a/Marlin/src/HAL/LINUX/hardware/Clock.h +++ b/Marlin/src/HAL/LINUX/hardware/Clock.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LINUX/hardware/Gpio.cpp b/Marlin/src/HAL/LINUX/hardware/Gpio.cpp index e49fb13754..61a7be7da9 100644 --- a/Marlin/src/HAL/LINUX/hardware/Gpio.cpp +++ b/Marlin/src/HAL/LINUX/hardware/Gpio.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __PLAT_LINUX__ #include "Gpio.h" diff --git a/Marlin/src/HAL/LINUX/hardware/Gpio.h b/Marlin/src/HAL/LINUX/hardware/Gpio.h index 33eea77731..9255ec1dfc 100644 --- a/Marlin/src/HAL/LINUX/hardware/Gpio.h +++ b/Marlin/src/HAL/LINUX/hardware/Gpio.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LINUX/hardware/Heater.cpp b/Marlin/src/HAL/LINUX/hardware/Heater.cpp index 7c9bfaf80f..70df816182 100644 --- a/Marlin/src/HAL/LINUX/hardware/Heater.cpp +++ b/Marlin/src/HAL/LINUX/hardware/Heater.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __PLAT_LINUX__ #include "Clock.h" diff --git a/Marlin/src/HAL/LINUX/hardware/Heater.h b/Marlin/src/HAL/LINUX/hardware/Heater.h index bb759da090..b17078d0b7 100644 --- a/Marlin/src/HAL/LINUX/hardware/Heater.h +++ b/Marlin/src/HAL/LINUX/hardware/Heater.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LINUX/hardware/IOLoggerCSV.cpp b/Marlin/src/HAL/LINUX/hardware/IOLoggerCSV.cpp index a79f14f6f5..c11fd1f55c 100644 --- a/Marlin/src/HAL/LINUX/hardware/IOLoggerCSV.cpp +++ b/Marlin/src/HAL/LINUX/hardware/IOLoggerCSV.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __PLAT_LINUX__ #include "IOLoggerCSV.h" diff --git a/Marlin/src/HAL/LINUX/hardware/IOLoggerCSV.h b/Marlin/src/HAL/LINUX/hardware/IOLoggerCSV.h index f8bca83e30..d8fe7383bd 100644 --- a/Marlin/src/HAL/LINUX/hardware/IOLoggerCSV.h +++ b/Marlin/src/HAL/LINUX/hardware/IOLoggerCSV.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LINUX/hardware/LinearAxis.cpp b/Marlin/src/HAL/LINUX/hardware/LinearAxis.cpp index ec58fe77e5..c5b3ccc986 100644 --- a/Marlin/src/HAL/LINUX/hardware/LinearAxis.cpp +++ b/Marlin/src/HAL/LINUX/hardware/LinearAxis.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __PLAT_LINUX__ #include diff --git a/Marlin/src/HAL/LINUX/hardware/LinearAxis.h b/Marlin/src/HAL/LINUX/hardware/LinearAxis.h index 04a5f3d0f7..34541e79a1 100644 --- a/Marlin/src/HAL/LINUX/hardware/LinearAxis.h +++ b/Marlin/src/HAL/LINUX/hardware/LinearAxis.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LINUX/hardware/Timer.cpp b/Marlin/src/HAL/LINUX/hardware/Timer.cpp index e7136bbdef..9f0d6a8f3a 100644 --- a/Marlin/src/HAL/LINUX/hardware/Timer.cpp +++ b/Marlin/src/HAL/LINUX/hardware/Timer.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __PLAT_LINUX__ #include "Timer.h" diff --git a/Marlin/src/HAL/LINUX/hardware/Timer.h b/Marlin/src/HAL/LINUX/hardware/Timer.h index ebfe8e8b9b..757efdcdbd 100644 --- a/Marlin/src/HAL/LINUX/hardware/Timer.h +++ b/Marlin/src/HAL/LINUX/hardware/Timer.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LINUX/inc/Conditionals_LCD.h b/Marlin/src/HAL/LINUX/inc/Conditionals_LCD.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/LINUX/inc/Conditionals_LCD.h +++ b/Marlin/src/HAL/LINUX/inc/Conditionals_LCD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LINUX/inc/Conditionals_adv.h b/Marlin/src/HAL/LINUX/inc/Conditionals_adv.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/LINUX/inc/Conditionals_adv.h +++ b/Marlin/src/HAL/LINUX/inc/Conditionals_adv.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LINUX/inc/Conditionals_post.h b/Marlin/src/HAL/LINUX/inc/Conditionals_post.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/LINUX/inc/Conditionals_post.h +++ b/Marlin/src/HAL/LINUX/inc/Conditionals_post.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LINUX/inc/SanityCheck.h b/Marlin/src/HAL/LINUX/inc/SanityCheck.h index a3238b088b..8d23cdabbf 100644 --- a/Marlin/src/HAL/LINUX/inc/SanityCheck.h +++ b/Marlin/src/HAL/LINUX/inc/SanityCheck.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LINUX/include/Arduino.h b/Marlin/src/HAL/LINUX/include/Arduino.h index 55bf0f95ee..e28b474ede 100644 --- a/Marlin/src/HAL/LINUX/include/Arduino.h +++ b/Marlin/src/HAL/LINUX/include/Arduino.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -106,12 +106,6 @@ 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); diff --git a/Marlin/src/HAL/LINUX/include/pinmapping.cpp b/Marlin/src/HAL/LINUX/include/pinmapping.cpp index 0340e681fe..870ab3a96e 100644 --- a/Marlin/src/HAL/LINUX/include/pinmapping.cpp +++ b/Marlin/src/HAL/LINUX/include/pinmapping.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __PLAT_LINUX__ #include diff --git a/Marlin/src/HAL/LINUX/include/pinmapping.h b/Marlin/src/HAL/LINUX/include/pinmapping.h index 0d99a38116..98f4b812e8 100644 --- a/Marlin/src/HAL/LINUX/include/pinmapping.h +++ b/Marlin/src/HAL/LINUX/include/pinmapping.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LINUX/include/serial.h b/Marlin/src/HAL/LINUX/include/serial.h index c881d5dbda..154e95aec2 100644 --- a/Marlin/src/HAL/LINUX/include/serial.h +++ b/Marlin/src/HAL/LINUX/include/serial.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LINUX/main.cpp b/Marlin/src/HAL/LINUX/main.cpp index 1155f2a873..4eeef318e7 100644 --- a/Marlin/src/HAL/LINUX/main.cpp +++ b/Marlin/src/HAL/LINUX/main.cpp @@ -14,10 +14,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __PLAT_LINUX__ extern void setup(); diff --git a/Marlin/src/HAL/LINUX/pinsDebug.h b/Marlin/src/HAL/LINUX/pinsDebug.h index e373d37067..a93ceddc61 100644 --- a/Marlin/src/HAL/LINUX/pinsDebug.h +++ b/Marlin/src/HAL/LINUX/pinsDebug.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/LINUX/servo_private.h b/Marlin/src/HAL/LINUX/servo_private.h index d576ff9266..122cfef3ea 100644 --- a/Marlin/src/HAL/LINUX/servo_private.h +++ b/Marlin/src/HAL/LINUX/servo_private.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LINUX/spi_pins.h b/Marlin/src/HAL/LINUX/spi_pins.h index 8abeb312f4..a444196f04 100644 --- a/Marlin/src/HAL/LINUX/spi_pins.h +++ b/Marlin/src/HAL/LINUX/spi_pins.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -24,7 +24,7 @@ #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) +#if BOTH(HAS_GRAPHICAL_LCD, 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 diff --git a/Marlin/src/HAL/LINUX/timers.cpp b/Marlin/src/HAL/LINUX/timers.cpp index ebfb950595..66d80f2518 100644 --- a/Marlin/src/HAL/LINUX/timers.cpp +++ b/Marlin/src/HAL/LINUX/timers.cpp @@ -16,16 +16,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 diff --git a/Marlin/src/HAL/LINUX/timers.h b/Marlin/src/HAL/LINUX/timers.h index b657584922..1beaea95ab 100644 --- a/Marlin/src/HAL/LINUX/timers.h +++ b/Marlin/src/HAL/LINUX/timers.h @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -37,9 +37,15 @@ typedef uint32_t hal_timer_t; #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 +#ifndef STEP_TIMER_NUM + #define STEP_TIMER_NUM 0 // Timer Index for Stepper +#endif +#ifndef PULSE_TIMER_NUM + #define PULSE_TIMER_NUM STEP_TIMER_NUM +#endif +#ifndef TEMP_TIMER_NUM + #define TEMP_TIMER_NUM 1 // Timer Index for Temperature +#endif #define TEMP_TIMER_RATE 1000000 #define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency @@ -59,8 +65,12 @@ typedef uint32_t hal_timer_t; #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) -#define HAL_STEP_TIMER_ISR() extern "C" void TIMER0_IRQHandler() -#define HAL_TEMP_TIMER_ISR() extern "C" void TIMER1_IRQHandler() +#ifndef HAL_STEP_TIMER_ISR + #define HAL_STEP_TIMER_ISR() extern "C" void TIMER0_IRQHandler() +#endif +#ifndef HAL_TEMP_TIMER_ISR + #define HAL_TEMP_TIMER_ISR() extern "C" void TIMER1_IRQHandler() +#endif // PWM timer #define HAL_PWM_TIMER diff --git a/Marlin/src/HAL/LINUX/watchdog.cpp b/Marlin/src/HAL/LINUX/watchdog.cpp index 5ffe860f05..c15b0e311c 100644 --- a/Marlin/src/HAL/LINUX/watchdog.cpp +++ b/Marlin/src/HAL/LINUX/watchdog.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __PLAT_LINUX__ #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/HAL/LINUX/watchdog.h b/Marlin/src/HAL/LINUX/watchdog.h index 4771426a0b..472624cc78 100644 --- a/Marlin/src/HAL/LINUX/watchdog.h +++ b/Marlin/src/HAL/LINUX/watchdog.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LPC1768/DebugMonitor.cpp b/Marlin/src/HAL/LPC1768/DebugMonitor.cpp index 2a39e56168..783b10cfac 100644 --- a/Marlin/src/HAL/LPC1768/DebugMonitor.cpp +++ b/Marlin/src/HAL/LPC1768/DebugMonitor.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef TARGET_LPC1768 #include "../../core/macros.h" @@ -211,11 +210,7 @@ void HardFault_HandlerC(unsigned long *sp, unsigned long lr, unsigned long cause // Nothing below here is compiled because NVIC_SystemReset loops forever - for (;;) { - #if ENABLED(USE_WATCHDOG) - watchdog_init(); - #endif - } + for (;;) { TERN_(USE_WATCHDOG, watchdog_init()); } } extern "C" { diff --git a/Marlin/src/HAL/LPC1768/HAL.cpp b/Marlin/src/HAL/LPC1768/HAL.cpp index f206ce7adb..939f1e8a94 100644 --- a/Marlin/src/HAL/LPC1768/HAL.cpp +++ b/Marlin/src/HAL/LPC1768/HAL.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef TARGET_LPC1768 #include "../../inc/MarlinConfig.h" @@ -70,9 +69,7 @@ int16_t PARSED_PIN_INDEX(const char code, const int16_t dval) { void flashFirmware(const int16_t) { NVIC_SystemReset(); } void HAL_clear_reset_source(void) { - #if ENABLED(USE_WATCHDOG) - watchdog_clear_timeout_flag(); - #endif + TERN_(USE_WATCHDOG, watchdog_clear_timeout_flag()); } uint8_t HAL_get_reset_source(void) { diff --git a/Marlin/src/HAL/LPC1768/HAL.h b/Marlin/src/HAL/LPC1768/HAL.h index f5ea629f16..0153bacf42 100644 --- a/Marlin/src/HAL/LPC1768/HAL.h +++ b/Marlin/src/HAL/LPC1768/HAL.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -41,13 +41,15 @@ extern "C" volatile uint32_t _millis; #include "../shared/HAL_SPI.h" #include "fastio.h" #include "watchdog.h" -#include "timers.h" #include "MarlinSerial.h" #include #include #include +// i2c uses 8-bit shifted address +#define I2C_ADDRESS(A) uint8_t((A) << 1) + // // Default graphical display delays // @@ -148,6 +150,8 @@ int freeMemory(); // 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_VREF 3.3 // ADC voltage reference + #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 @@ -197,6 +201,8 @@ void HAL_idletask(); #define PLATFORM_M997_SUPPORT void flashFirmware(const int16_t); +#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment + /** * set_pwm_frequency * Set the frequency of the timer corresponding to the provided pin @@ -216,3 +222,8 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, // Reset source void HAL_clear_reset_source(void); uint8_t HAL_get_reset_source(void); + +// Add strcmp_P if missing +#ifndef strcmp_P + #define strcmp_P(a, b) strcmp((a), (b)) +#endif diff --git a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp index 1c20e7f652..e34a102012 100644 --- a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp +++ b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -209,11 +209,11 @@ } -#endif // ENABLED(LPC_SOFTWARE_SPI) +#endif // LPC_SOFTWARE_SPI void SPIClass::begin() { spiBegin(); } -void SPIClass::beginTransaction(SPISettings cfg) { +void SPIClass::beginTransaction(const SPISettings &cfg) { uint8_t spiRate; switch (cfg.spiRate()) { case 8000000: spiRate = 0; break; diff --git a/Marlin/src/HAL/LPC1768/MarlinSerial.cpp b/Marlin/src/HAL/LPC1768/MarlinSerial.cpp index 1b80b211fb..c3fb3bd0e4 100644 --- a/Marlin/src/HAL/LPC1768/MarlinSerial.cpp +++ b/Marlin/src/HAL/LPC1768/MarlinSerial.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef TARGET_LPC1768 #include "../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/HAL/LPC1768/MarlinSerial.h b/Marlin/src/HAL/LPC1768/MarlinSerial.h index b6bbf8e453..98ce73d377 100644 --- a/Marlin/src/HAL/LPC1768/MarlinSerial.h +++ b/Marlin/src/HAL/LPC1768/MarlinSerial.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -44,10 +44,9 @@ public: MarlinSerial(LPC_UART_TypeDef *UARTx) : HardwareSerial(UARTx) #if ENABLED(EMERGENCY_PARSER) - , emergency_state(EmergencyParser::State::EP_RESET) + , emergency_state(EmergencyParser::State::EP_RESET) #endif - { - } + { } void end() {} diff --git a/Marlin/src/HAL/LPC1768/Servo.h b/Marlin/src/HAL/LPC1768/Servo.h index 71e2bb5695..e953cb9204 100644 --- a/Marlin/src/HAL/LPC1768/Servo.h +++ b/Marlin/src/HAL/LPC1768/Servo.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -60,9 +60,7 @@ class libServo: public Servo { 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 + TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach()); } } diff --git a/Marlin/src/HAL/LPC1768/eeprom_flash.cpp b/Marlin/src/HAL/LPC1768/eeprom_flash.cpp index 9225807480..2558486375 100644 --- a/Marlin/src/HAL/LPC1768/eeprom_flash.cpp +++ b/Marlin/src/HAL/LPC1768/eeprom_flash.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #ifdef TARGET_LPC1768 @@ -40,24 +40,29 @@ #if ENABLED(FLASH_EEPROM_EMULATION) -#include "eeprom_api.h" +#include "../shared/eeprom_api.h" 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) +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif -static uint8_t ram_eeprom[EEPROM_SIZE] __attribute__((aligned(4))) = {0}; +#define SECTOR_START(sector) ((sector < 16) ? (sector << 12) : ((sector - 14) << 15)) +#define EEPROM_SECTOR 29 +#define SECTOR_SIZE 32768 +#define EEPROM_SLOTS ((SECTOR_SIZE)/(MARLIN_EEPROM_SIZE)) +#define EEPROM_ERASE 0xFF +#define SLOT_ADDRESS(sector, slot) (((uint8_t *)SECTOR_START(sector)) + slot * (MARLIN_EEPROM_SIZE)) + +static uint8_t ram_eeprom[MARLIN_EEPROM_SIZE] __attribute__((aligned(4))) = {0}; static bool eeprom_dirty = false; static int current_slot = 0; +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } + bool PersistentStore::access_start() { uint32_t first_nblank_loc, first_nblank_val; IAP_STATUS_CODE status; @@ -69,15 +74,15 @@ bool PersistentStore::access_start() { if (status == CMD_SUCCESS) { // sector is blank so nothing stored yet - for (int i = 0; i < EEPROM_SIZE; i++) ram_eeprom[i] = EEPROM_ERASE; + for (int i = 0; i < MARLIN_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; + current_slot = first_nblank_loc / (MARLIN_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]; + for (int i = 0; i < MARLIN_EEPROM_SIZE; i++) ram_eeprom[i] = eeprom_data[i]; } eeprom_dirty = false; @@ -122,7 +127,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t return false; // return true for any error } -size_t PersistentStore::capacity() { return EEPROM_SIZE; } - #endif // FLASH_EEPROM_EMULATION #endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp b/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp index d982bd6268..9f2475f490 100644 --- a/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp +++ b/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #ifdef TARGET_LPC1768 @@ -26,7 +26,7 @@ #if ENABLED(SDCARD_EEPROM_EMULATION) -#include "eeprom_api.h" +#include "../shared/eeprom_api.h" #include #include @@ -38,6 +38,11 @@ FATFS fat_fs; FIL eeprom_file; bool eeprom_file_open = false; +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE size_t(0x1000) // 4KiB of Emulated EEPROM +#endif +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } + bool PersistentStore::access_start() { const char eeprom_erase_value = 0xFF; MSC_Aquire_Lock(); @@ -79,21 +84,16 @@ static void debug_rw(const bool write, int &pos, const uint8_t *value, const siz 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(", ...)"); + SERIAL_ECHOLNPAIR("_data(", pos, ",", int(value), ",", int(size), ", ...)"); if (total) { SERIAL_ECHOPGM(" f_"); serialprintPGM(rw_str); - SERIAL_ECHOPAIR("()=", (int)s); - SERIAL_ECHOPAIR("\n size=", size); - SERIAL_ECHOPGM("\n bytes_"); + SERIAL_ECHOPAIR("()=", int(s), "\n size=", int(size), "\n bytes_"); serialprintPGM(write ? PSTR("written=") : PSTR("read=")); SERIAL_ECHOLN(total); } else - SERIAL_ECHOLNPAIR(" f_lseek()=", (int)s); + SERIAL_ECHOLNPAIR(" f_lseek()=", int(s)); } // File function return codes for type FRESULT. This goes away soon, but @@ -173,7 +173,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin return bytes_read != size; // return true for any error } -size_t PersistentStore::capacity() { return 4096; } // 4KiB of Emulated EEPROM - #endif // SDCARD_EEPROM_EMULATION #endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/LPC1768/eeprom_wired.cpp b/Marlin/src/HAL/LPC1768/eeprom_wired.cpp new file mode 100644 index 0000000000..16c15eaf00 --- /dev/null +++ b/Marlin/src/HAL/LPC1768/eeprom_wired.cpp @@ -0,0 +1,81 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 USE_WIRED_EEPROM + +/** + * PersistentStore for Arduino-style EEPROM interface + * with implementations supplied by the framework. + */ + +#include "../shared/eeprom_if.h" +#include "../shared/eeprom_api.h" + +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE 0x8000 // 32KB‬ +#endif +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } + +bool PersistentStore::access_start() { eeprom_init(); 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 v = *value; + + // 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(STR_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 { + // Read from external EEPROM + const uint8_t c = eeprom_read_byte((uint8_t*)pos); + + if (writing) *value = c; + crc16(crc, &c, 1); + pos++; + value++; + } while (--size); + return false; +} + +#endif // USE_WIRED_EEPROM +#endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/LPC1768/endstop_interrupts.h b/Marlin/src/HAL/LPC1768/endstop_interrupts.h index 4c4e9bd3f0..b0d0c0ec5c 100644 --- a/Marlin/src/HAL/LPC1768/endstop_interrupts.h +++ b/Marlin/src/HAL/LPC1768/endstop_interrupts.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LPC1768/fast_pwm.cpp b/Marlin/src/HAL/LPC1768/fast_pwm.cpp index a1feb25903..46507ac0da 100644 --- a/Marlin/src/HAL/LPC1768/fast_pwm.cpp +++ b/Marlin/src/HAL/LPC1768/fast_pwm.cpp @@ -16,15 +16,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef TARGET_LPC1768 #include "../../inc/MarlinConfigPre.h" -#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_PWM +#if NEEDS_HARDWARE_PWM // Specific meta-flag for features that mandate PWM #include diff --git a/Marlin/src/HAL/LPC1768/fastio.h b/Marlin/src/HAL/LPC1768/fastio.h index 1772881b30..c553ffb182 100644 --- a/Marlin/src/HAL/LPC1768/fastio.h +++ b/Marlin/src/HAL/LPC1768/fastio.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LPC1768/inc/Conditionals_LCD.h b/Marlin/src/HAL/LPC1768/inc/Conditionals_LCD.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/LPC1768/inc/Conditionals_LCD.h +++ b/Marlin/src/HAL/LPC1768/inc/Conditionals_LCD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LPC1768/inc/Conditionals_adv.h b/Marlin/src/HAL/LPC1768/inc/Conditionals_adv.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/LPC1768/inc/Conditionals_adv.h +++ b/Marlin/src/HAL/LPC1768/inc/Conditionals_adv.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LPC1768/inc/Conditionals_post.h b/Marlin/src/HAL/LPC1768/inc/Conditionals_post.h index 490cfd50e8..ce6d3fdde2 100644 --- a/Marlin/src/HAL/LPC1768/inc/Conditionals_post.h +++ b/Marlin/src/HAL/LPC1768/inc/Conditionals_post.h @@ -16,11 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once -#if USE_FALLBACK_EEPROM && NONE(SDCARD_EEPROM_EMULATION, SRAM_EEPROM_EMULATION) +#if USE_FALLBACK_EEPROM #define FLASH_EEPROM_EMULATION +#elif EITHER(I2C_EEPROM, SPI_EEPROM) + #define USE_SHARED_EEPROM 1 #endif diff --git a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h index 949c7f4899..964538962c 100644 --- a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h +++ b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -174,7 +174,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o // // Flag any i2c pin conflicts // -#if ANY(DIGIPOT_I2C, DIGIPOT_MCP4018, DAC_STEPPER_CURRENT, EXPERIMENTAL_I2CBUS, I2C_POSITION_ENCODERS, PCA9632, I2C_EEPROM) +#if ANY(HAS_I2C_DIGIPOT, DAC_STEPPER_CURRENT, EXPERIMENTAL_I2CBUS, I2C_POSITION_ENCODERS, PCA9632, I2C_EEPROM) #define USEDI2CDEV_M 1 // /Wire.cpp #if USEDI2CDEV_M == 0 // P0_27 [D57] (AUX-1) .......... P0_28 [D58] (AUX-1) @@ -251,3 +251,9 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o #undef USEDI2CDEV_M #endif + +#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) + #error "SERIAL_STATS_MAX_RX_QUEUED is not supported on this platform." +#elif ENABLED(SERIAL_STATS_DROPPED_RX) + #error "SERIAL_STATS_DROPPED_RX is not supported on this platform." +#endif diff --git a/Marlin/src/HAL/LPC1768/include/SPI.h b/Marlin/src/HAL/LPC1768/include/SPI.h index af085f29a9..4acd9e7022 100644 --- a/Marlin/src/HAL/LPC1768/include/SPI.h +++ b/Marlin/src/HAL/LPC1768/include/SPI.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -31,7 +31,7 @@ class SPISettings { public: SPISettings(uint32_t speed, int, int) : spi_speed(speed) {}; - uint32_t spiRate() { return spi_speed; } + uint32_t spiRate() const { return spi_speed; } private: uint32_t spi_speed; }; @@ -39,7 +39,7 @@ class SPISettings { class SPIClass { public: void begin(); - void beginTransaction(SPISettings); + void beginTransaction(const SPISettings&); void endTransaction() {}; uint8_t transfer(uint8_t data); uint16_t transfer16(uint16_t data); diff --git a/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.c b/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.c index 1e53be5f62..f442ab71c0 100644 --- a/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.c +++ b/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.c @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.h b/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.h index 6e9ad6f179..9b6c62b052 100644 --- a/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.h +++ b/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LPC1768/include/i2c_util.c b/Marlin/src/HAL/LPC1768/include/i2c_util.c index b92f3f0453..e52fb7c4de 100644 --- a/Marlin/src/HAL/LPC1768/include/i2c_util.c +++ b/Marlin/src/HAL/LPC1768/include/i2c_util.c @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/LPC1768/include/i2c_util.h b/Marlin/src/HAL/LPC1768/include/i2c_util.h index eae275e0f9..a57f68a407 100644 --- a/Marlin/src/HAL/LPC1768/include/i2c_util.h +++ b/Marlin/src/HAL/LPC1768/include/i2c_util.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LPC1768/main.cpp b/Marlin/src/HAL/LPC1768/main.cpp index d7b05dce9d..0b4045cb99 100644 --- a/Marlin/src/HAL/LPC1768/main.cpp +++ b/Marlin/src/HAL/LPC1768/main.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #ifdef TARGET_LPC1768 @@ -38,8 +38,6 @@ extern "C" { #include "../../sd/cardreader.h" #include "../../inc/MarlinConfig.h" #include "../../core/millis_t.h" -#include "HAL.h" -#include "timers.h" extern uint32_t MSC_SD_Init(uint8_t pdrv); extern "C" int isLPC1769(); @@ -124,7 +122,7 @@ void HAL_init() { delay(1000); // Give OS time to notice USB_Connect(TRUE); - #if !BOTH(SHARED_SD_CARD, INIT_SDCARD_ON_BOOT) && DISABLED(NO_SD_HOST_DRIVE) + #if DISABLED(NO_SD_HOST_DRIVE) MSC_SD_Init(0); // Enable USB SD card access #endif @@ -142,7 +140,7 @@ void HAL_init() { // HAL idle task void HAL_idletask() { - #if ENABLED(SHARED_SD_CARD) + #if HAS_SHARED_MEDIA // 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 diff --git a/Marlin/src/HAL/LPC1768/pinsDebug.h b/Marlin/src/HAL/LPC1768/pinsDebug.h index 6cc824afa3..f80551604f 100644 --- a/Marlin/src/HAL/LPC1768/pinsDebug.h +++ b/Marlin/src/HAL/LPC1768/pinsDebug.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/LPC1768/spi_pins.h b/Marlin/src/HAL/LPC1768/spi_pins.h index 9b983428bd..2e6749bf57 100644 --- a/Marlin/src/HAL/LPC1768/spi_pins.h +++ b/Marlin/src/HAL/LPC1768/spi_pins.h @@ -16,14 +16,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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) +#if BOTH(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 diff --git a/Marlin/src/HAL/LPC1768/timers.cpp b/Marlin/src/HAL/LPC1768/timers.cpp index 686b251c69..a7a40584da 100644 --- a/Marlin/src/HAL/LPC1768/timers.cpp +++ b/Marlin/src/HAL/LPC1768/timers.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -29,7 +29,6 @@ #ifdef TARGET_LPC1768 #include "../../inc/MarlinConfig.h" -#include "timers.h" void HAL_timer_init() { SBI(LPC_SC->PCONP, SBIT_TIMER0); // Power ON Timer 0 diff --git a/Marlin/src/HAL/LPC1768/timers.h b/Marlin/src/HAL/LPC1768/timers.h index 30da933521..23dc20e2eb 100644 --- a/Marlin/src/HAL/LPC1768/timers.h +++ b/Marlin/src/HAL/LPC1768/timers.h @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -61,10 +61,18 @@ typedef uint32_t hal_timer_t; #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 +#ifndef STEP_TIMER_NUM + #define STEP_TIMER_NUM 0 // Timer Index for Stepper +#endif +#ifndef PULSE_TIMER_NUM + #define PULSE_TIMER_NUM STEP_TIMER_NUM +#endif +#ifndef TEMP_TIMER_NUM + #define TEMP_TIMER_NUM 1 // Timer Index for Temperature +#endif +#ifndef PWM_TIMER_NUM + #define PWM_TIMER_NUM 3 // Timer Index for PWM +#endif #define TEMP_TIMER_RATE 1000000 #define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency @@ -84,12 +92,16 @@ typedef uint32_t hal_timer_t; #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) -#define HAL_STEP_TIMER_ISR() _HAL_TIMER_ISR(STEP_TIMER_NUM) -#define HAL_TEMP_TIMER_ISR() _HAL_TIMER_ISR(TEMP_TIMER_NUM) +#ifndef HAL_STEP_TIMER_ISR + #define HAL_STEP_TIMER_ISR() _HAL_TIMER_ISR(STEP_TIMER_NUM) +#endif +#ifndef HAL_TEMP_TIMER_ISR + #define HAL_TEMP_TIMER_ISR() _HAL_TIMER_ISR(TEMP_TIMER_NUM) +#endif // Timer references by index -#define STEP_TIMER _HAL_TIMER(STEP_TIMER_NUM) -#define TEMP_TIMER _HAL_TIMER(TEMP_TIMER_NUM) +#define STEP_TIMER_PTR _HAL_TIMER(STEP_TIMER_NUM) +#define TEMP_TIMER_PTR _HAL_TIMER(TEMP_TIMER_NUM) // ------------------------ // Public functions @@ -99,23 +111,23 @@ 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 + case 0: STEP_TIMER_PTR->MR0 = compare; break; // Stepper Timer Match Register 0 + case 1: TEMP_TIMER_PTR->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 + case 0: return STEP_TIMER_PTR->MR0; // Stepper Timer Match Register 0 + case 1: return TEMP_TIMER_PTR->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 + case 0: return STEP_TIMER_PTR->TC; // Stepper Timer Count + case 1: return TEMP_TIMER_PTR->TC; // Temp Timer Count } return 0; } @@ -154,8 +166,8 @@ FORCE_INLINE static bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { 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; + case 0: SBI(STEP_TIMER_PTR->IR, SBIT_CNTEN); break; + case 1: SBI(TEMP_TIMER_PTR->IR, SBIT_CNTEN); break; } } diff --git a/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.cpp b/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.cpp index 6d643f5bf6..a48a820dc4 100644 --- a/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.cpp +++ b/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.h b/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.h index 9de3e93274..2d976c92d2 100644 --- a/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.h +++ b/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LPC1768/u8g/LCD_defines.h b/Marlin/src/HAL/LPC1768/u8g/LCD_defines.h index e7518d698a..d2260037b6 100644 --- a/Marlin/src/HAL/LPC1768/u8g/LCD_defines.h +++ b/Marlin/src/HAL/LPC1768/u8g/LCD_defines.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LPC1768/u8g/LCD_delay.h b/Marlin/src/HAL/LPC1768/u8g/LCD_delay.h index 0d9b8d3dcc..0b9e2b4fd0 100644 --- a/Marlin/src/HAL/LPC1768/u8g/LCD_delay.h +++ b/Marlin/src/HAL/LPC1768/u8g/LCD_delay.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.c b/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.c index 67e78f36f0..466fc80203 100644 --- a/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.c +++ b/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.c @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.h b/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.h index 8a73b69ded..d60d93dadd 100644 --- a/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.h +++ b/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp index c0105bc129..befc348fab 100644 --- a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp +++ b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp index b99abb6867..f03be9ab34 100644 --- a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp +++ b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp index 5f3da457aa..1500c22a0d 100644 --- a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp +++ b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp index a1f8097e52..10d8494162 100644 --- a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp +++ b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp index 6eac5daf24..4f52f7dd01 100644 --- a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp +++ b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/LPC1768/usb_serial.cpp b/Marlin/src/HAL/LPC1768/usb_serial.cpp index ddb31da20f..63a570efdf 100644 --- a/Marlin/src/HAL/LPC1768/usb_serial.cpp +++ b/Marlin/src/HAL/LPC1768/usb_serial.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef TARGET_LPC1768 #include "../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/HAL/LPC1768/watchdog.cpp b/Marlin/src/HAL/LPC1768/watchdog.cpp index 73563a6baa..3cd22d6651 100644 --- a/Marlin/src/HAL/LPC1768/watchdog.cpp +++ b/Marlin/src/HAL/LPC1768/watchdog.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef TARGET_LPC1768 #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/HAL/LPC1768/watchdog.h b/Marlin/src/HAL/LPC1768/watchdog.h index e9e25e4f2a..cc170881f3 100644 --- a/Marlin/src/HAL/LPC1768/watchdog.h +++ b/Marlin/src/HAL/LPC1768/watchdog.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/SAMD51/HAL.cpp b/Marlin/src/HAL/SAMD51/HAL.cpp index b3a741fe13..9f24d30071 100644 --- a/Marlin/src/HAL/SAMD51/HAL.cpp +++ b/Marlin/src/HAL/SAMD51/HAL.cpp @@ -15,10 +15,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __SAMD51__ #include "../../inc/MarlinConfig.h" @@ -29,71 +28,19 @@ // 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_6 - #define GET_TEMP_6_ADC() PIN_TO_ADC(TEMP_6_PIN) -#else - #define GET_TEMP_6_ADC() -1 -#endif -#if HAS_TEMP_ADC_7 - #define GET_TEMP_7_ADC() PIN_TO_ADC(TEMP_7_PIN) -#else - #define GET_TEMP_7_ADC() -1 -#endif -#if HAS_TEMP_PROBE - #define GET_PROBE_ADC() PIN_TO_ADC(TEMP_PROBE_PIN) -#else - #define GET_PROBE_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 GET_TEMP_0_ADC() TERN(HAS_TEMP_ADC_0, PIN_TO_ADC(TEMP_0_PIN), -1) +#define GET_TEMP_1_ADC() TERN(HAS_TEMP_ADC_1, PIN_TO_ADC(TEMP_1_PIN), -1) +#define GET_TEMP_2_ADC() TERN(HAS_TEMP_ADC_2, PIN_TO_ADC(TEMP_2_PIN), -1) +#define GET_TEMP_3_ADC() TERN(HAS_TEMP_ADC_3, PIN_TO_ADC(TEMP_3_PIN), -1) +#define GET_TEMP_4_ADC() TERN(HAS_TEMP_ADC_4, PIN_TO_ADC(TEMP_4_PIN), -1) +#define GET_TEMP_5_ADC() TERN(HAS_TEMP_ADC_5, PIN_TO_ADC(TEMP_5_PIN), -1) +#define GET_TEMP_6_ADC() TERN(HAS_TEMP_ADC_6, PIN_TO_ADC(TEMP_6_PIN), -1) +#define GET_TEMP_7_ADC() TERN(HAS_TEMP_ADC_7, PIN_TO_ADC(TEMP_7_PIN), -1) +#define GET_PROBE_ADC() TERN(HAS_TEMP_PROBE, PIN_TO_ADC(TEMP_PROBE_PIN), -1) +#define GET_BED_ADC() TERN(HAS_TEMP_ADC_BED, PIN_TO_ADC(TEMP_BED_PIN), -1) +#define GET_CHAMBER_ADC() TERN(HAS_TEMP_ADC_CHAMBER, PIN_TO_ADC(TEMP_CHAMBER_PIN), -1) +#define GET_FILAMENT_WIDTH_ADC() TERN(FILAMENT_WIDTH_SENSOR, PIN_TO_ADC(FILWIDTH_PIN), -1) +#define GET_BUTTONS_ADC() TERN(HAS_ADC_BUTTONS, PIN_TO_ADC(ADC_KEYPAD_PIN), -1) #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 \ @@ -105,21 +52,22 @@ || 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 +#if IS_ADC_REQUIRED(0) + #define ADC0_IS_REQUIRED 1 #define FIRST_ADC 0 #else #define FIRST_ADC 1 #endif -#if ADC1_IS_REQUIRED +#if IS_ADC_REQUIRED(1) + #define ADC1_IS_REQUIRED 1 #define LAST_ADC 1 #else #define LAST_ADC 0 #endif - -#define DMA_IS_REQUIRED ADC_IS_REQUIRED +#if ADC0_IS_REQUIRED || ADC1_IS_REQUIRED + #define ADC_IS_REQUIRED 1 + #define DMA_IS_REQUIRED 1 +#endif // ------------------------ // Types @@ -423,9 +371,7 @@ uint16_t HAL_adc_result; // HAL initialization task void HAL_init() { - #if DMA_IS_REQUIRED - dma_init(); - #endif + TERN_(DMA_IS_REQUIRED, dma_init()); #if ENABLED(SDSUPPORT) #if SD_CONNECTION_IS(ONBOARD) && PIN_EXISTS(SD_DETECT) SET_INPUT_PULLUP(SD_DETECT_PIN); diff --git a/Marlin/src/HAL/SAMD51/HAL.h b/Marlin/src/HAL/SAMD51/HAL.h index f2ee02a22f..ea0f694cdc 100644 --- a/Marlin/src/HAL/SAMD51/HAL.h +++ b/Marlin/src/HAL/SAMD51/HAL.h @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -27,7 +27,6 @@ #include "../shared/HAL_SPI.h" #include "fastio.h" #include "watchdog.h" -#include "timers.h" #ifdef ADAFRUIT_GRAND_CENTRAL_M4 #include "MarlinSerial_AGCM4.h" @@ -113,12 +112,6 @@ typedef int8_t pin_t; 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 // @@ -129,13 +122,13 @@ extern uint16_t HAL_adc_result; // Most recent ADC conversion void HAL_adc_init(); //#define HAL_ADC_FILTERED // Disable Marlin's oversampling. The HAL filters ADC values. +#define HAL_ADC_VREF 3.3 #define HAL_ADC_RESOLUTION 10 // ... 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); -inline uint16_t HAL_adc_get_result() { return HAL_adc_result; } // // Pin Map diff --git a/Marlin/src/HAL/SAMD51/HAL_SPI.cpp b/Marlin/src/HAL/SAMD51/HAL_SPI.cpp index 83226daa48..c3acd38237 100644 --- a/Marlin/src/HAL/SAMD51/HAL_SPI.cpp +++ b/Marlin/src/HAL/SAMD51/HAL_SPI.cpp @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.cpp b/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.cpp index f13b29555a..abc5f3acbf 100644 --- a/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.cpp +++ b/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.cpp @@ -15,10 +15,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef ADAFRUIT_GRAND_CENTRAL_M4 /** diff --git a/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.h b/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.h index a9eb0470a2..f3821d8d5a 100644 --- a/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.h +++ b/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.h @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/SAMD51/QSPIFlash.cpp b/Marlin/src/HAL/SAMD51/QSPIFlash.cpp index 76a3329707..161c04084f 100644 --- a/Marlin/src/HAL/SAMD51/QSPIFlash.cpp +++ b/Marlin/src/HAL/SAMD51/QSPIFlash.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/SAMD51/QSPIFlash.h b/Marlin/src/HAL/SAMD51/QSPIFlash.h index 7f75286ebf..b6f22769ff 100644 --- a/Marlin/src/HAL/SAMD51/QSPIFlash.h +++ b/Marlin/src/HAL/SAMD51/QSPIFlash.h @@ -29,7 +29,7 @@ #pragma once -#include "Adafruit_SPIFlashBase.h" +#include // This class extends Adafruit_SPIFlashBase by adding caching support. // diff --git a/Marlin/src/HAL/SAMD51/SAMD51.h b/Marlin/src/HAL/SAMD51/SAMD51.h index ef84a20820..783956140d 100644 --- a/Marlin/src/HAL/SAMD51/SAMD51.h +++ b/Marlin/src/HAL/SAMD51/SAMD51.h @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/SAMD51/Servo.cpp b/Marlin/src/HAL/SAMD51/Servo.cpp index b39869ef32..9bab8e89be 100644 --- a/Marlin/src/HAL/SAMD51/Servo.cpp +++ b/Marlin/src/HAL/SAMD51/Servo.cpp @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -29,11 +29,9 @@ #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) @@ -55,7 +53,7 @@ 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 * const tc = TimerConfig[SERVO_TC].pTc; tc->COUNT16.CTRLBSET.reg = TC_CTRLBCLR_CMD_READSYNC; SYNC(tc->COUNT16.SYNCBUSY.bit.CTRLB || tc->COUNT16.SYNCBUSY.bit.COUNT); @@ -67,7 +65,7 @@ FORCE_INLINE static uint16_t getTimerCount() { // Interrupt handler for the TC // ---------------------------- HAL_SERVO_TIMER_ISR() { - Tc * const tc = TimerConfig[SERVO_TC].pTimer; + Tc * const tc = TimerConfig[SERVO_TC].pTc; const timer16_Sequence_t timer = #ifndef _useTimer1 _timer2 @@ -127,7 +125,7 @@ HAL_SERVO_TIMER_ISR() { } void initISR(timer16_Sequence_t timer) { - Tc * const tc = TimerConfig[SERVO_TC].pTimer; + Tc * const tc = TimerConfig[SERVO_TC].pTc; const uint8_t tcChannel = TIMER_TCCHANNEL(timer); static bool initialized = false; // Servo TC has been initialized @@ -204,7 +202,7 @@ void initISR(timer16_Sequence_t timer) { } void finISR(timer16_Sequence_t timer) { - Tc * const tc = TimerConfig[SERVO_TC].pTimer; + Tc * const tc = TimerConfig[SERVO_TC].pTc; const uint8_t tcChannel = TIMER_TCCHANNEL(timer); // Disable the match channel interrupt request diff --git a/Marlin/src/HAL/SAMD51/ServoTimers.h b/Marlin/src/HAL/SAMD51/ServoTimers.h index 3572c608d2..948d515356 100644 --- a/Marlin/src/HAL/SAMD51/ServoTimers.h +++ b/Marlin/src/HAL/SAMD51/ServoTimers.h @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/SAMD51/eeprom_flash.cpp b/Marlin/src/HAL/SAMD51/eeprom_flash.cpp index fd8973369a..429ef1c2d4 100644 --- a/Marlin/src/HAL/SAMD51/eeprom_flash.cpp +++ b/Marlin/src/HAL/SAMD51/eeprom_flash.cpp @@ -15,10 +15,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __SAMD51__ #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp b/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp index c6aa383f9f..b403f7939f 100644 --- a/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp +++ b/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #ifdef __SAMD51__ diff --git a/Marlin/src/HAL/SAMD51/eeprom.cpp b/Marlin/src/HAL/SAMD51/eeprom_wired.cpp similarity index 76% rename from Marlin/src/HAL/SAMD51/eeprom.cpp rename to Marlin/src/HAL/SAMD51/eeprom_wired.cpp index e167515bff..3283195897 100644 --- a/Marlin/src/HAL/SAMD51/eeprom.cpp +++ b/Marlin/src/HAL/SAMD51/eeprom_wired.cpp @@ -15,21 +15,29 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __SAMD51__ #include "../../inc/MarlinConfig.h" -#if ENABLED(EEPROM_SETTINGS) && NONE(QSPI_EEPROM, FLASH_EEPROM_EMULATION) +#if USE_WIRED_EEPROM +/** + * PersistentStore for Arduino-style EEPROM interface + * with simple implementations supplied by Marlin. + */ + +#include "../shared/eeprom_if.h" #include "../shared/eeprom_api.h" -size_t PersistentStore::capacity() { return E2END + 1; } +#ifndef MARLIN_EEPROM_SIZE + #error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM." +#endif +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } -bool PersistentStore::access_start() { return true; } +bool PersistentStore::access_start() { eeprom_init(); return true; } bool PersistentStore::access_finish() { return true; } bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { @@ -62,5 +70,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t return false; } -#endif // EEPROM_SETTINGS && !(QSPI_EEPROM || FLASH_EEPROM_EMULATION) +#endif // USE_WIRED_EEPROM #endif // __SAMD51__ diff --git a/Marlin/src/HAL/SAMD51/endstop_interrupts.h b/Marlin/src/HAL/SAMD51/endstop_interrupts.h index 4c8f441ce2..03c2469453 100644 --- a/Marlin/src/HAL/SAMD51/endstop_interrupts.h +++ b/Marlin/src/HAL/SAMD51/endstop_interrupts.h @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/SAMD51/fastio.h b/Marlin/src/HAL/SAMD51/fastio.h index d3b3dc1f63..c456dfce30 100644 --- a/Marlin/src/HAL/SAMD51/fastio.h +++ b/Marlin/src/HAL/SAMD51/fastio.h @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/SAMD51/inc/Conditionals_LCD.h b/Marlin/src/HAL/SAMD51/inc/Conditionals_LCD.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/SAMD51/inc/Conditionals_LCD.h +++ b/Marlin/src/HAL/SAMD51/inc/Conditionals_LCD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/SAMD51/inc/Conditionals_adv.h b/Marlin/src/HAL/SAMD51/inc/Conditionals_adv.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/SAMD51/inc/Conditionals_adv.h +++ b/Marlin/src/HAL/SAMD51/inc/Conditionals_adv.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/SAMD51/inc/Conditionals_post.h b/Marlin/src/HAL/SAMD51/inc/Conditionals_post.h index 490cfd50e8..ce6d3fdde2 100644 --- a/Marlin/src/HAL/SAMD51/inc/Conditionals_post.h +++ b/Marlin/src/HAL/SAMD51/inc/Conditionals_post.h @@ -16,11 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once -#if USE_FALLBACK_EEPROM && NONE(SDCARD_EEPROM_EMULATION, SRAM_EEPROM_EMULATION) +#if USE_FALLBACK_EEPROM #define FLASH_EEPROM_EMULATION +#elif EITHER(I2C_EEPROM, SPI_EEPROM) + #define USE_SHARED_EEPROM 1 #endif diff --git a/Marlin/src/HAL/SAMD51/inc/SanityCheck.h b/Marlin/src/HAL/SAMD51/inc/SanityCheck.h index cc7a10e7a6..ee04e2e2e0 100644 --- a/Marlin/src/HAL/SAMD51/inc/SanityCheck.h +++ b/Marlin/src/HAL/SAMD51/inc/SanityCheck.h @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -35,6 +35,10 @@ #error "OnBoard SPI BUS can't be shared with other devices." #endif +#if SERVO_TC == RTC_TIMER_NUM + #error "Servos can't use RTC timer" +#endif + #if ENABLED(EMERGENCY_PARSER) #error "EMERGENCY_PARSER is not yet implemented for SAMD51. Disable EMERGENCY_PARSER to continue." #endif diff --git a/Marlin/src/HAL/SAMD51/pinsDebug.h b/Marlin/src/HAL/SAMD51/pinsDebug.h index 15b6473382..c28937d6c6 100644 --- a/Marlin/src/HAL/SAMD51/pinsDebug.h +++ b/Marlin/src/HAL/SAMD51/pinsDebug.h @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/SAMD51/spi_pins.h b/Marlin/src/HAL/SAMD51/spi_pins.h index 049aacb57a..5a9b1275ef 100644 --- a/Marlin/src/HAL/SAMD51/spi_pins.h +++ b/Marlin/src/HAL/SAMD51/spi_pins.h @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/SAMD51/timers.cpp b/Marlin/src/HAL/SAMD51/timers.cpp index 3eb021c25b..a68af2e074 100644 --- a/Marlin/src/HAL/SAMD51/timers.cpp +++ b/Marlin/src/HAL/SAMD51/timers.cpp @@ -15,17 +15,17 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __SAMD51__ // -------------------------------------------------------------------------- // Includes // -------------------------------------------------------------------------- + #include "../../inc/MarlinConfig.h" -#include "timers.h" +#include "ServoTimers.h" // for SERVO_TC // -------------------------------------------------------------------------- // Local defines @@ -38,15 +38,15 @@ // -------------------------------------------------------------------------- const tTimerConfig TimerConfig[NUM_HARDWARE_TIMERS+1] = { - { {.pTc=TC0}, TC0_IRQn, TC_PRIORITY(0) }, // 0 - stepper + { {.pTc=TC0}, TC0_IRQn, TC_PRIORITY(0) }, // 0 - stepper (assigned priority 2) { {.pTc=TC1}, TC1_IRQn, TC_PRIORITY(1) }, // 1 - stepper (needed by 32 bit timers) - { {.pTc=TC2}, TC2_IRQn, TC_PRIORITY(2) }, // 2 - tone (framework) - { {.pTc=TC3}, TC3_IRQn, TC_PRIORITY(3) }, // 3 - servo - { {.pTc=TC4}, TC4_IRQn, TC_PRIORITY(4) }, // 4 - software serial + { {.pTc=TC2}, TC2_IRQn, 5 }, // 2 - tone (reserved by framework and fixed assigned priority 5) + { {.pTc=TC3}, TC3_IRQn, TC_PRIORITY(3) }, // 3 - servo (assigned priority 1) + { {.pTc=TC4}, TC4_IRQn, TC_PRIORITY(4) }, // 4 - software serial (no interrupts used) { {.pTc=TC5}, TC5_IRQn, TC_PRIORITY(5) }, { {.pTc=TC6}, TC6_IRQn, TC_PRIORITY(6) }, { {.pTc=TC7}, TC7_IRQn, TC_PRIORITY(7) }, - { {.pRtc=RTC}, RTC_IRQn, TC_PRIORITY(8) } // 8 - temperature + { {.pRtc=RTC}, RTC_IRQn, TC_PRIORITY(8) } // 8 - temperature (assigned priority 6) }; // -------------------------------------------------------------------------- @@ -121,14 +121,15 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { tc->COUNT32.CTRLA.bit.SWRST = true; SYNC(tc->COUNT32.SYNCBUSY.bit.SWRST); - // Wave mode, reset counter on overflow on 0 (I use count down to prevent double buffer use) + // Wave mode, reset counter on compare match 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; + tc->COUNT32.CTRLBCLR.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; + tc->COUNT32.CC[0].reg = (HAL_TIMER_RATE) / frequency; + tc->COUNT32.COUNT.reg = 0; // Enable interrupt on compare tc->COUNT32.INTFLAG.reg = TC_INTFLAG_OVF; // reset pending interrupt diff --git a/Marlin/src/HAL/SAMD51/timers.h b/Marlin/src/HAL/SAMD51/timers.h index 4b21e47162..dc6e38b730 100644 --- a/Marlin/src/HAL/SAMD51/timers.h +++ b/Marlin/src/HAL/SAMD51/timers.h @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -32,9 +32,15 @@ typedef uint32_t hal_timer_t; #define HAL_TIMER_RATE F_CPU // 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 RTC_TIMER_NUM // index of timer to use for temperature +#ifndef STEP_TIMER_NUM + #define STEP_TIMER_NUM 0 // Timer Index for Stepper +#endif +#ifndef PULSE_TIMER_NUM + #define PULSE_TIMER_NUM STEP_TIMER_NUM +#endif +#ifndef TEMP_TIMER_NUM + #define TEMP_TIMER_NUM RTC_TIMER_NUM // Timer Index for Temperature +#endif #define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency @@ -53,20 +59,23 @@ typedef uint32_t hal_timer_t; #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) -#define TC_PRIORITY(t) (t == STEP_TIMER_NUM || t == PULSE_TIMER_NUM) ? 2 \ - : (t == TEMP_TIMER_NUM) ? 6 \ +#define TC_PRIORITY(t) t == SERVO_TC ? 1 \ + : (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) +#define _TC_HANDLER(t) void TC##t##_Handler() +#define TC_HANDLER(t) _TC_HANDLER(t) +#ifndef HAL_STEP_TIMER_ISR + #define HAL_STEP_TIMER_ISR() TC_HANDLER(STEP_TIMER_NUM) +#endif #if STEP_TIMER_NUM != PULSE_TIMER_NUM - #define HAL_PULSE_TIMER_ISR() TC_HANDLER(PULSE_TIMER_NUM) + #define HAL_PULSE_TIMER_ISR() TC_HANDLER(PULSE_TIMER_NUM) #endif #if TEMP_TIMER_NUM == RTC_TIMER_NUM - #define HAL_TEMP_TIMER_ISR() void RTC_Handler() + #define HAL_TEMP_TIMER_ISR() void RTC_Handler() #else - #define HAL_TEMP_TIMER_ISR() TC_HANDLER(TEMP_TIMER_NUM) + #define HAL_TEMP_TIMER_ISR() TC_HANDLER(TEMP_TIMER_NUM) #endif // -------------------------------------------------------------------------- @@ -97,13 +106,13 @@ 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) { // Should never be called with timer RTC_TIMER_NUM Tc * const tc = TimerConfig[timer_num].pTc; - tc->COUNT32.CC[0].reg = HAL_TIMER_TYPE_MAX - compare; + tc->COUNT32.CC[0].reg = compare; } FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) { // Should never be called with timer RTC_TIMER_NUM Tc * const tc = TimerConfig[timer_num].pTc; - return (hal_timer_t)(HAL_TIMER_TYPE_MAX - tc->COUNT32.CC[0].reg); + return (hal_timer_t)tc->COUNT32.CC[0].reg; } FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) { @@ -111,7 +120,7 @@ FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) { Tc * const tc = TimerConfig[timer_num].pTc; 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; + return tc->COUNT32.COUNT.reg; } void HAL_timer_enable_interrupt(const uint8_t timer_num); diff --git a/Marlin/src/HAL/SAMD51/watchdog.cpp b/Marlin/src/HAL/SAMD51/watchdog.cpp index 13539b4d70..ebc8dffe13 100644 --- a/Marlin/src/HAL/SAMD51/watchdog.cpp +++ b/Marlin/src/HAL/SAMD51/watchdog.cpp @@ -15,10 +15,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __SAMD51__ #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/HAL/SAMD51/watchdog.h b/Marlin/src/HAL/SAMD51/watchdog.h index aa8ef35371..2cd4788229 100644 --- a/Marlin/src/HAL/SAMD51/watchdog.h +++ b/Marlin/src/HAL/SAMD51/watchdog.h @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32/HAL.cpp b/Marlin/src/HAL/STM32/HAL.cpp index 77f8d27640..b1b727ce19 100644 --- a/Marlin/src/HAL/STM32/HAL.cpp +++ b/Marlin/src/HAL/STM32/HAL.cpp @@ -17,21 +17,17 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) #include "HAL.h" +#include "usb_serial.h" #include "../../inc/MarlinConfig.h" #include "../shared/Delay.h" -#if HAS_TMC_SW_SERIAL - #include "SoftwareSerial.h" -#endif - #if ENABLED(SRAM_EEPROM_EMULATION) #if STM32F7xx #include @@ -67,7 +63,7 @@ uint16_t HAL_adc_result; void HAL_init() { FastIO_init(); - #if ENABLED(SDSUPPORT) + #if ENABLED(SDSUPPORT) && DISABLED(SDIO_SUPPORT) OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up #endif @@ -76,20 +72,16 @@ void HAL_init() { #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_TMC_SW_SERIAL - SoftwareSerial::setInterruptPriority(SWSERIAL_TIMER_IRQ_PRIO, 0); + __HAL_RCC_PWR_CLK_ENABLE(); + HAL_PWR_EnableBkUpAccess(); // Enable access to backup SRAM + __HAL_RCC_BKPSRAM_CLK_ENABLE(); + LL_PWR_EnableBkUpRegulator(); // Enable backup regulator + while (!LL_PWR_IsActiveFlag_BRR()); // Wait until backup regulator is initialized #endif + + SetTimerInterruptPriorities(); + + TERN_(EMERGENCY_PARSER, USB_Hook_init()); } void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); } diff --git a/Marlin/src/HAL/STM32/HAL.h b/Marlin/src/HAL/STM32/HAL.h index c310cca74e..730ada96c1 100644 --- a/Marlin/src/HAL/STM32/HAL.h +++ b/Marlin/src/HAL/STM32/HAL.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -30,6 +30,7 @@ #include "../shared/HAL_SPI.h" #include "fastio.h" #include "watchdog.h" +#include "MarlinSerial.h" #include "../../inc/MarlinConfigPre.h" @@ -48,17 +49,17 @@ #elif SERIAL_PORT == -1 #define MYSERIAL0 SerialUSB #elif SERIAL_PORT == 1 - #define MYSERIAL0 Serial1 + #define MYSERIAL0 MSerial1 #elif SERIAL_PORT == 2 - #define MYSERIAL0 Serial2 + #define MYSERIAL0 MSerial2 #elif SERIAL_PORT == 3 - #define MYSERIAL0 Serial3 + #define MYSERIAL0 MSerial3 #elif SERIAL_PORT == 4 - #define MYSERIAL0 Serial4 + #define MYSERIAL0 MSerial4 #elif SERIAL_PORT == 5 - #define MYSERIAL0 Serial5 + #define MYSERIAL0 MSerial5 #elif SERIAL_PORT == 6 - #define MYSERIAL0 Serial6 + #define MYSERIAL0 MSerial6 #else #error "SERIAL_PORT must be from -1 to 6. Please update your configuration." #endif @@ -72,17 +73,17 @@ #elif SERIAL_PORT_2 == -1 #define MYSERIAL1 SerialUSB #elif SERIAL_PORT_2 == 1 - #define MYSERIAL1 Serial1 + #define MYSERIAL1 MSerial1 #elif SERIAL_PORT_2 == 2 - #define MYSERIAL1 Serial2 + #define MYSERIAL1 MSerial2 #elif SERIAL_PORT_2 == 3 - #define MYSERIAL1 Serial3 + #define MYSERIAL1 MSerial3 #elif SERIAL_PORT_2 == 4 - #define MYSERIAL1 Serial4 + #define MYSERIAL1 MSerial4 #elif SERIAL_PORT_2 == 5 - #define MYSERIAL1 Serial5 + #define MYSERIAL1 MSerial5 #elif SERIAL_PORT_2 == 6 - #define MYSERIAL1 Serial6 + #define MYSERIAL1 MSerial6 #else #error "SERIAL_PORT_2 must be from -1 to 6. Please update your configuration." #endif @@ -100,17 +101,17 @@ #elif DGUS_SERIAL_PORT == -1 #define DGUS_SERIAL SerialUSB #elif DGUS_SERIAL_PORT == 1 - #define DGUS_SERIAL Serial1 + #define DGUS_SERIAL MSerial1 #elif DGUS_SERIAL_PORT == 2 - #define DGUS_SERIAL Serial2 + #define DGUS_SERIAL MSerial2 #elif DGUS_SERIAL_PORT == 3 - #define DGUS_SERIAL Serial3 + #define DGUS_SERIAL MSerial3 #elif DGUS_SERIAL_PORT == 4 - #define DGUS_SERIAL Serial4 + #define DGUS_SERIAL MSerial4 #elif DGUS_SERIAL_PORT == 5 - #define DGUS_SERIAL Serial5 + #define DGUS_SERIAL MSerial5 #elif DGUS_SERIAL_PORT == 6 - #define DGUS_SERIAL Serial6 + #define DGUS_SERIAL MSerial6 #else #error "DGUS_SERIAL_PORT must be from -1 to 6. Please update your configuration." #endif @@ -118,7 +119,6 @@ #define DGUS_SERIAL_GET_TX_BUFFER_FREE DGUS_SERIAL.availableForWrite #endif -#include "timers.h" /** * TODO: review this to return 1 for pins that are not analog input @@ -191,16 +191,6 @@ static inline int freeMemory() { #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 // @@ -209,8 +199,9 @@ void eeprom_update_block(const void *__src, void *__dst, size_t __n); inline void HAL_adc_init() {} -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) +#define HAL_ADC_VREF 3.3 #define HAL_ADC_RESOLUTION 10 +#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) #define HAL_READ_ADC() HAL_adc_result #define HAL_ADC_READY() true diff --git a/Marlin/src/HAL/STM32/HAL_SPI.cpp b/Marlin/src/HAL/STM32/HAL_SPI.cpp index 7b37fff9c2..202442a71b 100644 --- a/Marlin/src/HAL/STM32/HAL_SPI.cpp +++ b/Marlin/src/HAL/STM32/HAL_SPI.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) diff --git a/Marlin/src/HAL/STM32/MarlinSerial.cpp b/Marlin/src/HAL/STM32/MarlinSerial.cpp new file mode 100644 index 0000000000..8d99ab7855 --- /dev/null +++ b/Marlin/src/HAL/STM32/MarlinSerial.cpp @@ -0,0 +1,88 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 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(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) + +#include "../../inc/MarlinConfig.h" +#include "MarlinSerial.h" + +#if ENABLED(EMERGENCY_PARSER) + #include "../../feature/e_parser.h" +#endif + +#ifndef USART4 + #define USART4 UART4 +#endif + +#ifndef USART5 + #define USART5 UART5 +#endif + +#define DECLARE_SERIAL_PORT(ser_num) \ + void _rx_complete_irq_ ## ser_num (serial_t * obj); \ + MarlinSerial MSerial ## ser_num (USART ## ser_num, &_rx_complete_irq_ ## ser_num); \ + void _rx_complete_irq_ ## ser_num (serial_t * obj) { MSerial ## ser_num ._rx_complete_irq(obj); } + +#define DECLARE_SERIAL_PORT_EXP(ser_num) DECLARE_SERIAL_PORT(ser_num) + +#if defined(SERIAL_PORT) && SERIAL_PORT >= 0 + DECLARE_SERIAL_PORT_EXP(SERIAL_PORT) +#endif + +#if defined(SERIAL_PORT_2) && SERIAL_PORT_2 >= 0 + DECLARE_SERIAL_PORT_EXP(SERIAL_PORT_2) +#endif + +#if defined(DGUS_SERIAL_PORT) && DGUS_SERIAL_PORT >= 0 + DECLARE_SERIAL_PORT_EXP(DGUS_SERIAL_PORT) +#endif + +void MarlinSerial::begin(unsigned long baud, uint8_t config) { + HardwareSerial::begin(baud, config); + // replace the IRQ callback with the one we have defined + #if ENABLED(EMERGENCY_PARSER) + _serial.rx_callback = _rx_callback; + #endif +} + +// This function is Copyright (c) 2006 Nicholas Zambetti. +void MarlinSerial::_rx_complete_irq(serial_t *obj) { + // No Parity error, read byte and store it in the buffer if there is room + unsigned char c; + + if (uart_getc(obj, &c) == 0) { + + rx_buffer_index_t i = (unsigned int)(obj->rx_head + 1) % SERIAL_RX_BUFFER_SIZE; + + // if we should be storing the received character into the location + // just before the tail (meaning that the head would advance to the + // current location of the tail), we're about to overflow the buffer + // and so we don't write the character or advance the head. + if (i != obj->rx_tail) { + obj->rx_buff[obj->rx_head] = c; + obj->rx_head = i; + } + + #if ENABLED(EMERGENCY_PARSER) + emergency_parser.update(emergency_state, c); + #endif + } +} + +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/MarlinSerial.h b/Marlin/src/HAL/STM32/MarlinSerial.h new file mode 100644 index 0000000000..5ab97ff3a9 --- /dev/null +++ b/Marlin/src/HAL/STM32/MarlinSerial.h @@ -0,0 +1,60 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 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 "../../inc/MarlinConfigPre.h" + +#if ENABLED(EMERGENCY_PARSER) + #include "../../feature/e_parser.h" +#endif + +typedef void (*usart_rx_callback_t)(serial_t * obj); + +class MarlinSerial : public HardwareSerial { +public: + MarlinSerial(void* peripheral, usart_rx_callback_t rx_callback) : + HardwareSerial(peripheral), _rx_callback(rx_callback) + #if ENABLED(EMERGENCY_PARSER) + , emergency_state(EmergencyParser::State::EP_RESET) + #endif + { } + + void begin(unsigned long baud, uint8_t config); + inline void begin(unsigned long baud) { begin(baud, SERIAL_8N1); } + + void _rx_complete_irq(serial_t* obj); + +protected: + usart_rx_callback_t _rx_callback; + #if ENABLED(EMERGENCY_PARSER) + EmergencyParser::State emergency_state; + #endif +}; + +extern MarlinSerial MSerial1; +extern MarlinSerial MSerial2; +extern MarlinSerial MSerial3; +extern MarlinSerial MSerial4; +extern MarlinSerial MSerial5; +extern MarlinSerial MSerial6; +extern MarlinSerial MSerial7; +extern MarlinSerial MSerial8; +extern MarlinSerial MSerial9; +extern MarlinSerial MSerial10; +extern MarlinSerial MSerialLP1; diff --git a/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp b/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp index ebe15f9391..9d32b342e4 100644 --- a/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp +++ b/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -27,248 +27,260 @@ #include #include -//#include "SdMscDriver.h" - -//#include "usbd_msc_bot.h" -//#include "usbd_msc_scsi.h" -//#include "usbd_msc_composite.h" -//#include "usbd_msc_cdc_composite.h" - -//#include "usbd_msc_data.h" - -#if defined(STM32F103xE) || defined(STM32F103xG) - #include - #include -#elif defined(STM32F4xx) - #include - #include - #include - #include -#elif defined(STM32F7xx) - #include - #include - #include - #include -#else +#if NONE(STM32F103xE, STM32F103xG, STM32F4xx, STM32F7xx) #error "ERROR - Only STM32F103xE, STM32F103xG, STM32F4xx or STM32F7xx CPUs supported" #endif -SD_HandleTypeDef hsd; // create SDIO structure +#ifdef USBD_USE_CDC_COMPOSITE -#define TRANSFER_CLOCK_DIV ((uint8_t)SDIO_INIT_CLK_DIV/40) + // use USB drivers -#ifndef USBD_OK - #define USBD_OK 0 -#endif + extern "C" { int8_t SD_MSC_Read(uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len); + int8_t SD_MSC_Write(uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len); + extern SD_HandleTypeDef hsd; + } -void go_to_transfer_speed() { + bool SDIO_Init() { + return hsd.State == HAL_SD_STATE_READY; // return pass/fail status + } - SD_InitTypeDef Init; + bool SDIO_ReadBlock(uint32_t block, uint8_t *src) { + int8_t status = SD_MSC_Read(0, (uint8_t*)src, block, 1); // read one 512 byte block + return (bool) status; + } - /* Default SDIO peripheral configuration for SD card initialization */ - Init.ClockEdge = hsd.Init.ClockEdge; - Init.ClockBypass = hsd.Init.ClockBypass; - Init.ClockPowerSave = hsd.Init.ClockPowerSave; - Init.BusWide = hsd.Init.BusWide; - Init.HardwareFlowControl = hsd.Init.HardwareFlowControl; - Init.ClockDiv = TRANSFER_CLOCK_DIV; + bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) { + int8_t status = SD_MSC_Write(0, (uint8_t*)src, block, 1); // write one 512 byte block + return (bool) status; + } - /* Initialize SDIO peripheral interface with default configuration */ - SDIO_Init(hsd.Instance, Init); -} +#else // !USBD_USE_CDC_COMPOSITE -void SD_LowLevel_Init(void) { + // use local drivers + #if defined(STM32F103xE) || defined(STM32F103xG) + #include + #include + #elif defined(STM32F4xx) + #include + #include + #include + #include + #elif defined(STM32F7xx) + #include + #include + #include + #include + #else + #error "ERROR - Only STM32F103xE, STM32F103xG, STM32F4xx or STM32F7xx CPUs supported" + #endif - uint32_t tempreg; + SD_HandleTypeDef hsd; // create SDIO structure - GPIO_InitTypeDef GPIO_InitStruct; + #define TRANSFER_CLOCK_DIV (uint8_t(SDIO_INIT_CLK_DIV) / 40) - __HAL_RCC_GPIOC_CLK_ENABLE(); //enable GPIO clocks - __HAL_RCC_GPIOD_CLK_ENABLE(); //enable GPIO clocks + #ifndef USBD_OK + #define USBD_OK 0 + #endif - GPIO_InitStruct.Pin = GPIO_PIN_8 | GPIO_PIN_12; // D0 & SCK - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = 1; //GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; - GPIO_InitStruct.Alternate = GPIO_AF12_SDIO; - HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + void go_to_transfer_speed() { + SD_InitTypeDef Init; - #if defined(SDIO_D1_PIN) && defined(SDIO_D2_PIN) && defined(SDIO_D3_PIN) // define D1-D3 only if have a four bit wide SDIO bus - GPIO_InitStruct.Pin = GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11; // D1-D3 + /* Default SDIO peripheral configuration for SD card initialization */ + Init.ClockEdge = hsd.Init.ClockEdge; + Init.ClockBypass = hsd.Init.ClockBypass; + Init.ClockPowerSave = hsd.Init.ClockPowerSave; + Init.BusWide = hsd.Init.BusWide; + Init.HardwareFlowControl = hsd.Init.HardwareFlowControl; + Init.ClockDiv = TRANSFER_CLOCK_DIV; + + /* Initialize SDIO peripheral interface with default configuration */ + SDIO_Init(hsd.Instance, Init); + } + + void SD_LowLevel_Init(void) { + uint32_t tempreg; + + GPIO_InitTypeDef GPIO_InitStruct; + + __HAL_RCC_GPIOC_CLK_ENABLE(); //enable GPIO clocks + __HAL_RCC_GPIOD_CLK_ENABLE(); //enable GPIO clocks + + GPIO_InitStruct.Pin = GPIO_PIN_8 | GPIO_PIN_12; // D0 & SCK GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = 1; //GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; GPIO_InitStruct.Alternate = GPIO_AF12_SDIO; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); - #endif - // Configure PD.02 CMD line - GPIO_InitStruct.Pin = GPIO_PIN_2; - HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); + #if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) // define D1-D3 only if have a four bit wide SDIO bus + GPIO_InitStruct.Pin = GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11; // D1-D3 + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = 1; // GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF12_SDIO; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + #endif - RCC->APB2RSTR &= ~RCC_APB2RSTR_SDIORST_Msk; // take SDIO out of reset - RCC->APB2ENR |= RCC_APB2RSTR_SDIORST_Msk; // enable SDIO clock + // Configure PD.02 CMD line + GPIO_InitStruct.Pin = GPIO_PIN_2; + HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); - // Enable the DMA2 Clock + RCC->APB2RSTR &= ~RCC_APB2RSTR_SDIORST_Msk; // take SDIO out of reset + RCC->APB2ENR |= RCC_APB2RSTR_SDIORST_Msk; // enable SDIO clock - //Initialize the SDIO (with initial <400Khz Clock) - tempreg = 0; //Reset value - tempreg |= SDIO_CLKCR_CLKEN; //Clock is enabled - tempreg |= (uint32_t)0x76; //Clock Divider. Clock = 48000/(118+2) = 400Khz - //Keep the rest at 0 => HW_Flow Disabled, Rising Clock Edge, Disable CLK ByPass, Bus Width = 0, Power save Disable - SDIO->CLKCR = tempreg; + // Enable the DMA2 Clock - //Power up the SDIO - SDIO->POWER = 0x03; -} + //Initialize the SDIO (with initial <400Khz Clock) + tempreg = 0; //Reset value + tempreg |= SDIO_CLKCR_CLKEN; // Clock enabled + tempreg |= (uint32_t)0x76; // Clock Divider. Clock = 48000 / (118 + 2) = 400Khz + // Keep the rest at 0 => HW_Flow Disabled, Rising Clock Edge, Disable CLK ByPass, Bus Width = 0, Power save Disable + SDIO->CLKCR = tempreg; - -void HAL_SD_MspInit(SD_HandleTypeDef *hsd) { // application specific init - UNUSED(hsd); /* Prevent unused argument(s) compilation warning */ - __HAL_RCC_SDIO_CLK_ENABLE(); // turn on SDIO clock -} - -constexpr uint8_t SD_RETRY_COUNT = (1 - #if ENABLED(SD_CHECK_AND_RETRY) - + 2 - #endif -); - -bool SDIO_Init() { - //init SDIO and get SD card info - - uint8_t retryCnt = SD_RETRY_COUNT; - - bool status; - hsd.Instance = SDIO; - hsd.State = (HAL_SD_StateTypeDef) 0; // HAL_SD_STATE_RESET - SD_LowLevel_Init(); - - uint8_t retry_Cnt = retryCnt; - for (;;) { - status = (bool) HAL_SD_Init(&hsd); - if (!status) break; - if (!--retry_Cnt) return false; // return failing status if retries are exhausted + // Power up the SDIO + SDIO->POWER = 0x03; } - go_to_transfer_speed(); + void HAL_SD_MspInit(SD_HandleTypeDef *hsd) { // application specific init + UNUSED(hsd); /* Prevent unused argument(s) compilation warning */ + __HAL_RCC_SDIO_CLK_ENABLE(); // turn on SDIO clock + } - #if defined(SDIO_D1_PIN) && defined(SDIO_D2_PIN) && defined(SDIO_D3_PIN) // go to 4 bit wide mode if pins are defined - retry_Cnt = retryCnt; + constexpr uint8_t SD_RETRY_COUNT = TERN(SD_CHECK_AND_RETRY, 3, 1); + + bool SDIO_Init() { + //init SDIO and get SD card info + + uint8_t retryCnt = SD_RETRY_COUNT; + + bool status; + hsd.Instance = SDIO; + hsd.State = (HAL_SD_StateTypeDef) 0; // HAL_SD_STATE_RESET + SD_LowLevel_Init(); + + uint8_t retry_Cnt = retryCnt; for (;;) { - if (!HAL_SD_ConfigWideBusOperation(&hsd, SDIO_BUS_WIDE_4B)) break; // some cards are only 1 bit wide so a pass here is not required - if (!--retry_Cnt) break; + status = (bool) HAL_SD_Init(&hsd); + if (!status) break; + if (!--retry_Cnt) return false; // return failing status if retries are exhausted } - if (!retry_Cnt) { // wide bus failed, go back to one bit wide mode - hsd.State = (HAL_SD_StateTypeDef) 0; // HAL_SD_STATE_RESET - SD_LowLevel_Init(); + + go_to_transfer_speed(); + + #if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) // go to 4 bit wide mode if pins are defined retry_Cnt = retryCnt; for (;;) { - status = (bool) HAL_SD_Init(&hsd); - if (!status) break; - if (!--retry_Cnt) return false; // return failing status if retries are exhausted + if (!HAL_SD_ConfigWideBusOperation(&hsd, SDIO_BUS_WIDE_4B)) break; // some cards are only 1 bit wide so a pass here is not required + if (!--retry_Cnt) break; } + if (!retry_Cnt) { // wide bus failed, go back to one bit wide mode + hsd.State = (HAL_SD_StateTypeDef) 0; // HAL_SD_STATE_RESET + SD_LowLevel_Init(); + retry_Cnt = retryCnt; + for (;;) { + status = (bool) HAL_SD_Init(&hsd); + if (!status) break; + if (!--retry_Cnt) return false; // return failing status if retries are exhausted + } + } + #endif + + return true; + } + + void init_SDIO_pins(void) { + GPIO_InitTypeDef GPIO_InitStruct = {0}; + + /**SDIO GPIO Configuration + PC8 ------> SDIO_D0 + PC12 ------> SDIO_CK + PD2 ------> SDIO_CMD + */ + GPIO_InitStruct.Pin = GPIO_PIN_8; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF12_SDIO; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = GPIO_PIN_12; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF12_SDIO; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = GPIO_PIN_2; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF12_SDIO; + HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); + } + + //bool SDIO_init() { return (bool) (SD_SDIO_Init() ? 1 : 0);} + //bool SDIO_Init_C() { return (bool) (SD_SDIO_Init() ? 1 : 0);} + + bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) { + hsd.Instance = SDIO; + uint8_t retryCnt = SD_RETRY_COUNT; + + bool status; + for (;;) { + status = (bool) HAL_SD_ReadBlocks(&hsd, (uint8_t*)dst, block, 1, 1000); // read one 512 byte block with 500mS timeout + status |= (bool) HAL_SD_GetCardState(&hsd); // make sure all is OK + if (!status) break; // return passing status + if (!--retryCnt) break; // return failing status if retries are exhausted } - #endif + return status; - return true; -} + /* + return (bool) ((status_read | status_card) ? 1 : 0); -void init_SDIO_pins(void) { - GPIO_InitTypeDef GPIO_InitStruct = {0}; + if (SDIO_GetCardState() != SDIO_CARD_TRANSFER) return false; + if (blockAddress >= SdCard.LogBlockNbr) return false; + if ((0x03 & (uint32_t)data)) return false; // misaligned data - /**SDIO GPIO Configuration - PC8 ------> SDIO_D0 - PC12 ------> SDIO_CK - PD2 ------> SDIO_CMD - */ - GPIO_InitStruct.Pin = GPIO_PIN_8; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = GPIO_AF12_SDIO; - HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + if (SdCard.CardType != CARD_SDHC_SDXC) { blockAddress *= 512U; } - GPIO_InitStruct.Pin = GPIO_PIN_12; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = GPIO_AF12_SDIO; - HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + if (!SDIO_CmdReadSingleBlock(blockAddress)) { + SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS); + dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL); + return false; + } - GPIO_InitStruct.Pin = GPIO_PIN_2; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = GPIO_AF12_SDIO; - HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); -} + while (!SDIO_GET_FLAG(SDIO_STA_DATAEND | SDIO_STA_TRX_ERROR_FLAGS)) {} -//bool SDIO_init() { return (bool) (SD_SDIO_Init() ? 1 : 0);} -//bool SDIO_Init_C() { return (bool) (SD_SDIO_Init() ? 1 : 0);} - -bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) { - bool status; - - hsd.Instance = SDIO; - - uint8_t retryCnt = SD_RETRY_COUNT; - - for (;;) { - bool status = (bool) HAL_SD_ReadBlocks(&hsd, (uint8_t*)dst, block, 1, 1000); // read one 512 byte block with 500mS timeout - status |= (bool) HAL_SD_GetCardState(&hsd); // make sure all is OK - if (!status) return false; // return passing status - if (!--retryCnt) return true; // return failing status if retries are exhausted - } - - /* - return (bool) ((status_read | status_card) ? 1 : 0); - - 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; } - - 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)) {} + 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; + } - dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL); - - if (SDIO->STA & SDIO_STA_RXDAVL) { - while (SDIO->STA & SDIO_STA_RXDAVL) (void)SDIO->FIFO; + 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 false; + */ + + return true; } - if (SDIO_GET_FLAG(SDIO_STA_TRX_ERROR_FLAGS)) { - SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS); - return false; + bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) { + hsd.Instance = SDIO; + uint8_t retryCnt = SD_RETRY_COUNT; + bool status; + for (;;) { + status = (bool) HAL_SD_WriteBlocks(&hsd, (uint8_t*)src, block, 1, 500); // write one 512 byte block with 500mS timeout + status |= (bool) HAL_SD_GetCardState(&hsd); // make sure all is OK + if (!status) break; // return passing status + if (!--retryCnt) break; // return failing status if retries are exhausted + } + return status; } - SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS); - */ - - return true; -} - -bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) { - bool status; - - hsd.Instance = SDIO; - - uint8_t retryCnt = SD_RETRY_COUNT; - - for (;;) { - status = (bool) HAL_SD_WriteBlocks(&hsd, (uint8_t*)src, block, 1, 500); // write one 512 byte block with 500mS timeout - status |= (bool) HAL_SD_GetCardState(&hsd); // make sure all is OK - if (!status) return (bool) status; // return passing status - if (!--retryCnt) return (bool) status; // return failing status if retries are exhausted - } -} +#endif // !USBD_USE_CDC_COMPOSITE #endif // SDIO_SUPPORT diff --git a/Marlin/src/HAL/STM32/Servo.cpp b/Marlin/src/HAL/STM32/Servo.cpp index 2dcadb8876..1cf117a056 100644 --- a/Marlin/src/HAL/STM32/Servo.cpp +++ b/Marlin/src/HAL/STM32/Servo.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) @@ -29,34 +29,82 @@ #include "Servo.h" static uint_fast8_t servoCount = 0; +static libServo *servos[NUM_SERVOS] = {0}; constexpr millis_t servoDelay[] = SERVO_DELAY; static_assert(COUNT(servoDelay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long."); +// Initialize to the default timer priority. This will be overridden by a call from timers.cpp. +// This allows all timer interrupt priorities to be managed from a single location in the HAL. +static uint32_t servo_interrupt_priority = NVIC_EncodePriority(NVIC_GetPriorityGrouping(), TIM_IRQ_PRIO, TIM_IRQ_SUBPRIO); + +// This must be called after the STM32 Servo class has intialized the timer. +// It may only be needed after the first call to attach(), but it is possible +// that is is necessary after every detach() call. To be safe this is currently +// called after every call to attach(). +static void fixServoTimerInterruptPriority() { + NVIC_SetPriority(getTimerUpIrq(TIMER_SERVO), servo_interrupt_priority); +} + libServo::libServo() -: delay(servoDelay[servoCount++]) -{} +: delay(servoDelay[servoCount]), + was_attached_before_pause(false), + value_before_pause(0) +{ + servos[servoCount++] = this; +} int8_t libServo::attach(const int pin) { if (servoCount >= MAX_SERVOS) return -1; if (pin > 0) servo_pin = pin; - return super::attach(servo_pin); + auto result = stm32_servo.attach(servo_pin); + fixServoTimerInterruptPriority(); + return result; } int8_t libServo::attach(const int pin, const int min, const int max) { if (servoCount >= MAX_SERVOS) return -1; if (pin > 0) servo_pin = pin; - return super::attach(servo_pin, min, max); + auto result = stm32_servo.attach(servo_pin, min, max); + fixServoTimerInterruptPriority(); + return result; } void libServo::move(const int value) { if (attach(0) >= 0) { - write(value); + stm32_servo.write(value); safe_delay(delay); - #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - detach(); - #endif + TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach()); } } -#endif // HAS_SERVOS +void libServo::pause() { + was_attached_before_pause = stm32_servo.attached(); + if (was_attached_before_pause) { + value_before_pause = stm32_servo.read(); + stm32_servo.detach(); + } +} + +void libServo::resume() { + if (was_attached_before_pause) { + attach(); + move(value_before_pause); + } +} + +void libServo::pause_all_servos() { + for (auto& servo : servos) + if (servo) servo->pause(); +} + +void libServo::resume_all_servos() { + for (auto& servo : servos) + if (servo) servo->resume(); +} + +void libServo::setInterruptPriority(uint32_t preemptPriority, uint32_t subPriority) { + servo_interrupt_priority = NVIC_EncodePriority(NVIC_GetPriorityGrouping(), preemptPriority, subPriority); +} + +#endif // HAS_SERVOS #endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/Servo.h b/Marlin/src/HAL/STM32/Servo.h index e8b3c4b100..1527e753b6 100644 --- a/Marlin/src/HAL/STM32/Servo.h +++ b/Marlin/src/HAL/STM32/Servo.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -27,15 +27,28 @@ #include "../../core/millis_t.h" // Inherit and expand on the official library -class libServo : public Servo { +class libServo { public: libServo(); - int8_t attach(const int pin); + int8_t attach(const int pin = 0); // pin == 0 uses value from previous call int8_t attach(const int pin, const int min, const int max); + void detach() { stm32_servo.detach(); } + int read() { return stm32_servo.read(); } void move(const int value); + + void pause(); + void resume(); + + static void pause_all_servos(); + static void resume_all_servos(); + static void setInterruptPriority(uint32_t preemptPriority, uint32_t subPriority); + private: - typedef Servo super; + Servo stm32_servo; int servo_pin = 0; millis_t delay = 0; + + bool was_attached_before_pause; + int value_before_pause; }; diff --git a/Marlin/src/HAL/STM32/SoftwareSerial.cpp b/Marlin/src/HAL/STM32/SoftwareSerial.cpp index f6363aa1cf..af92548cbb 100644 --- a/Marlin/src/HAL/STM32/SoftwareSerial.cpp +++ b/Marlin/src/HAL/STM32/SoftwareSerial.cpp @@ -3,14 +3,14 @@ * * Multi-instance software serial library for Arduino/Wiring * -- Interrupt-driven receive and other improvements by ladyada - * (http://ladyada.net) + * (https://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) + * -- Pin change interrupt macros by Paul Stoffregen (https://www.pjrc.com) * -- 20MHz processor support by Garrett Mace (http://www.macetech.com) - * -- ATmega1280/2560 support by Brett Hagman (http://www.roguerobotics.com/) + * -- ATmega1280/2560 support by Brett Hagman (https://www.roguerobotics.com/) * -- STM32 support by Armin van der Togt * * This library is free software; you can redistribute it and/or @@ -36,8 +36,9 @@ // #if defined(PLATFORMIO) && defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) +#include "../../inc/MarlinConfig.h" + #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). @@ -47,49 +48,49 @@ // 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) +#if defined(TIM18_BASE) #define TIMER_SERIAL TIM18 -#elif defined (TIM7_BASE) +#elif defined(TIM7_BASE) #define TIMER_SERIAL TIM7 -#elif defined (TIM6_BASE) +#elif defined(TIM6_BASE) #define TIMER_SERIAL TIM6 -#elif defined (TIM22_BASE) +#elif defined(TIM22_BASE) #define TIMER_SERIAL TIM22 -#elif defined (TIM21_BASE) +#elif defined(TIM21_BASE) #define TIMER_SERIAL TIM21 -#elif defined (TIM17_BASE) +#elif defined(TIM17_BASE) #define TIMER_SERIAL TIM17 -#elif defined (TIM16_BASE) +#elif defined(TIM16_BASE) #define TIMER_SERIAL TIM16 -#elif defined (TIM15_BASE) +#elif defined(TIM15_BASE) #define TIMER_SERIAL TIM15 -#elif defined (TIM14_BASE) +#elif defined(TIM14_BASE) #define TIMER_SERIAL TIM14 -#elif defined (TIM13_BASE) +#elif defined(TIM13_BASE) #define TIMER_SERIAL TIM13 -#elif defined (TIM11_BASE) +#elif defined(TIM11_BASE) #define TIMER_SERIAL TIM11 -#elif defined (TIM10_BASE) +#elif defined(TIM10_BASE) #define TIMER_SERIAL TIM10 -#elif defined (TIM12_BASE) +#elif defined(TIM12_BASE) #define TIMER_SERIAL TIM12 -#elif defined (TIM19_BASE) +#elif defined(TIM19_BASE) #define TIMER_SERIAL TIM19 -#elif defined (TIM9_BASE) +#elif defined(TIM9_BASE) #define TIMER_SERIAL TIM9 -#elif defined (TIM5_BASE) +#elif defined(TIM5_BASE) #define TIMER_SERIAL TIM5 -#elif defined (TIM4_BASE) +#elif defined(TIM4_BASE) #define TIMER_SERIAL TIM4 -#elif defined (TIM3_BASE) +#elif defined(TIM3_BASE) #define TIMER_SERIAL TIM3 -#elif defined (TIM2_BASE) +#elif defined(TIM2_BASE) #define TIMER_SERIAL TIM2 -#elif defined (TIM20_BASE) +#elif defined(TIM20_BASE) #define TIMER_SERIAL TIM20 -#elif defined (TIM8_BASE) +#elif defined(TIM8_BASE) #define TIMER_SERIAL TIM8 -#elif defined (TIM1_BASE) +#elif defined(TIM1_BASE) #define TIMER_SERIAL TIM1 #else #error No suitable timer found for SoftwareSerial, define TIMER_SERIAL in variant.h diff --git a/Marlin/src/HAL/STM32/SoftwareSerial.h b/Marlin/src/HAL/STM32/SoftwareSerial.h index 504bd6979b..1a4f742c32 100644 --- a/Marlin/src/HAL/STM32/SoftwareSerial.h +++ b/Marlin/src/HAL/STM32/SoftwareSerial.h @@ -3,14 +3,14 @@ * * Multi-instance software serial library for Arduino/Wiring * -- Interrupt-driven receive and other improvements by ladyada - * (http://ladyada.net) + * (https://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) + * -- Pin change interrupt macros by Paul Stoffregen (https://www.pjrc.com) * -- 20MHz processor support by Garrett Mace (http://www.macetech.com) - * -- ATmega1280/2560 support by Brett Hagman (http://www.roguerobotics.com/) + * -- ATmega1280/2560 support by Brett Hagman (https://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 diff --git a/Marlin/src/HAL/STM32/eeprom_flash.cpp b/Marlin/src/HAL/STM32/eeprom_flash.cpp index 39012f8205..0933b9f4e8 100644 --- a/Marlin/src/HAL/STM32/eeprom_flash.cpp +++ b/Marlin/src/HAL/STM32/eeprom_flash.cpp @@ -17,22 +17,24 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) #include "../../inc/MarlinConfig.h" -#if BOTH(EEPROM_SETTINGS, FLASH_EEPROM_EMULATION) +#if ENABLED(FLASH_EEPROM_EMULATION) #include "../shared/eeprom_api.h" - -// Only STM32F4 can support wear leveling at this time -#ifndef STM32F4xx - #undef FLASH_EEPROM_LEVELING +#if HAS_SERVOS + #include "Servo.h" + #define PAUSE_SERVO_OUTPUT() libServo::pause_all_servos() + #define RESUME_SERVO_OUTPUT() libServo::resume_all_servos() +#else + #define PAUSE_SERVO_OUTPUT() + #define RESUME_SERVO_OUTPUT() #endif /** @@ -57,8 +59,8 @@ #define DEBUG_OUT ENABLED(EEPROM_CHITCHAT) #include "src/core/debug_out.h" - #ifndef EEPROM_SIZE - #define EEPROM_SIZE 0x1000 // 4kB + #ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB #endif #ifndef FLASH_SECTOR @@ -68,11 +70,11 @@ #define FLASH_UNIT_SIZE 0x20000 // 128kB #endif - #define FLASH_ADDRESS_START (FLASH_END - ((FLASH_SECTOR_TOTAL - FLASH_SECTOR) * FLASH_UNIT_SIZE) + 1) + #define FLASH_ADDRESS_START (FLASH_END - ((FLASH_SECTOR_TOTAL - (FLASH_SECTOR)) * (FLASH_UNIT_SIZE)) + 1) #define FLASH_ADDRESS_END (FLASH_ADDRESS_START + FLASH_UNIT_SIZE - 1) - #define EEPROM_SLOTS (FLASH_UNIT_SIZE/EEPROM_SIZE) - #define SLOT_ADDRESS(slot) (FLASH_ADDRESS_START + (slot * EEPROM_SIZE)) + #define EEPROM_SLOTS ((FLASH_UNIT_SIZE) / (MARLIN_EEPROM_SIZE)) + #define SLOT_ADDRESS(slot) (FLASH_ADDRESS_START + (slot * (MARLIN_EEPROM_SIZE))) #define UNLOCK_FLASH() if (!flash_unlocked) { \ HAL_FLASH_Unlock(); \ @@ -85,12 +87,12 @@ #define EMPTY_UINT32 ((uint32_t)-1) #define EMPTY_UINT8 ((uint8_t)-1) - static uint8_t ram_eeprom[EEPROM_SIZE] __attribute__((aligned(4))) = {0}; + static uint8_t ram_eeprom[MARLIN_EEPROM_SIZE] __attribute__((aligned(4))) = {0}; static int current_slot = -1; - static_assert(0 == EEPROM_SIZE % 4, "EEPROM_SIZE must be a multiple of 4"); // Ensure copying as uint32_t is safe - static_assert(0 == FLASH_UNIT_SIZE % EEPROM_SIZE, "EEPROM_SIZE must divide evenly into your FLASH_UNIT_SIZE"); - static_assert(FLASH_UNIT_SIZE >= EEPROM_SIZE, "FLASH_UNIT_SIZE must be greater than or equal to your EEPROM_SIZE"); + static_assert(0 == MARLIN_EEPROM_SIZE % 4, "MARLIN_EEPROM_SIZE must be a multiple of 4"); // Ensure copying as uint32_t is safe + static_assert(0 == FLASH_UNIT_SIZE % MARLIN_EEPROM_SIZE, "MARLIN_EEPROM_SIZE must divide evenly into your FLASH_UNIT_SIZE"); + static_assert(FLASH_UNIT_SIZE >= MARLIN_EEPROM_SIZE, "FLASH_UNIT_SIZE must be greater than or equal to your MARLIN_EEPROM_SIZE"); static_assert(IS_FLASH_SECTOR(FLASH_SECTOR), "FLASH_SECTOR is invalid"); static_assert(IS_POWER_OF_2(FLASH_UNIT_SIZE), "FLASH_UNIT_SIZE should be a power of 2, please check your chip's spec sheet"); @@ -98,6 +100,11 @@ static bool eeprom_data_written = false; +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE size_t(E2END + 1) +#endif +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } + bool PersistentStore::access_start() { #if ENABLED(FLASH_EEPROM_LEVELING) @@ -111,20 +118,20 @@ bool PersistentStore::access_start() { while (address <= FLASH_ADDRESS_END) { uint32_t address_value = (*(__IO uint32_t*)address); if (address_value != EMPTY_UINT32) { - current_slot = (address - FLASH_ADDRESS_START) / EEPROM_SIZE; + current_slot = (address - (FLASH_ADDRESS_START)) / (MARLIN_EEPROM_SIZE); break; } address += sizeof(uint32_t); } if (current_slot == -1) { // We didn't find anything, so we'll just intialize to empty - for (int i = 0; i < EEPROM_SIZE; i++) ram_eeprom[i] = EMPTY_UINT8; + for (int i = 0; i < MARLIN_EEPROM_SIZE; i++) ram_eeprom[i] = EMPTY_UINT8; current_slot = EEPROM_SLOTS; } else { // load current settings uint8_t *eeprom_data = (uint8_t *)SLOT_ADDRESS(current_slot); - for (int i = 0; i < EEPROM_SIZE; i++) ram_eeprom[i] = eeprom_data[i]; + for (int i = 0; i < MARLIN_EEPROM_SIZE; i++) ram_eeprom[i] = eeprom_data[i]; DEBUG_ECHOLNPAIR("EEPROM loaded from slot ", current_slot, "."); } eeprom_data_written = false; @@ -140,6 +147,11 @@ bool PersistentStore::access_start() { bool PersistentStore::access_finish() { if (eeprom_data_written) { + #ifdef STM32F4xx + // MCU may come up with flash error bits which prevent some flash operations. + // Clear flags prior to flash operations to prevent errors. + __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); + #endif #if ENABLED(FLASH_EEPROM_LEVELING) @@ -160,7 +172,11 @@ bool PersistentStore::access_finish() { current_slot = EEPROM_SLOTS - 1; UNLOCK_FLASH(); + PAUSE_SERVO_OUTPUT(); + DISABLE_ISRS(); status = HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError); + ENABLE_ISRS(); + RESUME_SERVO_OUTPUT(); if (status != HAL_OK) { DEBUG_ECHOLNPAIR("HAL_FLASHEx_Erase=", status); DEBUG_ECHOLNPAIR("GetError=", HAL_FLASH_GetError()); @@ -174,7 +190,7 @@ bool PersistentStore::access_finish() { uint32_t offset = 0; uint32_t address = SLOT_ADDRESS(current_slot); - uint32_t address_end = address + EEPROM_SIZE; + uint32_t address_end = address + MARLIN_EEPROM_SIZE; uint32_t data = 0; bool success = true; @@ -205,7 +221,18 @@ bool PersistentStore::access_finish() { return success; #else + // The following was written for the STM32F4 but may work with other MCUs as well. + // Most STM32F4 flash does not allow reading from flash during erase operations. + // This takes about a second on a STM32F407 with a 128kB sector used as EEPROM. + // Interrupts during this time can have unpredictable results, such as killing Servo + // output. Servo output still glitches with interrupts disabled, but recovers after the + // erase. + PAUSE_SERVO_OUTPUT(); + DISABLE_ISRS(); eeprom_buffer_flush(); + ENABLE_ISRS(); + RESUME_SERVO_OUTPUT(); + eeprom_data_written = false; #endif } @@ -236,13 +263,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { - const uint8_t c = ( - #if ENABLED(FLASH_EEPROM_LEVELING) - ram_eeprom[pos] - #else - eeprom_buffered_read_byte(pos) - #endif - ); + const uint8_t c = TERN(FLASH_EEPROM_LEVELING, ram_eeprom[pos], eeprom_buffered_read_byte(pos)); if (writing) *value = c; crc16(crc, &c, 1); pos++; @@ -251,15 +272,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t return false; } -size_t PersistentStore::capacity() { - return ( - #if ENABLED(FLASH_EEPROM_LEVELING) - EEPROM_SIZE - #else - E2END + 1 - #endif - ); -} - -#endif // EEPROM_SETTINGS && FLASH_EEPROM_EMULATION +#endif // FLASH_EEPROM_EMULATION #endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/eeprom_sdcard.cpp b/Marlin/src/HAL/STM32/eeprom_sdcard.cpp index 2b89c21b89..711a83ed5b 100644 --- a/Marlin/src/HAL/STM32/eeprom_sdcard.cpp +++ b/Marlin/src/HAL/STM32/eeprom_sdcard.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -31,53 +31,44 @@ #if ENABLED(SDCARD_EEPROM_EMULATION) #include "../shared/eeprom_api.h" +#include "../../sd/cardreader.h" -#ifndef E2END - #define E2END 0xFFF // 4KB +#define EEPROM_FILENAME "eeprom.dat" + +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB #endif -#define HAL_EEPROM_SIZE int(E2END + 1) +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } #define _ALIGN(x) __attribute__ ((aligned(x))) -static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE]; +static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE]; -#if ENABLED(SDSUPPORT) +bool PersistentStore::access_start() { + if (!card.isMounted()) return false; - #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(); + SdFile file, root = card.getroot(); + if (!file.open(&root, EEPROM_FILENAME, O_RDONLY)) return true; + + int bytes_read = file.read(HAL_eeprom_data, MARLIN_EEPROM_SIZE); + if (bytes_read < 0) return false; + for (; bytes_read < MARLIN_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, MARLIN_EEPROM_SIZE); + file.close(); } - - 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 + return (bytes_written == MARLIN_EEPROM_SIZE); +} bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { for (size_t i = 0; i < size; i++) @@ -97,7 +88,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin return false; } -size_t PersistentStore::capacity() { return HAL_EEPROM_SIZE; } - #endif // SDCARD_EEPROM_EMULATION #endif // STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/eeprom_impl.cpp b/Marlin/src/HAL/STM32/eeprom_sram.cpp similarity index 58% rename from Marlin/src/HAL/STM32/eeprom_impl.cpp rename to Marlin/src/HAL/STM32/eeprom_sram.cpp index cd0f93e8d8..5f6f26f9c6 100644 --- a/Marlin/src/HAL/STM32/eeprom_impl.cpp +++ b/Marlin/src/HAL/STM32/eeprom_sram.cpp @@ -17,44 +17,32 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) #include "../../inc/MarlinConfig.h" -#if EITHER(USE_WIRED_EEPROM, SRAM_EEPROM_EMULATION) +#if ENABLED(SRAM_EEPROM_EMULATION) +#include "../shared/eeprom_if.h" #include "../shared/eeprom_api.h" -bool PersistentStore::access_start() { - return true; -} +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } -bool PersistentStore::access_finish() { - return true; -} +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 v = *value; - // Save to either external EEPROM, program flash or Backup SRAM - #if USE_WIRED_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(STR_ERR_EEPROM_WRITE); - return true; - } - } - #else - *(__IO uint8_t *)(BKPSRAM_BASE + (uint8_t * const)pos) = v; - #endif + // Save to Backup SRAM + *(__IO uint8_t *)(BKPSRAM_BASE + (uint8_t * const)pos) = v; crc16(crc, &v, 1); pos++; @@ -67,14 +55,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui 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 USE_WIRED_EEPROM - eeprom_read_byte((uint8_t*)pos) - #else - (*(__IO uint8_t *)(BKPSRAM_BASE + ((uint8_t*)pos))) - #endif - ); - + const uint8_t c = ( *(__IO uint8_t *)(BKPSRAM_BASE + ((uint8_t*)pos)) ); if (writing) *value = c; crc16(crc, &c, 1); pos++; @@ -83,15 +64,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t return false; } -size_t PersistentStore::capacity() { - return ( - #if USE_WIRED_EEPROM - E2END + 1 - #else - 4096 // 4kB - #endif - ); -} - -#endif // USE_WIRED_EEPROM || SRAM_EEPROM_EMULATION +#endif // SRAM_EEPROM_EMULATION #endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/eeprom_wired.cpp b/Marlin/src/HAL/STM32/eeprom_wired.cpp new file mode 100644 index 0000000000..8c46e45f03 --- /dev/null +++ b/Marlin/src/HAL/STM32/eeprom_wired.cpp @@ -0,0 +1,81 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2020 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 USE_WIRED_EEPROM + +/** + * PersistentStore for Arduino-style EEPROM interface + * with simple implementations supplied by Marlin. + */ + +#include "../shared/eeprom_if.h" +#include "../shared/eeprom_api.h" + +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE size_t(E2END + 1) +#endif +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } + +bool PersistentStore::access_start() { eeprom_init(); 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 v = *value; + + // 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(STR_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 { + // Read from either external EEPROM, program flash or Backup SRAM + const uint8_t c = eeprom_read_byte((uint8_t*)pos); + if (writing) *value = c; + crc16(crc, &c, 1); + pos++; + value++; + } while (--size); + return false; +} + +#endif // USE_WIRED_EEPROM +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/endstop_interrupts.h b/Marlin/src/HAL/STM32/endstop_interrupts.h index 0b97c3c774..fdff8cc644 100644 --- a/Marlin/src/HAL/STM32/endstop_interrupts.h +++ b/Marlin/src/HAL/STM32/endstop_interrupts.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -28,43 +28,22 @@ 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_Z4_MAX - attachInterrupt(Z4_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z4_MIN - attachInterrupt(Z4_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MIN_PROBE_PIN - attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE); - #endif + #define _ATTACH(P) attachInterrupt(P, endstop_ISR, CHANGE) + TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN)); + TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN)); + TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN)); + TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN)); + TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN)); + TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN)); + TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN)); + TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN)); + TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN)); + TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN)); + TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN)); + TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN)); + TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN)); + TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN)); + TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN)); + TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN)); + TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN)); } diff --git a/Marlin/src/HAL/STM32/fastio.cpp b/Marlin/src/HAL/STM32/fastio.cpp index c51effaa04..0d55579d88 100644 --- a/Marlin/src/HAL/STM32/fastio.cpp +++ b/Marlin/src/HAL/STM32/fastio.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) diff --git a/Marlin/src/HAL/STM32/fastio.h b/Marlin/src/HAL/STM32/fastio.h index c17901fa99..d90b2fbeb0 100644 --- a/Marlin/src/HAL/STM32/fastio.h +++ b/Marlin/src/HAL/STM32/fastio.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -64,12 +64,14 @@ void FastIO_init(); // Must be called before using fast io macros #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 _SET_OUTPUT_OD(IO) pinMode(IO, OUTPUT_OPEN_DRAIN) #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 OUT_WRITE_OD(IO,V) do{ _SET_OUTPUT_OD(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 */ @@ -81,6 +83,7 @@ void FastIO_init(); // Must be called before using fast io macros #define IS_OUTPUT(IO) #define PWM_PIN(P) digitalPinHasPWM(P) +#define NO_COMPILE_TIME_PWM // digitalRead/Write wrappers #define extDigitalRead(IO) digitalRead(IO) diff --git a/Marlin/src/HAL/STM32/inc/Conditionals_LCD.h b/Marlin/src/HAL/STM32/inc/Conditionals_LCD.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/STM32/inc/Conditionals_LCD.h +++ b/Marlin/src/HAL/STM32/inc/Conditionals_LCD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32/inc/Conditionals_adv.h b/Marlin/src/HAL/STM32/inc/Conditionals_adv.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/STM32/inc/Conditionals_adv.h +++ b/Marlin/src/HAL/STM32/inc/Conditionals_adv.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32/inc/Conditionals_post.h b/Marlin/src/HAL/STM32/inc/Conditionals_post.h index 11603c9ef4..18826e11d2 100644 --- a/Marlin/src/HAL/STM32/inc/Conditionals_post.h +++ b/Marlin/src/HAL/STM32/inc/Conditionals_post.h @@ -16,12 +16,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once -// If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation -#if ENABLED(EEPROM_SETTINGS) && NONE(USE_WIRED_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION) +// If no real or emulated EEPROM selected, fall back to SD emulation +#if USE_FALLBACK_EEPROM #define SDCARD_EEPROM_EMULATION +#elif EITHER(I2C_EEPROM, SPI_EEPROM) + #define USE_SHARED_EEPROM 1 #endif diff --git a/Marlin/src/HAL/STM32/inc/SanityCheck.h b/Marlin/src/HAL/STM32/inc/SanityCheck.h index b1d0029ba9..37ca3d5a30 100644 --- a/Marlin/src/HAL/STM32/inc/SanityCheck.h +++ b/Marlin/src/HAL/STM32/inc/SanityCheck.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -28,10 +28,29 @@ // #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 + +#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT) + #undef SDCARD_EEPROM_EMULATION // Avoid additional error noise + #if USE_FALLBACK_EEPROM + #warning "EEPROM type not specified. Fallback is SDCARD_EEPROM_EMULATION." + #endif + #error "SDCARD_EEPROM_EMULATION requires SDSUPPORT. Enable SDSUPPORT or choose another EEPROM emulation." +#endif + +#if defined(STM32F4xx) && BOTH(PRINTCOUNTER, FLASH_EEPROM_EMULATION) + #warning "FLASH_EEPROM_EMULATION may cause long delays when writing and should not be used while printing." + #error "Disable PRINTCOUNTER or choose another EEPROM emulation." +#endif + +#if !defined(STM32F4xx) && ENABLED(FLASH_EEPROM_LEVELING) + #error "FLASH_EEPROM_LEVELING is currently only supported on STM32F4 hardware." +#endif + +#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) + #error "SERIAL_STATS_MAX_RX_QUEUED is not supported on this platform." +#elif ENABLED(SERIAL_STATS_DROPPED_RX) + #error "SERIAL_STATS_DROPPED_RX is not supported on this platform." +#endif diff --git a/Marlin/src/HAL/STM32/pinsDebug.h b/Marlin/src/HAL/STM32/pinsDebug.h index 8c5d1ec2b6..ec08e3fd75 100644 --- a/Marlin/src/HAL/STM32/pinsDebug.h +++ b/Marlin/src/HAL/STM32/pinsDebug.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32/pinsDebug_STM32GENERIC.h b/Marlin/src/HAL/STM32/pinsDebug_STM32GENERIC.h index e3d28aed07..5ff40debea 100644 --- a/Marlin/src/HAL/STM32/pinsDebug_STM32GENERIC.h +++ b/Marlin/src/HAL/STM32/pinsDebug_STM32GENERIC.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32/pinsDebug_STM32duino.h b/Marlin/src/HAL/STM32/pinsDebug_STM32duino.h index 58b8c32cc7..09f2bb54e6 100644 --- a/Marlin/src/HAL/STM32/pinsDebug_STM32duino.h +++ b/Marlin/src/HAL/STM32/pinsDebug_STM32duino.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32/pins_Xref.h b/Marlin/src/HAL/STM32/pins_Xref.h index 7e88ec76ba..890e561860 100644 --- a/Marlin/src/HAL/STM32/pins_Xref.h +++ b/Marlin/src/HAL/STM32/pins_Xref.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/STM32/spi_pins.h b/Marlin/src/HAL/STM32/spi_pins.h index 8f46ca12c5..176e2a7b20 100644 --- a/Marlin/src/HAL/STM32/spi_pins.h +++ b/Marlin/src/HAL/STM32/spi_pins.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32/timers.cpp b/Marlin/src/HAL/STM32/timers.cpp index b7b65f714e..1196731448 100644 --- a/Marlin/src/HAL/STM32/timers.cpp +++ b/Marlin/src/HAL/STM32/timers.cpp @@ -16,15 +16,12 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) -#include "HAL.h" - -#include "timers.h" +#include "../../inc/MarlinConfig.h" // ------------------------ // Local defines @@ -32,11 +29,82 @@ #define NUM_HARDWARE_TIMERS 2 +// Default timer priorities. Override by specifying alternate priorities in the board pins file. +// The TONE timer is not present here, as it currently cannot be set programmatically. It is set +// by defining TIM_IRQ_PRIO in the variant.h or platformio.ini file, which adjusts the default +// priority for STM32 HardwareTimer objects. +#define SWSERIAL_TIMER_IRQ_PRIO_DEFAULT 1 // Requires tight bit timing to communicate reliably with TMC drivers +#define SERVO_TIMER_IRQ_PRIO_DEFAULT 1 // Requires tight PWM timing to control a BLTouch reliably +#define STEP_TIMER_IRQ_PRIO_DEFAULT 2 +#define TEMP_TIMER_IRQ_PRIO_DEFAULT 14 // Low priority avoids interference with other hardware and timers + +#ifndef STEP_TIMER_IRQ_PRIO + #define STEP_TIMER_IRQ_PRIO STEP_TIMER_IRQ_PRIO_DEFAULT +#endif +#ifndef TEMP_TIMER_IRQ_PRIO + #define TEMP_TIMER_IRQ_PRIO TEMP_TIMER_IRQ_PRIO_DEFAULT +#endif +#if HAS_TMC_SW_SERIAL + #include + #ifndef SWSERIAL_TIMER_IRQ_PRIO + #define SWSERIAL_TIMER_IRQ_PRIO SWSERIAL_TIMER_IRQ_PRIO_DEFAULT + #endif +#endif +#if HAS_SERVOS + #include "Servo.h" + #ifndef SERVO_TIMER_IRQ_PRIO + #define SERVO_TIMER_IRQ_PRIO SERVO_TIMER_IRQ_PRIO_DEFAULT + #endif +#endif +#if ENABLED(SPEAKER) + // Ensure the default timer priority is somewhere between the STEP and TEMP priorities. + // The STM32 framework defaults to interrupt 14 for all timers. This should be increased so that + // timing-sensitive operations such as speaker output are not impacted by the long-running + // temperature ISR. This must be defined in the platformio.ini file or the board's variant.h, + // so that it will be consumed by framework code. + #if !(TIM_IRQ_PRIO > STEP_TIMER_IRQ_PRIO && TIM_IRQ_PRIO < TEMP_TIMER_IRQ_PRIO) + #error "Default timer interrupt priority is unspecified or set to a value which may degrade performance." + #endif +#endif + +#ifdef STM32F0xx + #define MCU_TIMER_RATE (F_CPU) // Frequency of timer peripherals + #define MCU_STEP_TIMER 16 + #define MCU_TEMP_TIMER 17 +#elif defined(STM32F1xx) + #define MCU_TIMER_RATE (F_CPU) + #define MCU_STEP_TIMER 4 + #define MCU_TEMP_TIMER 2 +#elif defined(STM32F401xC) || defined(STM32F401xE) + #define MCU_TIMER_RATE (F_CPU / 2) + #define MCU_STEP_TIMER 9 + #define MCU_TEMP_TIMER 10 +#elif defined(STM32F4xx) || defined(STM32F7xx) + #define MCU_TIMER_RATE (F_CPU / 2) + #define MCU_STEP_TIMER 6 // STM32F401 has no TIM6, TIM7, or TIM8 + #define MCU_TEMP_TIMER 14 // TIM7 is consumed by Software Serial if used. +#endif + +#ifndef HAL_TIMER_RATE + #define HAL_TIMER_RATE MCU_TIMER_RATE +#endif +#ifndef STEP_TIMER + #define STEP_TIMER MCU_STEP_TIMER +#endif +#ifndef TEMP_TIMER + #define TEMP_TIMER MCU_TEMP_TIMER +#endif + #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) +#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) + // ------------------------ // Private Variables // ------------------------ @@ -136,4 +204,9 @@ TIM_TypeDef * HAL_timer_device(const uint8_t timer_num) { return nullptr; } +void SetTimerInterruptPriorities() { + TERN_(HAS_TMC_SW_SERIAL, SoftwareSerial::setInterruptPriority(SWSERIAL_TIMER_IRQ_PRIO, 0)); + TERN_(HAS_SERVOS, libServo::setInterruptPriority(SERVO_TIMER_IRQ_PRIO, 0)); +} + #endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/timers.h b/Marlin/src/HAL/STM32/timers.h index 8a0950a4d7..000f86043b 100644 --- a/Marlin/src/HAL/STM32/timers.h +++ b/Marlin/src/HAL/STM32/timers.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -33,84 +33,16 @@ #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(STM32F401xC) || defined(STM32F401xE) - - #define HAL_TIMER_RATE (F_CPU / 2) // frequency of timer peripherals - - #ifndef STEP_TIMER - #define STEP_TIMER 9 - #endif - - #ifndef TEMP_TIMER - #define TEMP_TIMER 10 - #endif - -#elif defined(STM32F4xx) - - #define HAL_TIMER_RATE (F_CPU / 2) // frequency of timer peripherals - - #ifndef STEP_TIMER - #define STEP_TIMER 6 // STM32F401 has no TIM6, TIM7, or TIM8 - #endif - - #ifndef TEMP_TIMER - #define TEMP_TIMER 14 // TIM7 is consumed by Software Serial if used. - #endif - -#elif defined(STM32F7xx) - - #define HAL_TIMER_RATE (F_CPU / 2) // frequency of timer peripherals - - #ifndef STEP_TIMER - #define STEP_TIMER 6 // the RIGHT timer! - #endif - - #ifndef TEMP_TIMER - #define TEMP_TIMER 14 - #endif - +#ifndef STEP_TIMER_NUM + #define STEP_TIMER_NUM 0 // Timer Index for Stepper #endif - -#ifndef SWSERIAL_TIMER_IRQ_PRIO - #define SWSERIAL_TIMER_IRQ_PRIO 1 +#ifndef PULSE_TIMER_NUM + #define PULSE_TIMER_NUM STEP_TIMER_NUM #endif - -#ifndef STEP_TIMER_IRQ_PRIO - #define STEP_TIMER_IRQ_PRIO 2 +#ifndef TEMP_TIMER_NUM + #define TEMP_TIMER_NUM 1 // Timer Index for Temperature #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 @@ -122,12 +54,6 @@ #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) @@ -137,8 +63,13 @@ 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) + +#ifndef HAL_STEP_TIMER_ISR + #define HAL_STEP_TIMER_ISR() void Step_Handler(HardwareTimer *htim) +#endif +#ifndef HAL_TEMP_TIMER_ISR + #define HAL_TEMP_TIMER_ISR() void Temp_Handler(HardwareTimer *htim) +#endif // ------------------------ // Public Variables @@ -155,6 +86,10 @@ 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); +// Configure timer priorities for peripherals such as Software Serial or Servos. +// Exposed here to allow all timer priority information to reside in timers.cpp +void SetTimerInterruptPriorities(); + //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 diff --git a/Marlin/src/HAL/STM32/usb_serial.cpp b/Marlin/src/HAL/STM32/usb_serial.cpp new file mode 100644 index 0000000000..2dd1bef12c --- /dev/null +++ b/Marlin/src/HAL/STM32/usb_serial.cpp @@ -0,0 +1,55 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 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(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) + +#include "../../inc/MarlinConfigPre.h" + +#if ENABLED(EMERGENCY_PARSER) + +#include "usb_serial.h" +#include "../../feature/e_parser.h" + +EmergencyParser::State emergency_state = EmergencyParser::State::EP_RESET; + +int8_t (*USBD_CDC_Receive_original) (uint8_t *Buf, uint32_t *Len) = nullptr; + +static int8_t USBD_CDC_Receive_hook(uint8_t *Buf, uint32_t *Len) { + for (uint32_t i = 0; i < *Len; i++) + emergency_parser.update(emergency_state, Buf[i]); + return USBD_CDC_Receive_original(Buf, Len); +} + +typedef struct _USBD_CDC_Itf { + int8_t (* Init)(void); + int8_t (* DeInit)(void); + int8_t (* Control)(uint8_t cmd, uint8_t *pbuf, uint16_t length); + int8_t (* Receive)(uint8_t *Buf, uint32_t *Len); + int8_t (* Transferred)(void); +} USBD_CDC_ItfTypeDef; + +extern USBD_CDC_ItfTypeDef USBD_CDC_fops; + +void USB_Hook_init() { + USBD_CDC_Receive_original = USBD_CDC_fops.Receive; + USBD_CDC_fops.Receive = USBD_CDC_Receive_hook; +} + +#endif // EMERGENCY_PARSER +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/usb_serial.h b/Marlin/src/HAL/STM32/usb_serial.h new file mode 100644 index 0000000000..ca61b9ed23 --- /dev/null +++ b/Marlin/src/HAL/STM32/usb_serial.h @@ -0,0 +1,21 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 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 + +void USB_Hook_init(); diff --git a/Marlin/src/HAL/STM32/watchdog.cpp b/Marlin/src/HAL/STM32/watchdog.cpp index 2c6b583e83..37e5638b05 100644 --- a/Marlin/src/HAL/STM32/watchdog.cpp +++ b/Marlin/src/HAL/STM32/watchdog.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) #include "../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/HAL/STM32/watchdog.h b/Marlin/src/HAL/STM32/watchdog.h index efa7d2b3d0..49a0d9c631 100644 --- a/Marlin/src/HAL/STM32/watchdog.h +++ b/Marlin/src/HAL/STM32/watchdog.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32F1/HAL.cpp b/Marlin/src/HAL/STM32F1/HAL.cpp index 01fd2c8fc3..d7f9264be6 100644 --- a/Marlin/src/HAL/STM32F1/HAL.cpp +++ b/Marlin/src/HAL/STM32F1/HAL.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -100,7 +100,7 @@ const uint8_t adc_pins[] = { #if HAS_HEATED_BED TEMP_BED_PIN, #endif - #if HAS_HEATED_CHAMBER + #if HAS_TEMP_CHAMBER TEMP_CHAMBER_PIN, #endif #if HAS_TEMP_ADC_1 @@ -139,16 +139,22 @@ const uint8_t adc_pins[] = { #if HAS_JOY_ADC_Z JOY_Z_PIN, #endif + #if ENABLED(POWER_MONITOR_CURRENT) + POWER_MONITOR_CURRENT_PIN, + #endif + #if ENABLED(POWER_MONITOR_VOLTAGE) + POWER_MONITOR_VOLTAGE_PIN, + #endif }; -enum TEMP_PINS : char { +enum TempPinIndex : char { #if HAS_TEMP_ADC_0 TEMP_0, #endif #if HAS_HEATED_BED TEMP_BED, #endif - #if HAS_HEATED_CHAMBER + #if HAS_TEMP_CHAMBER TEMP_CHAMBER, #endif #if HAS_TEMP_ADC_1 @@ -187,6 +193,12 @@ enum TEMP_PINS : char { #if HAS_JOY_ADC_Z JOY_Z, #endif + #if ENABLED(POWER_MONITOR_CURRENT) + POWERMON_CURRENT, + #endif + #if ENABLED(POWER_MONITOR_VOLTAGE) + POWERMON_VOLTS, + #endif ADC_PIN_COUNT }; @@ -246,7 +258,7 @@ void HAL_init() { // HAL idle task void HAL_idletask() { #ifdef USE_USB_COMPOSITE - #if ENABLED(SHARED_SD_CARD) + #if HAS_SHARED_MEDIA // 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 @@ -254,7 +266,7 @@ void HAL_idletask() { // 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*/ + /* copy from lpc1768 framework, should be fixed later for process HAS_SHARED_MEDIA*/ #endif // process USB mass storage device class loop MarlinMSC.loop(); @@ -265,9 +277,8 @@ 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; } +uint8_t HAL_get_reset_source() { return RST_POWER_ON; } void _delay_ms(const int delay_ms) { delay(delay_ms); } @@ -323,7 +334,8 @@ void HAL_adc_init() { } void HAL_adc_start_conversion(const uint8_t adc_pin) { - TEMP_PINS pin_index; + //TEMP_PINS pin_index; + TempPinIndex pin_index; switch (adc_pin) { default: return; #if HAS_TEMP_ADC_0 @@ -332,7 +344,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { #if HAS_HEATED_BED case TEMP_BED_PIN: pin_index = TEMP_BED; break; #endif - #if HAS_HEATED_CHAMBER + #if HAS_TEMP_CHAMBER case TEMP_CHAMBER_PIN: pin_index = TEMP_CHAMBER; break; #endif #if HAS_TEMP_ADC_1 @@ -371,6 +383,12 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { #if ENABLED(ADC_KEYPAD) case ADC_KEYPAD_PIN: pin_index = ADC_KEY; break; #endif + #if ENABLED(POWER_MONITOR_CURRENT) + case POWER_MONITOR_CURRENT_PIN: pin_index = POWERMON_CURRENT; break; + #endif + #if ENABLED(POWER_MONITOR_VOLTAGE) + case POWER_MONITOR_VOLTAGE_PIN: pin_index = POWERMON_VOLTS; break; + #endif } HAL_adc_result = (HAL_adc_results[(int)pin_index] >> 2) & 0x3FF; // shift to get 10 bits only. } diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index ff42beb92a..5a0b046009 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -36,7 +36,6 @@ #include "fastio.h" #include "watchdog.h" -#include "timers.h" #include #include @@ -52,7 +51,7 @@ // ------------------------ #ifndef STM32_FLASH_SIZE - #ifdef MCU_STM32F103RE + #if defined(MCU_STM32F103RE) || defined(MCU_STM32F103VE) #define STM32_FLASH_SIZE 512 #else #define STM32_FLASH_SIZE 256 @@ -248,19 +247,6 @@ static int freeMemory() { #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 // @@ -269,8 +255,9 @@ void eeprom_update_block(const void *__src, void *__dst, size_t __n); void HAL_adc_init(); -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) +#define HAL_ADC_VREF 3.3 #define HAL_ADC_RESOLUTION 10 +#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) #define HAL_READ_ADC() HAL_adc_result #define HAL_ADC_READY() true diff --git a/Marlin/src/HAL/STM32F1/HAL_SPI.cpp b/Marlin/src/HAL/STM32F1/HAL_SPI.cpp index bfbdf6af40..4d72473e7f 100644 --- a/Marlin/src/HAL/STM32F1/HAL_SPI.cpp +++ b/Marlin/src/HAL/STM32F1/HAL_SPI.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/STM32F1/SPI.cpp b/Marlin/src/HAL/STM32F1/SPI.cpp index 1cd064c359..80095ba1dc 100644 --- a/Marlin/src/HAL/STM32F1/SPI.cpp +++ b/Marlin/src/HAL/STM32F1/SPI.cpp @@ -243,7 +243,7 @@ void SPIClass::setDataMode(uint8_t dataMode) { _currentSetting->spi_d->regs->CR1 = cr1 | (dataMode & (SPI_CR1_CPOL|SPI_CR1_CPHA)); } -void SPIClass::beginTransaction(uint8_t pin, SPISettings settings) { +void SPIClass::beginTransaction(uint8_t pin, const SPISettings &settings) { setBitOrder(settings.bitOrder); setDataMode(settings.dataMode); setDataSize(settings.dataSize); @@ -251,7 +251,7 @@ void SPIClass::beginTransaction(uint8_t pin, SPISettings settings) { begin(); } -void SPIClass::beginTransactionSlave(SPISettings settings) { +void SPIClass::beginTransactionSlave(const SPISettings &settings) { setBitOrder(settings.bitOrder); setDataMode(settings.dataMode); setDataSize(settings.dataSize); @@ -266,7 +266,7 @@ void SPIClass::endTransaction() { } uint16_t SPIClass::read() { while (!spi_is_rx_nonempty(_currentSetting->spi_d)) { /* nada */ } - return (uint16)spi_rx_reg(_currentSetting->spi_d); + return (uint16_t)spi_rx_reg(_currentSetting->spi_d); } void SPIClass::read(uint8_t *buf, uint32_t len) { diff --git a/Marlin/src/HAL/STM32F1/SPI.h b/Marlin/src/HAL/STM32F1/SPI.h index 0162ac13bb..dc2a215865 100644 --- a/Marlin/src/HAL/STM32F1/SPI.h +++ b/Marlin/src/HAL/STM32F1/SPI.h @@ -126,6 +126,7 @@ private: bitOrder = inBitOrder; dataMode = inDataMode; dataSize = inDataSize; + //state = SPI_STATE_IDLE; } uint32_t clock; uint32_t dataSize; @@ -187,11 +188,11 @@ public: */ void end(); - void beginTransaction(SPISettings settings) { beginTransaction(BOARD_SPI_DEFAULT_SS, settings); } - void beginTransaction(uint8_t pin, SPISettings settings); + void beginTransaction(const SPISettings &settings) { beginTransaction(BOARD_SPI_DEFAULT_SS, settings); } + void beginTransaction(uint8_t pin, const SPISettings &settings); void endTransaction(); - void beginTransactionSlave(SPISettings settings); + void beginTransactionSlave(const SPISettings &settings); void setClockDivider(uint32_t clockDivider); void setBitOrder(BitOrder bitOrder); diff --git a/Marlin/src/HAL/STM32F1/Servo.cpp b/Marlin/src/HAL/STM32F1/Servo.cpp index 06abb2c2b9..e1ee831493 100644 --- a/Marlin/src/HAL/STM32F1/Servo.cpp +++ b/Marlin/src/HAL/STM32F1/Servo.cpp @@ -17,10 +17,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __STM32F1__ #include "../../inc/MarlinConfig.h" @@ -30,7 +29,6 @@ uint8_t ServoCount = 0; #include "Servo.h" -#include "timers.h" //#include "Servo.h" @@ -76,6 +74,7 @@ void libServo::servoWrite(uint8_t inPin, uint16_t duty_cycle) { libServo::libServo() { servoIndex = ServoCount < MAX_SERVOS ? ServoCount++ : INVALID_SERVO; + timer_set_interrupt_priority(SERVO0_TIMER_NUM, SERVO0_TIMER_IRQ_PRIO); } bool libServo::attach(const int32_t inPin, const int32_t inMinAngle, const int32_t inMaxAngle) { @@ -138,9 +137,7 @@ void libServo::move(const int32_t value) { 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 + TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach()); } } diff --git a/Marlin/src/HAL/STM32F1/Servo.h b/Marlin/src/HAL/STM32F1/Servo.h index b3ca09f238..b6143de81d 100644 --- a/Marlin/src/HAL/STM32F1/Servo.h +++ b/Marlin/src/HAL/STM32F1/Servo.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32F1/SoftwareSerial.cpp b/Marlin/src/HAL/STM32F1/SoftwareSerial.cpp index e9e4a162a5..3641c9fdf0 100644 --- a/Marlin/src/HAL/STM32F1/SoftwareSerial.cpp +++ b/Marlin/src/HAL/STM32F1/SoftwareSerial.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #if defined(__STM32F1__) && !defined(HAVE_SW_SERIAL) diff --git a/Marlin/src/HAL/STM32F1/SoftwareSerial.h b/Marlin/src/HAL/STM32F1/SoftwareSerial.h index 1899a2ae0b..1c8058665a 100644 --- a/Marlin/src/HAL/STM32F1/SoftwareSerial.h +++ b/Marlin/src/HAL/STM32F1/SoftwareSerial.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp b/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp index cc26a003d1..0f3887d29a 100644 --- a/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp +++ b/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -291,7 +291,7 @@ uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize) { return uint32_t(data); } -#if ENABLED(LCD_USE_DMA_FSMC) +#ifdef LCD_USE_DMA_FSMC void LCD_IO_WriteMultiple(uint16_t color, uint32_t count) { while (count > 0) { diff --git a/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp b/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp index 2e9d11f97e..894abb882a 100644 --- a/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp +++ b/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp @@ -13,14 +13,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #ifdef __STM32F1__ #include "../../../inc/MarlinConfig.h" -#if HAS_GRAPHICAL_LCD && ENABLED(FORCE_SOFT_SPI) +#if BOTH(HAS_GRAPHICAL_LCD, FORCE_SOFT_SPI) #include "../HAL.h" #include diff --git a/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp b/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp new file mode 100644 index 0000000000..f77306a88a --- /dev/null +++ b/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp @@ -0,0 +1,81 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * PersistentStore for Arduino-style EEPROM interface + * with simple implementations supplied by Marlin. + */ + +#include "../../inc/MarlinConfig.h" + +#if ENABLED(IIC_BL24CXX_EEPROM) + +#include "../shared/eeprom_if.h" +#include "../shared/eeprom_api.h" + +// +// PersistentStore +// + +#ifndef MARLIN_EEPROM_SIZE + #error "MARLIN_EEPROM_SIZE is required for IIC_BL24CXX_EEPROM." +#endif + +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } + +bool PersistentStore::access_start() { eeprom_init(); 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 v = *value; + uint8_t * const p = (uint8_t * const)pos; + // 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(STR_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 * const p = (uint8_t * const)pos; + uint8_t c = eeprom_read_byte(p); + if (writing) *value = c; + crc16(crc, &c, 1); + pos++; + value++; + } while (--size); + return false; +} + +#endif // IIC_BL24CXX_EEPROM diff --git a/Marlin/src/HAL/STM32F1/eeprom_flash.cpp b/Marlin/src/HAL/STM32F1/eeprom_flash.cpp index 9c81730465..8db8c8638b 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_flash.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_flash.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -39,18 +39,20 @@ #include // Store settings in the last two pages -#define EEPROM_SIZE (EEPROM_PAGE_SIZE * 2) -#define ACCESS_FINISHED(TF) do{ FLASH_Lock(); eeprom_dirty = false; return TF; }while(0) +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE ((EEPROM_PAGE_SIZE) * 2) +#endif +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } -static uint8_t ram_eeprom[EEPROM_SIZE] __attribute__((aligned(4))) = {0}; +static uint8_t ram_eeprom[MARLIN_EEPROM_SIZE] __attribute__((aligned(4))) = {0}; static bool eeprom_dirty = false; bool PersistentStore::access_start() { const uint32_t* source = reinterpret_cast(EEPROM_PAGE0_BASE); uint32_t* destination = reinterpret_cast(ram_eeprom); - static_assert(0 == EEPROM_SIZE % 4, "EEPROM_SIZE is corrupted. (Must be a multiple of 4.)"); // Ensure copying as uint32_t is safe - constexpr size_t eeprom_size_u32 = EEPROM_SIZE / 4; + static_assert(0 == (MARLIN_EEPROM_SIZE) % 4, "MARLIN_EEPROM_SIZE is corrupted. (Must be a multiple of 4.)"); // Ensure copying as uint32_t is safe + constexpr size_t eeprom_size_u32 = (MARLIN_EEPROM_SIZE) / 4; for (size_t i = 0; i < eeprom_size_u32; ++i, ++destination, ++source) *destination = *source; @@ -72,13 +74,15 @@ bool PersistentStore::access_finish() { // page changes...either way, something to look at later. FLASH_Unlock(); + #define ACCESS_FINISHED(TF) { FLASH_Lock(); eeprom_dirty = false; return TF; } + status = FLASH_ErasePage(EEPROM_PAGE0_BASE); if (status != FLASH_COMPLETE) ACCESS_FINISHED(true); status = FLASH_ErasePage(EEPROM_PAGE1_BASE); if (status != FLASH_COMPLETE) ACCESS_FINISHED(true); const uint16_t *source = reinterpret_cast(ram_eeprom); - for (size_t i = 0; i < EEPROM_SIZE; i += 2, ++source) { + for (size_t i = 0; i < MARLIN_EEPROM_SIZE; i += 2, ++source) { if (FLASH_ProgramHalfWord(EEPROM_PAGE0_BASE + i, *source) != FLASH_COMPLETE) ACCESS_FINISHED(false); } @@ -105,7 +109,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin return false; // return true for any error } -size_t PersistentStore::capacity() { return EEPROM_SIZE; } - #endif // FLASH_EEPROM_EMULATION #endif // __STM32F1__ diff --git a/Marlin/src/HAL/STM32F1/eeprom_if_iic.cpp b/Marlin/src/HAL/STM32F1/eeprom_if_iic.cpp new file mode 100644 index 0000000000..33dd277add --- /dev/null +++ b/Marlin/src/HAL/STM32F1/eeprom_if_iic.cpp @@ -0,0 +1,51 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Platform-independent Arduino functions for I2C EEPROM. + * Enable USE_SHARED_EEPROM if not supplied by the framework. + */ + +#include "../../inc/MarlinConfig.h" + +#if ENABLED(IIC_BL24CXX_EEPROM) + +#include "../../libs/BL24CXX.h" +#include "../shared/eeprom_if.h" + +void eeprom_init() { BL24CXX::init(); } + +// ------------------------ +// Public functions +// ------------------------ + +void eeprom_write_byte(uint8_t *pos, unsigned char value) { + const unsigned eeprom_address = (unsigned)pos; + return BL24CXX::writeOneByte(eeprom_address, value); +} + +uint8_t eeprom_read_byte(uint8_t *pos) { + const unsigned eeprom_address = (unsigned)pos; + return BL24CXX::readOneByte(eeprom_address); +} + +#endif // IIC_BL24CXX_EEPROM diff --git a/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp b/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp index 7894e69787..11959191f6 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -32,53 +32,44 @@ #if ENABLED(SDCARD_EEPROM_EMULATION) #include "../shared/eeprom_api.h" +#include "../../sd/cardreader.h" -#ifndef E2END - #define E2END 0xFFF // 4KB +#define EEPROM_FILENAME "eeprom.dat" + +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB #endif -#define HAL_EEPROM_SIZE (E2END + 1) +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } #define _ALIGN(x) __attribute__ ((aligned(x))) // SDIO uint32_t* compat. -static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE]; +static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE]; -#if ENABLED(SDSUPPORT) +bool PersistentStore::access_start() { + if (!card.isMounted()) return false; - #include "../../sd/cardreader.h" + SdFile file, root = card.getroot(); + if (!file.open(&root, EEPROM_FILENAME, O_RDONLY)) + return true; // false aborts the save - #define EEPROM_FILENAME "eeprom.dat" + int bytes_read = file.read(HAL_eeprom_data, MARLIN_EEPROM_SIZE); + if (bytes_read < 0) return false; + for (; bytes_read < MARLIN_EEPROM_SIZE; bytes_read++) + HAL_eeprom_data[bytes_read] = 0xFF; + file.close(); + return true; +} - bool PersistentStore::access_start() { - if (!card.isMounted()) return false; +bool PersistentStore::access_finish() { + 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; + 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, MARLIN_EEPROM_SIZE); 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 + return (bytes_written == MARLIN_EEPROM_SIZE); +} bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { for (size_t i = 0; i < size; i++) @@ -98,7 +89,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin return false; } -size_t PersistentStore::capacity() { return HAL_EEPROM_SIZE; } - #endif // SDCARD_EEPROM_EMULATION #endif // __STM32F1__ diff --git a/Marlin/src/HAL/STM32F1/eeprom.cpp b/Marlin/src/HAL/STM32F1/eeprom_wired.cpp similarity index 83% rename from Marlin/src/HAL/STM32F1/eeprom.cpp rename to Marlin/src/HAL/STM32F1/eeprom_wired.cpp index ed5d50cbde..b4699d00dc 100644 --- a/Marlin/src/HAL/STM32F1/eeprom.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_wired.cpp @@ -14,19 +14,32 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __STM32F1__ #include "../../inc/MarlinConfig.h" #if USE_WIRED_EEPROM +/** + * PersistentStore for Arduino-style EEPROM interface + * with simple implementations supplied by Marlin. + */ + +#include "../shared/eeprom_if.h" #include "../shared/eeprom_api.h" +#ifndef MARLIN_EEPROM_SIZE + #error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM." +#endif +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } + +bool PersistentStore::access_finish() { return true; } + bool PersistentStore::access_start() { + eeprom_init(); #if ENABLED(SPI_EEPROM) #if SPI_CHAN_EEPROM1 == 1 SET_OUTPUT(BOARD_SPI1_SCK_PIN); @@ -38,7 +51,6 @@ bool PersistentStore::access_start() { #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--) { @@ -56,7 +68,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui crc16(crc, &v, 1); pos++; value++; - }; + } return false; } @@ -71,7 +83,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t return false; } -size_t PersistentStore::capacity() { return E2END + 1; } - #endif // USE_WIRED_EEPROM #endif // __STM32F1__ diff --git a/Marlin/src/HAL/STM32F1/endstop_interrupts.h b/Marlin/src/HAL/STM32F1/endstop_interrupts.h index 246e292983..bcb07d991d 100644 --- a/Marlin/src/HAL/STM32F1/endstop_interrupts.h +++ b/Marlin/src/HAL/STM32F1/endstop_interrupts.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -53,43 +53,22 @@ 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_Z4_MAX - attachInterrupt(Z4_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z4_MIN - attachInterrupt(Z4_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MIN_PROBE_PIN - attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE); - #endif + #define _ATTACH(P) attachInterrupt(P, endstop_ISR, CHANGE) + TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN)); + TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN)); + TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN)); + TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN)); + TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN)); + TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN)); + TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN)); + TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN)); + TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN)); + TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN)); + TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN)); + TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN)); + TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN)); + TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN)); + TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN)); + TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN)); + TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN)); } diff --git a/Marlin/src/HAL/STM32F1/fastio.h b/Marlin/src/HAL/STM32F1/fastio.h index 9bf78d4254..e0e2e03a1c 100644 --- a/Marlin/src/HAL/STM32F1/fastio.h +++ b/Marlin/src/HAL/STM32F1/fastio.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h b/Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h index 0285c52ee3..f52e6fec2b 100644 --- a/Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h +++ b/Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h @@ -16,7 +16,12 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once + +#if ENABLED(USE_USB_COMPOSITE) + //#warning "SD_CHECK_AND_RETRY isn't needed with USE_USB_COMPOSITE." + #undef SD_CHECK_AND_RETRY +#endif diff --git a/Marlin/src/HAL/STM32F1/inc/Conditionals_adv.h b/Marlin/src/HAL/STM32F1/inc/Conditionals_adv.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/STM32F1/inc/Conditionals_adv.h +++ b/Marlin/src/HAL/STM32F1/inc/Conditionals_adv.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32F1/inc/Conditionals_post.h b/Marlin/src/HAL/STM32F1/inc/Conditionals_post.h index 0285c52ee3..656fbe1ce2 100644 --- a/Marlin/src/HAL/STM32F1/inc/Conditionals_post.h +++ b/Marlin/src/HAL/STM32F1/inc/Conditionals_post.h @@ -16,7 +16,19 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once + +// If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation +#if USE_FALLBACK_EEPROM + #define SDCARD_EEPROM_EMULATION +#elif EITHER(I2C_EEPROM, SPI_EEPROM) + #define USE_SHARED_EEPROM 1 +#endif + +// Allow SDSUPPORT to be disabled +#if DISABLED(SDSUPPORT) + #undef SDIO_SUPPORT +#endif diff --git a/Marlin/src/HAL/STM32F1/inc/SanityCheck.h b/Marlin/src/HAL/STM32F1/inc/SanityCheck.h index b8ebc446d6..5559b3d4a4 100644 --- a/Marlin/src/HAL/STM32F1/inc/SanityCheck.h +++ b/Marlin/src/HAL/STM32F1/inc/SanityCheck.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -29,10 +29,6 @@ #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 @@ -41,3 +37,17 @@ #warning "With TMC2208/9 consider using SoftwareSerialM with HAVE_SW_SERIAL and appropriate SS_TIMER." #error "Missing SoftwareSerial implementation." #endif + +#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT) + #undef SDCARD_EEPROM_EMULATION // Avoid additional error noise + #if USE_FALLBACK_EEPROM + #warning "EEPROM type not specified. Fallback is SDCARD_EEPROM_EMULATION." + #endif + #error "SDCARD_EEPROM_EMULATION requires SDSUPPORT. Enable SDSUPPORT or choose another EEPROM emulation." +#endif + +#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) + #error "SERIAL_STATS_MAX_RX_QUEUED is not supported on this platform." +#elif ENABLED(SERIAL_STATS_DROPPED_RX) + #error "SERIAL_STATS_DROPPED_RX is not supported on this platform." +#endif diff --git a/Marlin/src/HAL/STM32F1/msc_sd.cpp b/Marlin/src/HAL/STM32F1/msc_sd.cpp index a086b82bc3..ab5530174e 100644 --- a/Marlin/src/HAL/STM32F1/msc_sd.cpp +++ b/Marlin/src/HAL/STM32F1/msc_sd.cpp @@ -10,7 +10,7 @@ * (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 . + * along with this program. If not, see . * */ #ifdef USE_USB_COMPOSITE @@ -25,7 +25,7 @@ USBCompositeSerial MarlinCompositeSerial; #include "../../inc/MarlinConfig.h" -#ifdef HAS_ONBOARD_SD +#if SD_CONNECTION_IS(ONBOARD) #include "onboard_sd.h" @@ -47,7 +47,7 @@ void MSC_SD_init() { USBComposite.end(); USBComposite.clear(); // Set api and register mass storage - #ifdef HAS_ONBOARD_SD + #if SD_CONNECTION_IS(ONBOARD) uint32_t cardSize; if (disk_initialize(0) == RES_OK) { if (disk_ioctl(0, GET_SECTOR_COUNT, (void *)(&cardSize)) == RES_OK) { diff --git a/Marlin/src/HAL/STM32F1/msc_sd.h b/Marlin/src/HAL/STM32F1/msc_sd.h index 125ba36466..8715888f47 100644 --- a/Marlin/src/HAL/STM32F1/msc_sd.h +++ b/Marlin/src/HAL/STM32F1/msc_sd.h @@ -10,7 +10,7 @@ * (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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32F1/onboard_sd.cpp b/Marlin/src/HAL/STM32F1/onboard_sd.cpp index 0fd94a9199..099e2a0686 100644 --- a/Marlin/src/HAL/STM32F1/onboard_sd.cpp +++ b/Marlin/src/HAL/STM32F1/onboard_sd.cpp @@ -14,13 +14,13 @@ #include "../../inc/MarlinConfig.h" -#ifdef HAS_ONBOARD_SD +#if SD_CONNECTION_IS(ONBOARD) #include "onboard_sd.h" #include "SPI.h" #include "fastio.h" -#ifdef SHARED_SD_CARD +#if HAS_SHARED_MEDIA #ifndef ON_BOARD_SPI_DEVICE #define ON_BOARD_SPI_DEVICE SPI_DEVICE #endif @@ -553,4 +553,4 @@ DRESULT disk_read ( #endif // _DISKIO_IOCTL -#endif // HAS_ONBOARD_SD +#endif // SD_CONNECTION_IS(ONBOARD) diff --git a/Marlin/src/HAL/STM32F1/pinsDebug.h b/Marlin/src/HAL/STM32F1/pinsDebug.h index 913cb62afc..2d63ebd770 100644 --- a/Marlin/src/HAL/STM32F1/pinsDebug.h +++ b/Marlin/src/HAL/STM32F1/pinsDebug.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32F1/sdio.cpp b/Marlin/src/HAL/STM32F1/sdio.cpp index da6beda85c..0e8a745810 100644 --- a/Marlin/src/HAL/STM32F1/sdio.cpp +++ b/Marlin/src/HAL/STM32F1/sdio.cpp @@ -17,10 +17,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef ARDUINO_ARCH_STM32F1 #include @@ -102,7 +101,23 @@ bool SDIO_ReadBlock_DMA(uint32_t blockAddress, uint8_t *data) { return false; } - while (!SDIO_GET_FLAG(SDIO_STA_DATAEND | SDIO_STA_TRX_ERROR_FLAGS)) {} + while (!SDIO_GET_FLAG(SDIO_STA_DATAEND | SDIO_STA_TRX_ERROR_FLAGS)) { /* wait */ } + + //If there were SDIO errors, do not wait DMA. + if (SDIO->STA & SDIO_STA_TRX_ERROR_FLAGS) { + SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS); + dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL); + return false; + } + + //Wait for DMA transaction to complete + while ((DMA2_BASE->ISR & (DMA_ISR_TEIF4|DMA_ISR_TCIF4)) == 0 ) { /* wait */ } + + if (DMA2_BASE->ISR & DMA_ISR_TEIF4) { + dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL); + SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS); + return false; + } dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL); @@ -121,7 +136,7 @@ bool SDIO_ReadBlock_DMA(uint32_t blockAddress, uint8_t *data) { } bool SDIO_ReadBlock(uint32_t blockAddress, uint8_t *data) { - uint32_t retries = 3; + uint32_t retries = SDIO_READ_RETRIES; while (retries--) if (SDIO_ReadBlock_DMA(blockAddress, data)) return true; return false; } @@ -147,7 +162,7 @@ bool SDIO_WriteBlock(uint32_t blockAddress, const uint8_t *data) { 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)) {} + while (!SDIO_GET_FLAG(SDIO_STA_DATAEND | SDIO_STA_TRX_ERROR_FLAGS)) { /* wait */ } dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL); diff --git a/Marlin/src/HAL/STM32F1/sdio.h b/Marlin/src/HAL/STM32F1/sdio.h index f51ba6d0a6..8777299f01 100644 --- a/Marlin/src/HAL/STM32F1/sdio.h +++ b/Marlin/src/HAL/STM32F1/sdio.h @@ -16,12 +16,12 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once -#include "../shared/Marduino.h" +#include "../../inc/MarlinConfig.h" // Allow pins/pins.h to override SDIO clock / retries #include #include @@ -100,7 +100,13 @@ #define SDIO_DATA_TIMEOUT 100U /* Read data transfer timeout */ #define SDIO_WRITE_TIMEOUT 200U /* Write data transfer timeout */ -#define SDIO_CLOCK 18000000 /* 18 MHz */ +#ifndef SDIO_CLOCK + #define SDIO_CLOCK 18000000 /* 18 MHz */ +#endif + +#ifndef SDIO_READ_RETRIES + #define SDIO_READ_RETRIES 3 +#endif // ------------------------ // Types diff --git a/Marlin/src/HAL/STM32F1/spi_pins.h b/Marlin/src/HAL/STM32F1/spi_pins.h index e8e4cbba11..8f2b324f64 100644 --- a/Marlin/src/HAL/STM32F1/spi_pins.h +++ b/Marlin/src/HAL/STM32F1/spi_pins.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32F1/timers.cpp b/Marlin/src/HAL/STM32F1/timers.cpp index 720bd37ba4..8c2df1e216 100644 --- a/Marlin/src/HAL/STM32F1/timers.cpp +++ b/Marlin/src/HAL/STM32F1/timers.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -27,8 +27,6 @@ #ifdef __STM32F1__ #include "../../inc/MarlinConfig.h" -#include "HAL.h" -#include "timers.h" // ------------------------ // Local defines @@ -49,7 +47,10 @@ * 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) { + + + +void timer_set_interrupt_priority(uint_fast8_t timer_num, uint_fast8_t priority) { nvic_irq_num irq_num; switch (timer_num) { case 1: irq_num = NVIC_TIMER1_CC; break; @@ -66,9 +67,14 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { * This should never happen. Add a Sanitycheck for timer number. * Should be a general timer since basic timers have no CC channels. */ - break; + return; } + nvic_irq_set_priority(irq_num, priority); +} + + +void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { /** * Give the Stepper ISR a higher priority (lower number) * so it automatically preempts the Temperature ISR. @@ -85,7 +91,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { 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_set_interrupt_priority(STEP_TIMER_NUM, STEP_TIMER_IRQ_PRIO); timer_generate_update(STEP_TIMER_DEV); timer_resume(STEP_TIMER_DEV); break; @@ -97,7 +103,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { 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_set_interrupt_priority(TEMP_TIMER_NUM, TEMP_TIMER_IRQ_PRIO); timer_generate_update(TEMP_TIMER_DEV); timer_resume(TEMP_TIMER_DEV); break; diff --git a/Marlin/src/HAL/STM32F1/timers.h b/Marlin/src/HAL/STM32F1/timers.h index e5733cc563..6f360f6bfc 100644 --- a/Marlin/src/HAL/STM32F1/timers.h +++ b/Marlin/src/HAL/STM32F1/timers.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -44,8 +44,12 @@ typedef uint16_t hal_timer_t; #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 +#ifndef STEP_TIMER_CHAN + #define STEP_TIMER_CHAN 1 // Channel of the timer to use for compare and interrupts +#endif +#ifndef TEMP_TIMER_CHAN + #define TEMP_TIMER_CHAN 1 // Channel of the timer to use for compare and interrupts +#endif /** * Note: Timers may be used by platforms and libraries @@ -61,14 +65,20 @@ typedef uint16_t hal_timer_t; * - 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. +#ifndef STEP_TIMER_NUM + #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 +#endif +#ifndef PULSE_TIMER_NUM + #define PULSE_TIMER_NUM STEP_TIMER_NUM +#endif +#ifndef TEMP_TIMER_NUM + #define TEMP_TIMER_NUM 2 // Timer Index for Temperature + //#define TEMP_TIMER_NUM 4 // 2->4, Timer 2 for Stepper Current PWM #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, BTT_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. @@ -81,8 +91,9 @@ typedef uint16_t hal_timer_t; #define SERVO0_TIMER_NUM 1 // SERVO0 or BLTOUCH #endif -#define STEP_TIMER_IRQ_PRIO 1 -#define TEMP_TIMER_IRQ_PRIO 2 +#define STEP_TIMER_IRQ_PRIO 2 +#define TEMP_TIMER_IRQ_PRIO 3 +#define SERVO0_TIMER_IRQ_PRIO 1 #define TEMP_TIMER_PRESCALE 1000 // prescaler for setting Temp timer, 72Khz #define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency @@ -111,8 +122,12 @@ timer_dev* get_timer_dev(int number); // TODO change this -#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler() -#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler() +#ifndef HAL_TEMP_TIMER_ISR + #define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler() +#endif +#ifndef HAL_STEP_TIMER_ISR + #define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler() +#endif extern "C" void tempTC_Handler(); extern "C" void stepTC_Handler(); @@ -179,4 +194,6 @@ 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); } +void timer_set_interrupt_priority(uint_fast8_t timer_num, uint_fast8_t priority); + #define TIMER_OC_NO_PRELOAD 0 // Need to disable preload also on compare registers. diff --git a/Marlin/src/HAL/STM32F1/watchdog.cpp b/Marlin/src/HAL/STM32F1/watchdog.cpp index 9556d1fa66..4123bc3ef0 100644 --- a/Marlin/src/HAL/STM32F1/watchdog.cpp +++ b/Marlin/src/HAL/STM32F1/watchdog.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/STM32F1/watchdog.h b/Marlin/src/HAL/STM32F1/watchdog.h index 7218b1a720..7185d69775 100644 --- a/Marlin/src/HAL/STM32F1/watchdog.h +++ b/Marlin/src/HAL/STM32F1/watchdog.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32_F4_F7/HAL.cpp b/Marlin/src/HAL/STM32_F4_F7/HAL.cpp index 5acda8af41..b4629d2afd 100644 --- a/Marlin/src/HAL/STM32_F4_F7/HAL.cpp +++ b/Marlin/src/HAL/STM32_F4_F7/HAL.cpp @@ -17,10 +17,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) #include "HAL.h" diff --git a/Marlin/src/HAL/STM32_F4_F7/HAL.h b/Marlin/src/HAL/STM32_F4_F7/HAL.h index b5d8ac29cf..5601400c5a 100644 --- a/Marlin/src/HAL/STM32_F4_F7/HAL.h +++ b/Marlin/src/HAL/STM32_F4_F7/HAL.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -31,7 +31,6 @@ #include "../shared/HAL_SPI.h" #include "fastio.h" -#include "timers.h" #include "watchdog.h" #include @@ -51,6 +50,8 @@ #error "SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration." #elif SERIAL_PORT == -1 #define MYSERIAL0 SerialUSB +#elif SERIAL_PORT == 0 + #define MYSERIAL0 Serial1 #elif SERIAL_PORT == 1 #define MYSERIAL0 SerialUART1 #elif SERIAL_PORT == 2 @@ -74,6 +75,8 @@ #error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration." #elif SERIAL_PORT_2 == -1 #define MYSERIAL1 SerialUSB + #elif SERIAL_PORT_2 == 0 + #define MYSERIAL1 Serial1 #elif SERIAL_PORT_2 == 1 #define MYSERIAL1 SerialUART1 #elif SERIAL_PORT_2 == 2 @@ -103,6 +106,8 @@ #error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration." #elif DGUS_SERIAL_PORT == -1 #define DGUS_SERIAL SerialUSB + #elif DGUS_SERIAL_PORT == 0 + #define DGUS_SERIAL Serial1 #elif DGUS_SERIAL_PORT == 1 #define DGUS_SERIAL SerialUART1 #elif DGUS_SERIAL_PORT == 2 @@ -206,19 +211,6 @@ static inline int freeMemory() { #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 // @@ -227,8 +219,9 @@ void eeprom_update_block (const void *__src, void *__dst, size_t __n); inline void HAL_adc_init() {} -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) +#define HAL_ADC_VREF 3.3 #define HAL_ADC_RESOLUTION 10 +#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) #define HAL_READ_ADC() HAL_adc_result #define HAL_ADC_READY() true diff --git a/Marlin/src/HAL/STM32_F4_F7/HAL_SPI.cpp b/Marlin/src/HAL/STM32_F4_F7/HAL_SPI.cpp index deb14f2cfe..6fe81819ab 100644 --- a/Marlin/src/HAL/STM32_F4_F7/HAL_SPI.cpp +++ b/Marlin/src/HAL/STM32_F4_F7/HAL_SPI.cpp @@ -17,9 +17,10 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ +#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) /** * Software SPI functions originally from Arduino Sd2Card Library @@ -30,8 +31,6 @@ * Adapted to the Marlin STM32F4/7 HAL */ -#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - #include "../../inc/MarlinConfig.h" #include @@ -121,7 +120,7 @@ uint8_t spiRec() { */ void spiRead(uint8_t* buf, uint16_t nbyte) { SPI.beginTransaction(spiConfig); - #ifdef STM32GENERIC + #ifndef STM32GENERIC SPI.dmaTransfer(0, const_cast(buf), nbyte); #else SPI.transfer((uint8_t*)buf, nbyte); @@ -153,7 +152,7 @@ void spiSend(uint8_t b) { void spiSendBlock(uint8_t token, const uint8_t* buf) { SPI.beginTransaction(spiConfig); SPI.transfer(token); - #ifdef STM32GENERIC + #ifndef STM32GENERIC SPI.dmaSend(const_cast(buf), 512); #else SPI.transfer((uint8_t*)buf, nullptr, 512); diff --git a/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.cpp b/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.cpp index ffd46dae60..dc41f89131 100644 --- a/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.cpp +++ b/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.cpp @@ -16,14 +16,12 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #if defined(STM32GENERIC) && defined(STM32F4) -#include "../HAL.h" -#include "timers.h" +#include "../../../inc/MarlinConfig.h" // ------------------------ // Local defines diff --git a/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.h b/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.h index c52f5ea21c..a4a7ad82cc 100644 --- a/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.h +++ b/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -34,9 +34,15 @@ #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 +#ifndef STEP_TIMER_NUM + #define STEP_TIMER_NUM 0 // Timer Index for Stepper +#endif +#ifndef PULSE_TIMER_NUM + #define PULSE_TIMER_NUM STEP_TIMER_NUM +#endif +#ifndef TEMP_TIMER_NUM + #define TEMP_TIMER_NUM 1 // Timer Index for Temperature +#endif #define TEMP_TIMER_PRESCALE 1000 // prescaler for setting Temp timer, 72Khz #define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency @@ -59,17 +65,19 @@ // 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() + #define TC_TIMER_ARGS #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) + #define TC_TIMER_ARGS stimer_t *htim #endif +extern void TC5_Handler(TC_TIMER_ARGS); +extern void TC7_Handler(TC_TIMER_ARGS); +#ifndef HAL_STEP_TIMER_ISR + #define HAL_STEP_TIMER_ISR() void TC5_Handler(TC_TIMER_ARGS) +#endif +#ifndef HAL_TEMP_TIMER_ISR + #define HAL_TEMP_TIMER_ISR() void TC7_Handler(TC_TIMER_ARGS) +#endif // ------------------------ // Types diff --git a/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.cpp b/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.cpp index d90f22e03a..f7ded7454d 100644 --- a/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.cpp +++ b/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.cpp @@ -16,14 +16,12 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #if defined(STM32GENERIC) && defined(STM32F7) -#include "../HAL.h" -#include "timers.h" +#include "../../../inc/MarlinConfig.h" // ------------------------ // Local defines diff --git a/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.h b/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.h index 00428c54f1..d2f78259d6 100644 --- a/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.h +++ b/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -34,9 +34,15 @@ #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 +#ifndef STEP_TIMER_NUM + #define STEP_TIMER_NUM 0 // Timer Index for Stepper +#endif +#ifndef PULSE_TIMER_NUM + #define PULSE_TIMER_NUM STEP_TIMER_NUM +#endif +#ifndef TEMP_TIMER_NUM + #define TEMP_TIMER_NUM 1 // Timer Index for Temperature +#endif #define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency #define TEMP_TIMER_PRESCALE 1000 // prescaler for setting Temp timer, 72Khz @@ -62,8 +68,12 @@ extern void TC5_Handler(); extern void TC7_Handler(); -#define HAL_STEP_TIMER_ISR() void TC5_Handler() -#define HAL_TEMP_TIMER_ISR() void TC7_Handler() +#ifndef HAL_STEP_TIMER_ISR + #define HAL_STEP_TIMER_ISR() void TC5_Handler() +#endif +#ifndef HAL_TEMP_TIMER_ISR + #define HAL_TEMP_TIMER_ISR() void TC7_Handler() +#endif // ------------------------ // Types diff --git a/Marlin/src/HAL/STM32_F4_F7/Servo.cpp b/Marlin/src/HAL/STM32_F4_F7/Servo.cpp index e7fb15e6b1..7185468f50 100644 --- a/Marlin/src/HAL/STM32_F4_F7/Servo.cpp +++ b/Marlin/src/HAL/STM32_F4_F7/Servo.cpp @@ -17,10 +17,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) #include "../../inc/MarlinConfig.h" @@ -44,9 +43,7 @@ void libServo::move(const int value) { if (attach(0) >= 0) { write(value); safe_delay(servo_delay[servoIndex]); - #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - detach(); - #endif + TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach()); } } diff --git a/Marlin/src/HAL/STM32_F4_F7/Servo.h b/Marlin/src/HAL/STM32_F4_F7/Servo.h index 076a547bb2..e42cc60840 100644 --- a/Marlin/src/HAL/STM32_F4_F7/Servo.h +++ b/Marlin/src/HAL/STM32_F4_F7/Servo.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp b/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp index 3358fa3df7..e0726c7cd5 100644 --- a/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp +++ b/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp @@ -1,6 +1,6 @@ /** ****************************************************************************** - * @file EEPROM/EEPROM_Emulation/src/eeprom.c + * @file eeprom_emul.cpp * @author MCD Application Team * @version V1.2.6 * @date 04-November-2016 @@ -49,6 +49,10 @@ */ #if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) +#include "../../inc/MarlinConfig.h" + +#if ENABLED(FLASH_EEPROM_EMULATION) + /* Includes ------------------------------------------------------------------*/ #include "eeprom_emul.h" @@ -61,7 +65,7 @@ uint16_t DataVar = 0; 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); @@ -75,6 +79,9 @@ static uint16_t EE_VerifyPageFullyErased(uint32_t Address); * @retval - Flash error code: on write Flash error * - FLASH_COMPLETE: on success */ + +/* Private functions ---------------------------------------------------------*/ + uint16_t EE_Initialize() { /* Get Page0 and Page1 status */ uint16_t PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS), @@ -329,7 +336,7 @@ uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data) { * @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 + * EEPROM formatting */ static HAL_StatusTypeDef EE_Format() { FLASH_EraseInitTypeDef pEraseInit; @@ -518,6 +525,7 @@ static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data) { return HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, NewPageAddress, VALID_PAGE); } +#endif // FLASH_EEPROM_EMULATION #endif // STM32GENERIC && (STM32F4 || STM32F7) /** diff --git a/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.h b/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.h index e4094f8e13..84c4c6e3d2 100644 --- a/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.h +++ b/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.h @@ -50,7 +50,6 @@ // ------------------------ #include "../../inc/MarlinConfig.h" -#include "HAL.h" /* Exported constants --------------------------------------------------------*/ /* EEPROM emulation firmware error codes */ diff --git a/Marlin/src/HAL/STM32_F4_F7/EmulatedEeprom.cpp b/Marlin/src/HAL/STM32_F4_F7/eeprom_flash.cpp similarity index 57% rename from Marlin/src/HAL/STM32_F4_F7/EmulatedEeprom.cpp rename to Marlin/src/HAL/STM32_F4_F7/eeprom_flash.cpp index cc1a1bb01e..00b808fd48 100644 --- a/Marlin/src/HAL/STM32_F4_F7/EmulatedEeprom.cpp +++ b/Marlin/src/HAL/STM32_F4_F7/eeprom_flash.cpp @@ -13,33 +13,18 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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" #if ENABLED(FLASH_EEPROM_EMULATION) -// ------------------------ -// Includes -// ------------------------ - -#include "HAL.h" +#include "../shared/eeprom_api.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 @@ -49,18 +34,34 @@ //#define FLASH_FLAG_PGSERR FLASH_FLAG_ERSERR #endif -// ------------------------ -// Private Variables -// ------------------------ +void ee_write_byte(uint8_t *pos, unsigned char value) { + 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); -static bool eeprom_initialized = false; + const unsigned eeprom_address = (unsigned)pos; + if (EE_WriteVariable(eeprom_address, uint16_t(value)) != EE_OK) + for (;;) HAL_Delay(1); // Spin forever until watchdog reset -// ------------------------ -// Public functions -// ------------------------ + HAL_FLASH_Lock(); +} -void eeprom_init() { - if (!eeprom_initialized) { +uint8_t ee_read_byte(uint8_t *pos) { + uint16_t data = 0xFF; + const unsigned eeprom_address = (unsigned)pos; + (void)EE_ReadVariable(eeprom_address, &data); // Data unchanged on error + return uint8_t(data); +} + +#ifndef MARLIN_EEPROM_SIZE + #error "MARLIN_EEPROM_SIZE is required for Flash-based EEPROM." +#endif +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } + +bool PersistentStore::access_finish() { return true; } + +bool PersistentStore::access_start() { + static bool ee_initialized = false; + if (!ee_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); @@ -70,46 +71,40 @@ void eeprom_init() { for (;;) HAL_Delay(1); // Spin forever until watchdog reset HAL_FLASH_Lock(); - eeprom_initialized = true; + ee_initialized = true; } + return 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); - LOOP_L_N(c, __n) { - EE_ReadVariable(eeprom_address+c, &data); - *((uint8_t*)__dst + c) = data; +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 != ee_read_byte(p)) { + ee_write_byte(p, v); + if (ee_read_byte(p) != v) { + SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE); + return true; + } + } + crc16(crc, &v, 1); + pos++; + value++; } + return false; } -void eeprom_update_block(const void *__src, void *__dst, size_t __n) { - +bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { + do { + uint8_t c = ee_read_byte((uint8_t*)pos); + if (writing) *value = c; + crc16(crc, &c, 1); + pos++; + value++; + } while (--size); + return false; } #endif // FLASH_EEPROM_EMULATION diff --git a/Marlin/src/HAL/STM32_F4_F7/eeprom.cpp b/Marlin/src/HAL/STM32_F4_F7/eeprom_wired.cpp similarity index 77% rename from Marlin/src/HAL/STM32_F4_F7/eeprom.cpp rename to Marlin/src/HAL/STM32_F4_F7/eeprom_wired.cpp index b957aae6a8..c0d82dbd07 100644 --- a/Marlin/src/HAL/STM32_F4_F7/eeprom.cpp +++ b/Marlin/src/HAL/STM32_F4_F7/eeprom_wired.cpp @@ -17,19 +17,29 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) -#include "../../inc/MarlinConfigPre.h" +#include "../../inc/MarlinConfig.h" -#if ENABLED(EEPROM_SETTINGS) +#if USE_WIRED_EEPROM +/** + * PersistentStore for Arduino-style EEPROM interface + * with simple implementations supplied by Marlin. + */ + +#include "../shared/eeprom_if.h" #include "../shared/eeprom_api.h" -bool PersistentStore::access_start() { return true; } +#ifndef MARLIN_EEPROM_SIZE + #error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM." +#endif +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } + +bool PersistentStore::access_start() { eeprom_init(); return true; } bool PersistentStore::access_finish() { return true; } bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { @@ -48,7 +58,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui crc16(crc, &v, 1); pos++; value++; - }; + } return false; } @@ -63,7 +73,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t return false; } -size_t PersistentStore::capacity() { return E2END + 1; } - -#endif // EEPROM_SETTINGS +#endif // USE_WIRED_EEPROM #endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin/src/HAL/STM32_F4_F7/endstop_interrupts.h b/Marlin/src/HAL/STM32_F4_F7/endstop_interrupts.h index 0b97c3c774..fdff8cc644 100644 --- a/Marlin/src/HAL/STM32_F4_F7/endstop_interrupts.h +++ b/Marlin/src/HAL/STM32_F4_F7/endstop_interrupts.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -28,43 +28,22 @@ 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_Z4_MAX - attachInterrupt(Z4_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z4_MIN - attachInterrupt(Z4_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MIN_PROBE_PIN - attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE); - #endif + #define _ATTACH(P) attachInterrupt(P, endstop_ISR, CHANGE) + TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN)); + TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN)); + TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN)); + TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN)); + TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN)); + TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN)); + TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN)); + TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN)); + TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN)); + TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN)); + TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN)); + TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN)); + TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN)); + TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN)); + TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN)); + TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN)); + TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN)); } diff --git a/Marlin/src/HAL/STM32_F4_F7/fastio.h b/Marlin/src/HAL/STM32_F4_F7/fastio.h index ee64ca833d..f42be58354 100644 --- a/Marlin/src/HAL/STM32_F4_F7/fastio.h +++ b/Marlin/src/HAL/STM32_F4_F7/fastio.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_LCD.h b/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_LCD.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_LCD.h +++ b/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_LCD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_adv.h b/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_adv.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_adv.h +++ b/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_adv.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_post.h b/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_post.h index d21624955e..b5d808e21a 100644 --- a/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_post.h +++ b/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_post.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32_F4_F7/inc/SanityCheck.h b/Marlin/src/HAL/STM32_F4_F7/inc/SanityCheck.h index e04258fa07..53b15ba190 100644 --- a/Marlin/src/HAL/STM32_F4_F7/inc/SanityCheck.h +++ b/Marlin/src/HAL/STM32_F4_F7/inc/SanityCheck.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32_F4_F7/pinsDebug.h b/Marlin/src/HAL/STM32_F4_F7/pinsDebug.h index 208a3524f7..973abb1b01 100644 --- a/Marlin/src/HAL/STM32_F4_F7/pinsDebug.h +++ b/Marlin/src/HAL/STM32_F4_F7/pinsDebug.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32_F4_F7/spi_pins.h b/Marlin/src/HAL/STM32_F4_F7/spi_pins.h index f120e7178b..75a6a2b250 100644 --- a/Marlin/src/HAL/STM32_F4_F7/spi_pins.h +++ b/Marlin/src/HAL/STM32_F4_F7/spi_pins.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32_F4_F7/timers.h b/Marlin/src/HAL/STM32_F4_F7/timers.h index 632c05a5ad..4e8c81783e 100644 --- a/Marlin/src/HAL/STM32_F4_F7/timers.h +++ b/Marlin/src/HAL/STM32_F4_F7/timers.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/STM32_F4_F7/watchdog.cpp b/Marlin/src/HAL/STM32_F4_F7/watchdog.cpp index 347edcd49d..cb12ec7aac 100644 --- a/Marlin/src/HAL/STM32_F4_F7/watchdog.cpp +++ b/Marlin/src/HAL/STM32_F4_F7/watchdog.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/HAL/STM32_F4_F7/watchdog.h b/Marlin/src/HAL/STM32_F4_F7/watchdog.h index ece6ef0162..3dbc2d08c1 100644 --- a/Marlin/src/HAL/STM32_F4_F7/watchdog.h +++ b/Marlin/src/HAL/STM32_F4_F7/watchdog.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/TEENSY31_32/HAL.cpp b/Marlin/src/HAL/TEENSY31_32/HAL.cpp index f226a4a90e..d276a4c880 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL.cpp +++ b/Marlin/src/HAL/TEENSY31_32/HAL.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/TEENSY31_32/HAL.h b/Marlin/src/HAL/TEENSY31_32/HAL.h index 15e9ab71bb..890930f7f8 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL.h +++ b/Marlin/src/HAL/TEENSY31_32/HAL.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -34,7 +34,6 @@ #include "fastio.h" #include "watchdog.h" -#include "timers.h" #include @@ -108,8 +107,9 @@ extern "C" { void HAL_adc_init(); -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) +#define HAL_ADC_VREF 3.3 #define HAL_ADC_RESOLUTION 10 +#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) #define HAL_READ_ADC() HAL_adc_get_result() #define HAL_ADC_READY() true diff --git a/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp index 83d4d00bf2..cdb3f4701c 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp +++ b/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #ifdef __MK20DX256__ diff --git a/Marlin/src/HAL/TEENSY31_32/Servo.cpp b/Marlin/src/HAL/TEENSY31_32/Servo.cpp index 2b01d3d875..544892cb7d 100644 --- a/Marlin/src/HAL/TEENSY31_32/Servo.cpp +++ b/Marlin/src/HAL/TEENSY31_32/Servo.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #ifdef __MK20DX256__ @@ -46,9 +46,7 @@ void libServo::move(const int value) { if (attach(0) >= 0) { write(value); safe_delay(servo_delay[servoIndex]); - #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - detach(); - #endif + TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach()); } } diff --git a/Marlin/src/HAL/TEENSY31_32/Servo.h b/Marlin/src/HAL/TEENSY31_32/Servo.h index 9243291e43..82b601d956 100644 --- a/Marlin/src/HAL/TEENSY31_32/Servo.h +++ b/Marlin/src/HAL/TEENSY31_32/Servo.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/TEENSY31_32/eeprom_impl.cpp b/Marlin/src/HAL/TEENSY31_32/eeprom.cpp similarity index 78% rename from Marlin/src/HAL/TEENSY31_32/eeprom_impl.cpp rename to Marlin/src/HAL/TEENSY31_32/eeprom.cpp index 96499d4f19..f663132255 100644 --- a/Marlin/src/HAL/TEENSY31_32/eeprom_impl.cpp +++ b/Marlin/src/HAL/TEENSY31_32/eeprom.cpp @@ -13,18 +13,29 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #ifdef __MK20DX256__ #include "../../inc/MarlinConfig.h" -#if ENABLED(EEPROM_SETTINGS) +#if USE_WIRED_EEPROM + +/** + * PersistentStore for Arduino-style EEPROM interface + * with implementations supplied by the framework. + */ #include "../shared/eeprom_api.h" +#include -bool PersistentStore::access_start() { return true; } +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE size_t(E2END + 1) +#endif +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } + +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) { @@ -43,7 +54,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui crc16(crc, &v, 1); pos++; value++; - }; + } return false; } @@ -58,5 +69,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t return false; } -#endif // EEPROM_SETTINGS +#endif // USE_WIRED_EEPROM #endif // __MK20DX256__ diff --git a/Marlin/src/HAL/TEENSY31_32/endstop_interrupts.h b/Marlin/src/HAL/TEENSY31_32/endstop_interrupts.h index 21fea5bd01..999ada5127 100644 --- a/Marlin/src/HAL/TEENSY31_32/endstop_interrupts.h +++ b/Marlin/src/HAL/TEENSY31_32/endstop_interrupts.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -47,31 +47,21 @@ void 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_Z_MIN_PROBE_PIN - _ATTACH(Z_MIN_PROBE_PIN); - #endif + TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN)); + TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN)); + TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN)); + TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN)); + TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN)); + TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN)); + TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN)); + TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN)); + TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN)); + TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN)); + TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN)); + TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN)); + TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN)); + TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN)); + TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN)); + TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN)); + TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN)); } diff --git a/Marlin/src/HAL/TEENSY31_32/fastio.h b/Marlin/src/HAL/TEENSY31_32/fastio.h index 5bfb8d3a02..9a299de9c7 100644 --- a/Marlin/src/HAL/TEENSY31_32/fastio.h +++ b/Marlin/src/HAL/TEENSY31_32/fastio.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_LCD.h b/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_LCD.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_LCD.h +++ b/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_LCD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_adv.h b/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_adv.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_adv.h +++ b/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_adv.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_post.h b/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_post.h index 11603c9ef4..998f1dcc0d 100644 --- a/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_post.h +++ b/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_post.h @@ -16,12 +16,11 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once -// If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation -#if ENABLED(EEPROM_SETTINGS) && NONE(USE_WIRED_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION) - #define SDCARD_EEPROM_EMULATION +#if USE_FALLBACK_EEPROM + #define USE_WIRED_EEPROM 1 #endif diff --git a/Marlin/src/HAL/TEENSY31_32/inc/SanityCheck.h b/Marlin/src/HAL/TEENSY31_32/inc/SanityCheck.h index 9268868596..0b731a61d3 100644 --- a/Marlin/src/HAL/TEENSY31_32/inc/SanityCheck.h +++ b/Marlin/src/HAL/TEENSY31_32/inc/SanityCheck.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/TEENSY31_32/spi_pins.h b/Marlin/src/HAL/TEENSY31_32/spi_pins.h index 79230f3d44..5754fbfeed 100644 --- a/Marlin/src/HAL/TEENSY31_32/spi_pins.h +++ b/Marlin/src/HAL/TEENSY31_32/spi_pins.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/TEENSY31_32/timers.cpp b/Marlin/src/HAL/TEENSY31_32/timers.cpp index 92641742f9..bf756af8a1 100644 --- a/Marlin/src/HAL/TEENSY31_32/timers.cpp +++ b/Marlin/src/HAL/TEENSY31_32/timers.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -26,8 +26,7 @@ #ifdef __MK20DX256__ -#include "HAL.h" -#include "timers.h" +#include "../../inc/MarlinConfig.h" /** \brief Instruction Synchronization Barrier Instruction Synchronization Barrier flushes the pipeline in the processor, diff --git a/Marlin/src/HAL/TEENSY31_32/timers.h b/Marlin/src/HAL/TEENSY31_32/timers.h index 00f9f0740d..4f004ef751 100644 --- a/Marlin/src/HAL/TEENSY31_32/timers.h +++ b/Marlin/src/HAL/TEENSY31_32/timers.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -47,9 +47,15 @@ typedef uint32_t hal_timer_t; #define HAL_TIMER_RATE (FTM0_TIMER_RATE) -#define STEP_TIMER_NUM 0 -#define TEMP_TIMER_NUM 1 -#define PULSE_TIMER_NUM STEP_TIMER_NUM +#ifndef STEP_TIMER_NUM + #define STEP_TIMER_NUM 0 // Timer Index for Stepper +#endif +#ifndef PULSE_TIMER_NUM + #define PULSE_TIMER_NUM STEP_TIMER_NUM +#endif +#ifndef TEMP_TIMER_NUM + #define TEMP_TIMER_NUM 1 // Timer Index for Temperature +#endif #define TEMP_TIMER_FREQUENCY 1000 @@ -68,8 +74,12 @@ typedef uint32_t hal_timer_t; #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) -#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler() -#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler() +#ifndef HAL_STEP_TIMER_ISR + #define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler() +#endif +#ifndef HAL_TEMP_TIMER_ISR + #define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler() +#endif void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); diff --git a/Marlin/src/HAL/TEENSY31_32/watchdog.cpp b/Marlin/src/HAL/TEENSY31_32/watchdog.cpp index 618294591b..9f7b70d9f9 100644 --- a/Marlin/src/HAL/TEENSY31_32/watchdog.cpp +++ b/Marlin/src/HAL/TEENSY31_32/watchdog.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #ifdef __MK20DX256__ #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/HAL/TEENSY31_32/watchdog.h b/Marlin/src/HAL/TEENSY31_32/watchdog.h index cb881f8595..b8b46a4030 100644 --- a/Marlin/src/HAL/TEENSY31_32/watchdog.h +++ b/Marlin/src/HAL/TEENSY31_32/watchdog.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/TEENSY35_36/HAL.cpp b/Marlin/src/HAL/TEENSY35_36/HAL.cpp index 86ba40870f..bcbee1d4c5 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL.cpp +++ b/Marlin/src/HAL/TEENSY35_36/HAL.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/TEENSY35_36/HAL.h b/Marlin/src/HAL/TEENSY35_36/HAL.h index 7e5be1081c..5442ae2d3b 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL.h +++ b/Marlin/src/HAL/TEENSY35_36/HAL.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -34,8 +34,6 @@ #include "fastio.h" #include "watchdog.h" -#include "timers.h" - #include #include @@ -114,8 +112,9 @@ extern "C" { void HAL_adc_init(); -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) +#define HAL_ADC_VREF 3.3 #define HAL_ADC_RESOLUTION 10 +#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) #define HAL_READ_ADC() HAL_adc_get_result() #define HAL_ADC_READY() true diff --git a/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp index b35533aa94..0b1ae4afa4 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp +++ b/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #if defined(__MK64FX512__) || defined(__MK66FX1M0__) diff --git a/Marlin/src/HAL/TEENSY35_36/Servo.cpp b/Marlin/src/HAL/TEENSY35_36/Servo.cpp index f2fd5fe7ff..d1390187a7 100644 --- a/Marlin/src/HAL/TEENSY35_36/Servo.cpp +++ b/Marlin/src/HAL/TEENSY35_36/Servo.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #if defined(__MK64FX512__) || defined(__MK66FX1M0__) @@ -46,9 +46,7 @@ void libServo::move(const int value) { if (attach(0) >= 0) { write(value); safe_delay(servo_delay[servoIndex]); - #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - detach(); - #endif + TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach()); } } diff --git a/Marlin/src/HAL/TEENSY35_36/Servo.h b/Marlin/src/HAL/TEENSY35_36/Servo.h index 4962105d79..ae904f0e2e 100644 --- a/Marlin/src/HAL/TEENSY35_36/Servo.h +++ b/Marlin/src/HAL/TEENSY35_36/Servo.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/TEENSY35_36/eeprom.cpp b/Marlin/src/HAL/TEENSY35_36/eeprom.cpp index c66a45e2a5..d2d7324cdd 100644 --- a/Marlin/src/HAL/TEENSY35_36/eeprom.cpp +++ b/Marlin/src/HAL/TEENSY35_36/eeprom.cpp @@ -17,20 +17,29 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #if defined(__MK64FX512__) || defined(__MK66FX1M0__) #include "../../inc/MarlinConfig.h" -#if ENABLED(EEPROM_SETTINGS) +#if USE_WIRED_EEPROM + +/** + * PersistentStore for Arduino-style EEPROM interface + * with implementations supplied by the framework. + */ #include "../shared/eeprom_api.h" #include -bool PersistentStore::access_start() { return true; } +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE size_t(E2END + 1) +#endif +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } + +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) { @@ -49,7 +58,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui crc16(crc, &v, 1); pos++; value++; - }; + } return false; } @@ -64,7 +73,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t return false; } -size_t PersistentStore::capacity() { return E2END + 1; } - -#endif // EEPROM_SETTINGS +#endif // USE_WIRED_EEPROM #endif // __MK64FX512__ || __MK66FX1M0__ diff --git a/Marlin/src/HAL/TEENSY35_36/endstop_interrupts.h b/Marlin/src/HAL/TEENSY35_36/endstop_interrupts.h index eaaf297ea2..92e22efc0f 100644 --- a/Marlin/src/HAL/TEENSY35_36/endstop_interrupts.h +++ b/Marlin/src/HAL/TEENSY35_36/endstop_interrupts.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -46,43 +46,21 @@ void 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_Z4_MAX - _ATTACH(Z4_MAX_PIN); - #endif - #if HAS_Z4_MIN - _ATTACH(Z4_MIN_PIN); - #endif - #if HAS_Z_MIN_PROBE_PIN - _ATTACH(Z_MIN_PROBE_PIN); - #endif + TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN)); + TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN)); + TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN)); + TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN)); + TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN)); + TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN)); + TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN)); + TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN)); + TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN)); + TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN)); + TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN)); + TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN)); + TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN)); + TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN)); + TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN)); + TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN)); + TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN)); } diff --git a/Marlin/src/HAL/TEENSY35_36/fastio.h b/Marlin/src/HAL/TEENSY35_36/fastio.h index 5bfb8d3a02..9a299de9c7 100644 --- a/Marlin/src/HAL/TEENSY35_36/fastio.h +++ b/Marlin/src/HAL/TEENSY35_36/fastio.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_LCD.h b/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_LCD.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_LCD.h +++ b/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_LCD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_adv.h b/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_adv.h index 0285c52ee3..5f1c4b1601 100644 --- a/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_adv.h +++ b/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_adv.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_post.h b/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_post.h index 0285c52ee3..998f1dcc0d 100644 --- a/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_post.h +++ b/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_post.h @@ -16,7 +16,11 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once + +#if USE_FALLBACK_EEPROM + #define USE_WIRED_EEPROM 1 +#endif diff --git a/Marlin/src/HAL/TEENSY35_36/inc/SanityCheck.h b/Marlin/src/HAL/TEENSY35_36/inc/SanityCheck.h index f42bd63b17..36b8018085 100644 --- a/Marlin/src/HAL/TEENSY35_36/inc/SanityCheck.h +++ b/Marlin/src/HAL/TEENSY35_36/inc/SanityCheck.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/TEENSY35_36/pinsDebug.h b/Marlin/src/HAL/TEENSY35_36/pinsDebug.h index 61a54f15ed..e57c73c595 100644 --- a/Marlin/src/HAL/TEENSY35_36/pinsDebug.h +++ b/Marlin/src/HAL/TEENSY35_36/pinsDebug.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/TEENSY35_36/spi_pins.h b/Marlin/src/HAL/TEENSY35_36/spi_pins.h index b29a9346a1..276d4f456a 100644 --- a/Marlin/src/HAL/TEENSY35_36/spi_pins.h +++ b/Marlin/src/HAL/TEENSY35_36/spi_pins.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/TEENSY35_36/timers.cpp b/Marlin/src/HAL/TEENSY35_36/timers.cpp index 81e23e4d17..5725e83a85 100644 --- a/Marlin/src/HAL/TEENSY35_36/timers.cpp +++ b/Marlin/src/HAL/TEENSY35_36/timers.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -27,8 +27,7 @@ #if defined(__MK64FX512__) || defined(__MK66FX1M0__) -#include "HAL.h" -#include "timers.h" +#include "../../inc/MarlinConfig.h" /** \brief Instruction Synchronization Barrier Instruction Synchronization Barrier flushes the pipeline in the processor, diff --git a/Marlin/src/HAL/TEENSY35_36/timers.h b/Marlin/src/HAL/TEENSY35_36/timers.h index 6dc26a9665..68060d0e1c 100644 --- a/Marlin/src/HAL/TEENSY35_36/timers.h +++ b/Marlin/src/HAL/TEENSY35_36/timers.h @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #pragma once @@ -46,9 +46,15 @@ typedef uint32_t hal_timer_t; #define HAL_TIMER_RATE (FTM0_TIMER_RATE) -#define STEP_TIMER_NUM 0 -#define TEMP_TIMER_NUM 1 -#define PULSE_TIMER_NUM STEP_TIMER_NUM +#ifndef STEP_TIMER_NUM + #define STEP_TIMER_NUM 0 // Timer Index for Stepper +#endif +#ifndef PULSE_TIMER_NUM + #define PULSE_TIMER_NUM STEP_TIMER_NUM +#endif +#ifndef TEMP_TIMER_NUM + #define TEMP_TIMER_NUM 1 // Timer Index for Temperature +#endif #define TEMP_TIMER_FREQUENCY 1000 @@ -67,8 +73,12 @@ typedef uint32_t hal_timer_t; #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) -#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler() -#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler() +#ifndef HAL_STEP_TIMER_ISR + #define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler() +#endif +#ifndef HAL_TEMP_TIMER_ISR + #define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler() +#endif void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); diff --git a/Marlin/src/HAL/TEENSY35_36/watchdog.cpp b/Marlin/src/HAL/TEENSY35_36/watchdog.cpp index 69afa04a54..e735ee7923 100644 --- a/Marlin/src/HAL/TEENSY35_36/watchdog.cpp +++ b/Marlin/src/HAL/TEENSY35_36/watchdog.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #if defined(__MK64FX512__) || defined(__MK66FX1M0__) #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/HAL/TEENSY35_36/watchdog.h b/Marlin/src/HAL/TEENSY35_36/watchdog.h index ec3f18f094..981b1f0bd2 100644 --- a/Marlin/src/HAL/TEENSY35_36/watchdog.h +++ b/Marlin/src/HAL/TEENSY35_36/watchdog.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/platforms.h b/Marlin/src/HAL/platforms.h index cc462f37c5..d4cec64267 100644 --- a/Marlin/src/HAL/platforms.h +++ b/Marlin/src/HAL/platforms.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/shared/Delay.h b/Marlin/src/HAL/shared/Delay.h index 5cb68b1503..d98e960848 100644 --- a/Marlin/src/HAL/shared/Delay.h +++ b/Marlin/src/HAL/shared/Delay.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -36,7 +36,7 @@ #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/ + // https://www.anthonyvh.com/2017/05/18/cortex_m-cycle_counter/ FORCE_INLINE static void enableCycleCounter() { CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; diff --git a/Marlin/src/HAL/shared/HAL_SPI.h b/Marlin/src/HAL/shared/HAL_SPI.h index 0410d70c93..59af554806 100644 --- a/Marlin/src/HAL/shared/HAL_SPI.h +++ b/Marlin/src/HAL/shared/HAL_SPI.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/shared/HAL_ST7920.h b/Marlin/src/HAL/shared/HAL_ST7920.h index 69c1d741ae..05e8a1f2c5 100644 --- a/Marlin/src/HAL/shared/HAL_ST7920.h +++ b/Marlin/src/HAL/shared/HAL_ST7920.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -27,7 +27,7 @@ * (bypassing U8G), it will allow the LIGHTWEIGHT_UI to operate. */ -#if HAS_GRAPHICAL_LCD && ENABLED(LIGHTWEIGHT_UI) +#if BOTH(HAS_GRAPHICAL_LCD, LIGHTWEIGHT_UI) void ST7920_cs(); void ST7920_ncs(); void ST7920_set_cmd(); diff --git a/Marlin/src/HAL/shared/HAL_spi_L6470.cpp b/Marlin/src/HAL/shared/HAL_spi_L6470.cpp index 46e7b71f88..bd85dbe7bd 100644 --- a/Marlin/src/HAL/shared/HAL_spi_L6470.cpp +++ b/Marlin/src/HAL/shared/HAL_spi_L6470.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/HAL/shared/Marduino.h b/Marlin/src/HAL/shared/Marduino.h index c022fc72ed..3003f3cc28 100644 --- a/Marlin/src/HAL/shared/Marduino.h +++ b/Marlin/src/HAL/shared/Marduino.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/shared/backtrace/backtrace.cpp b/Marlin/src/HAL/shared/backtrace/backtrace.cpp index 7264969c74..6cf5e055e1 100644 --- a/Marlin/src/HAL/shared/backtrace/backtrace.cpp +++ b/Marlin/src/HAL/shared/backtrace/backtrace.cpp @@ -16,10 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ - #if defined(__arm__) || defined(__thumb__) #include "backtrace.h" diff --git a/Marlin/src/HAL/shared/backtrace/backtrace.h b/Marlin/src/HAL/shared/backtrace/backtrace.h index 636eb09a71..fccadedaa5 100644 --- a/Marlin/src/HAL/shared/backtrace/backtrace.h +++ b/Marlin/src/HAL/shared/backtrace/backtrace.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp b/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp index d5449f863e..26ca8b2604 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp @@ -807,7 +807,7 @@ UnwResult UnwStartThumb(UnwState * const state) { 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; + state->regData[rhd].o = state->regData[rhs].o; break; case 3: /* BX */ diff --git a/Marlin/src/HAL/shared/eeprom_api.cpp b/Marlin/src/HAL/shared/eeprom_api.cpp index d8839e3d9d..47cfa5a2db 100644 --- a/Marlin/src/HAL/shared/eeprom_api.cpp +++ b/Marlin/src/HAL/shared/eeprom_api.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include "../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/HAL/shared/eeprom_api.h b/Marlin/src/HAL/shared/eeprom_api.h index d7bee8a5f3..6445f7a4aa 100644 --- a/Marlin/src/HAL/shared/eeprom_api.h +++ b/Marlin/src/HAL/shared/eeprom_api.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -29,20 +29,38 @@ 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); + + // Total available persistent storage space (in bytes) static size_t capacity(); + // Prepare to read or write + static bool access_start(); + + // Housecleaning after read or write + static bool access_finish(); + + // Write one or more bytes of data and update the CRC + // Return 'true' on write error + static bool write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc); + + // Read one or more bytes of data and update the CRC + // Return 'true' on read error + static bool read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing=true); + + // Write one or more bytes of data + // Return 'true' on write error 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); } + // Write a single byte of data + // Return 'true' on write error static inline bool write_data(const int pos, const uint8_t value) { return write_data(pos, &value); } + // Read one or more bytes of data + // Return 'true' on read error static inline bool read_data(const int pos, uint8_t* value, const size_t size=1) { int data_pos = pos; uint16_t crc = 0; diff --git a/Marlin/src/HAL/shared/eeprom_i2c.cpp b/Marlin/src/HAL/shared/eeprom_i2c.cpp deleted file mode 100644 index 3eb72194ac..0000000000 --- a/Marlin/src/HAL/shared/eeprom_i2c.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General 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. - * - * TODO: Some platform Arduino libraries define these functions - * so Marlin needs to add a glue layer to prevent the conflict. - */ - -#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/src/HAL/shared/eeprom_if.h b/Marlin/src/HAL/shared/eeprom_if.h new file mode 100644 index 0000000000..e44da801df --- /dev/null +++ b/Marlin/src/HAL/shared/eeprom_if.h @@ -0,0 +1,29 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2020 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 + +// +// EEPROM +// +void eeprom_init(); +void eeprom_write_byte(uint8_t *pos, unsigned char value); +uint8_t eeprom_read_byte(uint8_t *pos); diff --git a/Marlin/src/HAL/shared/eeprom_if_i2c.cpp b/Marlin/src/HAL/shared/eeprom_if_i2c.cpp new file mode 100644 index 0000000000..cc22bf7d98 --- /dev/null +++ b/Marlin/src/HAL/shared/eeprom_if_i2c.cpp @@ -0,0 +1,78 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Platform-independent Arduino functions for I2C EEPROM. + * Enable USE_SHARED_EEPROM if not supplied by the framework. + */ + +#include "../../inc/MarlinConfig.h" + +#if ENABLED(I2C_EEPROM) + +#include "eeprom_if.h" +#include + +void eeprom_init() { Wire.begin(); } + +#if ENABLED(USE_SHARED_EEPROM) + +#ifndef EEPROM_WRITE_DELAY + #define EEPROM_WRITE_DELAY 5 +#endif +#ifndef EEPROM_DEVICE_ADDRESS + #define EEPROM_DEVICE_ADDRESS 0x50 +#endif + +static constexpr uint8_t eeprom_device_address = I2C_ADDRESS(EEPROM_DEVICE_ADDRESS); + +// ------------------------ +// Public functions +// ------------------------ + +void eeprom_write_byte(uint8_t *pos, unsigned char value) { + const unsigned eeprom_address = (unsigned)pos; + + Wire.beginTransmission(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(EEPROM_WRITE_DELAY); +} + +uint8_t eeprom_read_byte(uint8_t *pos) { + const unsigned eeprom_address = (unsigned)pos; + + Wire.beginTransmission(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; +} + +#endif // USE_SHARED_EEPROM +#endif // I2C_EEPROM diff --git a/Marlin/src/HAL/shared/eeprom_spi.cpp b/Marlin/src/HAL/shared/eeprom_if_spi.cpp similarity index 57% rename from Marlin/src/HAL/shared/eeprom_spi.cpp rename to Marlin/src/HAL/shared/eeprom_if_spi.cpp index ce7479aedb..a341fef9de 100644 --- a/Marlin/src/HAL/shared/eeprom_spi.cpp +++ b/Marlin/src/HAL/shared/eeprom_if_spi.cpp @@ -16,25 +16,33 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ /** - * Description: functions for SPI connected external EEPROM. - * Not platform dependent. + * Platform-independent Arduino functions for SPI EEPROM. + * Enable USE_SHARED_EEPROM if not supplied by the framework. */ #include "../../inc/MarlinConfig.h" #if ENABLED(SPI_EEPROM) -#include "../HAL.h" +#include "eeprom_if.h" + +void eeprom_init() {} + +#if ENABLED(USE_SHARED_EEPROM) #define CMD_WREN 6 // WREN #define CMD_READ 2 // WRITE #define CMD_WRITE 2 // WRITE +#ifndef EEPROM_WRITE_DELAY + #define EEPROM_WRITE_DELAY 7 +#endif + uint8_t eeprom_read_byte(uint8_t* pos) { uint8_t v; uint8_t eeprom_temp[3]; @@ -53,24 +61,6 @@ uint8_t eeprom_read_byte(uint8_t* pos) { 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]; @@ -90,29 +80,8 @@ void eeprom_write_byte(uint8_t* pos, uint8_t value) { spiSend(SPI_CHAN_EEPROM1, value); WRITE(SPI_EEPROM1_CS, HIGH); - delay(7); // wait for page write to complete + delay(EEPROM_WRITE_DELAY); // 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 +#endif // USE_SHARED_EEPROM +#endif // I2C_EEPROM diff --git a/Marlin/src/HAL/shared/esp_wifi.cpp b/Marlin/src/HAL/shared/esp_wifi.cpp new file mode 100644 index 0000000000..a55f5ca39f --- /dev/null +++ b/Marlin/src/HAL/shared/esp_wifi.cpp @@ -0,0 +1,43 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 "Delay.h" + +void esp_wifi_init(void) { // init ESP01 WIFI module pins + #if PIN_EXISTS(ESP_WIFI_MODULE_GPIO0) + OUT_WRITE(ESP_WIFI_MODULE_GPIO0_PIN, HIGH); + #endif + #if PIN_EXISTS(ESP_WIFI_MODULE_GPIO2) + OUT_WRITE(ESP_WIFI_MODULE_GPIO2_PIN, HIGH); + #endif + #if PIN_EXISTS(ESP_WIFI_MODULE_RESET) + delay(1); // power up delay (0.1mS minimum) + OUT_WRITE(ESP_WIFI_MODULE_RESET_PIN, LOW); + delay(1); + OUT_WRITE(ESP_WIFI_MODULE_RESET_PIN, HIGH); + #endif + #if PIN_EXISTS(ESP_WIFI_MODULE_ENABLE) + delay(1); // delay after reset released (0.1mS minimum) + OUT_WRITE(ESP_WIFI_MODULE_ENABLE_PIN, HIGH); + #endif +} diff --git a/Marlin/src/HAL/LPC1768/eeprom_api.h b/Marlin/src/HAL/shared/esp_wifi.h similarity index 85% rename from Marlin/src/HAL/LPC1768/eeprom_api.h rename to Marlin/src/HAL/shared/esp_wifi.h index f874eac58a..84a50a941d 100644 --- a/Marlin/src/HAL/LPC1768/eeprom_api.h +++ b/Marlin/src/HAL/shared/esp_wifi.h @@ -16,11 +16,9 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once -#include "../shared/eeprom_api.h" - -#define FLASH_EEPROM_EMULATION +void esp_wifi_init(); diff --git a/Marlin/src/HAL/shared/math_32bit.h b/Marlin/src/HAL/shared/math_32bit.h index d93ab9caf6..87e9e6406e 100644 --- a/Marlin/src/HAL/shared/math_32bit.h +++ b/Marlin/src/HAL/shared/math_32bit.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/shared/servo.cpp b/Marlin/src/HAL/shared/servo.cpp index 2c3d7bb7d3..d69cf2fe2c 100644 --- a/Marlin/src/HAL/shared/servo.cpp +++ b/Marlin/src/HAL/shared/servo.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -150,9 +150,7 @@ void Servo::move(const int value) { if (attach(0) >= 0) { write(value); safe_delay(servo_delay[servoIndex]); - #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - detach(); - #endif + TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach()); } } diff --git a/Marlin/src/HAL/shared/servo.h b/Marlin/src/HAL/shared/servo.h index b582221b86..f9c4784118 100644 --- a/Marlin/src/HAL/shared/servo.h +++ b/Marlin/src/HAL/shared/servo.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/HAL/shared/servo_private.h b/Marlin/src/HAL/shared/servo_private.h index 58e455b124..d85d8da8ba 100644 --- a/Marlin/src/HAL/shared/servo_private.h +++ b/Marlin/src/HAL/shared/servo_private.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 8130affe30..00ea51b058 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -30,6 +30,14 @@ #include "MarlinCore.h" +#include "HAL/shared/Delay.h" +#include "HAL/shared/esp_wifi.h" + +#ifdef ARDUINO + #include +#endif +#include + #include "core/utility.h" #include "lcd/ultralcd.h" #include "module/motion.h" @@ -43,20 +51,35 @@ #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 HAS_TFT_LVGL_UI + #include "lcd/extui/lib/mks_ui/tft_lvgl_configuration.h" + #include "lcd/extui/lib/mks_ui/draw_ui.h" + #include "lcd/extui/lib/mks_ui/mks_hardware_test.h" + #include +#endif + +#if ENABLED(DWIN_CREALITY_LCD) + #include "lcd/dwin/dwin.h" + #include "lcd/dwin/dwin_lcd.h" + #include "lcd/dwin/rotary_encoder.h" +#endif + +#if ENABLED(IIC_BL24CXX_EEPROM) + #include "libs/BL24CXX.h" +#endif + +#if ENABLED(DIRECT_STEPPING) + #include "feature/direct_stepping.h" +#endif + #if ENABLED(TOUCH_BUTTONS) #include "feature/touch/xpt2046.h" #endif @@ -69,7 +92,7 @@ #include "libs/buzzer.h" #endif -#if ENABLED(DIGIPOT_I2C) +#if HAS_I2C_DIGIPOT #include "feature/digipot/digipot.h" #endif @@ -153,6 +176,10 @@ #include "feature/runout.h" #endif +#if ENABLED(HOTEND_IDLE_TIMEOUT) + #include "feature/hotend_idle.h" +#endif + #if ENABLED(TEMP_STAT_LEDS) #include "feature/leds/tempstat.h" #endif @@ -181,26 +208,18 @@ #include "libs/L64XX/L64XX_Marlin.h" #endif -const char NUL_STR[] PROGMEM = "", - M112_KILL_STR[] PROGMEM = "M112 Shutdown", - G28_STR[] PROGMEM = "G28", - M21_STR[] PROGMEM = "M21", - M23_STR[] PROGMEM = "M23 %s", - M24_STR[] PROGMEM = "M24", - SP_P_STR[] PROGMEM = " P", - SP_T_STR[] PROGMEM = " T", - SP_X_STR[] PROGMEM = " X", - SP_Y_STR[] PROGMEM = " Y", - SP_Z_STR[] PROGMEM = " Z", - SP_E_STR[] PROGMEM = " E", - X_LBL[] PROGMEM = "X:", - Y_LBL[] PROGMEM = "Y:", - Z_LBL[] PROGMEM = "Z:", - E_LBL[] PROGMEM = "E:", - SP_X_LBL[] PROGMEM = " X:", - SP_Y_LBL[] PROGMEM = " Y:", - SP_Z_LBL[] PROGMEM = " Z:", - SP_E_LBL[] PROGMEM = " E:"; +PGMSTR(NUL_STR, ""); +PGMSTR(M112_KILL_STR, "M112 Shutdown"); +PGMSTR(G28_STR, "G28"); +PGMSTR(M21_STR, "M21"); +PGMSTR(M23_STR, "M23 %s"); +PGMSTR(M24_STR, "M24"); +PGMSTR(SP_P_STR, " P"); PGMSTR(SP_T_STR, " T"); +PGMSTR(X_STR, "X"); PGMSTR(Y_STR, "Y"); PGMSTR(Z_STR, "Z"); PGMSTR(E_STR, "E"); +PGMSTR(X_LBL, "X:"); PGMSTR(Y_LBL, "Y:"); PGMSTR(Z_LBL, "Z:"); PGMSTR(E_LBL, "E:"); +PGMSTR(SP_A_STR, " A"); PGMSTR(SP_B_STR, " B"); PGMSTR(SP_C_STR, " C"); +PGMSTR(SP_X_STR, " X"); PGMSTR(SP_Y_STR, " Y"); PGMSTR(SP_Z_STR, " Z"); PGMSTR(SP_E_STR, " E"); +PGMSTR(SP_X_LBL, " X:"); PGMSTR(SP_Y_LBL, " Y:"); PGMSTR(SP_Z_LBL, " Z:"); PGMSTR(SP_E_LBL, " E:"); MarlinState marlin_state = MF_INITIALIZING; @@ -212,28 +231,17 @@ bool wait_for_heatup = true; bool wait_for_user; // = false; void wait_for_user_response(millis_t ms/*=0*/, const bool no_sleep/*=false*/) { - #if DISABLED(ADVANCED_PAUSE_FEATURE) - UNUSED(no_sleep); - #endif + TERN(ADVANCED_PAUSE_FEATURE,,UNUSED(no_sleep)); KEEPALIVE_STATE(PAUSED_FOR_USER); wait_for_user = true; if (ms) ms += millis(); // expire time - while (wait_for_user && !(ms && ELAPSED(millis(), ms))) { - idle( - #if ENABLED(ADVANCED_PAUSE_FEATURE) - no_sleep - #endif - ); - } + while (wait_for_user && !(ms && ELAPSED(millis(), ms))) + idle(TERN_(ADVANCED_PAUSE_FEATURE, no_sleep)); wait_for_user = 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 @@ -250,7 +258,11 @@ millis_t max_inactive_time, // = 0 void setup_killpin() { #if HAS_KILL - SET_INPUT_PULLUP(KILL_PIN); + #if KILL_PIN_STATE + SET_INPUT_PULLDOWN(KILL_PIN); + #else + SET_INPUT_PULLUP(KILL_PIN); + #endif #endif } @@ -290,6 +302,9 @@ void setup_powerhold() { #include "pins/sensitive_pins.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wnarrowing" + bool pin_is_protected(const pin_t pin) { static const pin_t sensitive_pins[] PROGMEM = SENSITIVE_PINS; LOOP_L_N(i, COUNT(sensitive_pins)) { @@ -300,6 +315,8 @@ bool pin_is_protected(const pin_t pin) { return false; } +#pragma GCC diagnostic pop + void protected_pin_err() { SERIAL_ERROR_MSG(STR_ERR_PROTECTED_PIN); } @@ -317,9 +334,7 @@ void enable_e_steppers() { } void enable_all_steppers() { - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif + TERN_(AUTO_POWER_CONTROL, powerManager.power_on()); ENABLE_AXIS_X(); ENABLE_AXIS_Y(); ENABLE_AXIS_Z(); @@ -363,9 +378,7 @@ void disable_all_steppers() { } void event_probe_recover() { - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_INFO, PSTR("G29 Retrying"), DISMISS_STR); - #endif + TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, PSTR("G29 Retrying"), DISMISS_STR)); #ifdef ACTION_ON_G29_RECOVER host_action(PSTR(ACTION_ON_G29_RECOVER)); #endif @@ -382,6 +395,13 @@ void disable_all_steppers() { constexpr bool did_pause_print = false; #endif +/** + * A Print Job exists when the timer is running or SD printing + */ +bool printJobOngoing() { + return print_job_timer.isRunning() || IS_SD_PRINTING(); +} + /** * Printing is active when the print job timer is running */ @@ -398,12 +418,8 @@ bool printingIsPaused() { void startOrResumeJob() { if (!printingIsPaused()) { - #if ENABLED(CANCEL_OBJECTS) - cancelable.reset(); - #endif - #if ENABLED(LCD_SHOW_E_TOTAL) - e_move_accumulator = 0; - #endif + TERN_(CANCEL_OBJECTS, cancelable.reset()); + TERN_(LCD_SHOW_E_TOTAL, e_move_accumulator = 0); #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) ui.reset_remaining_time(); #endif @@ -414,22 +430,20 @@ void startOrResumeJob() { #if ENABLED(SDSUPPORT) inline void abortSDPrinting() { - card.endFilePrint( - #if SD_RESORT - true - #endif - ); + card.endFilePrint(TERN_(SD_RESORT, true)); 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) - recovery.purge(); + #if !HAS_CUTTER + thermalManager.zero_fan_speeds(); + #else + cutter.kill(); // Full cutter shutdown including ISR control #endif + wait_for_heatup = false; + TERN_(POWER_LOSS_RECOVERY, recovery.purge()); #ifdef EVENT_GCODE_SD_STOP queue.inject_P(PSTR(EVENT_GCODE_SD_STOP)); #endif @@ -444,7 +458,6 @@ void startOrResumeJob() { /** * Minimal management of Marlin's core 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 @@ -455,43 +468,46 @@ void startOrResumeJob() { * - Check if an idle but hot extruder needs filament extruded (EXTRUDER_RUNOUT_PREVENT) * - Pulse FET_SAFETY_PIN if it exists */ - inline 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)) { + // Prevent steppers timing-out in the middle of M600 + // unless PAUSE_PARK_NO_STEPPER_TIMEOUT is disabled + const bool parked_or_ignoring = ignore_stepper_queue || + (BOTH(ADVANCED_PAUSE_FEATURE, PAUSE_PARK_NO_STEPPER_TIMEOUT) && did_pause_print); + + // Reset both the M18/M84 activity timeout and the M85 max 'kill' timeout + if (parked_or_ignoring) gcode.reset_stepper_timeout(ms); + + if (gcode.stepper_max_timed_out(ms)) { SERIAL_ERROR_START(); SERIAL_ECHOLNPAIR(STR_KILL_INACTIVE_TIME, parser.command_ptr); kill(); } - // Prevent steppers timing-out in the middle of M600 - #define STAY_TEST (BOTH(ADVANCED_PAUSE_FEATURE, PAUSE_PARK_NO_STEPPER_TIMEOUT) && did_pause_print) + // M18 / M94 : Handle steppers inactive time timeout + if (gcode.stepper_inactive_time) { - if (stepper_inactive_time) { static bool already_shutdown_steppers; // = false + + // Any moves in the planner? Resets both the M18/M84 + // activity timeout and the M85 max 'kill' timeout if (planner.has_blocks_queued()) - gcode.reset_stepper_timeout(); - else if (!STAY_TEST && !ignore_stepper_queue && ELAPSED(ms, gcode.previous_move_ms + stepper_inactive_time)) { + gcode.reset_stepper_timeout(ms); + else if (!parked_or_ignoring && gcode.stepper_inactive_timeout()) { if (!already_shutdown_steppers) { already_shutdown_steppers = true; // L6470 SPI will consume 99% of free time without this + + // Individual axes will be disabled if configured if (ENABLED(DISABLE_INACTIVE_X)) DISABLE_AXIS_X(); if (ENABLED(DISABLE_INACTIVE_Y)) DISABLE_AXIS_Y(); if (ENABLED(DISABLE_INACTIVE_Z)) DISABLE_AXIS_Z(); if (ENABLED(DISABLE_INACTIVE_E)) disable_e_steppers(); - #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 + + TERN_(AUTO_BED_LEVELING_UBL, ubl.steppers_were_disabled()); } } else @@ -512,7 +528,7 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) { // ------------------------------------------------------------------------------- static int killCount = 0; // make the inactivity button a bit less responsive const int KILL_DELAY = 750; - if (!READ(KILL_PIN)) + if (kill_state()) killCount++; else if (killCount > 0) killCount--; @@ -540,17 +556,15 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) { } #endif - #if ENABLED(USE_CONTROLLER_FAN) - controllerFan.update(); // Check if fan should be turned on to cool stepper drivers down - #endif + TERN_(USE_CONTROLLER_FAN, controllerFan.update()); // Check if fan should be turned on to cool stepper drivers down - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.check(); - #endif + TERN_(AUTO_POWER_CONTROL, powerManager.check()); + + TERN_(HOTEND_IDLE_TIMEOUT, hotend_idle.check()); #if ENABLED(EXTRUDER_RUNOUT_PREVENT) if (thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP - && ELAPSED(ms, gcode.previous_move_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL) + && ELAPSED(ms, gcode.previous_move_ms + SEC_TO_MS(EXTRUDER_RUNOUT_SECONDS)) && !planner.has_blocks_queued() ) { #if ENABLED(SWITCHING_EXTRUDER) @@ -600,7 +614,7 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) { } #endif // !SWITCHING_EXTRUDER - gcode.reset_stepper_timeout(); + gcode.reset_stepper_timeout(ms); } #endif // EXTRUDER_RUNOUT_PREVENT @@ -614,17 +628,11 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) { } #endif - #if ENABLED(TEMP_STAT_LEDS) - handle_status_leds(); - #endif + TERN_(TEMP_STAT_LEDS, handle_status_leds()); - #if ENABLED(MONITOR_DRIVER_STATUS) - monitor_tmc_drivers(); - #endif + TERN_(MONITOR_DRIVER_STATUS, monitor_tmc_drivers()); - #if ENABLED(MONITOR_L6470_DRIVER_STATUS) - L64xxManager.monitor_driver(); - #endif + TERN_(MONITOR_L6470_DRIVER_STATUS, L64xxManager.monitor_driver()); // Limit check_axes_activity frequency to 10Hz static millis_t next_check_axes_ms = 0; @@ -645,54 +653,81 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) { } /** - * Standard idle routine keeps the machine alive + * Standard idle routine keeps the machine alive: + * - Core Marlin activities + * - Manage heaters (and Watchdog) + * - Max7219 heartbeat, animation, etc. + * + * Only after setup() is complete: + * - Handle filament runout sensors + * - Run HAL idle tasks + * - Handle Power-Loss Recovery + * - Run StallGuard endstop checks + * - Handle SD Card insert / remove + * - Handle USB Flash Drive insert / remove + * - Announce Host Keepalive state (if any) + * - Update the Print Job Timer state + * - Update the Beeper queue + * - Read Buttons and Update the LCD + * - Run i2c Position Encoders + * - Auto-report Temperatures / SD Status + * - Update the Prusa MMU2 + * - Handle Joystick jogging */ -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 +void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) { - #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 - ); + // Core Marlin activities + manage_inactivity(TERN_(ADVANCED_PAUSE_FEATURE, no_stepper_sleep)); + // Manage Heaters (and Watchdog) thermalManager.manage_heater(); - #if ENABLED(PRINTCOUNTER) - print_job_timer.tick(); + // Max7219 heartbeat, animation, etc + TERN_(MAX7219_DEBUG, max7219.idle_tasks()); + + // Return if setup() isn't completed + if (marlin_state == MF_INITIALIZING) return; + + // Handle filament runout sensors + TERN_(HAS_FILAMENT_SENSOR, runout.run()); + + // Run HAL idle tasks + #ifdef HAL_IDLETASK + HAL_idletask(); #endif - #if USE_BEEPER - buzzer.tick(); + // Handle Power-Loss Recovery + #if ENABLED(POWER_LOSS_RECOVERY) && PIN_EXISTS(POWER_LOSS) + if (printJobOngoing()) recovery.outage(); #endif + // Run StallGuard endstop checks + #if ENABLED(SPI_ENDSTOPS) + if (endstops.tmc_spi_homing.any + && TERN1(IMPROVE_HOMING_RELIABILITY, ELAPSED(millis(), sg_guard_period)) + ) LOOP_L_N(i, 4) // Read SGT 4 times per idle loop + if (endstops.tmc_spi_homing_check()) break; + #endif + + // Handle SD Card insert / remove + TERN_(SDSUPPORT, card.manage_media()); + + // Handle USB Flash Drive insert / remove + TERN_(USB_FLASH_DRIVE_SUPPORT, Sd2Card::idle()); + + // Announce Host Keepalive state (if any) + TERN_(HOST_KEEPALIVE_FEATURE, gcode.host_keepalive()); + + // Update the Print Job Timer state + TERN_(PRINTCOUNTER, print_job_timer.tick()); + + // Update the Beeper queue + TERN_(USE_BEEPER, buzzer.tick()); + + // Handle UI input / draw events + TERN(DWIN_CREALITY_LCD, DWIN_Update(), ui.update()); + + // Run i2c Position Encoders #if ENABLED(I2C_POSITION_ENCODERS) static millis_t i2cpem_next_update_ms; if (planner.has_blocks_queued()) { @@ -704,31 +739,25 @@ void idle( } #endif - #ifdef HAL_IDLETASK - HAL_idletask(); - #endif - + // Auto-report Temperatures / SD Status #if HAS_AUTO_REPORTING if (!gcode.autoreport_paused) { - #if ENABLED(AUTO_REPORT_TEMPERATURES) - thermalManager.auto_report_temperatures(); - #endif - #if ENABLED(AUTO_REPORT_SD_STATUS) - card.auto_report_sd_status(); - #endif + TERN_(AUTO_REPORT_TEMPERATURES, thermalManager.auto_report_temperatures()); + TERN_(AUTO_REPORT_SD_STATUS, card.auto_report_sd_status()); } #endif - #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - Sd2Card::idle(); - #endif + // Update the Prusa MMU2 + TERN_(PRUSA_MMU2, mmu2.mmu_loop()); - #if ENABLED(PRUSA_MMU2) - mmu2.mmu_loop(); - #endif + // Handle Joystick jogging + TERN_(POLL_JOG, joystick.inject_jog_moves()); - #if ENABLED(POLL_JOG) - joystick.inject_jog_moves(); + // Direct Stepping + TERN_(DIRECT_STEPPING, page_manager.write_responses()); + + #if HAS_TFT_LVGL_UI + LV_TASK_HANDLER(); #endif } @@ -739,6 +768,8 @@ void idle( void kill(PGM_P const lcd_error/*=nullptr*/, PGM_P const lcd_component/*=nullptr*/, const bool steppers_off/*=false*/) { thermalManager.disable_all_heaters(); + TERN_(HAS_CUTTER, cutter.kill()); // Full cutter shutdown including ISR control + SERIAL_ERROR_MSG(STR_ERR_KILLED); #if HAS_DISPLAY @@ -768,33 +799,31 @@ void minkill(const bool steppers_off/*=false*/) { // Reiterate heaters off thermalManager.disable_all_heaters(); + TERN_(HAS_CUTTER, cutter.kill()); // Reiterate cutter shutdown + // 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 + TERN_(PSU_CONTROL, PSU_OFF()); - #if HAS_SUICIDE - suicide(); - #endif + TERN_(HAS_SUICIDE, suicide()); #if HAS_KILL // Wait for kill to be released - while (!READ(KILL_PIN)) watchdog_refresh(); + while (kill_state()) watchdog_refresh(); // Wait for kill to be pressed - while (READ(KILL_PIN)) watchdog_refresh(); + while (!kill_state()) watchdog_refresh(); - void (*resetFunc)() = 0; // Declare resetFunc() at address 0 + void (*resetFunc)() = 0; // Declare resetFunc() at address 0 resetFunc(); // Jump to address 0 - #else // !HAS_KILL + #else - for (;;) watchdog_refresh(); // Wait for reset + for (;;) watchdog_refresh(); // Wait for reset - #endif // !HAS_KILL + #endif } /** @@ -838,86 +867,93 @@ void stop() { */ void setup() { - HAL_init(); - - #if HAS_L64XX - L64xxManager.init(); // Set up SPI, init drivers + #if ENABLED(MARLIN_DEV_MODE) + auto log_current_ms = [&](PGM_P const msg) { + SERIAL_ECHO_START(); + SERIAL_CHAR('['); SERIAL_ECHO(millis()); SERIAL_ECHOPGM("] "); + serialprintPGM(msg); + SERIAL_EOL(); + }; + #define SETUP_LOG(M) log_current_ms(PSTR(M)) + #else + #define SETUP_LOG(...) NOOP #endif + #define SETUP_RUN(C) do{ SETUP_LOG(STRINGIFY(C)); C; }while(0) - #if ENABLED(SMART_EFFECTOR) && PIN_EXISTS(SMART_EFFECTOR_MOD) - OUT_WRITE(SMART_EFFECTOR_MOD_PIN, LOW); // Put Smart Effector into NORMAL mode - #endif - - #if ENABLED(DISABLE_DEBUG) + #if EITHER(DISABLE_DEBUG, DISABLE_JTAG) // Disable any hardware debug to free up pins for IO - #ifdef JTAGSWD_DISABLE + #if ENABLED(DISABLE_DEBUG) && defined(JTAGSWD_DISABLE) JTAGSWD_DISABLE(); #elif defined(JTAG_DISABLE) JTAG_DISABLE(); #else - #error "DISABLE_DEBUG is not supported for the selected MCU/Board" + #error "DISABLE_(DEBUG|JTAG) 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); uint32_t serial_connect_timeout = millis() + 1000UL; while (!MYSERIAL0 && PENDING(millis(), serial_connect_timeout)) { /*nada*/ } - #if NUM_SERIAL > 1 + #if HAS_MULTI_SERIAL MYSERIAL1.begin(BAUDRATE); serial_connect_timeout = millis() + 1000UL; while (!MYSERIAL1 && PENDING(millis(), serial_connect_timeout)) { /*nada*/ } #endif + SERIAL_ECHO_MSG("start"); #endif - SERIAL_ECHOLNPGM("start"); - SERIAL_ECHO_START(); + SETUP_RUN(HAL_init()); + + #if HAS_L64XX + SETUP_RUN(L64xxManager.init()); // Set up SPI, init drivers + #endif + + #if ENABLED(SMART_EFFECTOR) && PIN_EXISTS(SMART_EFFECTOR_MOD) + OUT_WRITE(SMART_EFFECTOR_MOD_PIN, LOW); // Put Smart Effector into NORMAL mode + #endif + + #if HAS_FILAMENT_SENSOR + SETUP_RUN(runout.setup()); + #endif + + #if ENABLED(POWER_LOSS_RECOVERY) + SETUP_RUN(recovery.setup()); + #endif + + SETUP_RUN(setup_killpin()); + + #if HAS_TMC220x + SETUP_RUN(tmc_serial_begin()); + #endif + + SETUP_RUN(setup_powerhold()); + + #if HAS_STEPPER_RESET + SETUP_RUN(disableStepperDrivers()); + #endif #if HAS_TMC_SPI #if DISABLED(TMC_USE_SW_SPI) - SPI.begin(); + SETUP_RUN(SPI.begin()); #endif - tmc_init_cs_pins(); + SETUP_RUN(tmc_init_cs_pins()); #endif #ifdef BOARD_INIT + SETUP_LOG("BOARD_INIT"); BOARD_INIT(); #endif + SETUP_RUN(esp_wifi_init()); + // Check startup - does nothing if bootloader sets MCUSR to 0 - byte mcu = HAL_get_reset_source(); - if (mcu & 1) SERIAL_ECHOLNPGM(STR_POWERUP); - if (mcu & 2) SERIAL_ECHOLNPGM(STR_EXTERNAL_RESET); - if (mcu & 4) SERIAL_ECHOLNPGM(STR_BROWNOUT_RESET); - if (mcu & 8) SERIAL_ECHOLNPGM(STR_WATCHDOG_RESET); - if (mcu & 32) SERIAL_ECHOLNPGM(STR_SOFTWARE_RESET); + const byte mcu = HAL_get_reset_source(); + if (mcu & RST_POWER_ON) SERIAL_ECHOLNPGM(STR_POWERUP); + if (mcu & RST_EXTERNAL) SERIAL_ECHOLNPGM(STR_EXTERNAL_RESET); + if (mcu & RST_BROWN_OUT) SERIAL_ECHOLNPGM(STR_BROWNOUT_RESET); + if (mcu & RST_WATCHDOG) SERIAL_ECHOLNPGM(STR_WATCHDOG_RESET); + if (mcu & RST_SOFTWARE) SERIAL_ECHOLNPGM(STR_SOFTWARE_RESET); HAL_clear_reset_source(); serialprintPGM(GET_TEXT(MSG_MARLIN)); @@ -937,22 +973,6 @@ void setup() { SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(STR_FREE_MEMORY, freeMemory(), STR_PLANNER_BUFFER_BYTES, (int)sizeof(block_t) * (BLOCK_BUFFER_SIZE)); - // UI must be initialized before EEPROM - // (because EEPROM code calls the UI). - - #if ENABLED(MARLIN_DEV_MODE) - auto log_current_ms = [&](PGM_P const msg) { - SERIAL_ECHO_START(); - SERIAL_CHAR('['); SERIAL_ECHO(millis()); SERIAL_ECHO("] "); - serialprintPGM(msg); - SERIAL_EOL(); - }; - #define SETUP_LOG(M) log_current_ms(PSTR(M)) - #else - #define SETUP_LOG(...) NOOP - #endif - #define SETUP_RUN(C) do{ SETUP_LOG(STRINGIFY(C)); C; }while(0) - // Set up LEDs early #if HAS_COLOR_LEDS SETUP_RUN(leds.setup()); @@ -962,31 +982,35 @@ void setup() { SETUP_RUN(controllerFan.setup()); #endif - SETUP_RUN(ui.init()); - SETUP_RUN(ui.reset_status()); // Load welcome message early. (Retained if no errors exist.) + // UI must be initialized before EEPROM + // (because EEPROM code calls the UI). - #if HAS_SPI_LCD && ENABLED(SHOW_BOOTSCREEN) - SETUP_RUN(ui.show_bootscreen()); + #if ENABLED(DWIN_CREALITY_LCD) + delay(800); // Required delay (since boot?) + SERIAL_ECHOPGM("\nDWIN handshake "); + if (DWIN_Handshake()) SERIAL_ECHOLNPGM("ok."); else SERIAL_ECHOLNPGM("error."); + DWIN_Frame_SetDir(1); // Orientation 90° + DWIN_UpdateLCD(); // Show bootscreen (first image) + #else + SETUP_RUN(ui.init()); + #if HAS_SPI_LCD && ENABLED(SHOW_BOOTSCREEN) + SETUP_RUN(ui.show_bootscreen()); + #endif + SETUP_RUN(ui.reset_status()); // Load welcome message early. (Retained if no errors exist.) #endif - #if ENABLED(SDSUPPORT) && defined(SDCARD_CONNECTION) && !SD_CONNECTION_IS(LCD) - SETUP_RUN(card.mount()); // Mount onboard / custom SD card before settings.first_load + #if BOTH(SDSUPPORT, SDCARD_EEPROM_EMULATION) + SETUP_RUN(card.mount()); // Mount media with settings before first_load #endif SETUP_RUN(settings.first_load()); // Load data from EEPROM if available (or use defaults) // This also updates variables in the planner, elsewhere - #if HAS_SERVICE_INTERVALS - SETUP_RUN(ui.reset_status(true)); // Show service messages or keep current status - #endif - #if ENABLED(TOUCH_BUTTONS) SETUP_RUN(touch.init()); #endif - #if HAS_M206_COMMAND - current_position += home_offset; // Init current position based on home_offset - #endif + TERN_(HAS_M206_COMMAND, current_position += home_offset); // Init current position based on home_offset sync_plan_position(); // Vital to init stepper/planner equivalent for current_position @@ -1029,7 +1053,7 @@ void setup() { SETUP_RUN(enableStepperDrivers()); #endif - #if ENABLED(DIGIPOT_I2C) + #if HAS_I2C_DIGIPOT SETUP_RUN(digipot_i2c_init()); #endif @@ -1113,23 +1137,19 @@ void setup() { #endif #if ENABLED(SWITCHING_TOOLHEAD) - swt_init(); + SETUP_RUN(swt_init()); #endif #if ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) SETUP_RUN(est_init()); #endif - #if ENABLED(POWER_LOSS_RECOVERY) - SETUP_RUN(recovery.check()); - #endif - #if ENABLED(USE_WATCHDOG) SETUP_RUN(watchdog_init()); // Reinit watchdog after HAL_get_reset_source call #endif #if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) - SETUP_RUN(init_closedloop()); + SETUP_RUN(closedloop.init()); #endif #ifdef STARTUP_COMMANDS @@ -1137,10 +1157,6 @@ void setup() { queue.inject_P(PSTR(STARTUP_COMMANDS)); #endif - #if ENABLED(INIT_SDCARD_ON_BOOT) && !HAS_SPI_LCD - SETUP_RUN(card.beginautostart()); - #endif - #if ENABLED(HOST_PROMPT_SUPPORT) SETUP_RUN(host_action_prompt_end()); #endif @@ -1153,10 +1169,35 @@ void setup() { SETUP_RUN(mmu2.init()); #endif + #if ENABLED(IIC_BL24CXX_EEPROM) + BL24CXX::init(); + const uint8_t err = BL24CXX::check(); + SERIAL_ECHO_TERNARY(err, "BL24CXX Check ", "failed", "succeeded", "!\n"); + #endif + + #if ENABLED(DWIN_CREALITY_LCD) + Encoder_Configuration(); + HMI_Init(); + HMI_StartFrame(true); + #endif + + #if HAS_SERVICE_INTERVALS && DISABLED(DWIN_CREALITY_LCD) + ui.reset_status(true); // Show service messages or keep current status + #endif + #if ENABLED(MAX7219_DEBUG) SETUP_RUN(max7219.init()); #endif + #if ENABLED(DIRECT_STEPPING) + SETUP_RUN(page_manager.init()); + #endif + + #if HAS_TFT_LVGL_UI + if (!card.isMounted()) SETUP_RUN(card.mount()); // Mount SD to load graphics and fonts + SETUP_RUN(tft_lvgl_init()); + #endif + marlin_state = MF_RUNNING; SETUP_LOG("setup() completed."); @@ -1189,5 +1230,7 @@ void loop() { endstops.event_handler(); + TERN_(HAS_TFT_LVGL_UI, printer_state_polling()); + } while (ENABLED(__AVR__)); // Loop forever on slower (AVR) boards } diff --git a/Marlin/src/MarlinCore.h b/Marlin/src/MarlinCore.h index e6678c5b18..81041c8ee6 100644 --- a/Marlin/src/MarlinCore.h +++ b/Marlin/src/MarlinCore.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -31,26 +31,11 @@ #include #include -#if HAS_L64XX - #include "libs/L64XX/L64XX_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 timing out - #endif -); - -inline void idle_no_sleep() { - idle( - #if ENABLED(ADVANCED_PAUSE_FEATURE) - true - #endif - ); -} +// Pass true to keep steppers from timing out +void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep=false)); +inline void idle_no_sleep() { idle(TERN_(ADVANCED_PAUSE_FEATURE, true)); } #if ENABLED(EXPERIMENTAL_I2CBUS) #include "feature/twibus.h" @@ -102,13 +87,6 @@ extern bool wait_for_heatup; void wait_for_user_response(millis_t ms=0, const bool no_sleep=false); #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) @@ -129,12 +107,19 @@ void protected_pin_err(); inline void suicide() { OUT_WRITE(SUICIDE_PIN, SUICIDE_PIN_INVERTING); } #endif +#if HAS_KILL + #ifndef KILL_PIN_STATE + #define KILL_PIN_STATE LOW + #endif + inline bool kill_state() { return READ(KILL_PIN) == KILL_PIN_STATE; } +#endif + #if ENABLED(G29_RETRY_AND_RECOVER) void event_probe_recover(); void event_probe_failure(); #endif extern const char NUL_STR[], M112_KILL_STR[], G28_STR[], M21_STR[], M23_STR[], M24_STR[], + SP_A_STR[], SP_B_STR[], SP_C_STR[], SP_P_STR[], SP_T_STR[], SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[], X_LBL[], Y_LBL[], Z_LBL[], E_LBL[], SP_X_LBL[], SP_Y_LBL[], SP_Z_LBL[], SP_E_LBL[]; - diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 30c2d3eb87..6e57a43747 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -56,54 +56,57 @@ #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 BASE v1.4 with Allegro A4982 stepper drivers -#define BOARD_MKS_BASE_15 1107 // MKS BASE v1.5 with Allegro A4982 stepper drivers -#define BOARD_MKS_BASE_16 1108 // MKS BASE v1.6 with Allegro A4982 stepper drivers -#define BOARD_MKS_BASE_HEROIC 1109 // MKS BASE 1.0 with Heroic HR4982 stepper drivers -#define BOARD_MKS_GEN_13 1110 // MKS GEN v1.3 or 1.4 -#define BOARD_MKS_GEN_L 1111 // MKS GEN L -#define BOARD_KFB_2 1112 // BigTreeTech or BIQU KFB2.0 -#define BOARD_ZRIB_V20 1113 // zrib V2.0 control board (Chinese knock off RAMPS replica) -#define BOARD_FELIX2 1114 // Felix 2.0+ Electronics Board (RAMPS like) -#define BOARD_RIGIDBOARD 1115 // Invent-A-Part RigidBoard -#define BOARD_RIGIDBOARD_V2 1116 // Invent-A-Part RigidBoard V2 -#define BOARD_SAINSMART_2IN1 1117 // Sainsmart 2-in-1 board -#define BOARD_ULTIMAKER 1118 // Ultimaker -#define BOARD_ULTIMAKER_OLD 1119 // Ultimaker (Older electronics. Pre 1.5.4. This is rare) -#define BOARD_AZTEEG_X3 1120 // Azteeg X3 -#define BOARD_AZTEEG_X3_PRO 1121 // Azteeg X3 Pro -#define BOARD_ULTIMAIN_2 1122 // Ultimainboard 2.x (Uses TEMP_SENSOR 20) -#define BOARD_RUMBA 1123 // Rumba -#define BOARD_RUMBA_RAISE3D 1124 // Raise3D N series Rumba derivative -#define BOARD_RL200 1125 // Rapide Lite 200 (v1, low-cost RUMBA clone with drv) -#define BOARD_FORMBOT_TREX2PLUS 1126 // Formbot T-Rex 2 Plus -#define BOARD_FORMBOT_TREX3 1127 // Formbot T-Rex 3 -#define BOARD_FORMBOT_RAPTOR 1128 // Formbot Raptor -#define BOARD_FORMBOT_RAPTOR2 1129 // Formbot Raptor 2 -#define BOARD_BQ_ZUM_MEGA_3D 1130 // bq ZUM Mega 3D -#define BOARD_MAKEBOARD_MINI 1131 // MakeBoard Mini v2.1.2 is a control board sold by MicroMake -#define BOARD_TRIGORILLA_13 1132 // TriGorilla Anycubic version 1.3-based on RAMPS EFB -#define BOARD_TRIGORILLA_14 1133 // ... Ver 1.4 -#define BOARD_TRIGORILLA_14_11 1134 // ... Rev 1.1 (new servo pin order) -#define BOARD_RAMPS_ENDER_4 1135 // Creality: Ender-4, CR-8 -#define BOARD_RAMPS_CREALITY 1136 // Creality: CR10S, CR20, CR-X -#define BOARD_RAMPS_DAGOMA 1137 // Dagoma F5 -#define BOARD_FYSETC_F6_13 1138 // FYSETC F6 1.3 -#define BOARD_FYSETC_F6_14 1139 // FYSETC F6 1.4 -#define BOARD_DUPLICATOR_I3_PLUS 1140 // Wanhao Duplicator i3 Plus -#define BOARD_VORON 1141 // VORON Design -#define BOARD_TRONXY_V3_1_0 1142 // Tronxy TRONXY-V3-1.0 -#define BOARD_Z_BOLT_X_SERIES 1143 // Z-Bolt X Series -#define BOARD_TT_OSCAR 1144 // TT OSCAR -#define BOARD_OVERLORD 1145 // Overlord/Overlord Pro -#define BOARD_HJC2560C_REV1 1146 // ADIMLab Gantry v1 -#define BOARD_HJC2560C_REV2 1147 // ADIMLab Gantry v2 -#define BOARD_TANGO 1148 // BIQU Tango V1 -#define BOARD_MKS_GEN_L_V2 1149 // MKS GEN L V2 -#define BOARD_COPYMASTER_3D 1150 // Copymaster 3D +#define BOARD_K8600 1103 // Velleman K8600 Controller (Vertex Nano) +#define BOARD_BAM_DICE 1104 // 2PrintBeta BAM&DICE with STK drivers +#define BOARD_BAM_DICE_DUE 1105 // 2PrintBeta BAM&DICE Due with STK drivers +#define BOARD_MKS_BASE 1106 // MKS BASE v1.0 +#define BOARD_MKS_BASE_14 1107 // MKS BASE v1.4 with Allegro A4982 stepper drivers +#define BOARD_MKS_BASE_15 1108 // MKS BASE v1.5 with Allegro A4982 stepper drivers +#define BOARD_MKS_BASE_16 1109 // MKS BASE v1.6 with Allegro A4982 stepper drivers +#define BOARD_MKS_BASE_HEROIC 1110 // MKS BASE 1.0 with Heroic HR4982 stepper drivers +#define BOARD_MKS_GEN_13 1111 // MKS GEN v1.3 or 1.4 +#define BOARD_MKS_GEN_L 1112 // MKS GEN L +#define BOARD_KFB_2 1113 // BigTreeTech or BIQU KFB2.0 +#define BOARD_ZRIB_V20 1114 // zrib V2.0 control board (Chinese knock off RAMPS replica) +#define BOARD_FELIX2 1115 // Felix 2.0+ Electronics Board (RAMPS like) +#define BOARD_RIGIDBOARD 1116 // Invent-A-Part RigidBoard +#define BOARD_RIGIDBOARD_V2 1117 // Invent-A-Part RigidBoard V2 +#define BOARD_SAINSMART_2IN1 1118 // Sainsmart 2-in-1 board +#define BOARD_ULTIMAKER 1119 // Ultimaker +#define BOARD_ULTIMAKER_OLD 1120 // Ultimaker (Older electronics. Pre 1.5.4. This is rare) +#define BOARD_AZTEEG_X3 1121 // Azteeg X3 +#define BOARD_AZTEEG_X3_PRO 1122 // Azteeg X3 Pro +#define BOARD_ULTIMAIN_2 1123 // Ultimainboard 2.x (Uses TEMP_SENSOR 20) +#define BOARD_RUMBA 1124 // Rumba +#define BOARD_RUMBA_RAISE3D 1125 // Raise3D N series Rumba derivative +#define BOARD_RL200 1126 // Rapide Lite 200 (v1, low-cost RUMBA clone with drv) +#define BOARD_FORMBOT_TREX2PLUS 1127 // Formbot T-Rex 2 Plus +#define BOARD_FORMBOT_TREX3 1128 // Formbot T-Rex 3 +#define BOARD_FORMBOT_RAPTOR 1129 // Formbot Raptor +#define BOARD_FORMBOT_RAPTOR2 1130 // Formbot Raptor 2 +#define BOARD_BQ_ZUM_MEGA_3D 1131 // bq ZUM Mega 3D +#define BOARD_MAKEBOARD_MINI 1132 // MakeBoard Mini v2.1.2 is a control board sold by MicroMake +#define BOARD_TRIGORILLA_13 1133 // TriGorilla Anycubic version 1.3-based on RAMPS EFB +#define BOARD_TRIGORILLA_14 1134 // ... Ver 1.4 +#define BOARD_TRIGORILLA_14_11 1135 // ... Rev 1.1 (new servo pin order) +#define BOARD_RAMPS_ENDER_4 1136 // Creality: Ender-4, CR-8 +#define BOARD_RAMPS_CREALITY 1137 // Creality: CR10S, CR20, CR-X +#define BOARD_RAMPS_DAGOMA 1138 // Dagoma F5 +#define BOARD_FYSETC_F6_13 1139 // FYSETC F6 1.3 +#define BOARD_FYSETC_F6_14 1140 // FYSETC F6 1.4 +#define BOARD_DUPLICATOR_I3_PLUS 1141 // Wanhao Duplicator i3 Plus +#define BOARD_VORON 1142 // VORON Design +#define BOARD_TRONXY_V3_1_0 1143 // Tronxy TRONXY-V3-1.0 +#define BOARD_Z_BOLT_X_SERIES 1144 // Z-Bolt X Series +#define BOARD_TT_OSCAR 1145 // TT OSCAR +#define BOARD_OVERLORD 1146 // Overlord/Overlord Pro +#define BOARD_HJC2560C_REV1 1147 // ADIMLab Gantry v1 +#define BOARD_HJC2560C_REV2 1148 // ADIMLab Gantry v2 +#define BOARD_TANGO 1149 // BIQU Tango V1 +#define BOARD_MKS_GEN_L_V2 1150 // MKS GEN L V2 +#define BOARD_COPYMASTER_3D 1151 // Copymaster 3D +#define BOARD_ORTUR_4 1152 // Ortur 4 +#define BOARD_TENLOG_D3_HERO 1153 // Tenlog D3 Hero IDEX printer // // RAMBo and derivatives @@ -160,13 +163,14 @@ #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) +#define BOARD_MELZI_V2 1503 // Melzi V2 +#define BOARD_MELZI_MAKR3D 1504 // Melzi with ATmega1284 (MaKr3d version) +#define BOARD_MELZI_CREALITY 1505 // Melzi Creality3D board (for CR-10 etc) +#define BOARD_MELZI_MALYAN 1506 // Melzi Malyan M150 board +#define BOARD_MELZI_TRONXY 1507 // Tronxy X5S +#define BOARD_STB_11 1508 // STB V1.1 +#define BOARD_AZTEEG_X1 1509 // Azteeg X1 +#define BOARD_ANET_10 1510 // Anet 1.0 (Melzi clone) // // Other ATmega644P, ATmega644, ATmega1284P @@ -276,28 +280,39 @@ #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_MKS_ROBIN_LITE3 4010 // MKS Robin Lite3 (STM32F103RCT6) -#define BOARD_MKS_ROBIN_PRO 4011 // MKS Robin Pro (STM32F103ZET6) -#define BOARD_BTT_SKR_MINI_V1_1 4012 // BigTreeTech SKR Mini v1.1 (STM32F103RC) -#define BOARD_BTT_SKR_MINI_E3_V1_0 4013 // BigTreeTech SKR Mini E3 (STM32F103RC) -#define BOARD_BTT_SKR_MINI_E3_V1_2 4014 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC) -#define BOARD_BTT_SKR_E3_DIP 4015 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE) -#define BOARD_JGAURORA_A5S_A1 4016 // JGAurora A5S A1 (STM32F103ZET6) -#define BOARD_FYSETC_AIO_II 4017 // FYSETC AIO_II -#define BOARD_FYSETC_CHEETAH 4018 // FYSETC Cheetah -#define BOARD_FYSETC_CHEETAH_V12 4019 // FYSETC Cheetah V1.2 -#define BOARD_LONGER3D_LK 4020 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6 -#define BOARD_GTM32_MINI 4021 // STM32F103VET6 controller -#define BOARD_GTM32_MINI_A30 4022 // STM32F103VET6 controller -#define BOARD_GTM32_REV_B 4023 // STM32F103VET6 controller +#define BOARD_MALYAN_M200_V2 4002 // STM32F070RB Libmaple-based STM32F0 controller +#define BOARD_STM3R_MINI 4003 // STM32F103RE Libmaple-based STM32F1 controller +#define BOARD_GTM32_PRO_VB 4004 // STM32F103VET6 controller +#define BOARD_MORPHEUS 4005 // STM32F103C8 / STM32F103CB Libmaple-based STM32F1 controller +#define BOARD_CHITU3D 4006 // Chitu3D (STM32F103RET6) +#define BOARD_MKS_ROBIN 4007 // MKS Robin (STM32F103ZET6) +#define BOARD_MKS_ROBIN_MINI 4008 // MKS Robin Mini (STM32F103VET6) +#define BOARD_MKS_ROBIN_NANO 4009 // MKS Robin Nano (STM32F103VET6) +#define BOARD_MKS_ROBIN_NANO_V2 4010 // MKS Robin Nano V2 (STM32F103VET6) +#define BOARD_MKS_ROBIN_LITE 4011 // MKS Robin Lite/Lite2 (STM32F103RCT6) +#define BOARD_MKS_ROBIN_LITE3 4012 // MKS Robin Lite3 (STM32F103RCT6) +#define BOARD_MKS_ROBIN_PRO 4013 // MKS Robin Pro (STM32F103ZET6) +#define BOARD_BTT_SKR_MINI_V1_1 4014 // BigTreeTech SKR Mini v1.1 (STM32F103RC) +#define BOARD_BTT_SKR_MINI_E3_V1_0 4015 // BigTreeTech SKR Mini E3 (STM32F103RC) +#define BOARD_BTT_SKR_MINI_E3_V1_2 4016 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC) +#define BOARD_BTT_SKR_MINI_E3_V2_0 4017 // BigTreeTech SKR Mini E3 V2.0 (STM32F103RC) +#define BOARD_BTT_SKR_E3_DIP 4018 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE) +#define BOARD_JGAURORA_A5S_A1 4019 // JGAurora A5S A1 (STM32F103ZET6) +#define BOARD_FYSETC_AIO_II 4020 // FYSETC AIO_II +#define BOARD_FYSETC_CHEETAH 4021 // FYSETC Cheetah +#define BOARD_FYSETC_CHEETAH_V12 4022 // FYSETC Cheetah V1.2 +#define BOARD_LONGER3D_LK 4023 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6 +#define BOARD_GTM32_MINI 4024 // STM32F103VET6 controller +#define BOARD_GTM32_MINI_A30 4025 // STM32F103VET6 controller +#define BOARD_GTM32_REV_B 4026 // STM32F103VET6 controller +#define BOARD_MKS_ROBIN_E3D 4027 // MKS Robin E3D (STM32F103RCT6) +#define BOARD_MKS_ROBIN_E3 4028 // MKS Robin E3 (STM32F103RCT6) +#define BOARD_MALYAN_M300 4029 // STM32F070-based delta +#define BOARD_CCROBOT_MEEB_3DP 4030 // ccrobot-online.com MEEB_3DP (STM32F103RC) +#define BOARD_CHITU3D_V5 4031 // Chitu3D TronXY X5SA V5 Board +#define BOARD_CHITU3D_V6 4032 // Chitu3D TronXY X5SA V5 Board +#define BOARD_CREALITY_V4 4033 // Creality v4.x (STM32F103RE) +#define BOARD_TRIGORILLA_PRO 4034 // Trigorilla Pro (STM32F103ZET6) // // ARM Cortex-M4F @@ -313,20 +328,23 @@ #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_AUS3D 4203 // RUMBA32 STM32F446VET6 based controller from Aus3D -#define BOARD_RUMBA32_MKS 4204 // RUMBA32 STM32F446VET6 based controller from Makerbase -#define BOARD_BLACK_STM32F407VE 4205 // BLACK_STM32F407VE -#define BOARD_BLACK_STM32F407ZE 4206 // BLACK_STM32F407ZE -#define BOARD_STEVAL_3DP001V1 4207 // STEVAL-3DP001V1 3D PRINTER BOARD -#define BOARD_BTT_SKR_PRO_V1_1 4208 // BigTreeTech SKR Pro v1.1 (STM32F407ZG) -#define BOARD_BTT_BTT002_V1_0 4209 // BigTreeTech BTT002 v1.0 (STM32F407VE) -#define BOARD_BTT_GTR_V1_0 4210 // BigTreeTech GTR v1.0 (STM32F407IGT) -#define BOARD_LERDGE_K 4211 // Lerdge K (STM32F407ZG) -#define BOARD_LERDGE_X 4212 // Lerdge X (STM32F407VE) -#define BOARD_VAKE403D 4213 // VAkE 403D (STM32F446VET6) -#define BOARD_FYSETC_S6 4214 // FYSETC S6 board -#define BOARD_FLYF407ZG 4215 // FLYF407ZG board (STM32F407ZG) -#define BOARD_MKS_ROBIN2 4216 // MKS_ROBIN2 (STM32F407ZE) +#define BOARD_RUMBA32_V1_0 4203 // RUMBA32 STM32F446VET6 based controller from Aus3D +#define BOARD_RUMBA32_V1_1 4204 // RUMBA32 STM32F446VET6 based controller from Aus3D +#define BOARD_RUMBA32_MKS 4205 // RUMBA32 STM32F446VET6 based controller from Makerbase +#define BOARD_BLACK_STM32F407VE 4206 // BLACK_STM32F407VE +#define BOARD_BLACK_STM32F407ZE 4207 // BLACK_STM32F407ZE +#define BOARD_STEVAL_3DP001V1 4208 // STEVAL-3DP001V1 3D PRINTER BOARD +#define BOARD_BTT_SKR_PRO_V1_1 4209 // BigTreeTech SKR Pro v1.1 (STM32F407ZG) +#define BOARD_BTT_SKR_PRO_V1_2 4210 // BigTreeTech SKR Pro v1.2 (STM32F407ZG) +#define BOARD_BTT_BTT002_V1_0 4211 // BigTreeTech BTT002 v1.0 (STM32F407VG) +#define BOARD_BTT_GTR_V1_0 4212 // BigTreeTech GTR v1.0 (STM32F407IGT) +#define BOARD_LERDGE_K 4213 // Lerdge K (STM32F407ZG) +#define BOARD_LERDGE_S 4214 // Lerdge S (STM32F407VE) +#define BOARD_LERDGE_X 4215 // Lerdge X (STM32F407VE) +#define BOARD_VAKE403D 4216 // VAkE 403D (STM32F446VET6) +#define BOARD_FYSETC_S6 4217 // FYSETC S6 board +#define BOARD_FLYF407ZG 4218 // FLYF407ZG board (STM32F407ZG) +#define BOARD_MKS_ROBIN2 4219 // MKS_ROBIN2 (STM32F407ZE) // // ARM Cortex M7 @@ -357,4 +375,4 @@ #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) +#define IS_MELZI MB(MELZI, MELZI_CREALITY, MELZI_MAKR3D, MELZI_MALYAN, MELZI_TRONXY, MELZI_V2) diff --git a/Marlin/src/core/debug_out.h b/Marlin/src/core/debug_out.h index 4b2cdf9f77..6ae1b9d8bb 100644 --- a/Marlin/src/core/debug_out.h +++ b/Marlin/src/core/debug_out.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -26,11 +26,13 @@ // (or not) in a given .cpp file // +#undef DEBUG_SECTION #undef DEBUG_PRINT_P #undef DEBUG_ECHO_START #undef DEBUG_ERROR_START #undef DEBUG_CHAR #undef DEBUG_ECHO +#undef DEBUG_DECIMAL #undef DEBUG_ECHO_F #undef DEBUG_ECHOLN #undef DEBUG_ECHOPGM @@ -46,16 +48,23 @@ #undef DEBUG_ECHO_MSG #undef DEBUG_ERROR_MSG #undef DEBUG_EOL +#undef DEBUG_FLUSH #undef DEBUG_POS #undef DEBUG_XYZ #undef DEBUG_DELAY +#undef DEBUG_SYNCHRONIZE #if DEBUG_OUT + + #include "debug_section.h" + #define DEBUG_SECTION(N,S,D) SectionLog N(PSTR(S),D) + #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_DECIMAL SERIAL_DECIMAL #define DEBUG_ECHO_F SERIAL_ECHO_F #define DEBUG_ECHOLN SERIAL_ECHOLN #define DEBUG_ECHOPGM SERIAL_ECHOPGM @@ -71,15 +80,21 @@ #define DEBUG_ECHO_MSG SERIAL_ECHO_MSG #define DEBUG_ERROR_MSG SERIAL_ERROR_MSG #define DEBUG_EOL SERIAL_EOL + #define DEBUG_FLUSH SERIAL_FLUSH #define DEBUG_POS SERIAL_POS #define DEBUG_XYZ SERIAL_XYZ #define DEBUG_DELAY(ms) serial_delay(ms) + #define DEBUG_SYNCHRONIZE() planner.synchronize() + #else + + #define DEBUG_SECTION(...) NOOP #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_DECIMAL(...) NOOP #define DEBUG_ECHO_F(...) NOOP #define DEBUG_ECHOLN(...) NOOP #define DEBUG_ECHOPGM(...) NOOP @@ -95,9 +110,12 @@ #define DEBUG_ECHO_MSG(...) NOOP #define DEBUG_ERROR_MSG(...) NOOP #define DEBUG_EOL() NOOP + #define DEBUG_FLUSH() NOOP #define DEBUG_POS(...) NOOP #define DEBUG_XYZ(...) NOOP #define DEBUG_DELAY(...) NOOP + #define DEBUG_SYNCHRONIZE() NOOP + #endif #undef DEBUG_OUT diff --git a/Marlin/src/core/debug_section.h b/Marlin/src/core/debug_section.h new file mode 100644 index 0000000000..7f39bc7424 --- /dev/null +++ b/Marlin/src/core/debug_section.h @@ -0,0 +1,49 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 "serial.h" +#include "../module/motion.h" + +class SectionLog { +public: + SectionLog(PGM_P const msg=nullptr, bool inbug=true) { + the_msg = msg; + if ((debug = inbug)) echo_msg(PSTR(">>>")); + } + + ~SectionLog() { if (debug) echo_msg(PSTR("<<<")); } + +private: + PGM_P the_msg; + bool debug; + + void echo_msg(PGM_P const pre) { + serialprintPGM(pre); + if (the_msg) { + SERIAL_CHAR(' '); + serialprintPGM(the_msg); + } + SERIAL_CHAR(' '); + print_xyz(current_position); + } +}; diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h index 833899bdcb..3a0e620923 100644 --- a/Marlin/src/core/drivers.h +++ b/Marlin/src/core/drivers.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -86,6 +86,10 @@ || AXIS_DRIVER_TYPE_X2(T) || AXIS_DRIVER_TYPE_Y2(T) || AXIS_DRIVER_TYPE_Z2(T) \ || AXIS_DRIVER_TYPE_Z3(T) || AXIS_DRIVER_TYPE_Z4(T) || HAS_E_DRIVER(T) ) +// +// Trinamic Stepper Drivers +// + // Test for supported TMC drivers that require advanced configuration // Does not match standalone configurations #if ( HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2160) \ @@ -127,6 +131,7 @@ #define AXIS_HAS_RXTX AXIS_HAS_UART +#define AXIS_HAS_HW_SERIAL(A) ( AXIS_HAS_UART(A) && defined(A##_HARDWARE_SERIAL) ) #define AXIS_HAS_SW_SERIAL(A) ( AXIS_HAS_UART(A) && !defined(A##_HARDWARE_SERIAL) ) #define AXIS_HAS_STALLGUARD(A) ( AXIS_DRIVER_TYPE(A,TMC2130) || AXIS_DRIVER_TYPE(A,TMC2160) \ @@ -171,17 +176,16 @@ #define HAS_TMC_SPI 1 #endif -// Defines that can't be evaluated now -#define HAS_TMC_SW_SERIAL ANY_AXIS_HAS(SW_SERIAL) +// +// TMC26XX Stepper Drivers +// +#if HAS_DRIVER(TMC26X) + #define HAS_TMC26X 1 +#endif // -// Stretching 'drivers.h' to include LPC/SAMD51 SD options +// L64XX Stepper Drivers // -#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)) #if HAS_DRIVER(L6470) || HAS_DRIVER(L6474) || HAS_DRIVER(L6480) || HAS_DRIVER(POWERSTEP01) #define HAS_L64XX 1 diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index f58ace7709..5208b3e1bf 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -39,7 +39,7 @@ // // ==> 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 +// See also https://marlinfw.org/docs/development/lcd_language.html // Languages // an Aragonese @@ -57,6 +57,7 @@ // fr French // gl Galician // hr Croatian +// hu Hungarian // it Italian // jp_kana Japanese // ko_KR Korean (South Korea) @@ -64,6 +65,7 @@ // pl Polish // pt Portuguese // pt_br Portuguese (Brazilian) +// ro Romanian // ru Russian // sk Slovak // tr Turkish @@ -80,18 +82,16 @@ #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 +#elif defined(DEFAULT_MACHINE_NAME) + #undef MACHINE_NAME + #define MACHINE_NAME DEFAULT_MACHINE_NAME #endif #ifndef MACHINE_UUID #define MACHINE_UUID DEFAULT_MACHINE_UUID #endif -#define MARLIN_WEBSITE_URL "http://marlinfw.org" +#define MARLIN_WEBSITE_URL "https://marlinfw.org" //#if !defined(STRING_SPLASH_LINE3) && defined(WEBSITE_URL) // #define STRING_SPLASH_LINE3 WEBSITE_URL @@ -126,7 +126,7 @@ #define STR_INVALID_E_STEPPER "Invalid E stepper" #define STR_E_STEPPER_NOT_SPECIFIED "E stepper not specified" #define STR_INVALID_SOLENOID "Invalid solenoid" -#define STR_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 STR_M115_REPORT "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " (" __DATE__ " " __TIME__ ") SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID #define STR_COUNT_X " Count X:" #define STR_COUNT_A " Count A:" #define STR_WATCHDOG_FIRED "Watchdog timeout. Reset required." @@ -163,7 +163,7 @@ #define STR_ERR_MATERIAL_INDEX "M145 S out of range (0-1)" #define STR_ERR_M421_PARAMETERS "M421 incorrect parameter usage" #define STR_ERR_BAD_PLANE_MODE "G5 requires XY plane mode" -#define STR_ERR_MESH_XY "Mesh point cannot be resolved" +#define STR_ERR_MESH_XY "Mesh point out of range" #define STR_ERR_ARC_ARGS "G2/G3 bad parameters" #define STR_ERR_PROTECTED_PIN "Protected Pin" #define STR_ERR_M420_FAILED "Failed to enable Bed Leveling" @@ -185,7 +185,7 @@ #define STR_INVALID_POS_SLOT "Invalid slot. Total: " #define STR_SD_CANT_OPEN_SUBDIR "Cannot open subdir " -#define STR_SD_INIT_FAIL "SD init fail" +#define STR_SD_INIT_FAIL "No SD card" #define STR_SD_VOL_INIT_FAIL "volume.init failed" #define STR_SD_OPENROOT_FAIL "openRoot failed" #define STR_SD_CARD_OK "SD card ok" @@ -205,7 +205,6 @@ #define STR_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented" #define STR_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented" #define STR_ERR_HOTEND_TOO_COLD "Hotend too cold" -#define STR_ERR_Z_HOMING_SER "Home XY first" #define STR_ERR_EEPROM_WRITE "Error writing to EEPROM!" #define STR_FILAMENT_CHANGE_HEAT_LCD "Press button to heat nozzle" @@ -221,12 +220,10 @@ #define STR_KILL_BUTTON "!! KILL caused by KILL button/pin" // temperature.cpp strings -#define STR_PID_AUTOTUNE_PREFIX "PID Autotune" -#define STR_PID_AUTOTUNE_START STR_PID_AUTOTUNE_PREFIX " start" -#define STR_PID_AUTOTUNE_FAILED STR_PID_AUTOTUNE_PREFIX " failed!" -#define STR_PID_BAD_EXTRUDER_NUM STR_PID_AUTOTUNE_FAILED " Bad extruder number" -#define STR_PID_TEMP_TOO_HIGH STR_PID_AUTOTUNE_FAILED " Temperature too high" -#define STR_PID_TIMEOUT STR_PID_AUTOTUNE_FAILED " timeout" +#define STR_PID_AUTOTUNE_START "PID Autotune start" +#define STR_PID_BAD_EXTRUDER_NUM "PID Autotune failed! Bad extruder number" +#define STR_PID_TEMP_TOO_HIGH "PID Autotune failed! Temperature too high" +#define STR_PID_TIMEOUT "PID Autotune failed! timeout" #define STR_BIAS " bias: " #define STR_D_COLON " d: " #define STR_T_MIN " min: " @@ -237,7 +234,7 @@ #define STR_KP " Kp: " #define STR_KI " Ki: " #define STR_KD " Kd: " -#define STR_PID_AUTOTUNE_FINISHED STR_PID_AUTOTUNE_PREFIX " finished! Put the last Kp, Ki and Kd constants from below into Configuration.h" +#define STR_PID_AUTOTUNE_FINISHED "PID Autotune finished! Put the last Kp, Ki and Kd constants from below into Configuration.h" #define STR_PID_DEBUG " PID_DEBUG " #define STR_PID_DEBUG_INPUT ": Input " #define STR_PID_DEBUG_OUTPUT " Output " diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 899baf7359..3bd273872a 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -76,13 +76,6 @@ // 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) @@ -104,12 +97,15 @@ #define CBI(A,B) (A &= ~(1 << (B))) #endif +#define TBI(N,B) (N ^= _BV(B)) + #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 TBI32(N,B) (N ^= _BV32(B)) -#define cu(x) ((x)*(x)*(x)) +#define cu(x) ({__typeof__(x) _x = (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)) @@ -117,7 +113,7 @@ #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 SIGN(a) ({__typeof__(a) _a = (a); (_a>0)-(_a<0);}) #define IS_POWER_OF_2(x) ((x) && !((x) & ((x) - 1))) // Macros to constrain values @@ -137,8 +133,6 @@ #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); \ @@ -276,7 +270,7 @@ #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)) +#define FIXFLOAT(f) ({__typeof__(f) _f = (f); _f + (_f < 0 ? -0.0000005f : 0.0000005f);}) // // Maths macros that can be overridden by HAL @@ -292,12 +286,6 @@ #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) @@ -495,3 +483,14 @@ #define RREPEAT(N,OP) RREPEAT_S(0,N,OP) #define RREPEAT2_S(S,N,OP,V...) EVAL1024(_RREPEAT2(S,SUB##S(N),OP,V)) #define RREPEAT2(N,OP,V...) RREPEAT2_S(0,N,OP,V) + +// See https://github.com/swansontec/map-macro +#define MAP_OUT +#define MAP_END(...) +#define MAP_GET_END() 0, MAP_END +#define MAP_NEXT0(test, next, ...) next MAP_OUT +#define MAP_NEXT1(test, next) MAP_NEXT0 (test, next, 0) +#define MAP_NEXT(test, next) MAP_NEXT1 (MAP_GET_END test, next) +#define MAP0(f, x, peek, ...) f(x) MAP_NEXT (peek, MAP1) (f, peek, __VA_ARGS__) +#define MAP1(f, x, peek, ...) f(x) MAP_NEXT (peek, MAP0) (f, peek, __VA_ARGS__) +#define MAP(f, ...) EVAL512 (MAP1 (f, __VA_ARGS__, (), 0)) diff --git a/Marlin/src/core/millis_t.h b/Marlin/src/core/millis_t.h index 39ea17b9f0..95bc40e1ec 100644 --- a/Marlin/src/core/millis_t.h +++ b/Marlin/src/core/millis_t.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,5 +25,9 @@ typedef uint32_t millis_t; +#define SEC_TO_MS(N) millis_t((N)*1000UL) +#define MIN_TO_MS(N) SEC_TO_MS((N)*60UL) +#define MS_TO_SEC(N) millis_t((N)/1000UL) + #define PENDING(NOW,SOON) ((int32_t)(NOW-(SOON))<0) #define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON)) diff --git a/Marlin/src/core/multi_language.h b/Marlin/src/core/multi_language.h index 98020b1e8d..5852c439a8 100644 --- a/Marlin/src/core/multi_language.h +++ b/Marlin/src/core/multi_language.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once typedef const char Language_Str[]; -#if defined(LCD_LANGUAGE_5) +#ifdef LCD_LANGUAGE_5 #define NUM_LANGUAGES 5 #elif defined(LCD_LANGUAGE_4) #define NUM_LANGUAGES 4 @@ -76,4 +76,8 @@ typedef const char Language_Str[]; #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)) +#define GET_LANGUAGE_NAME(INDEX) GET_LANG(LCD_LANGUAGE_##INDEX)::LANGUAGE + +#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 diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index 304aa09a8a..77854d0f80 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -16,19 +16,19 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include "serial.h" -#include "language.h" +#include "../inc/MarlinConfig.h" uint8_t marlin_debug_flags = MARLIN_DEBUG_NONE; -static const char errormagic[] PROGMEM = "Error:"; -static const char echomagic[] PROGMEM = "echo:"; +static PGMSTR(errormagic, "Error:"); +static PGMSTR(echomagic, "echo:"); -#if NUM_SERIAL > 1 +#if HAS_MULTI_SERIAL int8_t serial_port_index = 0; #endif @@ -42,8 +42,8 @@ void serial_echopair_PGM(PGM_P const s_P, const char *v) { serialprintPGM(s_P) 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, float v) { serialprintPGM(s_P); SERIAL_DECIMAL(v); } +void serial_echopair_PGM(PGM_P const s_P, double v) { serialprintPGM(s_P); SERIAL_DECIMAL(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); } diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index 812ff5471f..fc830736a5 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -47,14 +47,20 @@ extern uint8_t marlin_debug_flags; #define DEBUGGING(F) (marlin_debug_flags & (MARLIN_DEBUG_## F)) #define SERIAL_BOTH 0x7F -#if NUM_SERIAL > 1 +#if HAS_MULTI_SERIAL 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) + + #ifdef SERIAL_CATCHALL + #define SERIAL_OUT(WHAT, V...) (void)CAT(MYSERIAL,SERIAL_CATCHALL).WHAT(V) + #else + #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) + #endif + #define SERIAL_ASSERT(P) if(serial_port_index!=(P)){ debugger(); } #else #define _PORT_REDIRECT(n,p) NOOP @@ -184,7 +190,13 @@ extern uint8_t marlin_debug_flags; #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 _SELP_24(a,b,V...) do{ _SEP_2(a,b); _SELP_22(V); }while(0) +#define _SELP_25(a,b,V...) do{ _SEP_2(a,b); _SELP_23(V); }while(0) +#define _SELP_26(a,b,V...) do{ _SEP_2(a,b); _SELP_24(V); }while(0) +#define _SELP_27(a,b,V...) do{ _SEP_2(a,b); _SELP_25(V); }while(0) +#define _SELP_28(a,b,V...) do{ _SEP_2(a,b); _SELP_26(V); }while(0) +#define _SELP_29(a,b,V...) do{ _SEP_2(a,b); _SELP_27(V); }while(0) +#define _SELP_30(a,b,V...) do{ _SEP_2(a,b); _SELP_28(V); }while(0) // Eat two args, pass the rest up #define SERIAL_ECHOLNPAIR(V...) _SELP_N(NUM_ARGS(V),V) @@ -214,7 +226,13 @@ extern uint8_t marlin_debug_flags; #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 _SELP_24_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_22_P(V); }while(0) +#define _SELP_25_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_23_P(V); }while(0) +#define _SELP_26_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_24_P(V); }while(0) +#define _SELP_27_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_25_P(V); }while(0) +#define _SELP_28_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_26_P(V); }while(0) +#define _SELP_29_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_27_P(V); }while(0) +#define _SELP_30_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_28_P(V); }while(0) // Eat two args, pass the rest up #define SERIAL_ECHOLNPAIR_P(V...) _SELP_N_P(NUM_ARGS(V),V) @@ -245,10 +263,11 @@ extern uint8_t marlin_debug_flags; #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_P(P) (serialprintPGM(P)) +#define SERIAL_ECHOLNPGM_P(P) (serialprintPGM(P "\n")) -#define SERIAL_ECHOPGM(S) (SERIAL_ECHO_P(PSTR(S))) -#define SERIAL_ECHOLNPGM(S) (SERIAL_ECHO_P(PSTR(S "\n"))) +#define SERIAL_ECHOPGM(S) (serialprintPGM(PSTR(S))) +#define SERIAL_ECHOLNPGM(S) (serialprintPGM(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) @@ -267,6 +286,12 @@ extern uint8_t marlin_debug_flags; #define SERIAL_ECHO_TERNARY(TF, PRE, ON, OFF, POST) serial_ternary(TF, PSTR(PRE), PSTR(ON), PSTR(OFF), PSTR(POST)) +#if SERIAL_FLOAT_PRECISION + #define SERIAL_DECIMAL(V) SERIAL_PRINT(V, SERIAL_FLOAT_PRECISION) +#else + #define SERIAL_DECIMAL(V) SERIAL_ECHO(V) +#endif + // // Functions for serial printing from PROGMEM. (Saves loads of SRAM.) // diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index 6bcd4bd489..a5b78caabb 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -501,4 +501,4 @@ struct XYZEval { #undef FI const xyze_char_t axis_codes { 'X', 'Y', 'Z', 'E' }; -#define XYZ_CHAR(A) ('X' + char(A)) +#define XYZ_CHAR(A) ((char)('X' + A)) diff --git a/Marlin/src/core/utility.cpp b/Marlin/src/core/utility.cpp index 5e159af581..295657fa64 100644 --- a/Marlin/src/core/utility.cpp +++ b/Marlin/src/core/utility.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -57,21 +57,21 @@ void safe_delay(millis_t ms) { void log_machine_info() { SERIAL_ECHOLNPGM("Machine Type: " - TERN(DELTA, "Delta", "") - TERN(IS_SCARA, "SCARA", "") - TERN(IS_CORE, "Core", "") - TERN(IS_CARTESIAN, "Cartesian", "") + TERN_(DELTA, "Delta") + TERN_(IS_SCARA, "SCARA") + TERN_(IS_CORE, "Core") + TERN_(IS_CARTESIAN, "Cartesian") ); SERIAL_ECHOLNPGM("Probe: " - TERN(PROBE_MANUALLY, "PROBE_MANUALLY", "") - TERN(NOZZLE_AS_PROBE, "NOZZLE_AS_PROBE", "") - TERN(FIX_MOUNTED_PROBE, "FIX_MOUNTED_PROBE", "") - TERN(HAS_Z_SERVO_PROBE, TERN(BLTOUCH, "BLTOUCH", "SERVO PROBE"), "") - TERN(TOUCH_MI_PROBE, "TOUCH_MI_PROBE", "") - TERN(Z_PROBE_SLED, "Z_PROBE_SLED", "") - TERN(Z_PROBE_ALLEN_KEY, "Z_PROBE_ALLEN_KEY", "") - TERN(SOLENOID_PROBE, "SOLENOID_PROBE", "") + TERN_(PROBE_MANUALLY, "PROBE_MANUALLY") + TERN_(NOZZLE_AS_PROBE, "NOZZLE_AS_PROBE") + TERN_(FIX_MOUNTED_PROBE, "FIX_MOUNTED_PROBE") + TERN_(HAS_Z_SERVO_PROBE, TERN(BLTOUCH, "BLTOUCH", "SERVO PROBE")) + TERN_(TOUCH_MI_PROBE, "TOUCH_MI_PROBE") + TERN_(Z_PROBE_SLED, "Z_PROBE_SLED") + TERN_(Z_PROBE_ALLEN_KEY, "Z_PROBE_ALLEN_KEY") + TERN_(SOLENOID_PROBE, "SOLENOID_PROBE") TERN(PROBE_SELECTED, "", "NONE") ); @@ -108,10 +108,10 @@ void safe_delay(millis_t ms) { #if HAS_ABL_OR_UBL SERIAL_ECHOPGM("Auto Bed Leveling: " - TERN(AUTO_BED_LEVELING_LINEAR, "LINEAR", "") - TERN(AUTO_BED_LEVELING_BILINEAR, "BILINEAR", "") - TERN(AUTO_BED_LEVELING_3POINT, "3POINT", "") - TERN(AUTO_BED_LEVELING_UBL, "UBL", "") + TERN_(AUTO_BED_LEVELING_LINEAR, "LINEAR") + TERN_(AUTO_BED_LEVELING_BILINEAR, "BILINEAR") + TERN_(AUTO_BED_LEVELING_3POINT, "3POINT") + TERN_(AUTO_BED_LEVELING_UBL, "UBL") ); if (planner.leveling_active) { @@ -123,10 +123,10 @@ void safe_delay(millis_t ms) { #if ABL_PLANAR SERIAL_ECHOPGM("ABL Adjustment X"); LOOP_XYZ(a) { - float v = planner.get_axis_position_mm(AxisEnum(a)) - current_position[a]; + const float v = planner.get_axis_position_mm(AxisEnum(a)) - current_position[a]; SERIAL_CHAR(' ', XYZ_CHAR(a)); if (v > 0) SERIAL_CHAR('+'); - SERIAL_ECHO(v); + SERIAL_DECIMAL(v); } #else #if ENABLED(AUTO_BED_LEVELING_UBL) diff --git a/Marlin/src/core/utility.h b/Marlin/src/core/utility.h index 0c2e91d31f..0481ffc02a 100644 --- a/Marlin/src/core/utility.h +++ b/Marlin/src/core/utility.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/babystep.cpp b/Marlin/src/feature/babystep.cpp index 5d2dc47bee..41d0a9cb1e 100644 --- a/Marlin/src/feature/babystep.cpp +++ b/Marlin/src/feature/babystep.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -54,66 +54,13 @@ void Babystep::add_mm(const AxisEnum axis, const float &mm) { } void Babystep::add_steps(const AxisEnum axis, const int16_t distance) { - if (DISABLED(BABYSTEP_WITHOUT_HOMING) && !TEST(axis_known_position, axis)) return; accum += distance; // Count up babysteps for the UI - #if ENABLED(BABYSTEP_DISPLAY_TOTAL) - axis_total[BS_TOTAL_IND(axis)] += distance; - #endif - - #if ENABLED(BABYSTEP_ALWAYS_AVAILABLE) - #define BSA_ENABLE(AXIS) do{ switch (AXIS) { case X_AXIS: ENABLE_AXIS_X(); break; case Y_AXIS: ENABLE_AXIS_Y(); break; case Z_AXIS: ENABLE_AXIS_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_AXIS_IND(axis)] += distance; - #endif - #if ENABLED(BABYSTEP_ALWAYS_AVAILABLE) - gcode.reset_stepper_timeout(); - #endif - - #if ENABLED(INTEGRATED_BABYSTEPPING) - if (has_steps()) stepper.initiateBabystepping(); - #endif + steps[BS_AXIS_IND(axis)] += distance; + TERN_(BABYSTEP_DISPLAY_TOTAL, axis_total[BS_TOTAL_IND(axis)] += distance); + TERN_(BABYSTEP_ALWAYS_AVAILABLE, gcode.reset_stepper_timeout()); + TERN_(INTEGRATED_BABYSTEPPING, if (has_steps()) stepper.initiateBabystepping()); } #endif // BABYSTEPPING diff --git a/Marlin/src/feature/babystep.h b/Marlin/src/feature/babystep.h index 287664502c..f85e5909ca 100644 --- a/Marlin/src/feature/babystep.h +++ b/Marlin/src/feature/babystep.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -55,11 +55,8 @@ public: #if ENABLED(BABYSTEP_DISPLAY_TOTAL) static int16_t axis_total[BS_TOTAL_IND(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_IND(axis)] = 0; + if (TERN1(BABYSTEP_XY, axis == Z_AXIS)) + axis_total[BS_TOTAL_IND(axis)] = 0; } #endif diff --git a/Marlin/src/feature/backlash.cpp b/Marlin/src/feature/backlash.cpp index bc33ae3185..867e9cdd21 100644 --- a/Marlin/src/feature/backlash.cpp +++ b/Marlin/src/feature/backlash.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/feature/backlash.h b/Marlin/src/feature/backlash.h index 20666c540b..8d00570f99 100644 --- a/Marlin/src/feature/backlash.h +++ b/Marlin/src/feature/backlash.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -55,26 +55,16 @@ public: 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 + return TERN(MEASURE_BACKLASH_WHEN_PROBING + , measured_count[a] > 0 ? measured_mm[a] / measured_count[a] : 0 + , 0 ); - #if DISABLED(MEASURE_BACKLASH_WHEN_PROBING) - UNUSED(a); - #endif + TERN(MEASURE_BACKLASH_WHEN_PROBING,,UNUSED(a)); } 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 + return TERN0(MEASURE_BACKLASH_WHEN_PROBING, measured_count[a] > 0); + TERN(MEASURE_BACKLASH_WHEN_PROBING,,UNUSED(a)); } static inline bool has_any_measurement() { diff --git a/Marlin/src/feature/baricuda.cpp b/Marlin/src/feature/baricuda.cpp index 3899348548..596891707e 100644 --- a/Marlin/src/feature/baricuda.cpp +++ b/Marlin/src/feature/baricuda.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/feature/baricuda.h b/Marlin/src/feature/baricuda.h index 567d2253e6..f28d07d642 100644 --- a/Marlin/src/feature/baricuda.h +++ b/Marlin/src/feature/baricuda.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/bedlevel/abl/abl.cpp b/Marlin/src/feature/bedlevel/abl/abl.cpp index 33c9cbdfde..a585c1e155 100644 --- a/Marlin/src/feature/bedlevel/abl/abl.cpp +++ b/Marlin/src/feature/bedlevel/abl/abl.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -74,9 +74,7 @@ static void extrapolate_one_point(const uint8_t x, const uint8_t y, const int8_t // 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 + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, z_values[x][y])); // Median is robust (ignores outliers). // z_values[x][y] = (a < b) ? ((b < c) ? b : (c < a) ? a : c) @@ -241,9 +239,7 @@ void print_bilinear_leveling_grid() { // 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 + TERN_(ABL_BILINEAR_SUBDIVISION, bed_level_virt_interpolate()); } #if ENABLED(ABL_BILINEAR_SUBDIVISION) diff --git a/Marlin/src/feature/bedlevel/abl/abl.h b/Marlin/src/feature/bedlevel/abl/abl.h index 312dc0db80..bbe2411dc3 100644 --- a/Marlin/src/feature/bedlevel/abl/abl.h +++ b/Marlin/src/feature/bedlevel/abl/abl.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/bedlevel/bedlevel.cpp b/Marlin/src/feature/bedlevel/bedlevel.cpp index 63493712a8..3e9225b7f9 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.cpp +++ b/Marlin/src/feature/bedlevel/bedlevel.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -47,17 +47,9 @@ #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 - ; + return TERN1(MESH_BED_LEVELING, mbl.has_mesh()) + && TERN1(AUTO_BED_LEVELING_BILINEAR, !!bilinear_grid_spacing.x) + && TERN1(AUTO_BED_LEVELING_UBL, ubl.mesh_is_valid()); } /** @@ -69,11 +61,7 @@ bool leveling_is_valid() { */ 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 + const bool can_change = TERN1(AUTO_BED_LEVELING_BILINEAR, !enable || leveling_is_valid()); if (can_change && enable != planner.leveling_active) { @@ -145,9 +133,7 @@ void reset_bed_level() { bilinear_grid_spacing.reset(); GRID_LOOP(x, y) { z_values[x][y] = NAN; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, 0); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, 0)); } #elif ABL_PLANAR planner.bed_level_matrix.set_to_identity(); @@ -245,9 +231,7 @@ void reset_bed_level() { current_position = pos; - #if ENABLED(LCD_BED_LEVELING) - ui.wait_for_move = false; - #endif + TERN_(LCD_BED_LEVELING, ui.wait_for_move = false); } #endif diff --git a/Marlin/src/feature/bedlevel/bedlevel.h b/Marlin/src/feature/bedlevel/bedlevel.h index fd3ed82e52..995e9d0dbc 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.h +++ b/Marlin/src/feature/bedlevel/bedlevel.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp index 7439c3fcd3..1200c2a1b3 100644 --- a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp +++ b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h index 3a1cbaccb0..ade7a93140 100644 --- a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h +++ b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.cpp b/Marlin/src/feature/bedlevel/ubl/ubl.cpp index 8ef2ad564c..63b4482344 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -49,14 +49,13 @@ void unified_bed_leveling::report_current_mesh() { if (!leveling_is_valid()) return; SERIAL_ECHO_MSG(" G29 I99"); - LOOP_L_N(x, GRID_MAX_POINTS_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 - } + GRID_LOOP(x, 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() { @@ -85,11 +84,7 @@ _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; + volatile int16_t unified_bed_leveling::encoder_diff; unified_bed_leveling::unified_bed_leveling() { reset(); @@ -114,9 +109,7 @@ void unified_bed_leveling::set_all_mesh_points_to_value(const float value) { GRID_LOOP(x, y) { z_values[x][y] = value; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, value); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, value)); } } @@ -209,7 +202,7 @@ if (human) SERIAL_CHAR(is_current ? ']' : ' '); SERIAL_FLUSHTX(); - idle(); + idle_no_sleep(); } if (!lcd) SERIAL_EOL(); diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index 9e227f02d9..9ac9de1806 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -111,9 +111,12 @@ class unified_bed_leveling { #if HAS_LCD_MENU static bool lcd_map_control; + static void steppers_were_disabled(); + #else + static inline void steppers_were_disabled() {} #endif - static volatile int encoder_diff; // Volatile because it's changed at interrupt time. + static volatile int16_t encoder_diff; // Volatile because buttons may changed it at interrupt time unified_bed_leveling(); diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 217d894543..f8219ac7e7 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -38,7 +38,7 @@ #include "../../../gcode/gcode.h" #include "../../../libs/least_squares_fit.h" - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND #include "../../../module/tool_change.h" #endif @@ -54,7 +54,18 @@ #define UBL_G29_P31 #if HAS_LCD_MENU - void _lcd_ubl_output_map_lcd(); + + bool unified_bed_leveling::lcd_map_control = false; + + void unified_bed_leveling::steppers_were_disabled() { + if (lcd_map_control) { + lcd_map_control = false; + ui.defer_status_screen(false); + } + } + + void ubl_map_screen(); + #endif #define SIZE_OF_LITTLE_RAISE 1 @@ -305,17 +316,13 @@ 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'); - #if HOTENDS > 1 - const uint8_t old_tool_index = active_extruder; - #endif + TERN_(HAS_MULTI_HOTEND, const uint8_t old_tool_index = active_extruder); // Check for commands that require the printer to be homed if (may_move) { planner.synchronize(); if (axes_need_homing()) gcode.home_all_axes(); - #if HOTENDS > 1 - if (active_extruder != 0) tool_change(0); - #endif + TERN_(HAS_MULTI_HOTEND, if (active_extruder) tool_change(0)); } // Invalidate Mesh Points. This command is a little bit asymmetrical because @@ -340,9 +347,7 @@ 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 + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(cpos, 0.0f)); cnt++; } } @@ -369,9 +374,7 @@ 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 + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, z_values[x][y])); } break; @@ -392,9 +395,7 @@ 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 + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, z_values[x][y])); } break; } @@ -403,17 +404,12 @@ #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))); + save_ubl_active_state_and_disable(); + tilt_mesh_based_on_probed_grid(g29_grid_size == 0); // Zero size does 3-Point + restore_ubl_active_state_and_leave(); + #if ENABLED(UBL_G29_J_RECENTER) + do_blocking_move_to_xy(0.5f * ((MESH_MIN_X) + (MESH_MAX_X)), 0.5f * ((MESH_MIN_Y) + (MESH_MAX_Y))); + #endif report_current_position(); probe_deployed = true; } @@ -448,11 +444,11 @@ if (g29_verbose_level > 1) { SERIAL_ECHOPAIR("Probing around (", g29_pos.x); SERIAL_CHAR(','); - SERIAL_ECHO(g29_pos.y); + SERIAL_DECIMAL(g29_pos.y); SERIAL_ECHOLNPGM(").\n"); } - const xy_pos_t near = g29_pos + probe.offset_xy; - probe_entire_mesh(near, parser.seen('T'), parser.seen('E'), parser.seen('U')); + const xy_pos_t near_probe_xy = g29_pos + probe.offset_xy; + probe_entire_mesh(near_probe_xy, parser.seen('T'), parser.seen('E'), parser.seen('U')); report_current_position(); probe_deployed = true; @@ -466,7 +462,7 @@ // Manually Probe Mesh in areas that can't be reached by the probe // SERIAL_ECHOLNPGM("Manually probing unreachable points."); - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); + do_z_clearance(Z_CLEARANCE_BETWEEN_PROBES); if (parser.seen('C') && !xy_seen) { @@ -488,7 +484,7 @@ } if (parser.seen('B')) { - g29_card_thickness = parser.has_value() ? parser.value_float() : measure_business_card_thickness((float) Z_CLEARANCE_BETWEEN_PROBES); + 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; @@ -540,9 +536,7 @@ } else { z_values[cpos.x][cpos.y] = g29_constant; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(cpos, g29_constant); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(cpos, g29_constant)); } } } @@ -683,9 +677,7 @@ UNUSED(probe_deployed); #endif - #if HOTENDS > 1 - tool_change(old_tool_index); - #endif + TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index)); return; } @@ -718,9 +710,7 @@ GRID_LOOP(x, 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 + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, z_values[x][y])); } } @@ -728,9 +718,7 @@ GRID_LOOP(x, 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 + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, z_values[x][y])); } } @@ -742,9 +730,7 @@ 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) { probe.deploy(); // Deploy before ui.capture() to allow for PAUSE_BEFORE_DEPLOY_STOW - #if HAS_LCD_MENU - ui.capture(); - #endif + TERN_(HAS_LCD_MENU, ui.capture()); save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained uint8_t count = GRID_MAX_POINTS; @@ -755,9 +741,7 @@ 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 + TERN_(HAS_DISPLAY, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_MESH), point_num, int(GRID_MAX_POINTS))); #if HAS_LCD_MENU if (ui.button_pressed()) { @@ -776,12 +760,14 @@ : find_closest_mesh_point_of_type(INVALID, near, true); if (best.pos.x >= 0) { // mesh point found and is reachable by probe + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(best.pos, ExtUI::PROBE_START)); const float measured_z = probe.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, ExtUI::PROBE_FINISH); ExtUI::onMeshUpdate(best.pos, measured_z); #endif } @@ -789,17 +775,12 @@ } while (best.pos.x >= 0 && --count); - #if HAS_LCD_MENU - ui.release(); - #endif - probe.stow(); // Release UI during stow to allow for PAUSE_BEFORE_DEPLOY_STOW - #if HAS_LCD_MENU - ui.capture(); - #endif + // Release UI during stow to allow for PAUSE_BEFORE_DEPLOY_STOW + TERN_(HAS_LCD_MENU, ui.release()); + probe.stow(); + TERN_(HAS_LCD_MENU, ui.capture()); - #ifdef Z_AFTER_PROBING - probe.move_z_after_probing(); - #endif + probe.move_z_after_probing(); restore_ubl_active_state_and_leave(); @@ -817,11 +798,11 @@ bool click_and_hold(const clickFunc_t func=nullptr) { if (ui.button_pressed()) { - ui.quick_feedback(false); // Preserve button state for click-and-hold + 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 + 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(); @@ -854,9 +835,7 @@ 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 + ui.capture(); 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); @@ -877,7 +856,6 @@ 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); @@ -887,17 +865,13 @@ 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 + ui.capture(); 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); @@ -922,12 +896,10 @@ LCD_MESSAGEPGM(MSG_UBL_MOVING_TO_NEXT); do_blocking_move_to(ppos); - do_blocking_move_to_z(z_clearance); + do_z_clearance(z_clearance); KEEPALIVE_STATE(PAUSED_FOR_USER); - #if HAS_LCD_MENU - ui.capture(); - #endif + ui.capture(); if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing @@ -940,15 +912,12 @@ if (click_and_hold()) { SERIAL_ECHOLNPGM("\nMesh only partially populated."); - do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE); - ui.release(); + do_z_clearance(Z_CLEARANCE_DEPLOY_PROBE); 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 + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(location, z_values[lpos.x][lpos.y])); if (g29_verbose_level > 2) SERIAL_ECHOLNPAIR_F("Mesh Point Measured at: ", z_values[lpos.x][lpos.y], 6); @@ -968,7 +937,7 @@ void abort_fine_tune() { ui.return_to_status(); - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); + do_z_clearance(Z_CLEARANCE_BETWEEN_PROBES); set_message_with_feedback(GET_TEXT(MSG_EDITING_STOPPED)); } @@ -994,14 +963,11 @@ 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 + ui.capture(); // Take over control of the LCD encoder - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - do_blocking_move_to_z(h_offset); // Move Z to the given 'H' offset - #endif + do_blocking_move_to_xy_z(pos, Z_CLEARANCE_BETWEEN_PROBES); // Move to the given XY with probe clearance + + TERN_(UBL_MESH_EDIT_MOVES_Z, do_blocking_move_to_z(h_offset)); // Move Z to the given 'H' offset MeshFlags done_flags{0}; const xy_int8_t &lpos = location.pos; @@ -1022,9 +988,7 @@ 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 + TERN_(UBL_MESH_EDIT_MOVES_Z, do_blocking_move_to_z(h_offset)); // Move Z to the given 'H' offset before editing KEEPALIVE_STATE(PAUSED_FOR_USER); @@ -1039,11 +1003,9 @@ 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(); + new_z = lcd_mesh_edit(); + TERN_(UBL_MESH_EDIT_MOVES_Z, do_blocking_move_to_z(h_offset + new_z)); // Move the nozzle as the point is edited SERIAL_FLUSH(); // Prevent host M105 buffer overrun. } while (!ui.button_pressed()); @@ -1052,17 +1014,13 @@ 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 + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(location, new_z)); 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(); @@ -1072,7 +1030,7 @@ SERIAL_ECHOLNPGM("Done Editing Mesh"); if (lcd_map_control) - ui.goto_screen(_lcd_ubl_output_map_lcd); + ui.goto_screen(ubl_map_screen); else ui.return_to_status(); } @@ -1082,9 +1040,7 @@ 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 + TERN_(HAS_LCD_MENU, set_message_with_feedback(GET_TEXT(MSG_UBL_DOING_G29))); g29_constant = 0; g29_repetition_cnt = 0; @@ -1206,9 +1162,7 @@ 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 + TERN_(HAS_LCD_MENU, set_message_with_feedback(GET_TEXT(MSG_UBL_SAVE_ERROR))); return; } #endif @@ -1217,12 +1171,11 @@ } void unified_bed_leveling::restore_ubl_active_state_and_leave() { + TERN_(HAS_LCD_MENU, ui.release()); #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 + TERN_(HAS_LCD_MENU, set_message_with_feedback(GET_TEXT(MSG_UBL_RESTORE_ERROR))); return; } #endif @@ -1337,9 +1290,7 @@ 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 + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, z_values[x][y])); return true; } } @@ -1403,9 +1354,7 @@ 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 + TERN_(HAS_DISPLAY, ui.status_printf_P(0, PSTR(S_FMT " 1/3"), GET_TEXT(MSG_LCD_TILTING_MESH))); measured_z = probe.probe_at_point(points[0], PROBE_PT_RAISE, g29_verbose_level); if (isnan(measured_z)) @@ -1424,9 +1373,7 @@ 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 + TERN_(HAS_DISPLAY, ui.status_printf_P(0, PSTR(S_FMT " 2/3"), GET_TEXT(MSG_LCD_TILTING_MESH))); measured_z = probe.probe_at_point(points[1], PROBE_PT_RAISE, g29_verbose_level); #ifdef VALIDATE_MESH_TILT @@ -1446,9 +1393,7 @@ 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 + TERN_(HAS_DISPLAY, ui.status_printf_P(0, PSTR(S_FMT " 3/3"), GET_TEXT(MSG_LCD_TILTING_MESH))); measured_z = probe.probe_at_point(points[2], PROBE_PT_STOW, g29_verbose_level); #ifdef VALIDATE_MESH_TILT @@ -1467,9 +1412,7 @@ } probe.stow(); - #ifdef Z_AFTER_PROBING - probe.move_z_after_probing(); - #endif + probe.move_z_after_probing(); if (abort_flag) { SERIAL_ECHOLNPGM("?Error probing point. Aborting operation."); @@ -1491,9 +1434,7 @@ 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 + TERN_(HAS_DISPLAY, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_LCD_TILTING_MESH), point_num, total_points)); measured_z = probe.probe_at_point(rpos, parser.seen('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level); // TODO: Needs error handling @@ -1532,9 +1473,7 @@ } } probe.stow(); - #ifdef Z_AFTER_PROBING - probe.move_z_after_probing(); - #endif + probe.move_z_after_probing(); if (abort_flag || finish_incremental_LSF(&lsf_results)) { SERIAL_ECHOPGM("Could not complete LSF!"); @@ -1582,9 +1521,7 @@ } z_values[i][j] = mz - lsf_results.D; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(i, j, z_values[i][j]); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(i, j, z_values[i][j])); } if (DEBUGGING(LEVELING)) { @@ -1680,9 +1617,7 @@ } 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 + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, z_values[ix][iy])); idle(); // housekeeping } } @@ -1743,8 +1678,9 @@ SERIAL_EOL(); #if HAS_KILL - SERIAL_ECHOLNPAIR("Kill pin on :", int(KILL_PIN), " state:", READ(KILL_PIN)); + SERIAL_ECHOLNPAIR("Kill pin on :", int(KILL_PIN), " state:", int(kill_state())); #endif + SERIAL_EOL(); serial_delay(50); @@ -1822,9 +1758,7 @@ GRID_LOOP(x, y) { z_values[x][y] -= tmp_z_values[x][y]; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, z_values[x][y]); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, z_values[x][y])); } } diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp index 5364108240..63559e0bb8 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include "../../../inc/MarlinConfig.h" diff --git a/Marlin/src/feature/binary_protocol.cpp b/Marlin/src/feature/binary_protocol.cpp index e555c0c463..5884a05f42 100644 --- a/Marlin/src/feature/binary_protocol.cpp +++ b/Marlin/src/feature/binary_protocol.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/feature/binary_protocol.h b/Marlin/src/feature/binary_protocol.h index 978d6a2c02..10dea10d47 100644 --- a/Marlin/src/feature/binary_protocol.h +++ b/Marlin/src/feature/binary_protocol.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -32,7 +32,7 @@ inline bool bs_serial_data_available(const uint8_t index) { switch (index) { case 0: return MYSERIAL0.available(); - #if NUM_SERIAL > 1 + #if HAS_MULTI_SERIAL case 1: return MYSERIAL1.available(); #endif } @@ -42,7 +42,7 @@ inline bool bs_serial_data_available(const uint8_t index) { inline int bs_read_serial(const uint8_t index) { switch (index) { case 0: return MYSERIAL0.read(); - #if NUM_SERIAL > 1 + #if HAS_MULTI_SERIAL case 1: return MYSERIAL1.read(); #endif } @@ -82,9 +82,7 @@ private: } transfer_active = true; data_waiting = 0; - #if ENABLED(BINARY_STREAM_COMPRESSION) - heatshrink_decoder_reset(&hsd); - #endif + TERN_(BINARY_STREAM_COMPRESSION, heatshrink_decoder_reset(&hsd)); return true; } @@ -127,9 +125,7 @@ private: card.closefile(); card.release(); } - #if ENABLED(BINARY_STREAM_COMPRESSION) - heatshrink_decoder_finish(&hsd); - #endif + TERN_(BINARY_STREAM_COMPRESSION, heatshrink_decoder_finish(&hsd)); transfer_active = false; return true; } @@ -139,9 +135,7 @@ private: card.closefile(); card.removeFile(card.filename); card.release(); - #if ENABLED(BINARY_STREAM_COMPRESSION) - heatshrink_decoder_finish(&hsd); - #endif + TERN_(BINARY_STREAM_COMPRESSION, heatshrink_decoder_finish(&hsd)); } transfer_active = false; return; diff --git a/Marlin/src/feature/bltouch.cpp b/Marlin/src/feature/bltouch.cpp index efe575ec63..d6b1f99c16 100644 --- a/Marlin/src/feature/bltouch.cpp +++ b/Marlin/src/feature/bltouch.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -124,9 +124,7 @@ bool BLTouch::deploy_proc() { } // One of the recommended ANTClabs ways to probe, using SW MODE - #if ENABLED(BLTOUCH_FORCE_SW_MODE) - _set_SW_mode(); - #endif + TERN_(BLTOUCH_FORCE_SW_MODE, _set_SW_mode()); // 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 diff --git a/Marlin/src/feature/bltouch.h b/Marlin/src/feature/bltouch.h index af75fb8b29..40685af1b3 100644 --- a/Marlin/src/feature/bltouch.h +++ b/Marlin/src/feature/bltouch.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -26,9 +26,17 @@ // BLTouch commands are sent as servo angles typedef unsigned char BLTCommand; -#define BLTOUCH_DEPLOY 10 +#if ENABLED(CREALITY_TOUCH) + #define STOW_ALARM false + #define BLTOUCH_DEPLOY 170 + #define BLTOUCH_STOW 20 +#else + #define STOW_ALARM true + #define BLTOUCH_DEPLOY 10 + #define BLTOUCH_STOW 90 +#endif + #define BLTOUCH_SW_MODE 60 -#define BLTOUCH_STOW 90 #define BLTOUCH_SELFTEST 120 #define BLTOUCH_MODE_STORE 130 #define BLTOUCH_5V_MODE 140 @@ -95,7 +103,7 @@ public: 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); } + FORCE_INLINE static bool _stow_query_alarm() { return command(BLTOUCH_STOW, BLTOUCH_STOW_DELAY) == STOW_ALARM; } static void clear(); static bool command(const BLTCommand cmd, const millis_t &ms); diff --git a/Marlin/src/feature/cancel_object.cpp b/Marlin/src/feature/cancel_object.cpp index e2ee645215..7eb4715435 100644 --- a/Marlin/src/feature/cancel_object.cpp +++ b/Marlin/src/feature/cancel_object.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include "../inc/MarlinConfig.h" diff --git a/Marlin/src/feature/cancel_object.h b/Marlin/src/feature/cancel_object.h index 41bbfb70fc..1d2d77f203 100644 --- a/Marlin/src/feature/cancel_object.h +++ b/Marlin/src/feature/cancel_object.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/caselight.cpp b/Marlin/src/feature/caselight.cpp index a135cac418..4287a0f262 100644 --- a/Marlin/src/feature/caselight.cpp +++ b/Marlin/src/feature/caselight.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/feature/caselight.h b/Marlin/src/feature/caselight.h index de77f0696b..ff01b1a67d 100644 --- a/Marlin/src/feature/caselight.h +++ b/Marlin/src/feature/caselight.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/closedloop.cpp b/Marlin/src/feature/closedloop.cpp index b777243481..8a97f0c0cd 100644 --- a/Marlin/src/feature/closedloop.cpp +++ b/Marlin/src/feature/closedloop.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include "../inc/MarlinConfig.h" @@ -29,12 +29,14 @@ #include "closedloop.h" -void init_closedloop() { +ClosedLoop closedloop; + +void ClosedLoop::init() { OUT_WRITE(CLOSED_LOOP_ENABLE_PIN, LOW); SET_INPUT_PULLUP(CLOSED_LOOP_MOVE_COMPLETE_PIN); } -void set_closedloop(const byte val) { +void ClosedLoop::set(const byte val) { OUT_WRITE(CLOSED_LOOP_ENABLE_PIN, val); } diff --git a/Marlin/src/feature/closedloop.h b/Marlin/src/feature/closedloop.h index 7e5594447d..e03400c35c 100644 --- a/Marlin/src/feature/closedloop.h +++ b/Marlin/src/feature/closedloop.h @@ -16,10 +16,17 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once -void init_closedloop(); -void set_closedloop(const byte val); +class ClosedLoop { +public: + static void init(); + static void set(const byte val); +}; + +extern ClosedLoop closedloop; + +#define CLOSED_LOOP_WAITING() (READ(CLOSED_LOOP_ENABLE_PIN) && !READ(CLOSED_LOOP_MOVE_COMPLETE_PIN)) diff --git a/Marlin/src/feature/controllerfan.cpp b/Marlin/src/feature/controllerfan.cpp index 0746700407..fa5a86b019 100644 --- a/Marlin/src/feature/controllerfan.cpp +++ b/Marlin/src/feature/controllerfan.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -55,43 +55,34 @@ void ControllerFan::update() { #define MOTOR_IS_ON(A,B) (A##_ENABLE_READ() == bool(B##_ENABLE_ON)) #define _OR_ENABLED_E(N) || MOTOR_IS_ON(E##N,E) - const bool motor_on = MOTOR_IS_ON(Z,Z) - #if HAS_Z2_ENABLE - || MOTOR_IS_ON(Z2,Z) - #endif - #if HAS_Z3_ENABLE - || MOTOR_IS_ON(Z3,Z) - #endif - #if HAS_Z4_ENABLE - || MOTOR_IS_ON(Z4,Z) - #endif - || (DISABLED(CONTROLLER_FAN_USE_Z_ONLY) && ( - MOTOR_IS_ON(X,X) || MOTOR_IS_ON(Y,Y) - #if HAS_X2_ENABLE - || MOTOR_IS_ON(X2,X) - #endif - #if HAS_Y2_ENABLE - || MOTOR_IS_ON(Y2,Y) - #endif + const bool motor_on = ( + ( DISABLED(CONTROLLER_FAN_IGNORE_Z) && + ( MOTOR_IS_ON(Z,Z) + || TERN0(HAS_Z2_ENABLE, MOTOR_IS_ON(Z2,Z)) + || TERN0(HAS_Z3_ENABLE, MOTOR_IS_ON(Z3,Z)) + || TERN0(HAS_Z4_ENABLE, MOTOR_IS_ON(Z4,Z)) + ) + ) || ( + DISABLED(CONTROLLER_FAN_USE_Z_ONLY) && + ( MOTOR_IS_ON(X,X) || MOTOR_IS_ON(Y,Y) + || TERN0(HAS_X2_ENABLE, MOTOR_IS_ON(X2,X)) + || TERN0(HAS_Y2_ENABLE, MOTOR_IS_ON(Y2,Y)) #if E_STEPPERS REPEAT(E_STEPPERS, _OR_ENABLED_E) #endif ) ) - ; + ); // If any of the drivers or the heated bed are enabled... - if (motor_on - #if HAS_HEATED_BED - || thermalManager.temp_bed.soft_pwm_amount > 0 - #endif - ) lastMotorOn = ms; //... set time to NOW so the fan will turn on + if (motor_on || TERN0(HAS_HEATED_BED, thermalManager.temp_bed.soft_pwm_amount > 0)) + lastMotorOn = ms; //... set time to NOW so the fan will turn on // Fan Settings. Set fan > 0: // - If AutoMode is on and steppers have been enabled for CONTROLLERFAN_IDLE_TIME seconds. // - If System is on idle and idle fan speed settings is activated. set_fan_speed( - settings.auto_mode && lastMotorOn && PENDING(ms, lastMotorOn + settings.duration * 1000UL) + settings.auto_mode && lastMotorOn && PENDING(ms, lastMotorOn + SEC_TO_MS(settings.duration)) ? settings.active_speed : settings.idle_speed ); diff --git a/Marlin/src/feature/controllerfan.h b/Marlin/src/feature/controllerfan.h index cd56ff8ced..d1d39f21f3 100644 --- a/Marlin/src/feature/controllerfan.h +++ b/Marlin/src/feature/controllerfan.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -62,11 +62,7 @@ class ControllerFan { #endif static inline bool state() { return speed > 0; } static inline void init() { reset(); } - static inline void reset() { - #if ENABLED(CONTROLLER_FAN_EDITABLE) - settings = controllerFan_defaults; - #endif - } + static inline void reset() { TERN_(CONTROLLER_FAN_EDITABLE, settings = controllerFan_defaults); } static void setup(); static void update(); }; diff --git a/Marlin/src/feature/dac/dac_dac084s085.h b/Marlin/src/feature/dac/dac_dac084s085.h index cccc9cbd45..5be0129fc9 100644 --- a/Marlin/src/feature/dac/dac_dac084s085.h +++ b/Marlin/src/feature/dac/dac_dac084s085.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/dac/dac_mcp4728.cpp b/Marlin/src/feature/dac/dac_mcp4728.cpp index cfb4dc462e..4976b36907 100644 --- a/Marlin/src/feature/dac/dac_mcp4728.cpp +++ b/Marlin/src/feature/dac/dac_mcp4728.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -27,7 +27,7 @@ * https://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 + * https://arduino.cc/forum/index.php/topic,51842.0.html */ #include "../../inc/MarlinConfig.h" @@ -43,7 +43,7 @@ xyze_uint_t mcp4728_values; */ void mcp4728_init() { Wire.begin(); - Wire.requestFrom(I2C_ADDRESS(DAC_DEV_ADDRESS), 24); + Wire.requestFrom(I2C_ADDRESS(DAC_DEV_ADDRESS), uint8_t(24)); while (Wire.available()) { char deviceID = Wire.read(), hiByte = Wire.read(), diff --git a/Marlin/src/feature/dac/dac_mcp4728.h b/Marlin/src/feature/dac/dac_mcp4728.h index 8e8b25ca69..6cce77856a 100644 --- a/Marlin/src/feature/dac/dac_mcp4728.h +++ b/Marlin/src/feature/dac/dac_mcp4728.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/dac/stepper_dac.cpp b/Marlin/src/feature/dac/stepper_dac.cpp index c8c1cb2494..6b140a0025 100644 --- a/Marlin/src/feature/dac/stepper_dac.cpp +++ b/Marlin/src/feature/dac/stepper_dac.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -29,6 +29,7 @@ #if ENABLED(DAC_STEPPER_CURRENT) #include "stepper_dac.h" +#include "../../MarlinCore.h" // for SP_X_LBL... bool dac_present = false; constexpr xyze_uint8_t dac_order = DAC_STEPPER_ORDER; @@ -85,15 +86,12 @@ void dac_current_set_percents(xyze_uint8_t &pct) { void dac_print_values() { if (!dac_present) return; - SERIAL_ECHO_MSG("Stepper current values in % (Amps):"); SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR_P( - SP_X_LBL, dac_perc(X_AXIS), PSTR(" ("), dac_amps(X_AXIS), PSTR(")") - SP_Y_LBL, dac_perc(Y_AXIS), PSTR(" ("), dac_amps(Y_AXIS), PSTR(")") - SP_Z_LBL, dac_perc(Z_AXIS), PSTR(" ("), dac_amps(Z_AXIS), PSTR(")") - SP_E_LBL, dac_perc(E_AXIS), PSTR(" ("), dac_amps(E_AXIS), PSTR(")") - ); + SERIAL_ECHOPAIR_P( SP_X_LBL, dac_perc(X_AXIS), PSTR(" ("), dac_amps(X_AXIS), PSTR(")")); + SERIAL_ECHOPAIR_P( SP_Y_LBL, dac_perc(Y_AXIS), PSTR(" ("), dac_amps(Y_AXIS), PSTR(")")); + SERIAL_ECHOPAIR_P( SP_Z_LBL, dac_perc(Z_AXIS), PSTR(" ("), dac_amps(Z_AXIS), PSTR(")")); + SERIAL_ECHOLNPAIR_P(SP_E_LBL, dac_perc(E_AXIS), PSTR(" ("), dac_amps(E_AXIS), PSTR(")")); } void dac_commit_eeprom() { diff --git a/Marlin/src/feature/dac/stepper_dac.h b/Marlin/src/feature/dac/stepper_dac.h index 3e77d471a6..0543b6275e 100644 --- a/Marlin/src/feature/dac/stepper_dac.h +++ b/Marlin/src/feature/dac/stepper_dac.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/digipot/digipot.h b/Marlin/src/feature/digipot/digipot.h index b7c0b65036..d59f8b930a 100644 --- a/Marlin/src/feature/digipot/digipot.h +++ b/Marlin/src/feature/digipot/digipot.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/digipot/digipot_mcp4018.cpp b/Marlin/src/feature/digipot/digipot_mcp4018.cpp index e8df4a475f..35c513a32c 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4018.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4018.cpp @@ -16,60 +16,52 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include "../../inc/MarlinConfig.h" -#if BOTH(DIGIPOT_I2C, DIGIPOT_MCP4018) +#if ENABLED(DIGIPOT_MCP4018) -#include "Stream.h" -#include "utility/twi.h" -#include //https://github.com/stawel/SlowSoftI2CMaster +#include +#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_MCP4018_MAX_VALUE 127 -#define DIGIPOT_A4988_Itripmax(Vref) ((Vref)/(8.0*DIGIPOT_A4988_Rsx)) +#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_FACTOR ((DIGIPOT_MCP4018_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 int16_t value = TERN(DIGIPOT_USE_RAW_VALUES, current, CEIL(current * DIGIPOT_A4988_FACTOR)); + return byte(constrain(value, 0, DIGIPOT_MCP4018_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 } + SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_X, DIGIPOTS_I2C_SCL) #if DIGIPOT_I2C_NUM_CHANNELS > 1 - , SlowSoftI2CMaster { sda_pins[Y_AXIS], DIGIPOTS_I2C_SCL } + , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_Y, DIGIPOTS_I2C_SCL) #if DIGIPOT_I2C_NUM_CHANNELS > 2 - , SlowSoftI2CMaster { sda_pins[Z_AXIS], DIGIPOTS_I2C_SCL } + , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_Z, DIGIPOTS_I2C_SCL) #if DIGIPOT_I2C_NUM_CHANNELS > 3 - , SlowSoftI2CMaster { sda_pins[E_AXIS], DIGIPOTS_I2C_SCL } + , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E0, DIGIPOTS_I2C_SCL) #if DIGIPOT_I2C_NUM_CHANNELS > 4 - , SlowSoftI2CMaster { sda_pins[E_AXIS + 1], DIGIPOTS_I2C_SCL } + , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E1, DIGIPOTS_I2C_SCL) + #if DIGIPOT_I2C_NUM_CHANNELS > 5 + , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E2, DIGIPOTS_I2C_SCL) + #if DIGIPOT_I2C_NUM_CHANNELS > 6 + , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E3, DIGIPOTS_I2C_SCL) + #if DIGIPOT_I2C_NUM_CHANNELS > 7 + , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E4, DIGIPOTS_I2C_SCL) + #endif + #endif + #endif #endif #endif #endif @@ -86,18 +78,23 @@ static void i2c_send(const uint8_t channel, const byte v) { // 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)))); + const float ival = _MIN(_MAX(current, 0), float(DIGIPOT_MCP4018_MAX_VALUE)); + i2c_send(channel, current_to_wiper(ival)); } void digipot_i2c_init() { - static const float digipot_motor_current[] PROGMEM = DIGIPOT_I2C_MOTOR_CURRENTS; + LOOP_L_N(i, DIGIPOT_I2C_NUM_CHANNELS) pots[i].i2c_init(); - LOOP_L_N(i, DIGIPOT_I2C_NUM_CHANNELS) - pots[i].i2c_init(); - - // setup initial currents as defined in Configuration_adv.h + // Init currents according to Configuration_adv.h + static const float digipot_motor_current[] PROGMEM = + #if ENABLED(DIGIPOT_USE_RAW_VALUES) + DIGIPOT_MOTOR_CURRENT + #else + DIGIPOT_I2C_MOTOR_CURRENTS + #endif + ; LOOP_L_N(i, COUNT(digipot_motor_current)) digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i])); } -#endif // DIGIPOT_I2C && DIGIPOT_MCP4018 +#endif // DIGIPOT_MCP4018 diff --git a/Marlin/src/feature/digipot/digipot_mcp4451.cpp b/Marlin/src/feature/digipot/digipot_mcp4451.cpp index 1183c96aa5..0c8ff04a0b 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4451.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4451.cpp @@ -16,15 +16,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include "../../inc/MarlinConfig.h" -#if ENABLED(DIGIPOT_I2C) && DISABLED(DIGIPOT_MCP4018) +#if ENABLED(DIGIPOT_MCP4451) -#include "Stream.h" +#include #include #if MB(MKS_SBASE) @@ -33,18 +33,18 @@ // 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 + #define DIGIPOT_I2C_FACTOR 117.96f + #define DIGIPOT_I2C_MAX_CURRENT 1.736f #elif MB(AZTEEG_X5_MINI, AZTEEG_X5_MINI_WIFI) - #define DIGIPOT_I2C_FACTOR 113.5 - #define DIGIPOT_I2C_MAX_CURRENT 2.0 + #define DIGIPOT_I2C_FACTOR 113.5f + #define DIGIPOT_I2C_MAX_CURRENT 2.0f #else - #define DIGIPOT_I2C_FACTOR 106.7 - #define DIGIPOT_I2C_MAX_CURRENT 2.5 + #define DIGIPOT_I2C_FACTOR 106.7f + #define DIGIPOT_I2C_MAX_CURRENT 2.5f #endif static byte current_to_wiper(const float current) { - return byte(CEIL(float((DIGIPOT_I2C_FACTOR * current)))); + return byte(TERN(DIGIPOT_USE_RAW_VALUES, current, CEIL(DIGIPOT_I2C_FACTOR * current))); } static void digipot_i2c_send(const byte addr, const byte a, const byte b) { @@ -62,8 +62,8 @@ static void digipot_i2c_send(const byte addr, const byte a, const byte b) { // 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 + // 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 @@ -77,14 +77,20 @@ void digipot_i2c_set_current(const uint8_t channel, const float current) { void digipot_i2c_init() { #if MB(MKS_SBASE) - configure_i2c(16); // Setting clock_option to 16 ensure the I2C bus is initialized at 400kHz + configure_i2c(16); // Set clock_option to 16 ensure I2C is initialized at 400kHz #else Wire.begin(); #endif - // setup initial currents as defined in Configuration_adv.h - static const float digipot_motor_current[] PROGMEM = DIGIPOT_I2C_MOTOR_CURRENTS; + // Set up initial currents as defined in Configuration_adv.h + static const float digipot_motor_current[] PROGMEM = + #if ENABLED(DIGIPOT_USE_RAW_VALUES) + DIGIPOT_MOTOR_CURRENT + #else + DIGIPOT_I2C_MOTOR_CURRENTS + #endif + ; LOOP_L_N(i, COUNT(digipot_motor_current)) digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i])); } -#endif // DIGIPOT_I2C +#endif // DIGIPOT_MCP4451 diff --git a/Marlin/src/feature/direct_stepping.cpp b/Marlin/src/feature/direct_stepping.cpp new file mode 100644 index 0000000000..d3bdb43ab3 --- /dev/null +++ b/Marlin/src/feature/direct_stepping.cpp @@ -0,0 +1,273 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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(DIRECT_STEPPING) + +#include "direct_stepping.h" + +#include "../MarlinCore.h" + +#define CHECK_PAGE(I, R) do{ \ + if (I >= sizeof(page_states) / sizeof(page_states[0])) { \ + fatal_error = true; \ + return R; \ + } \ +}while(0) + +#define CHECK_PAGE_STATE(I, R, S) do { \ + CHECK_PAGE(I, R); \ + if (page_states[I] != S) { \ + fatal_error = true; \ + return R; \ + } \ +}while(0) + +namespace DirectStepping { + + template + State SerialPageManager::state; + + template + volatile bool SerialPageManager::fatal_error; + + template + volatile PageState SerialPageManager::page_states[Cfg::NUM_PAGES]; + + template + volatile bool SerialPageManager::page_states_dirty; + + template + millis_t SerialPageManager::next_response; + + template + uint8_t SerialPageManager::pages[Cfg::NUM_PAGES][Cfg::PAGE_SIZE]; + + template + uint8_t SerialPageManager::checksum; + + template + typename Cfg::write_byte_idx_t SerialPageManager::write_byte_idx; + + template + typename Cfg::page_idx_t SerialPageManager::write_page_idx; + + template + typename Cfg::write_byte_idx_t SerialPageManager::write_page_size; + + template + void SerialPageManager::init() { + for (int i = 0 ; i < Cfg::NUM_PAGES ; i++) + page_states[i] = PageState::FREE; + + fatal_error = false; + next_response = 0; + state = State::NEWLINE; + + page_states_dirty = false; + + SERIAL_ECHOLNPGM("pages_ready"); + } + + template + FORCE_INLINE bool SerialPageManager::maybe_store_rxd_char(uint8_t c) { + switch (state) { + default: + case State::MONITOR: + switch (c) { + case '\n': + case '\r': + state = State::NEWLINE; + default: + return false; + } + case State::NEWLINE: + switch (c) { + case Cfg::CONTROL_CHAR: + state = State::ADDRESS; + return true; + case '\n': + case '\r': + state = State::NEWLINE; + return false; + default: + state = State::MONITOR; + return false; + } + case State::ADDRESS: + //TODO: 16 bit address, State::ADDRESS2 + write_page_idx = c; + write_byte_idx = 0; + checksum = 0; + + CHECK_PAGE(write_page_idx, true); + + if (page_states[write_page_idx] == PageState::FAIL) { + // Special case for fail + state = State::UNFAIL; + return true; + } + + set_page_state(write_page_idx, PageState::WRITING); + + state = Cfg::DIRECTIONAL ? State::COLLECT : State::SIZE; + + return true; + case State::SIZE: + // Zero means full page size + write_page_size = c; + state = State::COLLECT; + return true; + case State::COLLECT: + pages[write_page_idx][write_byte_idx++] = c; + checksum ^= c; + + // check if still collecting + if (Cfg::PAGE_SIZE == 256) { + // special case for 8-bit, check if rolled back to 0 + if (Cfg::DIRECTIONAL || !write_page_size) { // full 256 bytes + if (write_byte_idx) return true; + } else { + if (write_byte_idx < write_page_size) return true; + } + } else if (Cfg::DIRECTIONAL) { + if (write_byte_idx != Cfg::PAGE_SIZE) return true; + } else { + if (write_byte_idx < write_page_size) return true; + } + + state = State::CHECKSUM; + return true; + case State::CHECKSUM: { + const PageState page_state = (checksum == c) ? PageState::OK : PageState::FAIL; + set_page_state(write_page_idx, page_state); + state = State::MONITOR; + return true; + } + case State::UNFAIL: + if (c == 0) { + set_page_state(write_page_idx, PageState::FREE); + } else { + fatal_error = true; + } + state = State::MONITOR; + return true; + } + } + + template + void SerialPageManager::write_responses() { + if (fatal_error) { + kill(GET_TEXT(MSG_BAD_PAGE)); + return; + } + + // Runs on a set interval also, as responses may get lost. + if (next_response && next_response < millis()) { + page_states_dirty = true; + } + + if (!page_states_dirty) return; + + page_states_dirty = false; + next_response = millis() + Cfg::RESPONSE_INTERVAL_MS; + + SERIAL_ECHO(Cfg::CONTROL_CHAR); + constexpr int state_bits = 2; + constexpr int n_bytes = Cfg::NUM_PAGES >> state_bits; + volatile uint8_t bits_b[n_bytes] = { 0 }; + + for (page_idx_t i = 0 ; i < Cfg::NUM_PAGES ; i++) { + bits_b[i >> state_bits] |= page_states[i] << ((i * state_bits) & 0x7); + } + + uint8_t crc = 0; + for (uint8_t i = 0 ; i < n_bytes ; i++) { + crc ^= bits_b[i]; + SERIAL_ECHO(bits_b[i]); + } + + SERIAL_ECHO(crc); + SERIAL_EOL(); + } + + template + FORCE_INLINE void SerialPageManager::set_page_state(const page_idx_t page_idx, const PageState page_state) { + CHECK_PAGE(page_idx,); + + page_states[page_idx] = page_state; + page_states_dirty = true; + } + + template <> + FORCE_INLINE uint8_t *PageManager::get_page(const page_idx_t page_idx) { + CHECK_PAGE(page_idx, nullptr); + + return pages[page_idx]; + } + + template <> + FORCE_INLINE void PageManager::free_page(const page_idx_t page_idx) { + set_page_state(page_idx, PageState::FREE); + } + +}; + +DirectStepping::PageManager page_manager; + +const uint8_t segment_table[DirectStepping::Config::NUM_SEGMENTS][DirectStepping::Config::SEGMENT_STEPS] PROGMEM = { + + #if STEPPER_PAGE_FORMAT == SP_4x4D_128 + + { 1, 1, 1, 1, 1, 1, 1, 0 }, // 0 = -7 + { 1, 1, 1, 0, 1, 1, 1, 0 }, // 1 = -6 + { 0, 1, 1, 0, 1, 0, 1, 1 }, // 2 = -5 + { 0, 1, 0, 1, 0, 1, 0, 1 }, // 3 = -4 + { 0, 1, 0, 0, 1, 0, 0, 1 }, // 4 = -3 + { 0, 0, 1, 0, 0, 0, 1, 0 }, // 5 = -2 + { 0, 0, 0, 0, 1, 0, 0, 0 }, // 6 = -1 + { 0, 0, 0, 0, 0, 0, 0, 0 }, // 7 = 0 + { 0, 0, 0, 0, 1, 0, 0, 0 }, // 8 = 1 + { 0, 0, 1, 0, 0, 0, 1, 0 }, // 9 = 2 + { 0, 1, 0, 0, 1, 0, 0, 1 }, // 10 = 3 + { 0, 1, 0, 1, 0, 1, 0, 1 }, // 11 = 4 + { 0, 1, 1, 0, 1, 0, 1, 1 }, // 12 = 5 + { 1, 1, 1, 0, 1, 1, 1, 0 }, // 13 = 6 + { 1, 1, 1, 1, 1, 1, 1, 0 }, // 14 = 7 + { 0 } + + #elif STEPPER_PAGE_FORMAT == SP_4x2_256 + + { 0, 0, 0, 0 }, // 0 + { 0, 1, 0, 0 }, // 1 + { 1, 0, 1, 0 }, // 2 + { 1, 1, 1, 0 }, // 3 + + #elif STEPPER_PAGE_FORMAT == SP_4x1_512 + + {0} // Uncompressed format, table not used + + #endif + +}; + +#endif // DIRECT_STEPPING diff --git a/Marlin/src/feature/direct_stepping.h b/Marlin/src/feature/direct_stepping.h new file mode 100644 index 0000000000..dea2616508 --- /dev/null +++ b/Marlin/src/feature/direct_stepping.h @@ -0,0 +1,137 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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" + +namespace DirectStepping { + + enum State : char { + MONITOR, NEWLINE, ADDRESS, SIZE, COLLECT, CHECKSUM, UNFAIL + }; + + enum PageState : uint8_t { + FREE, WRITING, OK, FAIL + }; + + // Static state used for stepping through direct stepping pages + struct page_step_state_t { + // Current page + uint8_t *page; + // Current segment + uint16_t segment_idx; + // Current steps within segment + uint8_t segment_steps; + // Segment delta + xyze_uint8_t sd; + // Block delta + xyze_int_t bd; + }; + + template + class SerialPageManager { + public: + + typedef typename Cfg::page_idx_t page_idx_t; + + static bool maybe_store_rxd_char(uint8_t c); + static void write_responses(); + + // common methods for page managers + static void init(); + static uint8_t *get_page(const page_idx_t page_idx); + static void free_page(const page_idx_t page_idx); + + protected: + + typedef typename Cfg::write_byte_idx_t write_byte_idx_t; + + static State state; + static volatile bool fatal_error; + + static volatile PageState page_states[Cfg::NUM_PAGES]; + static volatile bool page_states_dirty; + static millis_t next_response; + + static uint8_t pages[Cfg::NUM_PAGES][Cfg::PAGE_SIZE]; + static uint8_t checksum; + static write_byte_idx_t write_byte_idx; + static page_idx_t write_page_idx; + static write_byte_idx_t write_page_size; + + static void set_page_state(const page_idx_t page_idx, const PageState page_state); + }; + + template struct TypeSelector { typedef T type;} ; + template struct TypeSelector { typedef F type; }; + + template + struct config_t { + static constexpr char CONTROL_CHAR = '!'; + + static constexpr int NUM_PAGES = num_pages; + static constexpr int NUM_AXES = num_axes; + static constexpr int BITS_SEGMENT = bits_segment; + static constexpr int DIRECTIONAL = dir ? 1 : 0; + static constexpr int SEGMENTS = segments; + + static constexpr int RAW = (BITS_SEGMENT == 1) ? 1 : 0; + static constexpr int NUM_SEGMENTS = 1 << BITS_SEGMENT; + static constexpr int SEGMENT_STEPS = 1 << (BITS_SEGMENT - DIRECTIONAL - RAW); + static constexpr int TOTAL_STEPS = SEGMENT_STEPS * SEGMENTS; + static constexpr int PAGE_SIZE = (NUM_AXES * BITS_SEGMENT * SEGMENTS) / 8; + + static constexpr millis_t RESPONSE_INTERVAL_MS = 50; + + typedef typename TypeSelector<(PAGE_SIZE>256), uint16_t, uint8_t>::type write_byte_idx_t; + typedef typename TypeSelector<(NUM_PAGES>256), uint16_t, uint8_t>::type page_idx_t; + }; + + template + using SP_4x4D_128 = config_t; + + template + using SP_4x2_256 = config_t; + + template + using SP_4x1_512 = config_t; + + // configured types + typedef STEPPER_PAGE_FORMAT Config; + + template class PAGE_MANAGER; + typedef PAGE_MANAGER PageManager; +}; + +#define SP_4x4D_128 1 +//#define SP_4x4_128 2 +//#define SP_4x2D_256 3 +#define SP_4x2_256 4 +#define SP_4x1_512 5 + +typedef typename DirectStepping::Config::page_idx_t page_idx_t; + +// TODO: use config +typedef DirectStepping::page_step_state_t page_step_state_t; + +extern const uint8_t segment_table[DirectStepping::Config::NUM_SEGMENTS][DirectStepping::Config::SEGMENT_STEPS]; +extern DirectStepping::PageManager page_manager; diff --git a/Marlin/src/feature/e_parser.cpp b/Marlin/src/feature/e_parser.cpp index e7d79bf745..85b1845a64 100644 --- a/Marlin/src/feature/e_parser.cpp +++ b/Marlin/src/feature/e_parser.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/feature/e_parser.h b/Marlin/src/feature/e_parser.h index 41261402a1..73e459680e 100644 --- a/Marlin/src/feature/e_parser.h +++ b/Marlin/src/feature/e_parser.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/encoder_i2c.cpp b/Marlin/src/feature/encoder_i2c.cpp index a70227a270..f67d50a6e0 100644 --- a/Marlin/src/feature/encoder_i2c.cpp +++ b/Marlin/src/feature/encoder_i2c.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -107,7 +107,7 @@ void I2CPositionEncoder::update() { 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_DECIMAL(mm_from_count(get_position())); SERIAL_ECHOLNPGM(")"); #endif } @@ -305,7 +305,7 @@ int32_t I2CPositionEncoder::get_raw_count() { encoderCount.val = 0x00; - if (Wire.requestFrom((int)i2cAddress, 3) != 3) { + if (Wire.requestFrom(I2C_ADDRESS(i2cAddress), uint8_t(3)) != 3) { //houston, we have a problem... H = I2CPE_MAG_SIG_NF; return 0; @@ -459,9 +459,7 @@ void I2CPositionEncoder::reset() { Wire.write(I2CPE_RESET_COUNT); Wire.endTransmission(); - #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - ZERO(err); - #endif + TERN_(I2CPE_ERR_ROLLING_AVERAGE, ZERO(err)); } @@ -746,7 +744,7 @@ void I2CPositionEncodersMgr::report_module_firmware(const uint8_t address) { Wire.endTransmission(); // Read value - if (Wire.requestFrom((int)address, 32)) { + if (Wire.requestFrom(I2C_ADDRESS(address), uint8_t(32))) { char c; while (Wire.available() > 0 && (c = (char)Wire.read()) > 0) SERIAL_ECHO(c); diff --git a/Marlin/src/feature/encoder_i2c.h b/Marlin/src/feature/encoder_i2c.h index 0665ee809d..511e560ba0 100644 --- a/Marlin/src/feature/encoder_i2c.h +++ b/Marlin/src/feature/encoder_i2c.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -280,13 +280,13 @@ class I2CPositionEncodersMgr { 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."); + SERIAL_ECHOLNPAIR("Error correct threshold for ", axis_codes[axis], " axis set to ", 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."); + SERIAL_ECHOLNPAIR("Error correct threshold for ", axis_codes[axis], " axis is ", threshold, "mm."); } static int8_t idx_from_axis(const AxisEnum axis) { diff --git a/Marlin/src/feature/fanmux.cpp b/Marlin/src/feature/fanmux.cpp index b90c72c648..43952ca8ee 100644 --- a/Marlin/src/feature/fanmux.cpp +++ b/Marlin/src/feature/fanmux.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/feature/fanmux.h b/Marlin/src/feature/fanmux.h index 2e54144478..b1b0c67a55 100644 --- a/Marlin/src/feature/fanmux.h +++ b/Marlin/src/feature/fanmux.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/filwidth.cpp b/Marlin/src/feature/filwidth.cpp index 4357d39fe0..2bd9c78980 100644 --- a/Marlin/src/feature/filwidth.cpp +++ b/Marlin/src/feature/filwidth.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/feature/filwidth.h b/Marlin/src/feature/filwidth.h index 335a49b74f..ef3859df71 100644 --- a/Marlin/src/feature/filwidth.h +++ b/Marlin/src/feature/filwidth.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/fwretract.cpp b/Marlin/src/feature/fwretract.cpp index 7d756ac6d0..c0e4db0a45 100644 --- a/Marlin/src/feature/fwretract.cpp +++ b/Marlin/src/feature/fwretract.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -60,9 +60,7 @@ float FWRetract::current_retract[EXTRUDERS], // Retract value used by p FWRetract::current_hop; void FWRetract::reset() { - #if ENABLED(FWRETRACT_AUTORETRACT) - autoretract_enabled = false; - #endif + TERN_(FWRETRACT_AUTORETRACT, autoretract_enabled = false); settings.retract_length = RETRACT_LENGTH; settings.retract_feedrate_mm_s = RETRACT_FEEDRATE; settings.retract_zraise = RETRACT_ZRAISE; @@ -95,7 +93,7 @@ void FWRetract::reset() { */ void FWRetract::retract(const bool retracting #if EXTRUDERS > 1 - , bool swapping /* =false */ + , bool swapping/*=false*/ #endif ) { // Prevent two retracts or recovers in a row @@ -128,12 +126,8 @@ void FWRetract::retract(const bool retracting 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 - ); + const float base_retract = TERN1(RETRACT_SYNC_MIXING, (MIXING_STEPPERS)) + * (swapping ? settings.swap_retract_length : settings.retract_length); // The current position will be the destination for E and Z moves destination = current_position; @@ -148,10 +142,7 @@ void FWRetract::retract(const bool 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 + settings.retract_feedrate_mm_s * TERN1(RETRACT_SYNC_MIXING, (MIXING_STEPPERS)) ); // Is a Z hop set, and has the hop not yet been done? @@ -177,18 +168,14 @@ void FWRetract::retract(const bool retracting current_retract[active_extruder] = 0; - const feedRate_t fr_mm_s = ( + // Recover E, set_current_to_destination + prepare_internal_move_to_destination( (swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s) - #if ENABLED(RETRACT_SYNC_MIXING) - * (MIXING_STEPPERS) - #endif + * TERN1(RETRACT_SYNC_MIXING, (MIXING_STEPPERS)) ); - 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 + TERN_(RETRACT_SYNC_MIXING, mixer.T(old_mixing_tool)); // Restore original mixing tool retracted[active_extruder] = retracting; // Active extruder now retracted / recovered diff --git a/Marlin/src/feature/fwretract.h b/Marlin/src/feature/fwretract.h index e08f8f03af..3d68736429 100644 --- a/Marlin/src/feature/fwretract.h +++ b/Marlin/src/feature/fwretract.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/host_actions.cpp b/Marlin/src/feature/host_actions.cpp index 2108f4e7f4..9539c82b64 100644 --- a/Marlin/src/feature/host_actions.cpp +++ b/Marlin/src/feature/host_actions.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -37,7 +37,8 @@ #include "runout.h" #endif -void host_action(const char * const pstr, const bool eol) { +void host_action(PGM_P const pstr, const bool eol) { + PORT_REDIRECT(SERIAL_BOTH); SERIAL_ECHOPGM("//action:"); serialprintPGM(pstr); if (eol) SERIAL_EOL(); @@ -64,8 +65,8 @@ void host_action(const char * const pstr, const bool eol) { #if ENABLED(HOST_PROMPT_SUPPORT) - const char CONTINUE_STR[] PROGMEM = "Continue", - DISMISS_STR[] PROGMEM = "Dismiss"; + PGMSTR(CONTINUE_STR, "Continue"); + PGMSTR(DISMISS_STR, "Dismiss"); #if HAS_RESUME_CONTINUE extern bool wait_for_user; @@ -74,33 +75,42 @@ void host_action(const char * const pstr, const bool eol) { PromptReason host_prompt_reason = PROMPT_NOT_DEFINED; void host_action_notify(const char * const message) { + PORT_REDIRECT(SERIAL_BOTH); + host_action(PSTR("notification "), false); + SERIAL_ECHOLN(message); + } + + void host_action_notify_P(PGM_P const message) { + PORT_REDIRECT(SERIAL_BOTH); host_action(PSTR("notification "), false); serialprintPGM(message); SERIAL_EOL(); } - void host_action_prompt(const char * const ptype, const bool eol=true) { + void host_action_prompt(PGM_P const ptype, const bool eol=true) { + PORT_REDIRECT(SERIAL_BOTH); 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 char extra_char='\0') { + void host_action_prompt_plus(PGM_P const ptype, PGM_P const pstr, const char extra_char='\0') { host_action_prompt(ptype, false); + PORT_REDIRECT(SERIAL_BOTH); SERIAL_CHAR(' '); serialprintPGM(pstr); if (extra_char != '\0') SERIAL_CHAR(extra_char); SERIAL_EOL(); } - void host_action_prompt_begin(const PromptReason reason, const char * const pstr, const char extra_char/*='\0'*/) { + void host_action_prompt_begin(const PromptReason reason, PGM_P const pstr, const char extra_char/*='\0'*/) { host_action_prompt_end(); host_prompt_reason = reason; host_action_prompt_plus(PSTR("begin"), pstr, extra_char); } - void host_action_prompt_button(const char * const pstr) { host_action_prompt_plus(PSTR("button"), pstr); } + void host_action_prompt_button(PGM_P 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 btn1/*=nullptr*/, const char * const btn2/*=nullptr*/) { + void host_prompt_do(const PromptReason reason, PGM_P const pstr, PGM_P const btn1/*=nullptr*/, PGM_P const btn2/*=nullptr*/) { host_action_prompt_begin(reason, pstr); if (btn1) host_action_prompt_button(btn1); if (btn2) host_action_prompt_button(btn2); @@ -108,11 +118,7 @@ void host_action(const char * const pstr, const bool eol) { } void filament_load_host_prompt() { - const bool disable_to_continue = (false - #if HAS_FILAMENT_SENSOR - || runout.filament_ran_out - #endif - ); + const bool disable_to_continue = TERN0(HAS_FILAMENT_SENSOR, runout.filament_ran_out); host_prompt_do(PROMPT_FILAMENT_RUNOUT, PSTR("Paused"), PSTR("PurgeMore"), disable_to_continue ? PSTR("DisableRunout") : CONTINUE_STR ); @@ -127,11 +133,11 @@ void host_action(const char * const pstr, const bool eol) { // void host_response_handler(const uint8_t response) { #ifdef DEBUG_HOST_ACTIONS - static const char m876_prefix[] PROGMEM = "M876 Handle Re"; + static PGMSTR(m876_prefix, "M876 Handle Re"); serialprintPGM(m876_prefix); SERIAL_ECHOLNPAIR("ason: ", host_prompt_reason); serialprintPGM(m876_prefix); SERIAL_ECHOLNPAIR("sponse: ", response); #endif - const char *msg = PSTR("UNKNOWN STATE"); + PGM_P msg = PSTR("UNKNOWN STATE"); const PromptReason hpr = host_prompt_reason; host_prompt_reason = PROMPT_NOT_DEFINED; // Reset now ahead of logic switch (hpr) { @@ -140,14 +146,14 @@ void host_action(const char * const pstr, const bool eol) { switch (response) { case 0: // "Purge More" button - #if HAS_LCD_MENU && ENABLED(ADVANCED_PAUSE_FEATURE) + #if BOTH(HAS_LCD_MENU, ADVANCED_PAUSE_FEATURE) pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; // Simulate menu selection (menu exits, doesn't extrude more) #endif filament_load_host_prompt(); // Initiate another host prompt. (NOTE: The loop in load_filament may also do this!) break; case 1: // "Continue" / "Disable Runout" button - #if HAS_LCD_MENU && ENABLED(ADVANCED_PAUSE_FEATURE) + #if BOTH(HAS_LCD_MENU, ADVANCED_PAUSE_FEATURE) pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; // Simulate menu selection #endif #if HAS_FILAMENT_SENSOR @@ -160,9 +166,7 @@ void host_action(const char * const pstr, const bool eol) { } break; case PROMPT_USER_CONTINUE: - #if HAS_RESUME_CONTINUE - wait_for_user = false; - #endif + TERN_(HAS_RESUME_CONTINUE, wait_for_user = false); msg = PSTR("FILAMENT_RUNOUT_CONTINUE"); break; case PROMPT_PAUSE_RESUME: diff --git a/Marlin/src/feature/host_actions.h b/Marlin/src/feature/host_actions.h index 3667b7f430..a6ad2c0485 100644 --- a/Marlin/src/feature/host_actions.h +++ b/Marlin/src/feature/host_actions.h @@ -16,14 +16,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once #include "../inc/MarlinConfigPre.h" +#include "../HAL/shared/Marduino.h" -void host_action(const char * const pstr, const bool eol=true); +void host_action(PGM_P const pstr, const bool eol=true); #ifdef ACTION_ON_KILL void host_action_kill(); @@ -61,12 +62,13 @@ void host_action(const char * const pstr, const bool eol=true); void host_response_handler(const uint8_t response); void host_action_notify(const char * const message); - void host_action_prompt_begin(const PromptReason reason, const char * const pstr, const char extra_char='\0'); - void host_action_prompt_button(const char * const pstr); + void host_action_notify_P(PGM_P const message); + void host_action_prompt_begin(const PromptReason reason, PGM_P const pstr, const char extra_char='\0'); + void host_action_prompt_button(PGM_P const pstr); void host_action_prompt_end(); void host_action_prompt_show(); - void host_prompt_do(const PromptReason reason, const char * const pstr, const char * const btn1=nullptr, const char * const btn2=nullptr); - inline void host_prompt_open(const PromptReason reason, const char * const pstr, const char * const btn1=nullptr, const char * const btn2=nullptr) { + void host_prompt_do(const PromptReason reason, PGM_P const pstr, PGM_P const btn1=nullptr, PGM_P const btn2=nullptr); + inline void host_prompt_open(const PromptReason reason, PGM_P const pstr, PGM_P const btn1=nullptr, PGM_P const btn2=nullptr) { if (host_prompt_reason == PROMPT_NOT_DEFINED) host_prompt_do(reason, pstr, btn1, btn2); } diff --git a/Marlin/src/feature/hotend_idle.cpp b/Marlin/src/feature/hotend_idle.cpp new file mode 100644 index 0000000000..9d5594c2f1 --- /dev/null +++ b/Marlin/src/feature/hotend_idle.cpp @@ -0,0 +1,89 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Hotend Idle Timeout + * Prevent filament in the nozzle from charring and causing a critical jam. + */ + +#include "../inc/MarlinConfig.h" + +#if ENABLED(HOTEND_IDLE_TIMEOUT) + +#include "hotend_idle.h" +#include "../gcode/gcode.h" + +#include "../module/temperature.h" +#include "../module/motion.h" +#include "../lcd/ultralcd.h" + +extern HotendIdleProtection hotend_idle; + +millis_t HotendIdleProtection::next_protect_ms = 0; + +void HotendIdleProtection::check_hotends(const millis_t &ms) { + bool do_prot = false; + HOTEND_LOOP() { + if (thermalManager.degHotend(e) >= HOTEND_IDLE_MIN_TRIGGER) { + do_prot = true; break; + } + } + if (bool(next_protect_ms) != do_prot) + next_protect_ms = do_prot ? ms + hp_interval : 0; +} + +void HotendIdleProtection::check_e_motion(const millis_t &ms) { + static float old_e_position = 0; + if (old_e_position != current_position.e) { + old_e_position = current_position.e; // Track filament motion + if (next_protect_ms) // If some heater is on then... + next_protect_ms = ms + hp_interval; // ...delay the timeout till later + } +} + +void HotendIdleProtection::check() { + const millis_t ms = millis(); // Shared millis + + check_hotends(ms); // Any hotends need protection? + check_e_motion(ms); // Motion will protect them + + // Hot and not moving for too long... + if (next_protect_ms && ELAPSED(ms, next_protect_ms)) + timed_out(); +} + +// Lower (but don't raise) hotend / bed temperatures +void HotendIdleProtection::timed_out() { + next_protect_ms = 0; + SERIAL_ECHOLNPGM("Hotend Idle Timeout"); + LCD_MESSAGEPGM(MSG_HOTEND_IDLE_TIMEOUT); + HOTEND_LOOP() { + if ((HOTEND_IDLE_NOZZLE_TARGET) < thermalManager.degTargetHotend(e)) + thermalManager.setTargetHotend(HOTEND_IDLE_NOZZLE_TARGET, e); + } + #if HAS_HEATED_BED + if ((HOTEND_IDLE_BED_TARGET) < thermalManager.degTargetBed()) + thermalManager.setTargetBed(HOTEND_IDLE_BED_TARGET); + #endif +} + +#endif // HOTEND_IDLE_TIMEOUT diff --git a/Marlin/src/feature/hotend_idle.h b/Marlin/src/feature/hotend_idle.h new file mode 100644 index 0000000000..40f557d5ed --- /dev/null +++ b/Marlin/src/feature/hotend_idle.h @@ -0,0 +1,37 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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/millis_t.h" + +class HotendIdleProtection { +public: + static void check(); +private: + static constexpr millis_t hp_interval = SEC_TO_MS(HOTEND_IDLE_TIMEOUT_SEC); + static millis_t next_protect_ms; + static void check_hotends(const millis_t &ms); + static void check_e_motion(const millis_t &ms); + static void timed_out(); +}; + +extern HotendIdleProtection hotend_idle; diff --git a/Marlin/src/feature/joystick.cpp b/Marlin/src/feature/joystick.cpp index 66afb63b05..d9c5ae7c1b 100644 --- a/Marlin/src/feature/joystick.cpp +++ b/Marlin/src/feature/joystick.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -154,9 +154,7 @@ Joystick joystick; // 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 + TERN_(EXTENSIBLE_UI, ExtUI::_joystick_update(norm_jog)); // norm_jog values of [-1 .. 1] maps linearly to [-feedrate .. feedrate] xyz_float_t move_dist{0}; diff --git a/Marlin/src/feature/joystick.h b/Marlin/src/feature/joystick.h index 12f9554a71..ca46834578 100644 --- a/Marlin/src/feature/joystick.h +++ b/Marlin/src/feature/joystick.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -35,19 +35,11 @@ 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 + TERN_(HAS_JOY_ADC_X, static temp_info_t x); + TERN_(HAS_JOY_ADC_Y, static temp_info_t y); + TERN_(HAS_JOY_ADC_Z, static temp_info_t z); public: - #if ENABLED(JOYSTICK_DEBUG) - static void report(); - #endif + TERN_(JOYSTICK_DEBUG, static void report()); static void calculate(xyz_float_t &norm_jog); static void inject_jog_moves(); }; diff --git a/Marlin/src/feature/leds/blinkm.cpp b/Marlin/src/feature/leds/blinkm.cpp index 1c7ceeb669..868eb4b3d9 100644 --- a/Marlin/src/feature/leds/blinkm.cpp +++ b/Marlin/src/feature/leds/blinkm.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/feature/leds/blinkm.h b/Marlin/src/feature/leds/blinkm.h index c7c099d3a8..29a9e78412 100644 --- a/Marlin/src/feature/leds/blinkm.h +++ b/Marlin/src/feature/leds/blinkm.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/leds/leds.cpp b/Marlin/src/feature/leds/leds.cpp index 995693ffc5..eec0cde630 100644 --- a/Marlin/src/feature/leds/leds.cpp +++ b/Marlin/src/feature/leds/leds.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -39,7 +39,7 @@ #endif #if ENABLED(PCA9533) - #include + #include "pca9533.h" #endif #if ENABLED(LED_COLOR_PRESETS) @@ -68,15 +68,9 @@ void LEDLights::setup() { 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 + TERN_(NEOPIXEL_LED, neo.init()); + TERN_(PCA9533, PCA9533_init()); + TERN_(LED_USER_PRESET_STARTUP, set_default()); } void LEDLights::set_color(const LEDColor &incol @@ -140,9 +134,7 @@ void LEDLights::set_color(const LEDColor &incol pca9632_set_led_color(incol); #endif - #if ENABLED(PCA9533) - RGBsetColor(incol.r, incol.g, incol.b, true); - #endif + TERN_(PCA9533, PCA9533_setColor(incol.r, incol.g, incol.b)); #if EITHER(LED_CONTROL_MENU, PRINTER_EVENT_LEDS) // Don't update the color when OFF diff --git a/Marlin/src/feature/leds/leds.h b/Marlin/src/feature/leds/leds.h index 22184381fc..577c94752f 100644 --- a/Marlin/src/feature/leds/leds.h +++ b/Marlin/src/feature/leds/leds.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -34,7 +34,9 @@ #endif // A white component can be passed -#define HAS_WHITE_LED EITHER(RGBW_LED, NEOPIXEL_LED) +#if EITHER(RGBW_LED, NEOPIXEL_LED) + #define HAS_WHITE_LED 1 +#endif /** * LEDcolor type for use with leds.set_color @@ -85,9 +87,7 @@ typedef struct LEDColor { LEDColor& operator=(const uint8_t (&rgbw)[4]) { r = rgbw[0]; g = rgbw[1]; b = rgbw[2]; - #if HAS_WHITE_LED - w = rgbw[3]; - #endif + TERN_(HAS_WHITE_LED, w = rgbw[3]); return *this; } diff --git a/Marlin/src/feature/leds/neopixel.cpp b/Marlin/src/feature/leds/neopixel.cpp index 892ebe15cb..5d80cfe5d2 100644 --- a/Marlin/src/feature/leds/neopixel.cpp +++ b/Marlin/src/feature/leds/neopixel.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -35,6 +35,7 @@ #endif Marlin_NeoPixel neo; +int8_t Marlin_NeoPixel::neoindex; Adafruit_NeoPixel Marlin_NeoPixel::adaneo1(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIXEL_TYPE + NEO_KHZ800) #if MULTIPLE_NEOPIXEL_TYPES @@ -52,14 +53,20 @@ Adafruit_NeoPixel Marlin_NeoPixel::adaneo1(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIX #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); + if (get_neo_index() >= 0) { + set_pixel_color(get_neo_index(), color); + set_neo_index(-1); + } + else { + 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(); } @@ -71,13 +78,12 @@ void Marlin_NeoPixel::set_color_startup(const uint32_t color) { } void Marlin_NeoPixel::init() { - SET_OUTPUT(NEOPIXEL_PIN); - set_brightness(NEOPIXEL_BRIGHTNESS); // 0 - 255 range + set_neo_index(-1); // -1 .. NEOPIXEL_PIXELS-1 range + 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 diff --git a/Marlin/src/feature/leds/neopixel.h b/Marlin/src/feature/leds/neopixel.h index 11e435b830..17057498d4 100644 --- a/Marlin/src/feature/leds/neopixel.h +++ b/Marlin/src/feature/leds/neopixel.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -38,10 +38,15 @@ // Defines // ------------------------ -#define MULTIPLE_NEOPIXEL_TYPES (defined(NEOPIXEL2_TYPE) && (NEOPIXEL2_TYPE != NEOPIXEL_TYPE)) +#if defined(NEOPIXEL2_TYPE) && NEOPIXEL2_TYPE != NEOPIXEL_TYPE + #define MULTIPLE_NEOPIXEL_TYPES 1 +#endif -#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_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_RGB 1 +#else + #define NEOPIXEL_IS_RGBW 1 +#endif #if NEOPIXEL_IS_RGB #define NEO_WHITE 255, 255, 255, 0 @@ -60,6 +65,7 @@ private: , adaneo2 #endif ; + static int8_t neoindex; public: static void init(); @@ -67,29 +73,26 @@ public: static void set_color(const uint32_t c); + FORCE_INLINE static void set_neo_index(const int8_t neoIndex) { neoindex = neoIndex; } + FORCE_INLINE static int8_t get_neo_index() { return neoindex; } + #ifdef NEOPIXEL_BKGD_LED_INDEX static void set_color_background(); #endif static inline void begin() { adaneo1.begin(); - #if MULTIPLE_NEOPIXEL_TYPES - adaneo2.begin(); - #endif + TERN_(MULTIPLE_NEOPIXEL_TYPES, adaneo2.begin()); } 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 + TERN_(MULTIPLE_NEOPIXEL_TYPES, adaneo2.setPixelColor(n, c)); } static inline void set_brightness(const uint8_t b) { adaneo1.setBrightness(b); - #if MULTIPLE_NEOPIXEL_TYPES - adaneo2.setBrightness(b); - #endif + TERN_(MULTIPLE_NEOPIXEL_TYPES, adaneo2.setBrightness(b)); } static inline void show() { diff --git a/Marlin/src/feature/leds/pca9533.cpp b/Marlin/src/feature/leds/pca9533.cpp new file mode 100644 index 0000000000..bcc4bc50a4 --- /dev/null +++ b/Marlin/src/feature/leds/pca9533.cpp @@ -0,0 +1,127 @@ +/* + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * PCA9533 LED controller driver (MightyBoard, FlashForge Creator Pro, etc.) + * by @grauerfuchs - 1 Apr 2020 + */ +#include "../../inc/MarlinConfig.h" + +#if ENABLED(PCA9533) + +#include "pca9533.h" +#include + +void PCA9533_init() { + Wire.begin(); + PCA9533_reset(); +} + +static void PCA9533_writeAllRegisters(uint8_t psc0, uint8_t pwm0, uint8_t psc1, uint8_t pwm1, uint8_t ls0){ + uint8_t data[6] = { PCA9533_REG_PSC0 | PCA9533_REGM_AI, psc0, pwm0, psc1, pwm1, ls0 }; + Wire.beginTransmission(PCA9533_Addr >> 1); + Wire.write(data, 6); + Wire.endTransmission(); + delayMicroseconds(1); +} + +static void PCA9533_writeRegister(uint8_t reg, uint8_t val){ + uint8_t data[2] = { reg, val }; + Wire.beginTransmission(PCA9533_Addr >> 1); + Wire.write(data, 2); + Wire.endTransmission(); + delayMicroseconds(1); +} + +// Reset (clear) all registers +void PCA9533_reset() { + PCA9533_writeAllRegisters(0, 0, 0, 0, 0); +} + +// Turn all LEDs off +void PCA9533_setOff() { + PCA9533_writeRegister(PCA9533_REG_SEL, 0); +} + +void PCA9533_setColor(uint8_t red, uint8_t green, uint8_t blue) { + uint8_t r_pwm0 = 0; // Register data - PWM value + uint8_t r_pwm1 = 0; // Register data - PWM value + + uint8_t op_g = 0, op_r = 0, op_b = 0; // Opcodes - Green, Red, Blue + + // Light theory! GREEN takes priority because + // it's the most visible to the human eye. + if (green == 0) op_g = PCA9533_LED_OP_OFF; + else if (green == 255) op_g = PCA9533_LED_OP_ON; + else { r_pwm0 = green; op_g = PCA9533_LED_OP_PWM0; } + + // RED + if (red == 0) op_r = PCA9533_LED_OP_OFF; + else if (red == 255) op_r = PCA9533_LED_OP_ON; + else if (r_pwm0 == 0 || r_pwm0 == red) { + r_pwm0 = red; op_r = PCA9533_LED_OP_PWM0; + } + else { + r_pwm1 = red; op_r = PCA9533_LED_OP_PWM1; + } + + // BLUE + if (blue == 0) op_b = PCA9533_LED_OP_OFF; + else if (blue == 255) op_b = PCA9533_LED_OP_ON; + else if (r_pwm0 == 0 || r_pwm0 == blue) { + r_pwm0 = blue; op_b = PCA9533_LED_OP_PWM0; + } + else if (r_pwm1 == 0 || r_pwm1 == blue) { + r_pwm1 = blue; op_b = PCA9533_LED_OP_PWM1; + } + else { + /** + * Conflict. 3 values are requested but only 2 channels exist. + * G is on channel 0 and R is on channel 1, so work from there. + * Find the closest match, average the values, then use the free channel. + */ + uint8_t dgb = ABS(green - blue), + dgr = ABS(green - red), + dbr = ABS(blue - red); + if (dgb < dgr && dgb < dbr) { // Mix with G on channel 0. + op_b = PCA9533_LED_OP_PWM0; + r_pwm0 = uint8_t(((uint16_t)green + (uint16_t)blue) / 2); + } + else if (dbr <= dgr && dbr <= dgb) { // Mix with R on channel 1. + op_b = PCA9533_LED_OP_PWM1; + r_pwm1 = uint8_t(((uint16_t)red + (uint16_t)blue) / 2); + } + else { // Mix R+G on 0 and put B on 1. + op_r = PCA9533_LED_OP_PWM0; + r_pwm0 = uint8_t(((uint16_t)green + (uint16_t)red) / 2); + op_b = PCA9533_LED_OP_PWM1; + r_pwm1 = blue; + } + } + + // Write the changes to the hardware + PCA9533_writeAllRegisters(0, r_pwm0, 0, r_pwm1, + (op_g << PCA9533_LED_OFS_GRN) | (op_r << PCA9533_LED_OFS_RED) | (op_b << PCA9533_LED_OFS_BLU) + ); +} + +#endif // PCA9533 diff --git a/Marlin/src/feature/leds/pca9533.h b/Marlin/src/feature/leds/pca9533.h new file mode 100644 index 0000000000..899418ff23 --- /dev/null +++ b/Marlin/src/feature/leds/pca9533.h @@ -0,0 +1,59 @@ +/* + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 PCA9533 LED controller found on the MightyBoard + * used by FlashForge Creator Pro, MakerBot, etc. + * Written 2020 APR 01 by grauerfuchs + */ +#include + +#define ENABLE_I2C_PULLUPS + +// Chip address (for Wire) +#define PCA9533_Addr 0xC4 + +// Control registers +#define PCA9533_REG_READ 0x00 +#define PCA9533_REG_PSC0 0x01 +#define PCA9533_REG_PWM0 0x02 +#define PCA9533_REG_PSC1 0x03 +#define PCA9533_REG_PWM1 0x04 +#define PCA9533_REG_SEL 0x05 +#define PCA9533_REGM_AI 0x10 + +// LED selector operation +#define PCA9533_LED_OP_OFF 0B00 +#define PCA9533_LED_OP_ON 0B01 +#define PCA9533_LED_OP_PWM0 0B10 +#define PCA9533_LED_OP_PWM1 0B11 + +// Select register bit offsets for LED colors +#define PCA9533_LED_OFS_RED 0 +#define PCA9533_LED_OFS_GRN 2 +#define PCA9533_LED_OFS_BLU 4 + +void PCA9533_init(); +void PCA9533_reset(); +void PCA9533_setColor(uint8_t red, uint8_t green, uint8_t blue); +void PCA9533_setOff(); diff --git a/Marlin/src/feature/leds/pca9632.cpp b/Marlin/src/feature/leds/pca9632.cpp index af9e39b863..df991ded36 100644 --- a/Marlin/src/feature/leds/pca9632.cpp +++ b/Marlin/src/feature/leds/pca9632.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/feature/leds/pca9632.h b/Marlin/src/feature/leds/pca9632.h index 749230f652..34aceb31d6 100644 --- a/Marlin/src/feature/leds/pca9632.h +++ b/Marlin/src/feature/leds/pca9632.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/leds/printer_event_leds.cpp b/Marlin/src/feature/leds/printer_event_leds.cpp index 70eee76b30..58084da837 100644 --- a/Marlin/src/feature/leds/printer_event_leds.cpp +++ b/Marlin/src/feature/leds/printer_event_leds.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -47,10 +47,10 @@ PrinterEventLEDs printerEventLEDs; 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 - ); + #if ENABLED(NEOPIXEL_IS_SEQUENTIAL) + , true + #endif + ); } #endif diff --git a/Marlin/src/feature/leds/printer_event_leds.h b/Marlin/src/feature/leds/printer_event_leds.h index d2888705e7..0295f9f5ac 100644 --- a/Marlin/src/feature/leds/printer_event_leds.h +++ b/Marlin/src/feature/leds/printer_event_leds.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/leds/tempstat.cpp b/Marlin/src/feature/leds/tempstat.cpp index 2d7afdcf9e..880258f852 100644 --- a/Marlin/src/feature/leds/tempstat.cpp +++ b/Marlin/src/feature/leds/tempstat.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -36,10 +36,7 @@ void handle_status_leds() { 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 + float max_temp = TERN0(HAS_HEATED_BED, _MAX(thermalManager.degTargetBed(), thermalManager.degBed())); 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; diff --git a/Marlin/src/feature/leds/tempstat.h b/Marlin/src/feature/leds/tempstat.h index fefe776cfd..a8b919bd8c 100644 --- a/Marlin/src/feature/leds/tempstat.h +++ b/Marlin/src/feature/leds/tempstat.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/max7219.cpp b/Marlin/src/feature/max7219.cpp index a012aeb5fa..ebcb56490d 100644 --- a/Marlin/src/feature/max7219.cpp +++ b/Marlin/src/feature/max7219.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/feature/max7219.h b/Marlin/src/feature/max7219.h index 19170b2d59..8e98c9456c 100644 --- a/Marlin/src/feature/max7219.h +++ b/Marlin/src/feature/max7219.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/mixing.cpp b/Marlin/src/feature/mixing.cpp index d6ae2bb629..7de4eb79ea 100644 --- a/Marlin/src/feature/mixing.cpp +++ b/Marlin/src/feature/mixing.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -44,7 +44,7 @@ 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) +#if EITHER(HAS_DUAL_MIXING, GRADIENT_MIX) mixer_perc_t Mixer::mix[MIXING_STEPPERS]; #endif @@ -90,15 +90,13 @@ void Mixer::normalize(const uint8_t tool_index) { SERIAL_ECHOLNPGM("]"); #endif - #if ENABLED(GRADIENT_MIX) - refresh_gradient(); - #endif + TERN_(GRADIENT_MIX, refresh_gradient()); } void Mixer::reset_vtools() { // Virtual Tools 0, 1, 2, 3 = Filament 1, 2, 3, 4, etc. // Every virtual tool gets a pure filament - LOOP_L_N(t, MIXING_VIRTUAL_TOOLS && t < MIXING_STEPPERS) + LOOP_L_N(t, _MIN(MIXING_VIRTUAL_TOOLS, MIXING_STEPPERS)) MIXER_STEPPER_LOOP(i) color[t][i] = (t == i) ? COLOR_A_MASK : 0; @@ -115,7 +113,7 @@ void Mixer::init() { reset_vtools(); - #if ENABLED(RETRACT_SYNC_MIXING) + #if HAS_MIXER_SYNC_CHANNEL // AUTORETRACT_TOOL gets the same amount of all filaments MIXER_STEPPER_LOOP(i) color[MIXER_AUTORETRACT_TOOL][i] = COLOR_A_MASK; @@ -123,13 +121,11 @@ void Mixer::init() { ZERO(collector); - #if DUAL_MIXING_EXTRUDER || ENABLED(GRADIENT_MIX) + #if EITHER(HAS_DUAL_MIXING, GRADIENT_MIX) update_mix_from_vtool(); #endif - #if ENABLED(GRADIENT_MIX) - update_gradient_for_planner_z(); - #endif + TERN_(GRADIENT_MIX, update_gradient_for_planner_z()); } void Mixer::refresh_collector(const float proportion/*=1.0*/, const uint8_t t/*=selected_vtool*/, float (&c)[MIXING_STEPPERS]/*=collector*/) { diff --git a/Marlin/src/feature/mixing.h b/Marlin/src/feature/mixing.h index da5240995c..7fe7062a7a 100644 --- a/Marlin/src/feature/mixing.h +++ b/Marlin/src/feature/mixing.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ //#define MIXER_NORMALIZER_DEBUG -#ifndef __AVR__ // || DUAL_MIXING_EXTRUDER +#ifndef __AVR__ // || HAS_DUAL_MIXING // 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; @@ -48,29 +48,23 @@ typedef int8_t mixer_perc_t; #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, + 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 HAS_MIXER_SYNC_CHANNEL + , MIXER_AUTORETRACT_TOOL #endif - NR_MIXING_VIRTUAL_TOOLS + , NR_MIXING_VIRTUAL_TOOLS }; -#if ENABLED(RETRACT_SYNC_MIXING) - #define MAX_VTOOLS 254 -#else - #define MAX_VTOOLS 255 -#endif +#define MAX_VTOOLS TERN(HAS_MIXER_SYNC_CHANNEL, 254, 255) 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) +#define MIXER_STEPPER_LOOP(VAR) for (uint_fast8_t VAR = 0; VAR < MIXING_STEPPERS; VAR++) #if ENABLED(GRADIENT_MIX) @@ -81,9 +75,7 @@ static_assert(NR_MIXING_VIRTUAL_TOOLS <= MAX_VTOOLS, "MIXING_VIRTUAL_TOOLS must 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 + TERN_(GRADIENT_VTOOL, int8_t vtool_index); // Use this virtual tool number as index } gradient_t; #endif @@ -112,12 +104,8 @@ class Mixer { 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 + TERN_(GRADIENT_VTOOL, refresh_gradient()); + TERN_(HAS_DUAL_MIXING, update_mix_from_vtool()); } // Used when dealing with blocks @@ -135,7 +123,7 @@ class Mixer { MIXER_STEPPER_LOOP(i) s_color[i] = b_color[i]; } - #if DUAL_MIXING_EXTRUDER || ENABLED(GRADIENT_MIX) + #if EITHER(HAS_DUAL_MIXING, GRADIENT_MIX) static mixer_perc_t mix[MIXING_STEPPERS]; // Scratch array for the Mix in proportion to 100 @@ -173,21 +161,19 @@ class Mixer { #endif } - #endif // DUAL_MIXING_EXTRUDER || GRADIENT_MIX + #endif // HAS_DUAL_MIXING || GRADIENT_MIX - #if DUAL_MIXING_EXTRUDER + #if HAS_DUAL_MIXING // 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 + TERN_(GRADIENT_MIX, refresh_gradient()); // MIXER_STEPPER_LOOP(i) collector[i] = mix[i]; // normalize(); } - #endif // DUAL_MIXING_EXTRUDER + #endif // HAS_DUAL_MIXING #if ENABLED(GRADIENT_MIX) diff --git a/Marlin/src/feature/mmu2/mmu2.cpp b/Marlin/src/feature/mmu2/mmu2.cpp index 4506883f46..35f2db45a9 100644 --- a/Marlin/src/feature/mmu2/mmu2.cpp +++ b/Marlin/src/feature/mmu2/mmu2.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -51,8 +51,13 @@ MMU2 mmu2; #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_TIMEOUT 45000UL // 45s timeout for mmu commands (except P0) +#define MMU_P0_TIMEOUT 3000UL // Timeout for P0 command: 3seconds + +#if ENABLED(MMU_EXTRUDER_SENSOR) + uint8_t mmu_idl_sens = 0; + static bool mmu_loading_flag = false; +#endif #define MMU_CMD_NONE 0 #define MMU_CMD_T0 0x10 @@ -79,11 +84,7 @@ MMU2 mmu2; #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 MMU_REQUIRED_FW_BUILDNR TERN(MMU2_MODE_12V, 132, 126) #define MMU2_NO_TOOL 99 #define MMU_BAUD 115200 @@ -91,23 +92,32 @@ MMU2 mmu2; #define mmuSerial MMU2_SERIAL bool MMU2::enabled, MMU2::ready, MMU2::mmu_print_saved; +#if ENABLED(PRUSA_MMU2_S_MODE) + bool MMU2::mmu2s_triggered; +#endif 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; +millis_t MMU2::prev_request, MMU2::prev_P0_request; char MMU2::rx_buffer[MMU_RX_SIZE], MMU2::tx_buffer[MMU_TX_SIZE]; -#if HAS_LCD_MENU && ENABLED(MMU2_MENUS) +#if BOTH(HAS_LCD_MENU, 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 }; + static constexpr E_Step + ramming_sequence[] PROGMEM = { MMU2_RAMMING_SEQUENCE } + , load_to_nozzle_sequence[] PROGMEM = { MMU2_LOAD_TO_NOZZLE_SEQUENCE } + #if ENABLED(PRUSA_MMU2_S_MODE) + , can_load_sequence[] PROGMEM = { MMU2_CAN_LOAD_SEQUENCE } + , can_load_increment_sequence[] PROGMEM = { MMU2_CAN_LOAD_INCREMENT_SEQUENCE } + #endif + ; #endif // MMU2_MENUS @@ -150,6 +160,10 @@ uint8_t MMU2::get_current_tool() { return extruder == MMU2_NO_TOOL ? -1 : extruder; } +#if EITHER(PRUSA_MMU2_S_MODE, MMU_EXTRUDER_SENSOR) + #define FILAMENT_PRESENT() (READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE) +#endif + void MMU2::mmu_loop() { switch (state) { @@ -228,6 +242,7 @@ void MMU2::mmu_loop() { enabled = true; state = 1; + TERN_(PRUSA_MMU2_S_MODE, mmu2s_triggered = false); } break; @@ -238,6 +253,7 @@ void MMU2::mmu_loop() { int filament = cmd - MMU_CMD_T0; DEBUG_ECHOLNPAIR("MMU <= T", filament); tx_printf_P(PSTR("T%d\n"), filament); + TERN_(MMU_EXTRUDER_SENSOR, mmu_idl_sens = 1); // enable idler sensor, if any state = 3; // wait for response } else if (WITHIN(cmd, MMU_CMD_L0, MMU_CMD_L4)) { @@ -286,11 +302,13 @@ void MMU2::mmu_loop() { last_cmd = cmd; cmd = MMU_CMD_NONE; } - else if (ELAPSED(millis(), next_P0_request)) { + else if (ELAPSED(millis(), prev_P0_request + 300)) { // read FINDA tx_str_P(PSTR("P0\n")); state = 2; // wait for response } + + TERN_(PRUSA_MMU2_S_MODE, check_filament()); break; case 2: // response to command P0 @@ -300,25 +318,35 @@ void MMU2::mmu_loop() { // 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(); + if (cmd == 0) ready = true; + state = 1; } - else if (ELAPSED(millis(), last_request + MMU_P0_TIMEOUT)) // Resend request after timeout (3s) + else if (ELAPSED(millis(), prev_request + MMU_P0_TIMEOUT)) // Resend request after timeout (3s) state = 1; + TERN_(PRUSA_MMU2_S_MODE, check_filament()); break; case 3: // response to mmu commands + #if ENABLED(MMU_EXTRUDER_SENSOR) + if (mmu_idl_sens) { + if (FILAMENT_PRESENT() && mmu_loading_flag) { + DEBUG_ECHOLNPGM("MMU <= 'A'\n"); + tx_str_P(PSTR("A\n")); // send 'abort' request + mmu_idl_sens = 0; + DEBUG_ECHOLNPGM("MMU IDLER_SENSOR = 0 - ABORT\n"); + } + } + #endif + 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)) { + else if (ELAPSED(millis(), prev_request + MMU_CMD_TIMEOUT)) { // resend request after timeout if (last_cmd) { DEBUG_ECHOLNPGM("MMU retry"); @@ -327,6 +355,7 @@ void MMU2::mmu_loop() { } state = 1; } + TERN_(PRUSA_MMU2_S_MODE, check_filament()); break; } } @@ -337,7 +366,7 @@ void MMU2::mmu_loop() { bool MMU2::rx_start() { // check for start message if (rx_str_P(PSTR("start\n"))) { - next_P0_request = millis() + 300; + prev_P0_request = millis(); return true; } return false; @@ -383,7 +412,7 @@ void MMU2::tx_str_P(const char* str) { uint8_t len = strlen_P(str); LOOP_L_N(i, len) mmuSerial.write(pgm_read_byte(str++)); rx_buffer[0] = '\0'; - last_request = millis(); + prev_request = millis(); } /** @@ -394,7 +423,7 @@ void MMU2::tx_printf_P(const char* format, int argument = -1) { uint8_t len = sprintf_P(tx_buffer, format, argument); LOOP_L_N(i, len) mmuSerial.write(tx_buffer[i]); rx_buffer[0] = '\0'; - last_request = millis(); + prev_request = millis(); } /** @@ -405,7 +434,7 @@ void MMU2::tx_printf_P(const char* format, int argument1, int argument2) { uint8_t len = sprintf_P(tx_buffer, format, argument1, argument2); LOOP_L_N(i, len) mmuSerial.write(tx_buffer[i]); rx_buffer[0] = '\0'; - last_request = millis(); + prev_request = millis(); } /** @@ -421,7 +450,7 @@ void MMU2::clear_rx_buffer() { */ bool MMU2::rx_ok() { if (rx_str_P(PSTR("ok\n"))) { - next_P0_request = millis() + 300; + prev_P0_request = millis(); return true; } return false; @@ -433,37 +462,235 @@ bool MMU2::rx_ok() { 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)); + kill(GET_TEXT(MSG_KILL_MMU2_FIRMWARE)); } } +static void mmu2_not_responding() { + LCD_MESSAGEPGM(MSG_MMU2_NOT_RESPONDING); + BUZZ(100, 659); + BUZZ(200, 698); + BUZZ(100, 659); + BUZZ(300, 440); + BUZZ(100, 659); +} + +#if ENABLED(PRUSA_MMU2_S_MODE) + + bool MMU2::load_to_gears() { + command(MMU_CMD_C0); + manage_response(true, true); + LOOP_L_N(i, MMU2_C0_RETRY) { // Keep loading until filament reaches gears + if (mmu2s_triggered) break; + command(MMU_CMD_C0); + manage_response(true, true); + check_filament(); + } + const bool success = mmu2s_triggered && can_load(); + if (!success) mmu2_not_responding(); + return success; + } + + /** + * Handle tool change + */ + void MMU2::tool_change(const uint8_t index) { + + if (!enabled) return; + + set_runout_valid(false); + + if (index != extruder) { + + DISABLE_AXIS_E0(); + ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); + + command(MMU_CMD_T0 + index); + manage_response(true, true); + + if (load_to_gears()) { + extruder = index; // filament change is finished + active_extruder = 0; + ENABLE_AXIS_E0(); + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR(STR_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_AXIS_E0(); + command(MMU_CMD_T0 + index); + manage_response(true, true); + + if (load_to_gears()) { + mmu_loop(); + ENABLE_AXIS_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 // MMU2_MENUS + } + +#elif ENABLED(MMU_EXTRUDER_SENSOR) + + /** + * Handle tool change + */ + void MMU2::tool_change(const uint8_t index) { + if (!enabled) return; + + set_runout_valid(false); + + if (index != extruder) { + DISABLE_AXIS_E0(); + if (FILAMENT_PRESENT()) { + DEBUG_ECHOLNPGM("Unloading\n"); + mmu_loading_flag = false; + command(MMU_CMD_U0); + manage_response(true, true); + } + ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); + mmu_loading_flag = true; + command(MMU_CMD_T0 + index); + manage_response(true, true); + mmu_continue_loading(); + command(MMU_CMD_C0); + extruder = index; + active_extruder = 0; + + ENABLE_AXIS_E0(); + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR(STR_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 '?': { + DEBUG_ECHOLNPGM("case ?\n"); + 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': { + DEBUG_ECHOLNPGM("case x\n"); + planner.synchronize(); + uint8_t index = mmu2_choose_filament(); + DISABLE_AXIS_E0(); + command(MMU_CMD_T0 + index); + manage_response(true, true); + mmu_continue_loading(); + command(MMU_CMD_C0); + mmu_loop(); + + ENABLE_AXIS_E0(); + extruder = index; + active_extruder = 0; + } break; + + case 'c': { + DEBUG_ECHOLNPGM("case c\n"); + 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 // MMU2_MENUS + } + + void MMU2::mmu_continue_loading() { + for (uint8_t i = 0; i < MMU_LOADING_ATTEMPTS_NR; i++) { + DEBUG_ECHOLNPAIR("Additional load attempt #", i); + if (FILAMENT_PRESENT()) break; + command(MMU_CMD_C0); + manage_response(true, true); + } + if (!FILAMENT_PRESENT()) { + DEBUG_ECHOLNPGM("Filament never reached sensor, runout"); + filament_runout(); + } + mmu_idl_sens = 0; + } + +#elif DISABLED(MMU_EXTRUDER_SENSOR) && DISABLED(PRUSA_MMU2_S_MODE) + /** * Handle tool change */ -void MMU2::tool_change(uint8_t index) { - +void MMU2::tool_change(const uint8_t index) { if (!enabled) return; set_runout_valid(false); if (index != extruder) { - DISABLE_AXIS_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_AXIS_E0(); - SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(STR_ACTIVE_EXTRUDER, int(extruder)); - ui.reset_status(); } @@ -480,7 +707,6 @@ void MMU2::tool_change(uint8_t index) { * */ void MMU2::tool_change(const char* special) { - if (!enabled) return; #if ENABLED(MMU2_MENUS) @@ -489,12 +715,14 @@ void MMU2::tool_change(const char* special) { switch (*special) { case '?': { + DEBUG_ECHOLNPGM("case ?\n"); 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': { + DEBUG_ECHOLNPGM("case x\n"); planner.synchronize(); uint8_t index = mmu2_choose_filament(); DISABLE_AXIS_E0(); @@ -509,6 +737,7 @@ void MMU2::tool_change(const char* special) { } break; case 'c': { + DEBUG_ECHOLNPGM("case c\n"); 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; @@ -517,7 +746,9 @@ void MMU2::tool_change(const char* special) { set_runout_valid(true); #endif -} + } + +#endif // MMU_EXTRUDER_SENSOR /** * Set next command @@ -554,7 +785,7 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) { bool response = false; mmu_print_saved = false; xyz_pos_t resume_position; - int16_t resume_hotend_temp; + int16_t resume_hotend_temp = thermalManager.degTargetHotend(active_extruder); KEEPALIVE_STATE(PAUSED_FOR_USER); @@ -575,16 +806,11 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) { resume_position = current_position; if (move_axes && all_axes_homed()) - nozzle.park(2, park_point /*= NOZZLE_PARK_POINT*/); + nozzle.park(0, 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); + mmu2_not_responding(); } } else if (mmu_print_saved) { @@ -618,7 +844,7 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) { } } -void MMU2::set_filament_type(uint8_t index, uint8_t filamentType) { +void MMU2::set_filament_type(const uint8_t index, const uint8_t filamentType) { if (!enabled) return; cmd_arg = filamentType; @@ -632,10 +858,44 @@ void MMU2::filament_runout() { planner.synchronize(); } -#if HAS_LCD_MENU && ENABLED(MMU2_MENUS) +#if ENABLED(PRUSA_MMU2_S_MODE) + + void MMU2::check_filament() { + const bool present = FILAMENT_PRESENT(); + if (present && !mmu2s_triggered) { + DEBUG_ECHOLNPGM("MMU <= 'A'"); + tx_str_P(PSTR("A\n")); + } + mmu2s_triggered = present; + } + + bool MMU2::can_load() { + execute_extruder_sequence((const E_Step *)can_load_sequence, COUNT(can_load_sequence)); + + int filament_detected_count = 0; + const int steps = (MMU2_CAN_LOAD_RETRACT) / (MMU2_CAN_LOAD_INCREMENT); + DEBUG_ECHOLNPGM("MMU can_load:"); + LOOP_L_N(i, steps) { + execute_extruder_sequence((const E_Step *)can_load_increment_sequence, COUNT(can_load_increment_sequence)); + check_filament(); // Don't trust the idle function + DEBUG_CHAR(mmu2s_triggered ? 'O' : 'o'); + if (mmu2s_triggered) ++filament_detected_count; + } + + if (filament_detected_count <= steps - (MMU2_CAN_LOAD_DEVIATION) / (MMU2_CAN_LOAD_INCREMENT)) { + DEBUG_ECHOLNPGM(" failed."); + return false; + } + + DEBUG_ECHOLNPGM(" succeeded."); + return true; + } +#endif + +#if BOTH(HAS_LCD_MENU, MMU2_MENUS) // Load filament into MMU2 - void MMU2::load_filament(uint8_t index) { + void MMU2::load_filament(const uint8_t index) { if (!enabled) return; command(MMU_CMD_L0 + index); manage_response(false, false); @@ -647,7 +907,7 @@ void MMU2::filament_runout() { * Switch material and load to nozzle * */ - bool MMU2::load_filament_to_nozzle(uint8_t index) { + bool MMU2::load_filament_to_nozzle(const uint8_t index) { if (!enabled) return false; @@ -656,24 +916,22 @@ void MMU2::filament_runout() { LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD); return false; } - else { - command(MMU_CMD_T0 + index); - manage_response(true, true); - command(MMU_CMD_C0); - mmu_loop(); + command(MMU_CMD_T0 + index); + manage_response(true, true); + + const bool success = load_to_gears(); + if (success) { + mmu_loop(); extruder = index; active_extruder = 0; - load_to_nozzle(); - BUZZ(200, 404); - return true; } + return success; } /** - * * Load filament to nozzle of multimaterial printer * * This function is used only only after T? (user select filament) and M600 (change filament). @@ -685,7 +943,7 @@ void MMU2::filament_runout() { execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, COUNT(load_to_nozzle_sequence)); } - bool MMU2::eject_filament(uint8_t index, bool recover) { + bool MMU2::eject_filament(const uint8_t index, const bool recover) { if (!enabled) return false; @@ -707,12 +965,8 @@ void MMU2::filament_runout() { if (recover) { LCD_MESSAGEPGM(MSG_MMU2_EJECT_RECOVER); BUZZ(200, 404); - #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 + TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), CONTINUE_STR)); + TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("MMU2 Eject Recover"))); wait_for_user_response(); BUZZ(200, 404); BUZZ(200, 404); @@ -736,9 +990,7 @@ void MMU2::filament_runout() { } /** - * - * unload from hotend and retract to MMU - * + * Unload from hotend and retract to MMU */ bool MMU2::unload() { diff --git a/Marlin/src/feature/mmu2/mmu2.h b/Marlin/src/feature/mmu2/mmu2.h index 970b0b4338..678f65d072 100644 --- a/Marlin/src/feature/mmu2/mmu2.h +++ b/Marlin/src/feature/mmu2/mmu2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -44,24 +44,24 @@ public: static void init(); static void reset(); static void mmu_loop(); - static void tool_change(uint8_t index); + static void tool_change(const 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); + static void set_filament_type(const uint8_t index, const uint8_t type); - #if HAS_LCD_MENU && ENABLED(MMU2_MENUS) + #if BOTH(HAS_LCD_MENU, 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); + static bool load_filament_to_nozzle(const uint8_t index); + static bool eject_filament(const uint8_t index, const 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 tx_printf_P(const char* format, const int argument); + static void tx_printf_P(const char* format, const int argument1, const int argument2); static void clear_rx_buffer(); static bool rx_ok(); @@ -72,7 +72,7 @@ private: static bool get_response(); static void manage_response(const bool move_axes, const bool turn_off_nozzle); - #if HAS_LCD_MENU && ENABLED(MMU2_MENUS) + #if BOTH(HAS_LCD_MENU, MMU2_MENUS) static void load_to_nozzle(); static void filament_ramming(); static void execute_extruder_sequence(const E_Step * sequence, int steps); @@ -80,13 +80,27 @@ private: static void filament_runout(); + #if ENABLED(PRUSA_MMU2_S_MODE) + static bool mmu2s_triggered; + static void check_filament(); + static bool can_load(); + static bool load_to_gears(); + #else + FORCE_INLINE static bool load_to_gears() { return true; } + #endif + + #if ENABLED(MMU_EXTRUDER_SENSOR) + static void mmu_continue_loading(); + #endif + 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 millis_t prev_request, prev_P0_request; static char rx_buffer[MMU_RX_SIZE], tx_buffer[MMU_TX_SIZE]; static inline void set_runout_valid(const bool valid) { diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 9c615b6ff8..77f352c399 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -53,7 +53,6 @@ #include "../lcd/extui/ui_api.h" #endif -#include "../core/language.h" #include "../lcd/ultralcd.h" #if HAS_BUZZER @@ -85,26 +84,30 @@ fil_change_settings_t fc_settings[EXTRUDERS]; #endif #if HAS_BUZZER - static void filament_change_beep(const int8_t max_beep_count, const bool init=false) { + static void impatient_beep(const int8_t max_beep_count, const bool restart=false) { - #if HAS_LCD_MENU - if (pause_mode == PAUSE_MODE_PAUSE_PRINT) return; - #endif + if (TERN0(HAS_LCD_MENU, 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; + if (restart) next_buzz = runout_beep = 0; + + const bool always = max_beep_count < 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); + if (always || runout_beep < max_beep_count + 5) { // Only beep as long as we're supposed to + next_buzz = ms + ((always || runout_beep < max_beep_count) ? 1000 : 500); BUZZ(50, 880 - (runout_beep & 1) * 220); runout_beep++; } } } + inline void first_impatient_beep(const int8_t max_beep_count) { impatient_beep(max_beep_count, true); } +#else + inline void impatient_beep(const int8_t, const bool=false) {} + inline void first_impatient_beep(const int8_t) {} #endif /** @@ -116,7 +119,7 @@ fil_change_settings_t fc_settings[EXTRUDERS]; * * Returns 'true' if heating was completed, 'false' for abort */ -static bool ensure_safe_temperature(const PauseMode mode=PAUSE_MODE_SAME) { +static bool ensure_safe_temperature(const bool wait=true, const PauseMode mode=PAUSE_MODE_SAME) { #if ENABLED(PREVENT_COLD_EXTRUSION) if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) { @@ -131,7 +134,13 @@ static bool ensure_safe_temperature(const PauseMode mode=PAUSE_MODE_SAME) { UNUSED(mode); #endif - return thermalManager.wait_for_hotend(active_extruder); + if (wait) + return thermalManager.wait_for_hotend(active_extruder); + + while (ABS(thermalManager.degHotend(active_extruder) - thermalManager.degTargetHotend(active_extruder)) > TEMP_WINDOW) + idle(); + + return true; } /** @@ -151,11 +160,9 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l const PauseMode mode/*=PAUSE_MODE_PAUSE_PRINT*/ DXC_ARGS ) { - #if !HAS_LCD_MENU - UNUSED(show_lcd); - #endif + TERN(HAS_LCD_MENU,,UNUSED(show_lcd)); - if (!ensure_safe_temperature(mode)) { + if (!ensure_safe_temperature(false, mode)) { #if HAS_LCD_MENU if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_STATUS, mode); #endif @@ -168,11 +175,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l #endif SERIAL_ECHO_MSG(_PMSG(STR_FILAMENT_CHANGE_INSERT)); - #if HAS_BUZZER - filament_change_beep(max_beep_count, true); - #else - UNUSED(max_beep_count); - #endif + first_impatient_beep(max_beep_count); KEEPALIVE_STATE(PAUSED_FOR_USER); #if ENABLED(HOST_PROMPT_SUPPORT) @@ -185,13 +188,9 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l host_action_prompt_button(CONTINUE_STR); host_action_prompt_show(); #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onUserConfirmRequired_P(PSTR("Load Filament")); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Load Filament"))); while (wait_for_user) { - #if HAS_BUZZER - filament_change_beep(max_beep_count); - #endif + impatient_beep(max_beep_count); idle_no_sleep(); } } @@ -236,12 +235,8 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_PURGE); #endif - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Filament Purging..."), CONTINUE_STR); - #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onUserConfirmRequired_P(PSTR("Filament Purging...")); - #endif + TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Filament Purging..."), CONTINUE_STR)); + TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Filament Purging..."))); wait_for_user = true; // A click or M108 breaks the purge_length loop for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count) unscaled_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE); @@ -260,9 +255,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l unscaled_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE); } - #if ENABLED(HOST_PROMPT_SUPPORT) - filament_load_host_prompt(); // Initiate another host prompt. (NOTE: host_response_handler may also do this!) - #endif + TERN_(HOST_PROMPT_SUPPORT, filament_load_host_prompt()); // Initiate another host prompt. (NOTE: host_response_handler may also do this!) #if HAS_LCD_MENU if (show_lcd) { @@ -275,13 +268,10 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l #endif // Keep looping if "Purge More" was selected - } while (false - #if HAS_LCD_MENU - || (show_lcd && pause_menu_response == PAUSE_RESPONSE_EXTRUDE_MORE) - #endif - ); + } while (TERN0(HAS_LCD_MENU, show_lcd && pause_menu_response == PAUSE_RESPONSE_EXTRUDE_MORE)); #endif + TERN_(HOST_PROMPT_SUPPORT, host_action_prompt_end()); return true; } @@ -302,15 +292,13 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/, , const float &mix_multiplier/*=1.0*/ #endif ) { - #if !HAS_LCD_MENU - UNUSED(show_lcd); - #endif + TERN(HAS_LCD_MENU,,UNUSED(show_lcd)); #if !BOTH(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER) constexpr float mix_multiplier = 1.0; #endif - if (!ensure_safe_temperature(mode)) { + if (!ensure_safe_temperature(false, mode)) { #if HAS_LCD_MENU if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_STATUS); #endif @@ -370,10 +358,7 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/, 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 + TERN(HAS_LCD_MENU,,UNUSED(show_lcd)); if (did_pause_print) return false; // already paused @@ -385,9 +370,7 @@ bool pause_print(const float &retract, const xyz_pos_t &park_point, const float #endif #endif - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_INFO, PSTR("Pause"), DISMISS_STR); - #endif + TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, PSTR("Pause"), DISMISS_STR)); if (!DEBUGGING(DRYRUN) && unload_length && thermalManager.targetTooColdToExtrude(active_extruder)) { SERIAL_ECHO_MSG(STR_ERR_HOTEND_TOO_COLD); @@ -421,7 +404,7 @@ bool pause_print(const float &retract, const xyz_pos_t &park_point, const float // Wait for buffered blocks to complete planner.synchronize(); - #if ENABLED(ADVANCED_PAUSE_FANS_PAUSE) && FAN_COUNT > 0 + #if ENABLED(ADVANCED_PAUSE_FANS_PAUSE) && HAS_FAN thermalManager.set_fans_paused(true); #endif @@ -431,7 +414,7 @@ bool pause_print(const float &retract, const xyz_pos_t &park_point, const float // 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); + nozzle.park(0, park_point); #if ENABLED(DUAL_X_CARRIAGE) const int8_t saved_ext = active_extruder; @@ -466,9 +449,7 @@ bool pause_print(const float &retract, const xyz_pos_t &park_point, const float */ 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 + TERN_(HAS_LCD_MENU, lcd_pause_show_message(is_reload ? PAUSE_MESSAGE_INSERT : PAUSE_MESSAGE_WAITING)); SERIAL_ECHO_START(); serialprintPGM(is_reload ? PSTR(_PMSG(STR_FILAMENT_CHANGE_INSERT) "\n") : PSTR(_PMSG(STR_FILAMENT_CHANGE_WAIT) "\n")); } @@ -478,14 +459,10 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep show_continue_prompt(is_reload); - #if HAS_BUZZER - filament_change_beep(max_beep_count, true); - #else - UNUSED(max_beep_count); - #endif + first_impatient_beep(max_beep_count); // Start the heater idle timers - const millis_t nozzle_timeout = (millis_t)(PAUSE_PARK_NOZZLE_TIMEOUT) * 1000UL; + const millis_t nozzle_timeout = SEC_TO_MS(PAUSE_PARK_NOZZLE_TIMEOUT); HOTEND_LOOP() thermalManager.hotend_idle[e].start(nozzle_timeout); @@ -498,17 +475,11 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep // Wait for filament insert by user and press button KEEPALIVE_STATE(PAUSED_FOR_USER); - #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 + TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_NOZZLE_PARKED), CONTINUE_STR)); + TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_NOZZLE_PARKED))); 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 + impatient_beep(max_beep_count); // If the nozzle has timed out... if (!nozzle_timed_out) @@ -517,53 +488,38 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep // 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 + TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_HEAT)); SERIAL_ECHO_MSG(_PMSG(STR_FILAMENT_CHANGE_HEAT)); - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("HeaterTimeout"), PSTR("Reheat")); - #endif + TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_HEATER_TIMEOUT), GET_TEXT(MSG_REHEAT))); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onUserConfirmRequired_P(PSTR("HeaterTimeout")); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_HEATER_TIMEOUT))); wait_for_user_response(0, true); // Wait for LCD click or M108 - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_INFO, PSTR("Reheating")); - #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onStatusChanged(PSTR("Reheating...")); - #endif + TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, GET_TEXT(MSG_REHEATING))); + + TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged_P(GET_TEXT(MSG_REHEATING))); // Re-enable the heaters if they timed out HOTEND_LOOP() thermalManager.reset_hotend_idle_timer(e); // Wait for the heaters to reach the target temperatures - ensure_safe_temperature(); + ensure_safe_temperature(false); // 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; + const millis_t nozzle_timeout = SEC_TO_MS(PAUSE_PARK_NOZZLE_TIMEOUT); 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 + TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Reheat Done"), CONTINUE_STR)); + TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Reheat finished."))); wait_for_user = true; nozzle_timed_out = false; - #if HAS_BUZZER - filament_change_beep(max_beep_count, true); - #endif + first_impatient_beep(max_beep_count); } idle_no_sleep(); } @@ -583,16 +539,18 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep * - a nozzle timed out, or * - the nozzle is already heated. * - Display "wait for print to resume" + * - Retract to prevent oozing + * - Move the nozzle back to resume_position + * - Unretract * - 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) { +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*/, int16_t targetTemp/*=0*/ DXC_ARGS) { /* SERIAL_ECHOLNPAIR( "start of resume_print()\ndual_x_carriage_mode:", dual_x_carriage_mode, @@ -611,12 +569,32 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le thermalManager.reset_hotend_idle_timer(e); } + if (targetTemp > thermalManager.degTargetHotend(active_extruder)) + thermalManager.setTargetHotend(targetTemp, active_extruder); + 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 + if (targetTemp > 0) { + thermalManager.setTargetHotend(targetTemp, active_extruder); + thermalManager.wait_for_hotend(active_extruder, false); + } + + TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_RESUME)); + + // Retract to prevent oozing + unscaled_e_move(-(PAUSE_PARK_RETRACT_LENGTH), 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)); + + // Unretract + unscaled_e_move(PAUSE_PARK_RETRACT_LENGTH, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE)); + + ensure_safe_temperature(); // Intelligent resuming #if ENABLED(FWRETRACT) @@ -627,13 +605,6 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le // If resume_position is negative if (resume_position.e < 0) unscaled_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 unscaled_e_move(ADVANCED_PAUSE_RESUME_PRIME, feedRate_t(ADVANCED_PAUSE_PURGE_FEEDRATE)); #endif @@ -642,9 +613,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le // 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 + TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_STATUS)); #ifdef ACTION_ON_RESUMED host_action_resumed(); @@ -654,34 +623,23 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le --did_pause_print; - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_INFO, PSTR("Resuming"), DISMISS_STR); - #endif + TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, PSTR("Resuming"), DISMISS_STR)); #if ENABLED(SDSUPPORT) - if (did_pause_print) { - card.startFileprint(); - --did_pause_print; - } + if (did_pause_print) { card.startFileprint(); --did_pause_print; } #endif - #if ENABLED(ADVANCED_PAUSE_FANS_PAUSE) && FAN_COUNT > 0 + #if ENABLED(ADVANCED_PAUSE_FANS_PAUSE) && HAS_FAN thermalManager.set_fans_paused(false); #endif - #if HAS_FILAMENT_SENSOR - runout.reset(); - #endif + TERN_(HAS_FILAMENT_SENSOR, runout.reset()); // 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 + TERN_(HAS_DISPLAY, ui.reset_status()); + TERN_(HAS_LCD_MENU, ui.return_to_status()); } #endif // ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/feature/pause.h b/Marlin/src/feature/pause.h index f1c8eed4d3..d8a676afa4 100644 --- a/Marlin/src/feature/pause.h +++ b/Marlin/src/feature/pause.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -45,7 +45,7 @@ enum PauseMode : char { }; enum PauseMessage : char { - PAUSE_MESSAGE_PAUSING, + PAUSE_MESSAGE_PARKING, PAUSE_MESSAGE_CHANGING, PAUSE_MESSAGE_WAITING, PAUSE_MESSAGE_UNLOAD, @@ -87,7 +87,7 @@ bool pause_print(const float &retract, const xyz_pos_t &park_point, const float 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); +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, int16_t targetTemp=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); diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index 1fa751811e..74850122c2 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -33,6 +33,10 @@ #include "../module/stepper/indirection.h" #include "../MarlinCore.h" +#if BOTH(USE_CONTROLLER_FAN, AUTO_POWER_CONTROLLERFAN) + #include "controllerfan.h" +#endif + Power powerManager; millis_t Power::lastPowerOn; @@ -50,15 +54,12 @@ bool Power::is_power_needed() { if (controllerFan.state()) return true; #endif - #if ENABLED(AUTO_POWER_CHAMBER_FAN) - if (thermalManager.chamberfan_speed) return true; - #endif + if (TERN0(AUTO_POWER_CHAMBER_FAN, thermalManager.chamberfan_speed)) + return true; // 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 + || TERN0(HAS_HEATED_BED, thermalManager.temp_bed.soft_pwm_amount > 0) #if HAS_X2_ENABLE || X2_ENABLE_READ() == X_ENABLE_ON #endif @@ -75,12 +76,9 @@ bool Power::is_power_needed() { ) return true; HOTEND_LOOP() if (thermalManager.degTargetHotend(e) > 0) return true; + if (TERN0(HAS_HEATED_BED, thermalManager.degTargetBed() > 0)) return true; - #if HAS_HEATED_BED - if (thermalManager.degTargetBed() > 0) return true; - #endif - - #if HOTENDS && AUTO_POWER_E_TEMP + #if HAS_HOTEND && AUTO_POWER_E_TEMP HOTEND_LOOP() if (thermalManager.degHotend(e) >= AUTO_POWER_E_TEMP) return true; #endif @@ -98,7 +96,7 @@ void Power::check() { nextPowerCheck = ms + 2500UL; if (is_power_needed()) power_on(); - else if (!lastPowerOn || ELAPSED(ms, lastPowerOn + (POWER_TIMEOUT) * 1000UL)) + else if (!lastPowerOn || ELAPSED(ms, lastPowerOn + SEC_TO_MS(POWER_TIMEOUT))) power_off(); } } @@ -107,11 +105,9 @@ void Power::power_on() { lastPowerOn = millis(); if (!powersupply_on) { PSU_PIN_ON(); - - #if HAS_TRINAMIC_CONFIG - delay(PSU_POWERUP_DELAY); // Wait for power to settle - restore_stepper_drivers(); - #endif + safe_delay(PSU_POWERUP_DELAY); + restore_stepper_drivers(); + TERN_(HAS_TRINAMIC_CONFIG, safe_delay(PSU_POWERUP_DELAY)); } } diff --git a/Marlin/src/feature/power.h b/Marlin/src/feature/power.h index 0bad7736ef..8b988907e6 100644 --- a/Marlin/src/feature/power.h +++ b/Marlin/src/feature/power.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/power_monitor.cpp b/Marlin/src/feature/power_monitor.cpp new file mode 100644 index 0000000000..bf5ac748a8 --- /dev/null +++ b/Marlin/src/feature/power_monitor.cpp @@ -0,0 +1,75 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_POWER_MONITOR + +#include "power_monitor.h" + +#include "../lcd/ultralcd.h" +#include "../lcd/lcdprint.h" +#include "../libs/numtostr.h" + +uint8_t PowerMonitor::flags; // = 0 + +#if ENABLED(POWER_MONITOR_CURRENT) + pm_lpf_t PowerMonitor::amps; +#endif +#if ENABLED(POWER_MONITOR_VOLTAGE) + pm_lpf_t PowerMonitor::volts; +#endif + +millis_t PowerMonitor::display_item_ms; +uint8_t PowerMonitor::display_item; + +PowerMonitor power_monitor; // Single instance - this calls the constructor + +#if HAS_GRAPHICAL_LCD + + #if ENABLED(POWER_MONITOR_CURRENT) + void PowerMonitor::draw_current() { + const float amps = getAmps(); + lcd_put_u8str(amps < 100 ? ftostr31ns(amps) : ui16tostr4rj((uint16_t)amps)); + lcd_put_wchar('A'); + } + #endif + + #if HAS_POWER_MONITOR_VREF + void PowerMonitor::draw_voltage() { + const float volts = getVolts(); + lcd_put_u8str(volts < 100 ? ftostr31ns(volts) : ui16tostr4rj((uint16_t)volts)); + lcd_put_wchar('V'); + } + #endif + + #if HAS_POWER_MONITOR_WATTS + void PowerMonitor::draw_power() { + const float power = getPower(); + lcd_put_u8str(power < 100 ? ftostr31ns(power) : ui16tostr4rj((uint16_t)power)); + lcd_put_wchar('W'); + } + #endif + +#endif // HAS_GRAPHICAL_LCD + +#endif // HAS_POWER_MONITOR diff --git a/Marlin/src/feature/power_monitor.h b/Marlin/src/feature/power_monitor.h new file mode 100644 index 0000000000..ca52ed74c6 --- /dev/null +++ b/Marlin/src/feature/power_monitor.h @@ -0,0 +1,140 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 PM_SAMPLE_RANGE 1024 +#define PM_K_VALUE 6 +#define PM_K_SCALE 6 + +template +struct pm_lpf_t { + uint32_t filter_buf; + float value; + void add_sample(const uint16_t sample) { + filter_buf = filter_buf - (filter_buf >> K_VALUE) + (uint32_t(sample) << K_SCALE); + } + void capture() { + value = filter_buf * (SCALE * (1.0f / (1UL << (PM_K_VALUE + PM_K_SCALE)))) + (POWER_MONITOR_CURRENT_OFFSET); + } + void reset(uint16_t reset_value = 0) { + filter_buf = uint32_t(reset_value) << (K_VALUE + K_SCALE); + capture(); + } +}; + +class PowerMonitor { +private: + #if ENABLED(POWER_MONITOR_CURRENT) + static constexpr float amps_adc_scale = float(ADC_VREF) / (POWER_MONITOR_VOLTS_PER_AMP * PM_SAMPLE_RANGE); + static pm_lpf_t amps; + #endif + #if ENABLED(POWER_MONITOR_VOLTAGE) + static constexpr float volts_adc_scale = float(ADC_VREF) / (POWER_MONITOR_VOLTS_PER_VOLT * PM_SAMPLE_RANGE); + static pm_lpf_t volts; + #endif + +public: + static uint8_t flags; // M430 flags to display current + + static millis_t display_item_ms; + static uint8_t display_item; + + PowerMonitor() { reset(); } + + enum PM_Display_Bit : uint8_t { + PM_DISP_BIT_I, // Current display enable bit + PM_DISP_BIT_V, // Voltage display enable bit + PM_DISP_BIT_P // Power display enable bit + }; + + #if ENABLED(POWER_MONITOR_CURRENT) + FORCE_INLINE static float getAmps() { return amps.value; } + void add_current_sample(const uint16_t value) { amps.add_sample(value); } + #endif + + #if HAS_POWER_MONITOR_VREF + #if ENABLED(POWER_MONITOR_VOLTAGE) + FORCE_INLINE static float getVolts() { return volts.value; } + #else + FORCE_INLINE static float getVolts() { return POWER_MONITOR_FIXED_VOLTAGE; } // using a specified fixed valtage as the voltage measurement + #endif + #if ENABLED(POWER_MONITOR_VOLTAGE) + void add_voltage_sample(const uint16_t value) { volts.add_sample(value); } + #endif + #endif + + #if HAS_POWER_MONITOR_WATTS + FORCE_INLINE static float getPower() { return getAmps() * getVolts(); } + #endif + + #if HAS_SPI_LCD + FORCE_INLINE static bool display_enabled() { return flags != 0x00; } + #if ENABLED(POWER_MONITOR_CURRENT) + static void draw_current(); + FORCE_INLINE static bool current_display_enabled() { return TEST(flags, PM_DISP_BIT_I); } + FORCE_INLINE static void set_current_display(const bool b) { SET_BIT_TO(flags, PM_DISP_BIT_I, b); } + FORCE_INLINE static void toggle_current_display() { TBI(flags, PM_DISP_BIT_I); } + #endif + #if HAS_POWER_MONITOR_VREF + static void draw_voltage(); + FORCE_INLINE static bool voltage_display_enabled() { return TEST(flags, PM_DISP_BIT_V); } + FORCE_INLINE static void set_voltage_display(const bool b) { SET_BIT_TO(flags, PM_DISP_BIT_V, b); } + FORCE_INLINE static void toggle_voltage_display() { TBI(flags, PM_DISP_BIT_V); } + #endif + #if HAS_POWER_MONITOR_WATTS + static void draw_power(); + FORCE_INLINE static bool power_display_enabled() { return TEST(flags, PM_DISP_BIT_P); } + FORCE_INLINE static void set_power_display(const bool b) { SET_BIT_TO(flags, PM_DISP_BIT_P, b); } + FORCE_INLINE static void toggle_power_display() { TBI(flags, PM_DISP_BIT_P); } + #endif + #endif + + static void reset() { + flags = 0x00; + + #if ENABLED(POWER_MONITOR_CURRENT) + amps.reset(); + #endif + + #if ENABLED(POWER_MONITOR_VOLTAGE) + volts.reset(); + #endif + + #if ENABLED(SDSUPPORT) + display_item_ms = 0; + display_item = 0; + #endif + } + + static void capture_values() { + #if ENABLED(POWER_MONITOR_CURRENT) + amps.capture(); + #endif + #if ENABLED(POWER_MONITOR_VOLTAGE) + volts.capture(); + #endif + } +}; + +extern PowerMonitor power_monitor; diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index bb0062d4ec..29a2cef97c 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -40,6 +40,10 @@ uint8_t PrintJobRecovery::queue_index_r; uint32_t PrintJobRecovery::cmd_sdpos, // = 0 PrintJobRecovery::sdpos[BUFSIZE]; +#if ENABLED(DWIN_CREALITY_LCD) + bool PrintJobRecovery::dwin_flag; // = false +#endif + #include "../sd/cardreader.h" #include "../lcd/ultralcd.h" #include "../gcode/queue.h" @@ -62,12 +66,16 @@ PrintJobRecovery recovery; #ifndef POWER_LOSS_PURGE_LEN #define POWER_LOSS_PURGE_LEN 0 #endif +#ifndef POWER_LOSS_ZRAISE + #define POWER_LOSS_ZRAISE 2 // Move on loss with backup power, or on resume without it +#endif + +#if DISABLED(BACKUP_POWER_SUPPLY) + #undef POWER_LOSS_RETRACT_LEN // No retract at outage without backup power +#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 @@ -103,8 +111,9 @@ void PrintJobRecovery::check() { //if (!card.isMounted()) card.mount(); if (card.isMounted()) { load(); - if (!valid()) return purge(); + if (!valid()) return cancel(); queue.inject_P(PSTR("M1000 S")); + TERN_(DWIN_CREALITY_LCD, dwin_flag = true); } } @@ -139,7 +148,7 @@ void PrintJobRecovery::prepare() { /** * Save the current machine state to the power-loss recovery file */ -void PrintJobRecovery::save(const bool force/*=false*/) { +void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=0*/) { #if SAVE_INFO_INTERVAL_MS > 0 static millis_t next_save_ms; // = 0 @@ -172,12 +181,9 @@ void PrintJobRecovery::save(const bool force/*=false*/) { // 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.zraise = zraise; + TERN_(HAS_HOME_OFFSET, info.home_offset = home_offset); + TERN_(HAS_POSITION_SHIFT, info.position_shift = position_shift); info.feedrate = uint16_t(feedrate_mm_s * 60.0f); #if EXTRUDERS > 1 @@ -189,7 +195,7 @@ void PrintJobRecovery::save(const bool force/*=false*/) { #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]; + if (parser.volumetric_enabled) info.filament_size[0] = planner.filament_size[active_extruder]; #endif #endif @@ -197,28 +203,18 @@ void PrintJobRecovery::save(const bool force/*=false*/) { 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 + TERN_(HAS_HEATED_BED, info.target_temperature_bed = thermalManager.temp_bed.target); - #if FAN_COUNT + #if HAS_FAN 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 - ); + info.fade = TERN0(ENABLE_LEVELING_FADE_HEIGHT, planner.z_fade_height); #endif - #if ENABLED(GRADIENT_MIX) - memcpy(&info.gradient, &mixer.gradient, sizeof(info.gradient)); - #endif + TERN_(GRADIENT_MIX, memcpy(&info.gradient, &mixer.gradient, sizeof(info.gradient))); #if ENABLED(FWRETRACT) COPY(info.retract, fwretract.current_retract); @@ -237,33 +233,74 @@ void PrintJobRecovery::save(const bool force/*=false*/) { #if PIN_EXISTS(POWER_LOSS) + #if ENABLED(BACKUP_POWER_SUPPLY) + + void PrintJobRecovery::retract_and_lift(const float &zraise) { + #if POWER_LOSS_RETRACT_LEN || POWER_LOSS_ZRAISE + + gcode.set_relative_mode(true); // Use relative coordinates + + #if POWER_LOSS_RETRACT_LEN + // Retract filament now + gcode.process_subcommands_now_P(PSTR("G1 F3000 E-" STRINGIFY(POWER_LOSS_RETRACT_LEN))); + #endif + + #if POWER_LOSS_ZRAISE + // Raise the Z axis now + if (zraise) { + char cmd[20], str_1[16]; + sprintf_P(cmd, PSTR("G0 Z%s"), dtostrf(zraise, 1, 3, str_1)); + gcode.process_subcommands_now(cmd); + } + #else + UNUSED(zraise); + #endif + + //gcode.axis_relative = info.axis_relative; + planner.synchronize(); + #endif + } + + #endif + + /** + * An outage was detected by a sensor pin. + * - If not SD printing, let the machine turn off on its own with no "KILL" screen + * - Disable all heaters first to save energy + * - Save the recovery data for the current instant + * - If backup power is available Retract E and Raise Z + * - Go to the KILL screen + */ void PrintJobRecovery::_outage() { #if ENABLED(BACKUP_POWER_SUPPLY) static bool lock = false; - if (lock) return; // No re-entrance from idle() during raise_z() + if (lock) return; // No re-entrance from idle() during retract_and_lift() lock = true; #endif - if (IS_SD_PRINTING()) save(true); + + #if POWER_LOSS_ZRAISE + // Get the limited Z-raise to do now or on resume + const float zraise = _MAX(0, _MIN(current_position.z + POWER_LOSS_ZRAISE, Z_MAX_POS - 1) - current_position.z); + #else + constexpr float zraise = 0; + #endif + + // Save, including the limited Z raise + if (IS_SD_PRINTING()) save(true, zraise); + + // Disable all heaters to reduce power loss + thermalManager.disable_all_heaters(); + #if ENABLED(BACKUP_POWER_SUPPLY) - raise_z(); + // Do a hard-stop of the steppers (with possibly a loud thud) + quickstop_stepper(); + // With backup power a retract and raise can be done now + retract_and_lift(zraise); #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 /** @@ -285,6 +322,8 @@ void PrintJobRecovery::write() { */ void PrintJobRecovery::resume() { + char cmd[MAX_CMD_SIZE+16], str_1[16], str_2[16]; + const uint32_t resume_sdpos = info.sdpos; // Get here before the stepper ISR overwrites it #if HAS_LEVELING @@ -293,54 +332,46 @@ void PrintJobRecovery::resume() { #endif // Reset E, raise Z, home XY... - gcode.process_subcommands_now_P(PSTR("G92.9 E0" - #if Z_HOME_DIR > 0 + #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 + // If Z homing goes to max, just reset E and home all + gcode.process_subcommands_now_P(PSTR( + "G92.9 E0\n" + "G28R0" TERN_(MARLIN_DEV_MODE, "S") + )); - #else // "G92.9 E0 ..." + #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" + // Set Z to 0, raise Z by info.zraise, and Home (XY only for Cartesian) + // with no raise. (Only do simulated homing in Marlin Dev Mode.) - "G28R0" - #if ENABLED(MARLIN_DEV_MODE) - "S" - #elif !IS_KINEMATIC - "XY" - #endif - #endif - )); + sprintf_P(cmd, PSTR("G92.9 E0 " + #if ENABLED(BACKUP_POWER_SUPPLY) + "Z%s" // Z was already raised at outage + #else + "Z0\nG1Z%s" // Set Z=0 and Raise Z now + #endif + ), + dtostrf(info.zraise, 1, 3, str_1) + ); + gcode.process_subcommands_now(cmd); + + gcode.process_subcommands_now_P(PSTR( + "G28R0" // No raise during G28 + TERN_(MARLIN_DEV_MODE, "S") // Simulated Homing + TERN_(IS_CARTESIAN, "XY") // Don't home Z on Cartesian + )); + + #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); + sprintf_P(cmd, PSTR("M200 T%i D%s"), e, dtostrf(info.filament_size[e], 1, 3, str_1)); gcode.process_subcommands_now(cmd); } if (!info.volumetric_enabled) { @@ -349,8 +380,7 @@ void PrintJobRecovery::resume() { } #else if (info.volumetric_enabled) { - dtostrf(info.filament_size, 1, 3, str_1); - sprintf_P(cmd, PSTR("M200 D%s"), str_1); + sprintf_P(cmd, PSTR("M200 D%s"), dtostrf(info.filament_size[0], 1, 3, str_1)); gcode.process_subcommands_now(cmd); } #endif @@ -366,12 +396,12 @@ void PrintJobRecovery::resume() { #endif // Restore all hotend temperatures - #if HOTENDS + #if HAS_HOTEND HOTEND_LOOP() { const int16_t et = info.target_temperature[e]; if (et) { - #if HOTENDS > 1 - sprintf_P(cmd, PSTR("T%i"), e); + #if HAS_MULTI_HOTEND + sprintf_P(cmd, PSTR("T%i S"), e); gcode.process_subcommands_now(cmd); #endif sprintf_P(cmd, PSTR("M109 S%i"), et); @@ -380,6 +410,12 @@ void PrintJobRecovery::resume() { } #endif + // 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 + // Restore print cooling fan speeds FANS_LOOP(i) { uint8_t f = info.fan_speed[i]; @@ -413,18 +449,21 @@ void PrintJobRecovery::resume() { 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")); + // Un-retract if there was a retract at outage + #if POWER_LOSS_RETRACT_LEN + gcode.process_subcommands_now_P(PSTR("G1 E" STRINGIFY(POWER_LOSS_RETRACT_LEN) " F3000")); #endif - #if POWER_LOSS_RETRACT_LEN - sprintf_P(cmd, PSTR("G1 E%d F3000"), POWER_LOSS_PURGE_LEN - (POWER_LOSS_RETRACT_LEN)); + // Additional purge if configured + #if POWER_LOSS_PURGE_LEN + sprintf_P(cmd, PSTR("G1 E%d F200"), (POWER_LOSS_PURGE_LEN) + (POWER_LOSS_RETRACT_LEN)); gcode.process_subcommands_now(cmd); #endif + #if ENABLED(NOZZLE_CLEAN_FEATURE) + gcode.process_subcommands_now_P(PSTR("G12")); + #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), @@ -442,13 +481,6 @@ void PrintJobRecovery::resume() { #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); @@ -460,12 +492,8 @@ void PrintJobRecovery::resume() { // 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 + TERN_(HAS_HOME_OFFSET, home_offset = info.home_offset); + TERN_(HAS_POSITION_SHIFT, position_shift = info.position_shift); #if HAS_HOME_OFFSET || HAS_POSITION_SHIFT LOOP_XYZ(i) update_workspace_offset((AxisEnum)i); #endif @@ -489,15 +517,17 @@ void PrintJobRecovery::resume() { DEBUG_ECHOPGM("current_position: "); LOOP_XYZE(i) { if (i) DEBUG_CHAR(','); - DEBUG_ECHO(info.current_position[i]); + DEBUG_DECIMAL(info.current_position[i]); } DEBUG_EOL(); + DEBUG_ECHOLNPAIR("zraise: ", info.zraise); + #if HAS_HOME_OFFSET DEBUG_ECHOPGM("home_offset: "); LOOP_XYZ(i) { if (i) DEBUG_CHAR(','); - DEBUG_ECHO(info.home_offset[i]); + DEBUG_DECIMAL(info.home_offset[i]); } DEBUG_EOL(); #endif @@ -506,7 +536,7 @@ void PrintJobRecovery::resume() { DEBUG_ECHOPGM("position_shift: "); LOOP_XYZ(i) { if (i) DEBUG_CHAR(','); - DEBUG_ECHO(info.position_shift[i]); + DEBUG_DECIMAL(info.position_shift[i]); } DEBUG_EOL(); #endif @@ -517,7 +547,7 @@ void PrintJobRecovery::resume() { DEBUG_ECHOLNPAIR("active_extruder: ", int(info.active_extruder)); #endif - #if HOTENDS + #if HAS_HOTEND DEBUG_ECHOPGM("target_temperature: "); HOTEND_LOOP() { DEBUG_ECHO(info.target_temperature[e]); @@ -530,7 +560,7 @@ void PrintJobRecovery::resume() { DEBUG_ECHOLNPAIR("target_temperature_bed: ", info.target_temperature_bed); #endif - #if FAN_COUNT + #if HAS_FAN DEBUG_ECHOPGM("fan_speed: "); FANS_LOOP(i) { DEBUG_ECHO(int(info.fan_speed[i])); @@ -540,7 +570,7 @@ void PrintJobRecovery::resume() { #endif #if HAS_LEVELING - DEBUG_ECHOLNPAIR("leveling: ", int(info.leveling), "\n fade: ", int(info.fade)); + DEBUG_ECHOLNPAIR("leveling: ", int(info.leveling), " fade: ", info.fade); #endif #if ENABLED(FWRETRACT) DEBUG_ECHOPGM("retract: "); diff --git a/Marlin/src/feature/powerloss.h b/Marlin/src/feature/powerloss.h index 0496560785..30ea343424 100644 --- a/Marlin/src/feature/powerloss.h +++ b/Marlin/src/feature/powerloss.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -26,6 +26,8 @@ */ #include "../sd/cardreader.h" +#include "../gcode/gcode.h" + #include "../inc/MarlinConfig.h" #if ENABLED(MIXING_EXTRUDER) @@ -45,6 +47,7 @@ typedef struct { // Machine state xyze_pos_t current_position; + float zraise; #if HAS_HOME_OFFSET xyz_pos_t home_offset; @@ -61,14 +64,10 @@ typedef struct { #if DISABLED(NO_VOLUMETRICS) bool volumetric_enabled; - #if EXTRUDERS > 1 - float filament_size[EXTRUDERS]; - #else - float filament_size; - #endif + float filament_size[EXTRUDERS]; #endif - #if HOTENDS + #if HAS_HOTEND int16_t target_temperature[HOTENDS]; #endif @@ -76,7 +75,7 @@ typedef struct { int16_t target_temperature_bed; #endif - #if FAN_COUNT + #if HAS_FAN uint8_t fan_speed[FAN_COUNT]; #endif @@ -110,6 +109,8 @@ typedef struct { uint8_t valid_foot; + bool valid() { return valid_head && valid_head == valid_foot; } + } job_recovery_info_t; class PrintJobRecovery { @@ -123,6 +124,10 @@ class PrintJobRecovery { static uint32_t cmd_sdpos, //!< SD position of the next command sdpos[BUFSIZE]; //!< SD positions of queued commands + #if ENABLED(DWIN_CREALITY_LCD) + static bool dwin_flag; + #endif + static void init(); static void prepare(); @@ -159,33 +164,34 @@ class PrintJobRecovery { static inline void cancel() { purge(); card.autostart_index = 0; } static void load(); - static void save(const bool force=ENABLED(SAVE_EACH_CMD_MODE)); + static void save(const bool force=ENABLED(SAVE_EACH_CMD_MODE), const float zraise=0); - #if PIN_EXISTS(POWER_LOSS) - static inline void outage() { - if (enabled && READ(POWER_LOSS_PIN) == POWER_LOSS_STATE) - _outage(); - } - #endif + #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; } + static inline bool valid() { return info.valid(); } - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - static void debug(PGM_P const prefix); - #else - static inline void debug(PGM_P const) {} - #endif + #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 ENABLED(BACKUP_POWER_SUPPLY) + static void retract_and_lift(const float &zraise); + #endif - #if PIN_EXISTS(POWER_LOSS) - static void _outage(); - #endif + #if PIN_EXISTS(POWER_LOSS) + friend class GcodeSuite; + static void _outage(); + #endif }; extern PrintJobRecovery recovery; diff --git a/Marlin/src/feature/probe_temp_comp.cpp b/Marlin/src/feature/probe_temp_comp.cpp index 6b787f420a..af8039d8b1 100644 --- a/Marlin/src/feature/probe_temp_comp.cpp +++ b/Marlin/src/feature/probe_temp_comp.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -29,11 +29,11 @@ ProbeTempComp temp_comp; -int16_t ProbeTempComp::z_offsets_probe[ProbeTempComp::cali_info_init[TSI_PROBE].measurements], // = {0} - ProbeTempComp::z_offsets_bed[ProbeTempComp::cali_info_init[TSI_BED].measurements]; // = {0} +int16_t ProbeTempComp::z_offsets_probe[cali_info_init[TSI_PROBE].measurements], // = {0} + ProbeTempComp::z_offsets_bed[cali_info_init[TSI_BED].measurements]; // = {0} #if ENABLED(USE_TEMP_EXT_COMPENSATION) - int16_t ProbeTempComp::z_offsets_ext[ProbeTempComp::cali_info_init[TSI_EXT].measurements]; // = {0} + int16_t ProbeTempComp::z_offsets_ext[cali_info_init[TSI_EXT].measurements]; // = {0} #endif int16_t *ProbeTempComp::sensor_z_offsets[TSI_COUNT] = { @@ -44,12 +44,16 @@ int16_t *ProbeTempComp::sensor_z_offsets[TSI_COUNT] = { }; const temp_calib_t ProbeTempComp::cali_info[TSI_COUNT] = { - ProbeTempComp::cali_info_init[TSI_PROBE], ProbeTempComp::cali_info_init[TSI_BED] + cali_info_init[TSI_PROBE], cali_info_init[TSI_BED] #if ENABLED(USE_TEMP_EXT_COMPENSATION) - , ProbeTempComp::cali_info_init[TSI_EXT] + , cali_info_init[TSI_EXT] #endif }; +constexpr xyz_pos_t ProbeTempComp::park_point; +constexpr xy_pos_t ProbeTempComp::measure_point; +constexpr int ProbeTempComp::probe_calib_bed_temp; + uint8_t ProbeTempComp::calib_idx; // = 0 float ProbeTempComp::init_measurement; // = 0.0 @@ -161,28 +165,41 @@ void ProbeTempComp::compensate_measurement(const TempSensorID tsi, const float & } float ProbeTempComp::get_offset_for_temperature(const TempSensorID tsi, const float &temp) { - const uint8_t measurements = cali_info[tsi].measurements; const float start_temp = cali_info[tsi].start_temp, - end_temp = cali_info[tsi].end_temp, res_temp = cali_info[tsi].temp_res; const int16_t * const data = sensor_z_offsets[tsi]; - if (temp <= start_temp) return 0.0f; - if (temp >= end_temp) return static_cast(data[measurements - 1]) / 1000.0f; + auto point = [&](uint8_t i) { + return xy_float_t({start_temp + i*res_temp, static_cast(data[i])}); + }; + + auto linear_interp = [](float x, xy_float_t p1, xy_float_t p2) { + return (p2.y - p1.y) / (p2.x - p2.y) * (x - p1.x) + p1.y; + }; // Linear interpolation - int16_t val1 = 0, val2 = data[0]; - uint8_t idx = 0; - float meas_temp = start_temp + res_temp; - while (meas_temp < temp) { - if (++idx >= measurements) return static_cast(val2) / 1000.0f; - meas_temp += res_temp; - val1 = val2; - val2 = data[idx]; - } - const float factor = (meas_temp - temp) / static_cast(res_temp); - return (static_cast(val2) - static_cast(val2 - val1) * factor) / 1000.0f; + uint8_t idx = static_cast((temp - start_temp) / res_temp); + + // offset in um + float offset = 0.0f; + + #if !defined(PTC_LINEAR_EXTRAPOLATION) || PTC_LINEAR_EXTRAPOLATION <= 0 + if (idx < 0) + offset = 0.0f; + else if (idx > measurements - 2) + offset = static_cast(data[measurements - 1]); + #else + if (idx < 0) + offset = linear_interp(temp, point(0), point(PTC_LINEAR_EXTRAPOLATION)); + else if (idx > measurements - 2) + offset = linear_interp(temp, point(measurements - PTC_LINEAR_EXTRAPOLATION - 1), point(measurements - 1)); + #endif + else + offset = linear_interp(temp, point(idx), point(idx + 1)); + + // return offset in mm + return offset / 1000.0f; } bool ProbeTempComp::linear_regression(const TempSensorID tsi, float &k, float &d) { diff --git a/Marlin/src/feature/probe_temp_comp.h b/Marlin/src/feature/probe_temp_comp.h index 2ed10eeb99..626dd87f94 100644 --- a/Marlin/src/feature/probe_temp_comp.h +++ b/Marlin/src/feature/probe_temp_comp.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -44,31 +44,64 @@ typedef struct { * Z-probes like the P.I.N.D.A V2 allow for compensation of * measurement errors/shifts due to changed temperature. */ + +// Probe temperature calibration constants +#ifndef PTC_SAMPLE_COUNT + #define PTC_SAMPLE_COUNT 10U +#endif +#ifndef PTC_SAMPLE_RES + #define PTC_SAMPLE_RES 5.0f +#endif +#ifndef PTC_SAMPLE_START + #define PTC_SAMPLE_START 30.0f +#endif +#define PTC_SAMPLE_END ((PTC_SAMPLE_START) + (PTC_SAMPLE_COUNT) * (PTC_SAMPLE_RES)) + +// Bed temperature calibration constants +#ifndef BTC_PROBE_TEMP + #define BTC_PROBE_TEMP 30.0f +#endif +#ifndef BTC_SAMPLE_COUNT + #define BTC_SAMPLE_COUNT 10U +#endif +#ifndef BTC_SAMPLE_STEP + #define BTC_SAMPLE_RES 5.0f +#endif +#ifndef BTC_SAMPLE_START + #define BTC_SAMPLE_START 60.0f +#endif +#define BTC_SAMPLE_END ((BTC_SAMPLE_START) + (BTC_SAMPLE_COUNT) * (BTC_SAMPLE_RES)) + +#ifndef PTC_PROBE_HEATING_OFFSET + #define PTC_PROBE_HEATING_OFFSET 0.5f +#endif + +#ifndef PTC_PROBE_RAISE + #define PTC_PROBE_RAISE 10.0f +#endif + +static constexpr temp_calib_t cali_info_init[TSI_COUNT] = { + { PTC_SAMPLE_COUNT, PTC_SAMPLE_RES, PTC_SAMPLE_START, PTC_SAMPLE_END }, // Probe + { BTC_SAMPLE_COUNT, BTC_SAMPLE_RES, BTC_SAMPLE_START, BTC_SAMPLE_END }, // Bed + #if ENABLED(USE_TEMP_EXT_COMPENSATION) + { 20, 5, 180, 180 + 5 * 20 } // Extruder + #endif +}; + class ProbeTempComp { public: - static constexpr temp_calib_t cali_info_init[TSI_COUNT] = { - { 10, 5, 30, 30 + 10 * 5 }, // Probe - { 10, 5, 60, 60 + 10 * 5 }, // Bed - #if ENABLED(USE_TEMP_EXT_COMPENSATION) - { 20, 5, 180, 180 + 5 * 20 } // Extruder - #endif - }; static const temp_calib_t cali_info[TSI_COUNT]; // Where to park nozzle to wait for probe cooldown - static constexpr float park_point_x = PTC_PARK_POS_X, - park_point_y = PTC_PARK_POS_Y, - park_point_z = PTC_PARK_POS_Z, - // XY coordinates of nozzle for probing the bed - measure_point_x = PTC_PROBE_POS_X, // Coordinates to probe - measure_point_y = PTC_PROBE_POS_Y; - //measure_point_x = 12.0f, // Coordinates to probe on MK52 magnetic heatbed - //measure_point_y = 7.3f; + static constexpr xyz_pos_t park_point = PTC_PARK_POS; - static constexpr int max_bed_temp = PTC_MAX_BED_TEMP, // Max temperature to avoid heating errors - probe_calib_bed_temp = max_bed_temp, // Bed temperature while calibrating probe - bed_calib_probe_temp = 30; // Probe temperature while calibrating bed + // XY coordinates of nozzle for probing the bed + static constexpr xy_pos_t measure_point = PTC_PROBE_POS; // Coordinates to probe + //measure_point = { 12.0f, 7.3f }; // Coordinates for the MK52 magnetic heatbed + + static constexpr int probe_calib_bed_temp = BED_MAX_TARGET, // Bed temperature while calibrating probe + bed_calib_probe_temp = BTC_PROBE_TEMP; // Probe temperature while calibrating bed static int16_t *sensor_z_offsets[TSI_COUNT], z_offsets_probe[cali_info_init[TSI_PROBE].measurements], // (µm) @@ -84,9 +117,7 @@ class ProbeTempComp { static inline void clear_all_offsets() { clear_offsets(TSI_BED); clear_offsets(TSI_PROBE); - #if ENABLED(USE_TEMP_EXT_COMPENSATION) - clear_offsets(TSI_EXT); - #endif + TERN_(USE_TEMP_EXT_COMPENSATION, clear_offsets(TSI_EXT)); } static bool set_offset(const TempSensorID tsi, const uint8_t idx, const int16_t offset); static void print_offsets(); diff --git a/Marlin/src/feature/runout.cpp b/Marlin/src/feature/runout.cpp index bd4a653e99..0b5c0ebc2e 100644 --- a/Marlin/src/feature/runout.cpp +++ b/Marlin/src/feature/runout.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -39,6 +39,11 @@ bool FilamentMonitorBase::enabled = true, bool FilamentMonitorBase::host_handling; // = false #endif +#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) + //#define DEBUG_TOOLCHANGE_MIGRATION_FEATURE + #include "../module/tool_change.h" +#endif + /** * Called by FilamentSensorSwitch::run when filament is detected. * Called by FilamentSensorEncoder::block_completed when motion is detected. @@ -47,13 +52,12 @@ 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 +#if HAS_FILAMENT_RUNOUT_DISTANCE float RunoutResponseDelayed::runout_distance_mm = FILAMENT_RUNOUT_DISTANCE_MM; volatile float RunoutResponseDelayed::runout_mm_countdown[EXTRUDERS]; + #if ENABLED(FILAMENT_MOTION_SENSOR) + uint8_t FilamentSensorEncoder::motion_detected; + #endif #else int8_t RunoutResponseDebounced::runout_count; // = 0 #endif @@ -74,13 +78,24 @@ void FilamentSensorBase::filament_present(const uint8_t extruder) { void event_filament_runout() { - #if ENABLED(ADVANCED_PAUSE_FEATURE) - if (did_pause_print) return; // Action already in progress. Purge triggered repeated runout. + if (TERN0(ADVANCED_PAUSE_FEATURE, did_pause_print)) return; // Action already in progress. Purge triggered repeated runout. + + #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) + if (migration.in_progress) { + #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) + SERIAL_ECHOLN("Migration Already In Progress"); + #endif + return; // Action already in progress. Purge triggered repeated runout. + } + if (migration.automode) { + #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) + SERIAL_ECHOLN("Migration Starting"); + #endif + if (extruder_migration()) return; + } #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onFilamentRunout(ExtUI::getActiveTool()); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onFilamentRunout(ExtUI::getActiveTool())); #if EITHER(HOST_PROMPT_SUPPORT, HOST_ACTION_COMMANDS) const char tool = '0' diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index b975551c6e..450ae1830a 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -84,7 +84,7 @@ class TFilamentMonitor : public FilamentMonitorBase { response.filament_present(extruder); } - #ifdef FILAMENT_RUNOUT_DISTANCE_MM + #if HAS_FILAMENT_RUNOUT_DISTANCE 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 @@ -100,20 +100,14 @@ class TFilamentMonitor : public FilamentMonitorBase { // 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 + if ( enabled && !filament_ran_out + && (printingIsActive() || TERN0(ADVANCED_PAUSE_FEATURE, did_pause_print)) + ) { + TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, cli()); // Prevent RunoutResponseDelayed::block_completed from accumulating here response.run(); sensor.run(); const bool ran_out = response.has_run_out(); - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - sei(); - #endif + TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, sei()); if (ran_out) { filament_ran_out = true; event_filament_runout(); @@ -142,6 +136,7 @@ class FilamentSensorBase { #define _INIT_RUNOUT(N) INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN); REPEAT_S(1, INCREMENT(NUM_RUNOUT_SENSORS), _INIT_RUNOUT) #undef _INIT_RUNOUT + #undef INIT_RUNOUT_PIN } // Return a bitmask of runout pin states @@ -153,14 +148,12 @@ class FilamentSensorBase { // Return a bitmask of runout flag states (1 bits always indicates runout) static inline uint8_t poll_runout_states() { - return (poll_runout_pins() - #if DISABLED(FIL_RUNOUT_INVERTING) + return poll_runout_pins() + #if FIL_RUNOUT_STATE == LOW ^ uint8_t(_BV(NUM_RUNOUT_SENSORS) - 1) #endif - ); + ; } - - #undef INIT_RUNOUT_PIN }; #if ENABLED(FILAMENT_MOTION_SENSOR) @@ -217,26 +210,14 @@ class 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); + #else + if ( !TERN0(DUAL_X_CARRIAGE, dxc_is_duplicating()) + && !TERN0(MULTI_NOZZLE_DUPLICATION, extruder_duplication_enabled) + ) return TEST(runout_states, extruder); // A specific extruder ran out #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 + return !!runout_states; // Any extruder ran out } public: @@ -261,7 +242,7 @@ class FilamentSensorBase { /********************************* RESPONSE TYPE *********************************/ -#ifdef FILAMENT_RUNOUT_DISTANCE_MM +#if HAS_FILAMENT_RUNOUT_DISTANCE // RunoutResponseDelayed triggers a runout event only if the length // of filament specified by FILAMENT_RUNOUT_DISTANCE_MM has been fed @@ -302,9 +283,7 @@ class FilamentSensorBase { 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 + || TERN0(ADVANCED_PAUSE_FEATURE, did_pause_print) // Allow pause purge move to re-trigger runout state ) { // Only trigger on extrusion with XYZ movement to allow filament change and retract/recover. const uint8_t e = b->extruder; @@ -314,7 +293,7 @@ class FilamentSensorBase { } }; -#else // !FILAMENT_RUNOUT_DISTANCE_MM +#else // !HAS_FILAMENT_RUNOUT_DISTANCE // RunoutResponseDebounced triggers a runout event after a runout // condition has been detected runout_threshold times in a row. @@ -331,21 +310,13 @@ class FilamentSensorBase { static inline void filament_present(const uint8_t) { runout_count = runout_threshold; } }; -#endif // !FILAMENT_RUNOUT_DISTANCE_MM +#endif // !HAS_FILAMENT_RUNOUT_DISTANCE /********************************* TEMPLATE SPECIALIZATION *********************************/ typedef TFilamentMonitor< - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - RunoutResponseDelayed, - #if ENABLED(FILAMENT_MOTION_SENSOR) - FilamentSensorEncoder - #else - FilamentSensorSwitch - #endif - #else - RunoutResponseDebounced, FilamentSensorSwitch - #endif -> FilamentMonitor; + TERN(HAS_FILAMENT_RUNOUT_DISTANCE, RunoutResponseDelayed, RunoutResponseDebounced), + TERN(FILAMENT_MOTION_SENSOR, FilamentSensorEncoder, FilamentSensorSwitch) + > FilamentMonitor; extern FilamentMonitor runout; diff --git a/Marlin/src/feature/snmm.cpp b/Marlin/src/feature/snmm.cpp index e994028d9e..25723f7b38 100644 --- a/Marlin/src/feature/snmm.cpp +++ b/Marlin/src/feature/snmm.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/feature/snmm.h b/Marlin/src/feature/snmm.h index 671542e3bf..10805c8e26 100644 --- a/Marlin/src/feature/snmm.h +++ b/Marlin/src/feature/snmm.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/solenoid.cpp b/Marlin/src/feature/solenoid.cpp index d53118fdd4..8646ec872f 100644 --- a/Marlin/src/feature/solenoid.cpp +++ b/Marlin/src/feature/solenoid.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/feature/solenoid.h b/Marlin/src/feature/solenoid.h index 5a503b1056..2ba4983fb0 100644 --- a/Marlin/src/feature/solenoid.h +++ b/Marlin/src/feature/solenoid.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/spindle_laser.cpp b/Marlin/src/feature/spindle_laser.cpp index 0567ba5d3e..3dcf6e928a 100644 --- a/Marlin/src/feature/spindle_laser.cpp +++ b/Marlin/src/feature/spindle_laser.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -31,71 +31,85 @@ #include "spindle_laser.h" SpindleLaser cutter; +uint8_t SpindleLaser::power; +bool SpindleLaser::isReady; // Ready to apply power setting from the UI to OCR +cutter_power_t SpindleLaser::menuPower, // Power set via LCD menu in PWM, PERCENT, or RPM + SpindleLaser::unitPower; // LCD status power in PWM, PERCENT, or RPM -cutter_power_t SpindleLaser::power; // = 0 - +#if ENABLED(MARLIN_DEV_MODE) + cutter_frequency_t SpindleLaser::frequency; // setting PWM frequency; range: 2K - 50K +#endif #define SPINDLE_LASER_PWM_OFF ((SPINDLE_LASER_PWM_INVERT) ? 255 : 0) +// +// Init the cutter to a safe OFF state +// void SpindleLaser::init() { - OUT_WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_HIGH); // Init spindle to off + 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) + 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 + analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_OFF); // set to lowest speed + #endif + #if ENABLED(HAL_CAN_SET_PWM_FREQ) && defined(SPINDLE_LASER_FREQUENCY) + set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_FREQUENCY); + TERN_(MARLIN_DEV_MODE, frequency = SPINDLE_LASER_FREQUENCY); #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 + * Set the cutter PWM directly to the given ocr value */ void SpindleLaser::set_ocr(const uint8_t ocr) { - WRITE(SPINDLE_LASER_ENA_PIN, SPINDLE_LASER_ACTIVE_HIGH); // turn spindle on (active low) + WRITE(SPINDLE_LASER_ENA_PIN, SPINDLE_LASER_ACTIVE_HIGH); // turn spindle on analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF); } - + void SpindleLaser::ocr_off() { + WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_HIGH); // Turn spindle off + analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_OFF); // Only write low byte + } #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; +// +// Set cutter ON/OFF state (and PWM) to the given cutter power value +// +void SpindleLaser::apply_power(const uint8_t opwr) { + static uint8_t last_power_applied = 0; + if (opwr == last_power_applied) return; + last_power_applied = opwr; + power = opwr; #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 + if (cutter.unitPower == 0 && CUTTER_UNIT_IS(RPM)) { + ocr_off(); + isReady = false; + } + else if (enabled() || ENABLED(CUTTER_POWER_RELATIVE)) { + set_ocr(power); + isReady = true; } 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 + ocr_off(); + isReady = false; } #else - WRITE(SPINDLE_LASER_ENA_PIN, (SPINDLE_LASER_ACTIVE_HIGH) ? enabled() : !enabled()); + WRITE(SPINDLE_LASER_ENA_PIN, enabled() == SPINDLE_LASER_ACTIVE_HIGH); + isReady = true; #endif } #if ENABLED(SPINDLE_CHANGE_DIR) - + // + // Set the spindle direction and apply immediately + // Stop on direction change if SPINDLE_STOP_ON_DIR_CHANGE is enabled + // 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 + if (TERN0(SPINDLE_STOP_ON_DIR_CHANGE, enabled()) && READ(SPINDLE_DIR_PIN) != dir_state) disable(); WRITE(SPINDLE_DIR_PIN, dir_state); } - #endif #endif // HAS_CUTTER diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index ea035299be..8240efa2dd 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -28,55 +28,159 @@ #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) +#include "spindle_laser_types.h" -#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 +#if ENABLED(LASER_POWER_INLINE) + #include "../module/planner.h" #endif +#define PCT_TO_PWM(X) ((X) * 255 / 100) + +#ifndef SPEED_POWER_INTERCEPT + #define SPEED_POWER_INTERCEPT 0 +#endif +#define SPEED_POWER_FLOOR TERN(CUTTER_POWER_RELATIVE, SPEED_POWER_MIN, 0) + +// #define _MAP(N,S1,S2,D1,D2) ((N)*_MAX((D2)-(D1),0)/_MAX((S2)-(S1),1)+(D1)) + 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 constexpr float + min_pct = round(TERN(CUTTER_POWER_RELATIVE, 0, (100 * float(SPEED_POWER_MIN) / TERN(SPINDLE_FEATURE, float(SPEED_POWER_MAX), 100)))), + max_pct = round(TERN(SPINDLE_FEATURE, 100, float(SPEED_POWER_MAX))); + + static const inline uint8_t pct_to_ocr(const float pct) { return uint8_t(PCT_TO_PWM(pct)); } + + // cpower = configured values (ie SPEED_POWER_MAX) + static const inline uint8_t cpwr_to_pct(const cutter_cpower_t cpwr) { // configured value to pct + return unitPower ? round(100 * (cpwr - SPEED_POWER_FLOOR) / (SPEED_POWER_MAX - SPEED_POWER_FLOOR)) : 0; + } + + // Convert a configured value (cpower)(ie SPEED_POWER_STARTUP) to unit power (upwr, upower), + // which can be PWM, Percent, or RPM (rel/abs). + static const inline cutter_power_t cpwr_to_upwr(const cutter_cpower_t cpwr) { // STARTUP power to Unit power + const cutter_power_t upwr = ( + #if ENABLED(SPINDLE_FEATURE) + // Spindle configured values are in RPM + #if CUTTER_UNIT_IS(RPM) + cpwr // to RPM + #elif CUTTER_UNIT_IS(PERCENT) // to PCT + cpwr_to_pct(cpwr) + #else // to PWM + PCT_TO_PWM(cpwr_to_pct(cpwr)) + #endif + #else + // Laser configured values are in PCT + #if CUTTER_UNIT_IS(PWM255) + PCT_TO_PWM(cpwr) + #else + cpwr // to RPM/PCT + #endif + #endif + ); + return upwr; + } + + static const cutter_power_t mpower_min() { return cpwr_to_upwr(SPEED_POWER_MIN); } + static const cutter_power_t mpower_max() { return cpwr_to_upwr(SPEED_POWER_MAX); } + + static bool isReady; // Ready to apply power setting from the UI to OCR + static uint8_t power; + + #if ENABLED(MARLIN_DEV_MODE) + static cutter_frequency_t frequency; // Set PWM frequency; range: 2K-50K + #endif + + static cutter_power_t menuPower, // Power as set via LCD menu in PWM, Percentage or RPM + unitPower; // Power as displayed status in PWM, Percentage or RPM 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); } + #if ENABLED(MARLIN_DEV_MODE) + static inline void refresh_frequency() { set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), frequency); } #endif + // Modifying this function should update everywhere + static inline bool enabled(const cutter_power_t opwr) { return opwr > 0; } + static inline bool enabled() { return enabled(power); } + + static void apply_power(const uint8_t inpow); + + FORCE_INLINE static void refresh() { apply_power(power); } + FORCE_INLINE static void set_power(const uint8_t upwr) { power = upwr; refresh(); } + + #if ENABLED(SPINDLE_LASER_PWM) + + static void set_ocr(const uint8_t ocr); + static inline void set_ocr_power(const uint8_t ocr) { power = ocr; set_ocr(ocr); } + static void ocr_off(); + // Used to update output for power->OCR translation + static inline uint8_t upower_to_ocr(const cutter_power_t upwr) { + return ( + #if CUTTER_UNIT_IS(PWM255) + uint8_t(upwr) + #elif CUTTER_UNIT_IS(PERCENT) + pct_to_ocr(upwr) + #else + uint8_t(pct_to_ocr(cpwr_to_pct(upwr))) + #endif + ); + } + + // Correct power to configured range + static inline cutter_power_t power_to_range(const cutter_power_t pwr) { + return power_to_range(pwr, ( + #if CUTTER_UNIT_IS(PWM255) + 0 + #elif CUTTER_UNIT_IS(PERCENT) + 1 + #elif CUTTER_UNIT_IS(RPM) + 2 + #else + #error "???" + #endif + )); + } + static inline cutter_power_t power_to_range(const cutter_power_t pwr, const uint8_t pwrUnit) { + if (pwr <= 0) return 0; + cutter_power_t upwr; + switch (pwrUnit) { + case 0: // PWM + upwr = cutter_power_t( + (pwr < pct_to_ocr(min_pct)) ? pct_to_ocr(min_pct) // Use minimum if set below + : (pwr > pct_to_ocr(max_pct)) ? pct_to_ocr(max_pct) // Use maximum if set above + : pwr + ); + break; + case 1: // PERCENT + upwr = cutter_power_t( + (pwr < min_pct) ? min_pct // Use minimum if set below + : (pwr > max_pct) ? max_pct // Use maximum if set above + : pwr // PCT + ); + break; + case 2: // RPM + upwr = cutter_power_t( + (pwr < SPEED_POWER_MIN) ? SPEED_POWER_MIN // Use minimum if set below + : (pwr > SPEED_POWER_MAX) ? SPEED_POWER_MAX // Use maximum if set above + : pwr // Calculate OCR value + ); + break; + default: break; + } + return upwr; + } + + #endif // SPINDLE_LASER_PWM + + static inline void set_enabled(const bool enable) { + set_power(enable ? TERN(SPINDLE_LASER_PWM, (power ?: (unitPower ? upower_to_ocr(cpwr_to_upwr(SPEED_POWER_STARTUP)) : 0)), 255) : 0); + } + // 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); + static inline void power_delay(const bool on) { + #if DISABLED(LASER_POWER_INLINE) + safe_delay(on ? SPINDLE_LASER_POWERUP_DELAY : SPINDLE_LASER_POWERDOWN_DELAY); #endif } @@ -86,10 +190,93 @@ public: 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); } + static inline void disable() { isReady = false; set_enabled(false); } + #if HAS_LCD_MENU + + static inline void enable_with_dir(const bool reverse) { + isReady = true; + const uint8_t ocr = TERN(SPINDLE_LASER_PWM, upower_to_ocr(menuPower), 255); + if (menuPower) + power = ocr; + else + menuPower = cpwr_to_upwr(SPEED_POWER_STARTUP); + unitPower = menuPower; + set_direction(reverse); + set_enabled(true); + } + FORCE_INLINE static void enable_forward() { enable_with_dir(false); } + FORCE_INLINE static void enable_reverse() { enable_with_dir(true); } + + #if ENABLED(SPINDLE_LASER_PWM) + static inline void update_from_mpower() { + if (isReady) power = upower_to_ocr(menuPower); + unitPower = menuPower; + } + #endif + + #endif + + #if ENABLED(LASER_POWER_INLINE) + /** + * Inline power adds extra fields to the planner block + * to handle laser power and scale to movement speed. + */ + + // Force disengage planner power control + static inline void inline_disable() { + isReady = false; + unitPower = 0; + planner.laser_inline.status.isPlanned = false; + planner.laser_inline.status.isEnabled = false; + planner.laser_inline.power = 0; + } + + // Inline modes of all other functions; all enable planner inline power control + static inline void set_inline_enabled(const bool enable) { + if (enable) + inline_power(cpwr_to_upwr(SPEED_POWER_STARTUP)); + else { + isReady = false; + unitPower = menuPower = 0; + planner.laser_inline.status.isPlanned = false; + TERN(SPINDLE_LASER_PWM, inline_ocr_power, inline_power)(0); + } + } + + // Set the power for subsequent movement blocks + static void inline_power(const cutter_power_t upwr) { + unitPower = menuPower = upwr; + #if ENABLED(SPINDLE_LASER_PWM) + #if ENABLED(SPEED_POWER_RELATIVE) && !CUTTER_UNIT_IS(RPM) // relative mode does not turn laser off at 0, except for RPM + planner.laser_inline.status.isEnabled = true; + planner.laser_inline.power = upower_to_ocr(upwr); + isReady = true; + #else + inline_ocr_power(upower_to_ocr(upwr)); + #endif + #else + planner.laser_inline.status.isEnabled = enabled(upwr); + planner.laser_inline.power = upwr; + isReady = enabled(upwr); + #endif + } + + static inline void inline_direction(const bool) { /* never */ } + + #if ENABLED(SPINDLE_LASER_PWM) + static inline void inline_ocr_power(const uint8_t ocrpwr) { + isReady = ocrpwr > 0; + planner.laser_inline.status.isEnabled = ocrpwr > 0; + planner.laser_inline.power = ocrpwr; + } + #endif + #endif // LASER_POWER_INLINE + + static inline void kill() { + TERN_(LASER_POWER_INLINE, inline_disable()); + disable(); + } }; extern SpindleLaser cutter; diff --git a/Marlin/src/feature/spindle_laser_types.h b/Marlin/src/feature/spindle_laser_types.h new file mode 100644 index 0000000000..181c4d73ac --- /dev/null +++ b/Marlin/src/feature/spindle_laser_types.h @@ -0,0 +1,53 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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_types.h + * Support for Laser Power or Spindle Power & Direction + */ + +#include "../inc/MarlinConfigPre.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) + +typedef IF<(SPEED_POWER_MAX > 255), uint16_t, uint8_t>::type cutter_cpower_t; + +#if CUTTER_UNIT_IS(RPM) && SPEED_POWER_MAX > 255 + typedef uint16_t cutter_power_t; + #define CUTTER_MENU_POWER_TYPE uint16_5 + #define cutter_power2str ui16tostr5rj +#else + typedef uint8_t cutter_power_t; + #define CUTTER_MENU_POWER_TYPE uint8 + #define cutter_power2str ui8tostr3rj +#endif + +#if ENABLED(MARLIN_DEV_MODE) + typedef uint16_t cutter_frequency_t; + #define CUTTER_MENU_FREQUENCY_TYPE uint16_5 +#endif diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index e5e69eed50..495d6a9f5b 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -63,9 +63,9 @@ , is_stall:1 , is_stealth:1 , is_standstill:1 - #if HAS_STALLGUARD - , sg_result_reasonable:1 - #endif + #if HAS_STALLGUARD + , sg_result_reasonable:1 + #endif #endif ; #if ENABLED(TMC_DEBUG) @@ -169,9 +169,7 @@ data.is_stealth = TEST(ds, STEALTH_bp); data.is_standstill = TEST(ds, STST_bp); #endif - #if HAS_STALLGUARD - data.sg_result_reasonable = false; - #endif + TERN_(HAS_STALLGUARD, data.sg_result_reasonable = false); #endif return data; } @@ -213,9 +211,7 @@ 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 + TERN_(TMC_DEBUG, tmc_report_all(true, true, true, true)); kill(PSTR("Driver error")); } #endif @@ -446,9 +442,7 @@ (void)monitor_tmc_driver(stepperE7, need_update_error_counters, need_debug_reporting); #endif - #if ENABLED(TMC_DEBUG) - if (need_debug_reporting) SERIAL_EOL(); - #endif + if (TERN0(TMC_DEBUG, need_debug_reporting)) SERIAL_EOL(); } } @@ -486,6 +480,10 @@ TMC_GLOBAL_SCALER, TMC_CS_ACTUAL, TMC_PWM_SCALE, + TMC_PWM_SCALE_SUM, + TMC_PWM_SCALE_AUTO, + TMC_PWM_OFS_AUTO, + TMC_PWM_GRAD_AUTO, TMC_VSENSE, TMC_STEALTHCHOP, TMC_MICROSTEPS, @@ -498,7 +496,8 @@ TMC_TBL, TMC_HEND, TMC_HSTRT, - TMC_SGT + TMC_SGT, + TMC_MSCNT }; enum TMC_drv_status_enum : char { TMC_DRV_CODES, @@ -597,7 +596,10 @@ #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_PWM_SCALE_SUM: SERIAL_PRINT(st.pwm_scale_sum(), DEC); break; + case TMC_PWM_SCALE_AUTO: SERIAL_PRINT(st.pwm_scale_auto(), DEC); break; + case TMC_PWM_OFS_AUTO: SERIAL_PRINT(st.pwm_ofs_auto(), DEC); break; + case TMC_PWM_GRAD_AUTO: SERIAL_PRINT(st.pwm_grad_auto(), 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; @@ -686,6 +688,7 @@ 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; + case TMC_MSCNT: SERIAL_PRINT(st.get_microstep_counter(), DEC); break; default: _tmc_status(st, i); break; } } @@ -906,11 +909,20 @@ #if ENABLED(MONITOR_DRIVER_STATUS) TMC_REPORT("triggered\n OTP\t", TMC_OTPW_TRIGGERED); #endif + + #if HAS_TMC220x + TMC_REPORT("pwm scale sum", TMC_PWM_SCALE_SUM); + TMC_REPORT("pwm scale auto", TMC_PWM_SCALE_AUTO); + TMC_REPORT("pwm offset auto", TMC_PWM_OFS_AUTO); + TMC_REPORT("pwm grad auto", TMC_PWM_GRAD_AUTO); + #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); + TMC_REPORT("uStep count", TMC_MSCNT); DRV_REPORT("DRVSTATUS", TMC_DRV_CODES); #if HAS_TMCX1X0 || HAS_TMC220x DRV_REPORT("sg_result", TMC_SG_RESULT); @@ -1254,7 +1266,7 @@ void test_tmc_connection(const bool test_x, const bool test_y, const bool test_z #endif } - if (axis_connection) ui.set_status_P(GET_TEXT(MSG_ERROR_TMC)); + if (axis_connection) LCD_MESSAGEPGM(MSG_ERROR_TMC); } #endif // HAS_TRINAMIC_CONFIG diff --git a/Marlin/src/feature/tmc_util.h b/Marlin/src/feature/tmc_util.h index ccae8b660c..2779ae4ef4 100644 --- a/Marlin/src/feature/tmc_util.h +++ b/Marlin/src/feature/tmc_util.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -35,6 +35,7 @@ #define CHOPPER_DEFAULT_36V { 5, 2, 4 } #define CHOPPER_PRUSAMK3_24V { 3, -2, 6 } #define CHOPPER_MARLIN_119 { 5, 2, 3 } +#define CHOPPER_09STEP_24V { 3, -1, 5 } #if ENABLED(MONITOR_DRIVER_STATUS) && !defined(MONITOR_DRIVER_STATUS_INTERVAL_MS) #define MONITOR_DRIVER_STATUS_INTERVAL_MS 500u @@ -69,15 +70,9 @@ class TMCStorage { } 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 + TERN_(HAS_STEALTHCHOP, bool stealthChop_enabled = false); + TERN_(HYBRID_THRESHOLD, uint8_t hybrid_thrs = 0); + TERN_(USE_SENSORLESS, int16_t homing_thrs = 0); } stored; }; @@ -105,6 +100,7 @@ class TMCMarlin : public TMC, public TMCStorage { this->val_mA = mA; TMC::rms_current(mA, mult); } + inline uint16_t get_microstep_counter() { return TMC::MSCNT(); } #if HAS_STEALTHCHOP inline void refresh_stepping_mode() { this->en_pwm_mode(this->stored.stealthChop_enabled); } @@ -117,9 +113,7 @@ class TMCMarlin : public TMC, public TMCStorage { } 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 + TERN_(HAS_LCD_MENU, this->stored.hybrid_thrs = thrs); } #endif @@ -128,9 +122,7 @@ class TMCMarlin : public TMC, public TMCStorage { 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 + TERN_(HAS_LCD_MENU, this->stored.homing_thrs = sgt_val); } #if ENABLED(SPI_ENDSTOPS) bool test_stall_status(); @@ -158,9 +150,13 @@ class TMCMarlin : public TMC220 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) + TMCMarlin(Stream * SerialPort, const float RS, uint8_t addr, const uint16_t mul_pin1, const uint16_t mul_pin2) : + TMC2208Stepper(SerialPort, RS, addr, mul_pin1, mul_pin2) + {} + TMCMarlin(const uint16_t RX, const uint16_t TX, const float RS, const uint8_t) : + TMC2208Stepper(RX, TX, RS) {} + uint16_t rms_current() { return TMC2208Stepper::rms_current(); } inline void rms_current(const uint16_t mA) { this->val_mA = mA; @@ -170,6 +166,7 @@ class TMCMarlin : public TMC220 this->val_mA = mA; TMC2208Stepper::rms_current(mA, mult); } + inline uint16_t get_microstep_counter() { return TMC2208Stepper::MSCNT(); } #if HAS_STEALTHCHOP inline void refresh_stepping_mode() { en_spreadCycle(!this->stored.stealthChop_enabled); } @@ -182,9 +179,7 @@ class TMCMarlin : public TMC220 } 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 + TERN_(HAS_LCD_MENU, this->stored.hybrid_thrs = thrs); } #endif @@ -203,7 +198,7 @@ class TMCMarlin : public TMC220 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) : + TMCMarlin(const uint16_t RX, const uint16_t TX, const float RS, const uint8_t addr) : TMC2209Stepper(RX, TX, RS, addr) {} uint8_t get_address() { return slave_address; } @@ -216,6 +211,7 @@ class TMCMarlin : public TMC220 this->val_mA = mA; TMC2209Stepper::rms_current(mA, mult); } + inline uint16_t get_microstep_counter() { return TMC2209Stepper::MSCNT(); } #if HAS_STEALTHCHOP inline void refresh_stepping_mode() { en_spreadCycle(!this->stored.stealthChop_enabled); } @@ -228,9 +224,7 @@ class TMCMarlin : public TMC220 } 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 + TERN_(HAS_LCD_MENU, this->stored.hybrid_thrs = thrs); } #endif #if USE_SENSORLESS @@ -238,9 +232,7 @@ class TMCMarlin : public TMC220 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 + TERN_(HAS_LCD_MENU, this->stored.homing_thrs = sgt_val); } #endif @@ -273,15 +265,14 @@ class TMCMarlin : public TMC266 this->val_mA = mA; TMC2660Stepper::rms_current(mA); } + inline uint16_t get_microstep_counter() { return TMC2660Stepper::mstep(); } #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 + TERN_(HAS_LCD_MENU, this->stored.homing_thrs = sgt_val); } #endif @@ -363,9 +354,7 @@ void test_tmc_connection(const bool test_x, const bool test_y, const bool test_z struct slow_homing_t { xy_ulong_t acceleration; - #if HAS_CLASSIC_JERK - xy_float_t jerk_xy; - #endif + TERN_(HAS_CLASSIC_JERK, xy_float_t jerk_xy); }; #endif diff --git a/Marlin/src/feature/touch/xpt2046.cpp b/Marlin/src/feature/touch/xpt2046.cpp index 26e25950d8..235c17b50c 100644 --- a/Marlin/src/feature/touch/xpt2046.cpp +++ b/Marlin/src/feature/touch/xpt2046.cpp @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -23,6 +23,49 @@ #include "xpt2046.h" #include "../../inc/MarlinConfig.h" +#if ENABLED(FSMC_GRAPHICAL_TFT) + #include "../../lcd/dogm/ultralcd_DOGM.h" // for LCD_FULL_PIXEL_WIDTH, etc. +#endif + + +/* + * Draw and Touch processing + * + * LCD_PIXEL_WIDTH/HEIGHT (128x64) is the (emulated DOGM) Pixel Drawing resolution. + * TOUCH_SCREEN_WIDTH/HEIGHT (320x240) is the Touch Area resolution. + * LCD_FULL_PIXEL_WIDTH/HEIGHT (320x240 or 480x320) is the Actual (FSMC) Display resolution. + * + * - All native (u8g) drawing is done in LCD_PIXEL_* (128x64) + * - The DOGM pixels are is upscaled 2-3x (as needed) for display. + * - Touch coordinates use TOUCH_SCREEN_* resolution and are converted to + * click and scroll-wheel events (emulating of a common DOGM display). + * + * TOUCH_SCREEN resolution exists to fit our calibration values. The original touch code was made + * and originally calibrated for 320x240. If you decide to change the resolution of the touch code, + * new calibration values will be needed. + * + * The Marlin menus are drawn scaled in the upper region of the screen. The bottom region (in a + * fixed location in TOUCH_SCREEN* coordinate space) is used for 4 general-purpose buttons to + * navigate and select menu items. Both regions are touchable. + * + * The Marlin screen touchable area starts at LCD_PIXEL_OFFSET_X/Y (translated to SCREEN_START_LEFT/TOP) + * and spans LCD_PIXEL_WIDTH/HEIGHT (scaled to SCREEN_WIDTH/HEIGHT). + */ +// Touch screen resolution independent of display resolution +#define TOUCH_SCREEN_HEIGHT 240 +#define TOUCH_SCREEN_WIDTH 320 + +// Coordinates in terms of touch area +#define BUTTON_AREA_TOP 175 +#define BUTTON_AREA_BOT 234 + +#define SCREEN_START_TOP ((LCD_PIXEL_OFFSET_Y) * (TOUCH_SCREEN_HEIGHT) / (LCD_FULL_PIXEL_HEIGHT)) +#define SCREEN_START_LEFT ((LCD_PIXEL_OFFSET_X) * (TOUCH_SCREEN_WIDTH) / (LCD_FULL_PIXEL_WIDTH)) +#define SCREEN_HEIGHT ((LCD_PIXEL_HEIGHT * FSMC_UPSCALE) * (TOUCH_SCREEN_HEIGHT) / (LCD_FULL_PIXEL_HEIGHT)) +#define SCREEN_WIDTH ((LCD_PIXEL_WIDTH * FSMC_UPSCALE) * (TOUCH_SCREEN_WIDTH) / (LCD_FULL_PIXEL_WIDTH)) + +#define TOUCHABLE_Y_HEIGHT SCREEN_HEIGHT +#define TOUCHABLE_X_WIDTH SCREEN_WIDTH #ifndef TOUCH_INT_PIN #define TOUCH_INT_PIN -1 @@ -41,7 +84,6 @@ #endif XPT2046 touch; -extern int8_t encoderDiff; void XPT2046::init() { SET_INPUT(TOUCH_MISO_PIN); @@ -61,30 +103,42 @@ void XPT2046::init() { #include "../../lcd/ultralcd.h" // For EN_C bit mask uint8_t XPT2046::read_buttons() { - int16_t tsoffsets[4] = { 0 }; + #ifdef HAS_SPI_LCD + 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; - } + 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. + // 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 (!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; + // Touch within the button area simulates an encoder button + if (y > BUTTON_AREA_TOP && y < BUTTON_AREA_BOT) + 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; - 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; + if (x > TOUCH_SCREEN_WIDTH || !WITHIN(y, SCREEN_START_TOP, SCREEN_START_TOP + SCREEN_HEIGHT)) return 0; + + // Column and row above BUTTON_AREA_TOP + int8_t col = (x - (SCREEN_START_LEFT)) * (LCD_WIDTH) / (TOUCHABLE_X_WIDTH), + row = (y - (SCREEN_START_TOP)) * (LCD_HEIGHT) / (TOUCHABLE_Y_HEIGHT); + + // Send the touch to the UI (which will simulate the encoder wheel) + MarlinUI::screen_click(row, col, x, y); + #endif + return 0; } bool XPT2046::isTouched() { diff --git a/Marlin/src/feature/touch/xpt2046.h b/Marlin/src/feature/touch/xpt2046.h index 7f8eece1f4..347881e0ad 100644 --- a/Marlin/src/feature/touch/xpt2046.h +++ b/Marlin/src/feature/touch/xpt2046.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/feature/twibus.cpp b/Marlin/src/feature/twibus.cpp index 9dbb1deb4f..3cc20579ac 100644 --- a/Marlin/src/feature/twibus.cpp +++ b/Marlin/src/feature/twibus.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -104,8 +104,8 @@ bool TWIBus::request(const uint8_t bytes) { debug(PSTR("request"), bytes); // requestFrom() is a blocking function - if (Wire.requestFrom(addr, bytes) == 0) { - debug("request fail", addr); + if (Wire.requestFrom(I2C_ADDRESS(addr), bytes) == 0) { + debug("request fail", I2C_ADDRESS(addr)); return false; } diff --git a/Marlin/src/feature/twibus.h b/Marlin/src/feature/twibus.h index 2c1b20da51..8bc8eb4e74 100644 --- a/Marlin/src/feature/twibus.h +++ b/Marlin/src/feature/twibus.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -46,8 +46,8 @@ typedef void (*twiRequestFunc_t)(); * for the host to interpret. * * For more information see - * - http://marlinfw.org/docs/gcode/M260.html - * - http://marlinfw.org/docs/gcode/M261.html + * - https://marlinfw.org/docs/gcode/M260.html + * - https://marlinfw.org/docs/gcode/M261.html * */ class TWIBus { diff --git a/Marlin/src/feature/z_stepper_align.cpp b/Marlin/src/feature/z_stepper_align.cpp index 6fccff7cc9..87b1f6f251 100644 --- a/Marlin/src/feature/z_stepper_align.cpp +++ b/Marlin/src/feature/z_stepper_align.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -56,10 +56,10 @@ void ZStepperAlign::reset_to_default() { constexpr xyz_pos_t dpo = NOZZLE_TO_PROBE_OFFSET; - #define LTEST(N) (xy_init[N].x >= _MAX(X_MIN_BED + MIN_PROBE_EDGE_LEFT, X_MIN_POS + dpo.x) - 0.00001f) - #define RTEST(N) (xy_init[N].x <= _MIN(X_MAX_BED - MIN_PROBE_EDGE_RIGHT, X_MAX_POS + dpo.x) + 0.00001f) - #define FTEST(N) (xy_init[N].y >= _MAX(Y_MIN_BED + MIN_PROBE_EDGE_FRONT, Y_MIN_POS + dpo.y) - 0.00001f) - #define BTEST(N) (xy_init[N].y <= _MIN(Y_MAX_BED - MIN_PROBE_EDGE_BACK, Y_MAX_POS + dpo.y) + 0.00001f) + #define LTEST(N) (xy_init[N].x >= _MAX(X_MIN_BED + PROBING_MARGIN_LEFT, X_MIN_POS + dpo.x) - 0.00001f) + #define RTEST(N) (xy_init[N].x <= _MIN(X_MAX_BED - PROBING_MARGIN_RIGHT, X_MAX_POS + dpo.x) + 0.00001f) + #define FTEST(N) (xy_init[N].y >= _MAX(Y_MIN_BED + PROBING_MARGIN_FRONT, Y_MIN_POS + dpo.y) - 0.00001f) + #define BTEST(N) (xy_init[N].y <= _MIN(Y_MAX_BED - PROBING_MARGIN_BACK, Y_MAX_POS + dpo.y) + 0.00001f) static_assert(LTEST(0) && RTEST(0), "The 1st Z_STEPPER_ALIGN_XY X is unreachable with the default probe X offset."); static_assert(FTEST(0) && BTEST(0), "The 1st Z_STEPPER_ALIGN_XY Y is unreachable with the default probe Y offset."); diff --git a/Marlin/src/feature/z_stepper_align.h b/Marlin/src/feature/z_stepper_align.h index ade3d6b575..e1b235b52c 100644 --- a/Marlin/src/feature/z_stepper_align.h +++ b/Marlin/src/feature/z_stepper_align.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 28fdf581ff..438a619242 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -16,58 +16,10 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 "../../MarlinCore.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 PRIME_LENGTH 10.0 -#define OOZE_AMOUNT 0.3 - -#define INTERSECTION_CIRCLE_RADIUS 5 -#define CROSSHAIRS_SIZE 3 - -#ifndef G26_RETRACT_MULTIPLIER - #define G26_RETRACT_MULTIPLIER 1.0 // x 1mm -#endif - -#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 * @@ -95,6 +47,8 @@ * * H # Hotend Set the Nozzle Temperature. If not specified, a default of 205 C. will be assumed. * + * I # Preset Heat the Nozzle and Bed based on a Material Preset (if material presets are defined). + * * 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 @@ -141,13 +95,54 @@ * Y # Y Coord. Specify the starting location of the drawing activity. */ -// External references +#include "../../inc/MarlinConfig.h" -// Private functions +#if ENABLED(G26_MESH_VALIDATION) + +#define G26_OK false +#define G26_ERR true + +#include "../../gcode/gcode.h" +#include "../../feature/bedlevel/bedlevel.h" + +#include "../../MarlinCore.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 PRIME_LENGTH 10.0 +#define OOZE_AMOUNT 0.3 + +#define INTERSECTION_CIRCLE_RADIUS 5 +#define CROSSHAIRS_SIZE 3 + +#ifndef G26_RETRACT_MULTIPLIER + #define G26_RETRACT_MULTIPLIER 1.0 // x 1mm +#endif + +#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 + +constexpr float g26_e_axis_feedrate = 0.025; static MeshFlags circle_flags, horizontal_mesh_line_flags, vertical_mesh_line_flags; -float g26_e_axis_feedrate = 0.025, - random_deviation = 0.0; +float g26_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. @@ -172,9 +167,7 @@ int8_t g26_prime_flag; bool user_canceled() { if (!ui.button_pressed()) return false; // Return if the button isn't pressed ui.set_status_P(GET_TEXT(MSG_G26_CANCELED), 99); - #if HAS_LCD_MENU - ui.quick_feedback(); - #endif + TERN_(HAS_LCD_MENU, ui.quick_feedback()); ui.wait_for_release(); return true; } @@ -202,7 +195,7 @@ mesh_index_pair find_closest_circle_to_print(const xy_pos_t &pos) { f += (g26_xy_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 (g26_random_deviation > 1.0) f += random(0.0, g26_random_deviation); if (f < closest) { closest = f; // Found a closer un-printed location @@ -308,9 +301,7 @@ inline bool look_for_lines_to_connect() { GRID_LOOP(i, j) { - #if HAS_LCD_MENU - if (user_canceled()) return true; - #endif + if (TERN0(HAS_LCD_MENU, user_canceled())) return true; 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. @@ -371,9 +362,7 @@ inline bool turn_on_heaters() { #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 + TERN_(HAS_LCD_MENU, ui.capture()); #endif thermalManager.setTargetBed(g26_bed_temp); @@ -397,11 +386,10 @@ inline bool turn_on_heaters() { // 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 G26_CLICK_CAN_CANCEL + , true + #endif + )) return G26_ERR; #if HAS_SPI_LCD ui.reset_status(); @@ -522,15 +510,35 @@ void GcodeSuite::G26() { bool g26_continue_with_closest = parser.boolval('C'), g26_keep_heaters_on = parser.boolval('K'); + // Accept 'I' if temperature presets are defined + const uint8_t preset_index = (0 + #if PREHEAT_COUNT + + (parser.seenval('I') ? _MIN(parser.value_byte(), PREHEAT_COUNT - 1) + 1 : 0) + #endif + ); + #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)."); + + // Get a temperature from 'I' or 'B' + int16_t bedtemp = 0; + + // Use the 'I' index if temperature presets are defined + #if PREHEAT_COUNT + if (preset_index) bedtemp = ui.material_preset[preset_index - 1].bed_temp; + #endif + + // Look for 'B' Bed Temperature + if (parser.seenval('B')) bedtemp = parser.value_celsius(); + + if (bedtemp) { + if (!WITHIN(bedtemp, 40, BED_MAX_TARGET)) { + SERIAL_ECHOLNPAIR("?Specified bed temperature not plausible (40-", int(BED_MAX_TARGET), "C)."); return; } + g26_bed_temp = bedtemp; } - #endif + + #endif // HAS_HEATED_BED if (parser.seenval('L')) { g26_layer_height = parser.value_linear_units(); @@ -594,20 +602,34 @@ void GcodeSuite::G26() { 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))) { + // Get a temperature from 'I' or 'H' + int16_t noztemp = 0; + + // Accept 'I' if temperature presets are defined + #if PREHEAT_COUNT + if (preset_index) noztemp = ui.material_preset[preset_index - 1].hotend_temp; + #endif + + // Look for 'H' Hotend Temperature + if (parser.seenval('H')) noztemp = parser.value_celsius(); + + // If any preset or temperature was specified + if (noztemp) { + if (!WITHIN(noztemp, 165, (HEATER_0_MAXTEMP) - (HOTEND_OVERSHOOT))) { SERIAL_ECHOLNPGM("?Specified nozzle temperature not plausible."); return; } + g26_hotend_temp = noztemp; } + // 'U' to Randomize and optionally set circle deviation if (parser.seen('U')) { randomSeed(millis()); // This setting will persist for the next G26 - random_deviation = parser.has_value() ? parser.value_float() : 50.0; + g26_random_deviation = parser.has_value() ? parser.value_float() : 50.0; } + // Get repeat from 'R', otherwise do one full circuit int16_t g26_repeats; #if HAS_LCD_MENU g26_repeats = parser.intval('R', GRID_MAX_POINTS + 1); @@ -624,6 +646,7 @@ void GcodeSuite::G26() { return; } + // Set a position with 'X' and/or 'Y'. Default: current_position g26_xy_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_xy_pos)) { @@ -636,8 +659,7 @@ void GcodeSuite::G26() { */ set_bed_leveling_enabled(!parser.seen('D')); - if (current_position.z < Z_CLEARANCE_BETWEEN_PROBES) - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); + do_z_clearance(Z_CLEARANCE_BETWEEN_PROBES); #if DISABLED(NO_VOLUMETRICS) bool volumetric_was_enabled = parser.volumetric_enabled; @@ -672,9 +694,7 @@ void GcodeSuite::G26() { move_to(destination, 0.0); move_to(destination, g26_ooze_amount); - #if HAS_LCD_MENU - ui.capture(); - #endif + TERN_(HAS_LCD_MENU, ui.capture()); #if DISABLED(ARC_SUPPORT) @@ -769,9 +789,7 @@ void GcodeSuite::G26() { 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 + if (TERN0(HAS_LCD_MENU, user_canceled())) goto LEAVE; // Check if the user wants to stop the Mesh Validation #else // !ARC_SUPPORT @@ -795,9 +813,7 @@ void GcodeSuite::G26() { 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 + if (TERN0(HAS_LCD_MENU, user_canceled())) goto LEAVE; // Check if the user wants to stop the Mesh Validation 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 }; @@ -840,14 +856,10 @@ void GcodeSuite::G26() { planner.calculate_volumetric_multipliers(); #endif - #if HAS_LCD_MENU - ui.release(); // Give back control of the LCD - #endif + TERN_(HAS_LCD_MENU, ui.release()); // Give back control of the LCD if (!g26_keep_heaters_on) { - #if HAS_HEATED_BED - thermalManager.setTargetBed(0); - #endif + TERN_(HAS_HEATED_BED, thermalManager.setTargetBed(0)); thermalManager.setTargetHotend(active_extruder, 0); } } diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp new file mode 100755 index 0000000000..786065b346 --- /dev/null +++ b/Marlin/src/gcode/bedlevel/G35.cpp @@ -0,0 +1,185 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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(ASSISTED_TRAMMING) + +#include "../gcode.h" +#include "../../module/planner.h" +#include "../../module/probe.h" +#include "../../feature/bedlevel/bedlevel.h" + +#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) +#include "../../core/debug_out.h" + +constexpr xy_pos_t screws_tilt_adjust_pos[] = TRAMMING_POINT_XY; + +static PGMSTR(point_name_1, TRAMMING_POINT_NAME_1); +static PGMSTR(point_name_2, TRAMMING_POINT_NAME_2); +static PGMSTR(point_name_3, TRAMMING_POINT_NAME_3); +#ifdef TRAMMING_POINT_NAME_4 + static PGMSTR(point_name_4, TRAMMING_POINT_NAME_4); + #ifdef TRAMMING_POINT_NAME_5 + static PGMSTR(point_name_5, TRAMMING_POINT_NAME_5); + #endif +#endif + +static PGM_P const tramming_point_name[] PROGMEM = { + point_name_1, point_name_2, point_name_3 + #ifdef TRAMMING_POINT_NAME_4 + , point_name_4 + #ifdef TRAMMING_POINT_NAME_5 + , point_name_5 + #endif + #endif +}; + +#define G35_PROBE_COUNT COUNT(screws_tilt_adjust_pos) + +#if !WITHIN(TRAMMING_SCREW_THREAD, 30, 51) || TRAMMING_SCREW_THREAD % 10 > 1 + #error "TRAMMING_SCREW_THREAD must be equal to 30, 31, 40, 41, 50, or 51." +#endif + +static_assert(G35_PROBE_COUNT > 2, "TRAMMING_POINT_XY requires at least 3 XY positions."); + +/** + * G35: Read bed corners to help adjust bed screws + * + * S + * + * Screw thread: 30 - Clockwise M3 + * 31 - Counter-Clockwise M3 + * 40 - Clockwise M4 + * 41 - Counter-Clockwise M4 + * 50 - Clockwise M5 + * 51 - Counter-Clockwise M5 + **/ +void GcodeSuite::G35() { + DEBUG_SECTION(log_G35, "G35", DEBUGGING(LEVELING)); + + if (DEBUGGING(LEVELING)) log_machine_info(); + + float z_measured[G35_PROBE_COUNT] = { 0 }; + + const uint8_t screw_thread = parser.byteval('S', TRAMMING_SCREW_THREAD); + if (!WITHIN(screw_thread, 30, 51) || screw_thread % 10 > 1) { + SERIAL_ECHOLNPGM("?(S)crew thread must be 30, 31, 40, 41, 50, or 51."); + return; + } + + // Wait for planner moves to finish! + planner.synchronize(); + + // Disable the leveling matrix before auto-aligning + #if HAS_LEVELING + TERN_(RESTORE_LEVELING_AFTER_G35, const bool leveling_was_active = planner.leveling_active); + set_bed_leveling_enabled(false); + #endif + + #if ENABLED(CNC_WORKSPACE_PLANES) + workspace_plane = PLANE_XY; + #endif + + // Always home with tool 0 active + #if HAS_MULTI_HOTEND + const uint8_t old_tool_index = active_extruder; + tool_change(0, true); + #endif + + #if HAS_DUPLICATION_MODE + extruder_duplication_enabled = false; + #endif + + // Home all before this procedure + home_all_axes(); + + bool err_break = false; + + // Probe all positions + LOOP_L_N(i, G35_PROBE_COUNT) { + + // In BLTOUCH HS mode, the probe travels in a deployed state. + // Users of G35 might have a badly misaligned bed, so raise Z by the + // length of the deployed pin (BLTOUCH stroke < 7mm) + current_position.z = (Z_CLEARANCE_BETWEEN_PROBES) + (7 * ENABLED(BLTOUCH_HS_MODE)); + + const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[i], PROBE_PT_RAISE, 0, true); + + if (isnan(z_probed_height)) { + SERIAL_ECHOPAIR("G35 failed at point ", int(i), " (", tramming_point_name[i], ")"); + SERIAL_ECHOLNPAIR_P(SP_X_STR, screws_tilt_adjust_pos[i].x, SP_Y_STR, screws_tilt_adjust_pos[i].y); + err_break = true; + break; + } + + if (DEBUGGING(LEVELING)) { + DEBUG_ECHOPAIR("Probing point ", int(i), " (", tramming_point_name[i], ")"); + SERIAL_ECHOLNPAIR_P(SP_X_STR, screws_tilt_adjust_pos[i].x, SP_Y_STR, screws_tilt_adjust_pos[i].y, SP_Z_STR, z_probed_height); + } + + z_measured[i] = z_probed_height; + } + + if (!err_break) { + const float threads_factor[] = { 0.5, 0.7, 0.8 }; + + // Calculate adjusts + LOOP_S_L_N(i, 1, G35_PROBE_COUNT) { + const float diff = z_measured[0] - z_measured[i], + adjust = abs(diff) < 0.001f ? 0 : diff / threads_factor[(screw_thread - 30) / 10]; + + const int full_turns = trunc(adjust); + const float decimal_part = adjust - float(full_turns); + const int minutes = trunc(decimal_part * 60.0f); + + SERIAL_ECHOPAIR("Turn ", tramming_point_name[i], + " ", (screw_thread & 1) == (adjust > 0) ? "Counter-Clockwise" : "Clockwise", + " by ", abs(full_turns), " turns"); + if (minutes) SERIAL_ECHOPAIR(" and ", abs(minutes), " minutes"); + SERIAL_EOL(); + } + } + else + SERIAL_ECHOLNPGM("G35 aborted."); + + // Restore the active tool after homing + #if HAS_MULTI_HOTEND + tool_change(old_tool_index, DISABLED(PARKING_EXTRUDER)); // Fetch previous toolhead if not PARKING_EXTRUDER + #endif + + #if BOTH(HAS_LEVELING, RESTORE_LEVELING_AFTER_G35) + set_bed_leveling_enabled(leveling_was_active); + #endif + + // Stow the probe, as the last call to probe.probe_at_point(...) left + // the probe deployed if it was successful. + probe.stow(); + + // After this operation the Z position needs correction + set_axis_not_trusted(Z_AXIS); + + // Home Z after the alignment procedure + process_subcommands_now_P(PSTR("G28Z")); +} + +#endif // ASSISTED_TRAMMING diff --git a/Marlin/src/gcode/bedlevel/G42.cpp b/Marlin/src/gcode/bedlevel/G42.cpp index 139bd1bb66..a2896ed6c7 100644 --- a/Marlin/src/gcode/bedlevel/G42.cpp +++ b/Marlin/src/gcode/bedlevel/G42.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/bedlevel/M420.cpp b/Marlin/src/gcode/bedlevel/M420.cpp index d042ace8da..d515434171 100644 --- a/Marlin/src/gcode/bedlevel/M420.cpp +++ b/Marlin/src/gcode/bedlevel/M420.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -73,9 +73,7 @@ void GcodeSuite::M420() { #endif GRID_LOOP(x, y) { Z_VALUES(x, y) = 0.001 * random(-200, 200); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y)); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y))); } SERIAL_ECHOPGM("Simulated " STRINGIFY(GRID_MAX_POINTS_X) "x" STRINGIFY(GRID_MAX_POINTS_Y) " mesh "); SERIAL_ECHOPAIR(" (", x_min); @@ -86,12 +84,12 @@ void GcodeSuite::M420() { } #endif + xyz_pos_t oldpos = current_position; + // 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 @@ -155,21 +153,18 @@ void GcodeSuite::M420() { // 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); + GRID_LOOP(x, 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); - } + GRID_LOOP(x, 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; @@ -179,16 +174,11 @@ void GcodeSuite::M420() { 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 + GRID_LOOP(x, y) { + Z_VALUES(x, y) -= zmean; + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y))); + } + TERN_(ABL_BILINEAR_SUBDIVISION, bed_level_virt_interpolate()); } #endif @@ -210,9 +200,7 @@ void GcodeSuite::M420() { 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 + TERN_(ABL_BILINEAR_SUBDIVISION, print_bilinear_leveling_grid_virt()); #elif ENABLED(MESH_BED_LEVELING) SERIAL_ECHOLNPGM("Mesh Bed Level data:"); mbl.report_mesh(); diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index de69545983..f25fe32b07 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -60,7 +60,11 @@ #include "../../../lcd/extui/ui_api.h" #endif -#if HOTENDS > 1 +#if ENABLED(DWIN_CREALITY_LCD) + #include "../../../lcd/dwin/dwin.h" +#endif + +#if HAS_MULTI_HOTEND #include "../../../module/tool_change.h" #endif @@ -78,11 +82,7 @@ #endif #endif -#if ENABLED(G29_RETRY_AND_RECOVER) - #define G29_RETURN(b) return b; -#else - #define G29_RETURN(b) return; -#endif +#define G29_RETURN(b) return TERN_(G29_RETRY_AND_RECOVER, b) /** * G29: Detailed Z probe, probes the bed at 3 or more points. @@ -164,55 +164,34 @@ */ G29_TYPE GcodeSuite::G29() { - #if EITHER(DEBUG_LEVELING_FEATURE, PROBE_MANUALLY) - const bool seenQ = parser.seen('Q'); - #else - constexpr bool seenQ = false; - #endif + reset_stepper_timeout(); + + const bool seenQ = EITHER(DEBUG_LEVELING_FEATURE, PROBE_MANUALLY) && parser.seen('Q'); // 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(); - } + DEBUG_SECTION(log_G29, "G29", DEBUGGING(LEVELING)); + if (DEBUGGING(LEVELING)) log_machine_info(); marlin_debug_flags = old_debug_flags; - #if DISABLED(PROBE_MANUALLY) - if (seenQ) G29_RETURN(false); - #endif + if (DISABLED(PROBE_MANUALLY) && seenQ) G29_RETURN(false); #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 - ; + const bool seenA = TERN0(PROBE_MANUALLY, parser.seen('A')), + no_action = seenA || seenQ, + faux = ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY) ? parser.boolval('C') : no_action; // 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"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> Auto-level not needed, skip"); 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 + #define ABL_VAR TERN_(PROBE_MANUALLY, static) ABL_VAR int verbose_level; ABL_VAR xy_pos_t probePos; @@ -223,7 +202,7 @@ G29_TYPE GcodeSuite::G29() { ABL_VAR int abl_probe_index; #endif - #if HAS_SOFTWARE_ENDSTOPS && ENABLED(PROBE_MANUALLY) + #if BOTH(HAS_SOFTWARE_ENDSTOPS, PROBE_MANUALLY) ABL_VAR bool saved_soft_endstops_state = true; #endif @@ -245,7 +224,7 @@ G29_TYPE GcodeSuite::G29() { #if ENABLED(AUTO_BED_LEVELING_LINEAR) ABL_VAR int abl_points; - #elif ENABLED(PROBE_MANUALLY) // Bilinear + #else int constexpr abl_points = GRID_MAX_POINTS; #endif @@ -283,9 +262,7 @@ G29_TYPE GcodeSuite::G29() { */ if (!g29_in_progress) { - #if HOTENDS > 1 - if (active_extruder != 0) tool_change(0); - #endif + TERN_(HAS_MULTI_HOTEND, if (active_extruder) tool_change(0)); #if EITHER(PROBE_MANUALLY, AUTO_BED_LEVELING_LINEAR) abl_probe_index = -1; @@ -322,12 +299,8 @@ G29_TYPE GcodeSuite::G29() { 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 + TERN_(ABL_BILINEAR_SUBDIVISION, bed_level_virt_interpolate()); + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(i, j, rz)); set_bed_leveling_enabled(abl_should_enable); if (abl_should_enable) report_current_position(); } @@ -352,11 +325,7 @@ G29_TYPE GcodeSuite::G29() { G29_RETURN(false); } - dryrun = parser.boolval('D') - #if ENABLED(PROBE_MANUALLY) - || no_action - #endif - ; + dryrun = parser.boolval('D') || TERN0(PROBE_MANUALLY, no_action); #if ENABLED(AUTO_BED_LEVELING_LINEAR) @@ -436,26 +405,27 @@ G29_TYPE GcodeSuite::G29() { planner.synchronize(); + if (!faux) remember_feedrate_scaling_off(); + // Disable auto bed leveling during G29. // Be formal so G29 can be done successively without G28. if (!no_action) set_bed_leveling_enabled(false); + // Deploy certain probes before starting probing #if HAS_BED_PROBE - // Deploy the probe. Probe will raise if needed. - if (probe.deploy()) { + if (ENABLED(BLTOUCH)) + do_z_clearance(Z_CLEARANCE_DEPLOY_PROBE); + else if (probe.deploy()) { 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) { + if (TERN1(PROBE_MANUALLY, !no_action) + && (gridSpacing != bilinear_grid_spacing || probe_position_lf != bilinear_start) + ) { // Reset grid to 0.0 or "not probed". (Also disables ABL) reset_bed_level(); @@ -492,14 +462,10 @@ G29_TYPE GcodeSuite::G29() { // 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 + TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = saved_soft_endstops_state); set_bed_leveling_enabled(abl_should_enable); g29_in_progress = false; - #if ENABLED(LCD_BED_LEVELING) - ui.wait_for_move = false; - #endif + TERN_(LCD_BED_LEVELING, ui.wait_for_move = false); } // Query G29 status @@ -517,9 +483,7 @@ G29_TYPE GcodeSuite::G29() { 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 + TERN_(HAS_SOFTWARE_ENDSTOPS, saved_soft_endstops_state = soft_endstops_enabled); // Move close to the bed before the first point do_blocking_move_to_z(0); } @@ -551,9 +515,7 @@ G29_TYPE GcodeSuite::G29() { const float newz = measured_z + zoffset; z_values[meshCount.x][meshCount.y] = newz; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(meshCount, newz); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(meshCount, newz)); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR_P(PSTR("Save X"), meshCount.x, SP_Y_STR, meshCount.y, SP_Z_STR, measured_z + zoffset); @@ -574,15 +536,12 @@ G29_TYPE GcodeSuite::G29() { 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); - + const 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 + TERN_(AUTO_BED_LEVELING_LINEAR, indexIntoAB[meshCount.x][meshCount.y] = abl_probe_index); // Keep looping till a reachable point is found if (position_is_reachable(probePos)) break; @@ -592,23 +551,16 @@ G29_TYPE GcodeSuite::G29() { // 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 + // Disable software endstops to allow manual adjustment + // If G29 is not completed, they will not be re-enabled + TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = false); 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 + TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = saved_soft_endstops_state); } #elif ENABLED(AUTO_BED_LEVELING_3POINT) @@ -617,11 +569,9 @@ G29_TYPE GcodeSuite::G29() { 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 + // Disable software endstops to allow manual adjustment + // If G29 is not completed, they will not be re-enabled + TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = false); G29_RETURN(false); } else { @@ -629,9 +579,7 @@ G29_TYPE GcodeSuite::G29() { SERIAL_ECHOLNPGM("3-point probing done."); // Re-enable software endstops, if needed - #if HAS_SOFTWARE_ENDSTOPS - soft_endstops_enabled = saved_soft_endstops_state; - #endif + TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = saved_soft_endstops_state); if (!dryrun) { vector_3 planeNormal = vector_3::cross(points[0] - points[1], points[2] - points[1]).get_normal(); @@ -688,19 +636,13 @@ G29_TYPE GcodeSuite::G29() { probePos = probe_position_lf + gridSpacing * meshCount.asFloat(); - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - indexIntoAB[meshCount.x][meshCount.y] = ++abl_probe_index; // 0... - #endif + TERN_(AUTO_BED_LEVELING_LINEAR, indexIntoAB[meshCount.x][meshCount.y] = ++abl_probe_index); // 0... - #if IS_KINEMATIC - // Avoid probing outside the round or hexagonal area - if (!probe.can_reach(probePos)) continue; - #endif + // Avoid probing outside the round or hexagonal area + if (TERN0(IS_KINEMATIC, !probe.can_reach(probePos))) continue; - 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 + if (verbose_level) SERIAL_ECHOLNPAIR("Probing mesh point ", int(pt_index), "/", abl_points, "."); + TERN_(HAS_DISPLAY, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_MESH), int(pt_index), int(abl_points))); measured_z = faux ? 0.001f * random(-100, 101) : probe.probe_at_point(probePos, raise_after, verbose_level); @@ -712,9 +654,7 @@ G29_TYPE GcodeSuite::G29() { #if ENABLED(PROBE_TEMP_COMPENSATION) temp_comp.compensate_measurement(TSI_BED, thermalManager.degBed(), measured_z); temp_comp.compensate_measurement(TSI_PROBE, thermalManager.degProbe(), measured_z); - #if ENABLED(USE_TEMP_EXT_COMPENSATION) - temp_comp.compensate_measurement(TSI_EXT, thermalManager.degHotend(), measured_z); - #endif + TERN_(USE_TEMP_EXT_COMPENSATION, temp_comp.compensate_measurement(TSI_EXT, thermalManager.degHotend(), measured_z)); #endif #if ENABLED(AUTO_BED_LEVELING_LINEAR) @@ -730,14 +670,12 @@ G29_TYPE GcodeSuite::G29() { #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 + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(meshCount, z_values[meshCount.x][meshCount.y])); #endif abl_should_enable = false; - idle(); + idle_no_sleep(); } // inner } // outer @@ -747,10 +685,8 @@ G29_TYPE GcodeSuite::G29() { // Probe at 3 arbitrary points LOOP_L_N(i, 3) { - 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 + if (verbose_level) SERIAL_ECHOLNPAIR("Probing point ", int(i + 1), "/3."); + TERN_(HAS_DISPLAY, ui.status_printf_P(0, PSTR(S_FMT " %i/3"), GET_TEXT(MSG_PROBING_MESH), int(i + 1))); // Retain the last probe position probePos = points[i]; @@ -773,9 +709,7 @@ G29_TYPE GcodeSuite::G29() { #endif // AUTO_BED_LEVELING_3POINT - #if HAS_DISPLAY - ui.reset_status(); - #endif + TERN_(HAS_DISPLAY, ui.reset_status()); // Stow the probe. No raise for FIX_MOUNTED_PROBE. if (probe.stow()) { @@ -799,9 +733,7 @@ G29_TYPE GcodeSuite::G29() { #if ENABLED(PROBE_MANUALLY) g29_in_progress = false; - #if ENABLED(LCD_BED_LEVELING) - ui.wait_for_move = false; - #endif + TERN_(LCD_BED_LEVELING, ui.wait_for_move = false); #endif // Calculate leveling, print reports, correct the position @@ -813,9 +745,7 @@ G29_TYPE GcodeSuite::G29() { refresh_bed_level(); - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - print_bilinear_leveling_grid_virt(); - #endif + TERN_(ABL_BILINEAR_SUBDIVISION, print_bilinear_leveling_grid_virt()); #elif ENABLED(AUTO_BED_LEVELING_LINEAR) @@ -934,11 +864,7 @@ G29_TYPE GcodeSuite::G29() { // Unapply the offset because it is going to be immediately applied // and cause compensation movement in Z - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - const float fade_scaling_factor = planner.fade_scaling_factor_for_z(current_position.z); - #else - constexpr float fade_scaling_factor = 1.0f; - #endif + const float fade_scaling_factor = TERN(ENABLE_LEVELING_FADE_HEIGHT, planner.fade_scaling_factor_for_z(current_position.z), 1); current_position.z -= fade_scaling_factor * bilinear_z_offset(current_position); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR(" corrected Z:", current_position.z); @@ -956,7 +882,7 @@ G29_TYPE GcodeSuite::G29() { // Sync the planner from the current_position if (planner.leveling_active) sync_plan_position(); - #if HAS_BED_PROBE && defined(Z_AFTER_PROBING) + #if HAS_BED_PROBE probe.move_z_after_probing(); #endif @@ -966,9 +892,11 @@ G29_TYPE GcodeSuite::G29() { process_subcommands_now_P(PSTR(Z_PROBE_END_SCRIPT)); #endif - report_current_position(); + #if ENABLED(DWIN_CREALITY_LCD) + DWIN_CompletedLeveling(); + #endif - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G29"); + report_current_position(); G29_RETURN(isnan(measured_z)); } diff --git a/Marlin/src/gcode/bedlevel/abl/M421.cpp b/Marlin/src/gcode/bedlevel/abl/M421.cpp index 3cd2673d66..182dc32515 100644 --- a/Marlin/src/gcode/bedlevel/abl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/abl/M421.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -36,32 +36,39 @@ #endif /** - * M421: Set a single Mesh Bed Leveling Z coordinate + * M421: Set one or more Mesh Bed Leveling Z coordinates * * Usage: * M421 I J Z * M421 I J Q + * + * - If I is omitted, set the entire row + * - If J is omitted, set the entire column + * - If both I and J are omitted, set all */ 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'); + const bool hasZ = parser.seenval('Z'), + hasQ = !hasZ && parser.seenval('Q'); - if (!hasI || !hasJ || !(hasZ || hasQ)) - SERIAL_ERROR_MSG(STR_ERR_M421_PARAMETERS); - else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) - SERIAL_ERROR_MSG(STR_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 + if (hasZ || hasQ) { + if (WITHIN(ix, -1, GRID_MAX_POINTS_X - 1) && WITHIN(iy, -1, GRID_MAX_POINTS_Y - 1)) { + const float zval = parser.value_linear_units(); + uint8_t sx = ix >= 0 ? ix : 0, ex = ix >= 0 ? ix : GRID_MAX_POINTS_X - 1, + sy = iy >= 0 ? iy : 0, ey = iy >= 0 ? iy : GRID_MAX_POINTS_Y - 1; + LOOP_S_LE_N(x, sx, ex) { + LOOP_S_LE_N(y, sy, ey) { + z_values[x][y] = zval + (hasQ ? z_values[x][y] : 0); + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, z_values[x][y])); + } + } + TERN_(ABL_BILINEAR_SUBDIVISION, bed_level_virt_interpolate()); + } + else + SERIAL_ERROR_MSG(STR_ERR_MESH_XY); } + else + SERIAL_ERROR_MSG(STR_ERR_M421_PARAMETERS); } #endif // AUTO_BED_LEVELING_BILINEAR diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index 6c8fafe23f..68ac459ebb 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -62,9 +62,7 @@ inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_ECHOLNPGM(" void GcodeSuite::G29() { static int mbl_probe_index = -1; - #if HAS_SOFTWARE_ENDSTOPS - static bool saved_soft_endstops_state; - #endif + TERN_(HAS_SOFTWARE_ENDSTOPS, static bool saved_soft_endstops_state); MeshLevelingState state = (MeshLevelingState)parser.byteval('S', (int8_t)MeshReport); if (!WITHIN(state, 0, 5)) { @@ -111,9 +109,7 @@ void GcodeSuite::G29() { 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 + TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = saved_soft_endstops_state); } // If there's another point to sample, move there with optional lift. if (mbl_probe_index < GRID_MAX_POINTS) { @@ -147,9 +143,7 @@ void GcodeSuite::G29() { planner.synchronize(); #endif - #if ENABLED(LCD_BED_LEVELING) - ui.wait_for_move = false; - #endif + TERN_(LCD_BED_LEVELING, ui.wait_for_move = false); } break; @@ -178,9 +172,7 @@ void GcodeSuite::G29() { 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 + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, mbl.z_values[ix][iy])); } else return echo_not_entered('Z'); diff --git a/Marlin/src/gcode/bedlevel/mbl/M421.cpp b/Marlin/src/gcode/bedlevel/mbl/M421.cpp index 3997e5ad59..1368ab0bef 100644 --- a/Marlin/src/gcode/bedlevel/mbl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/M421.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/bedlevel/ubl/G29.cpp b/Marlin/src/gcode/bedlevel/ubl/G29.cpp index 7b42e6dddf..2ef3ab4cec 100644 --- a/Marlin/src/gcode/bedlevel/ubl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/ubl/G29.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/bedlevel/ubl/M421.cpp b/Marlin/src/gcode/bedlevel/ubl/M421.cpp index bd65c21ad3..600c1fc8ba 100644 --- a/Marlin/src/gcode/bedlevel/ubl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/ubl/M421.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -63,9 +63,7 @@ void GcodeSuite::M421() { 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 + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ij.x, ij.y, zval)); } } diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index fafce9a896..1fbb3dd353 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -27,7 +27,7 @@ #include "../../module/stepper.h" #include "../../module/endstops.h" -#if HOTENDS > 1 +#if HAS_MULTI_HOTEND #include "../../module/tool_change.h" #endif @@ -46,11 +46,18 @@ #endif #include "../../lcd/ultralcd.h" +#if ENABLED(DWIN_CREALITY_LCD) + #include "../../lcd/dwin/dwin.h" +#endif #if HAS_L64XX // set L6470 absolute position registers to counts #include "../../libs/L64XX/L64XX_Marlin.h" #endif +#if ENABLED(LASER_MOVE_G28_OFF) + #include "../../feature/spindle_laser.h" +#endif + #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../core/debug_out.h" @@ -108,15 +115,10 @@ #if ENABLED(Z_SAFE_HOMING) inline void home_z_safely() { + DEBUG_SECTION(log_G28, "home_z_safely", DEBUGGING(LEVELING)); - // 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(STR_ERR_Z_HOMING_SER); - return; - } - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("home_z_safely >>>"); + // Disallow Z homing if X or Y homing is needed + if (axis_unhomed_error(_BV(X_AXIS) | _BV(Y_AXIS))) return; sync_plan_position(); @@ -126,22 +128,16 @@ */ destination.set(safe_homing_xy, current_position.z); - #if HOMING_Z_WITH_PROBE - destination -= probe.offset_xy; - #endif + TERN_(HOMING_Z_WITH_PROBE, destination -= probe.offset_xy); 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 + TERN_(DUAL_X_CARRIAGE, active_extruder_parked = false); - #if ENABLED(SENSORLESS_HOMING) - safe_delay(500); // Short delay needed to settle - #endif + TERN_(SENSORLESS_HOMING, safe_delay(500)); // Short delay needed to settle do_blocking_move_to_xy(destination); homeaxis(Z_AXIS); @@ -150,8 +146,6 @@ LCD_MESSAGEPGM(MSG_ZPROBE_OUT); SERIAL_ECHO_MSG(STR_ZPROBE_OUT_SER); } - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< home_z_safely"); } #endif // Z_SAFE_HOMING @@ -175,9 +169,7 @@ 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 + TERN_(HAS_CLASSIC_JERK, planner.max_jerk = slow_homing.jerk_xy); planner.reset_acceleration_rates(); } @@ -203,10 +195,12 @@ * */ void GcodeSuite::G28() { - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPGM(">>> G28"); - log_machine_info(); - } + DEBUG_SECTION(log_G28, "G28", DEBUGGING(LEVELING)); + if (DEBUGGING(LEVELING)) log_machine_info(); + + TERN_(LASER_MOVE_G28_OFF, cutter.set_inline_enabled(false)); // turn off laser + + TERN_(DWIN_CREALITY_LCD, HMI_flag.home_flag = true); #if ENABLED(DUAL_X_CARRIAGE) bool IDEX_saved_duplication_state = extruder_duplication_enabled; @@ -219,14 +213,13 @@ void GcodeSuite::G28() { 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"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> homing not needed, skip"); return; } @@ -237,22 +230,21 @@ void GcodeSuite::G28() { #if HAS_LEVELING // Cancel the active G29 session - #if ENABLED(PROBE_MANUALLY) - g29_in_progress = false; - #endif + TERN_(PROBE_MANUALLY, g29_in_progress = false); - #if ENABLED(RESTORE_LEVELING_AFTER_G28) - const bool leveling_was_active = planner.leveling_active; - #endif + TERN_(RESTORE_LEVELING_AFTER_G28, const bool leveling_was_active = planner.leveling_active); set_bed_leveling_enabled(false); #endif - #if ENABLED(CNC_WORKSPACE_PLANES) - workspace_plane = PLANE_XY; - #endif + TERN_(CNC_WORKSPACE_PLANES, workspace_plane = PLANE_XY); + + // Count this command as movement / activity + reset_stepper_timeout(); #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_CURRENT_HOME(X) || HAS_CURRENT_HOME(X2) || HAS_CURRENT_HOME(Y) || HAS_CURRENT_HOME(Y2) + #define HAS_HOMING_CURRENT 1 + #endif #if HAS_HOMING_CURRENT auto debug_current = [](PGM_P const s, const int16_t a, const int16_t b){ @@ -280,21 +272,17 @@ void GcodeSuite::G28() { #endif #endif - #if ENABLED(IMPROVE_HOMING_RELIABILITY) - slow_homing_t slow_homing = begin_slow_homing(); - #endif + TERN_(IMPROVE_HOMING_RELIABILITY, slow_homing_t slow_homing = begin_slow_homing()); // Always home with tool 0 active - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND #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 + TERN_(HAS_DUPLICATION_MODE, extruder_duplication_enabled = false); remember_feedrate_scaling_off(); @@ -306,18 +294,17 @@ void GcodeSuite::G28() { home_delta(); - #if ENABLED(IMPROVE_HOMING_RELIABILITY) - end_slow_homing(slow_homing); - #endif + TERN_(IMPROVE_HOMING_RELIABILITY, end_slow_homing(slow_homing)); #else // NOT DELTA - const bool homeX = parser.seen('X'), homeY = parser.seen('Y'), homeZ = parser.seen('Z'), + const bool homeZ = parser.seen('Z'), + needX = homeZ && TERN0(Z_SAFE_HOMING, axes_need_homing(_BV(X_AXIS))), + needY = homeZ && TERN0(Z_SAFE_HOMING, axes_need_homing(_BV(Y_AXIS))), + homeX = needX || parser.seen('X'), homeY = needY || parser.seen('Y'), home_all = homeX == homeY && homeX == homeZ, // All or None 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); @@ -325,17 +312,14 @@ void GcodeSuite::G28() { #endif const float z_homing_height = - (DISABLED(UNKNOWN_Z_NO_RAISE) || TEST(axis_known_position, Z_AXIS)) - ? (parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT) - : 0; + ENABLED(UNKNOWN_Z_NO_RAISE) && TEST(axis_known_position, Z_AXIS) + ? 0 + : (parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT); - if (z_homing_height && (doX || doY)) { + if (z_homing_height && (doX || doY || (ENABLED(Z_SAFE_HOMING) && doZ))) { // 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 (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Raise Z (before homing) by ", z_homing_height); + do_z_clearance(z_homing_height, TEST(axis_known_position, Z_AXIS), DISABLED(UNKNOWN_Z_NO_RAISE)); } #if ENABLED(QUICK_HOME) @@ -380,32 +364,17 @@ void GcodeSuite::G28() { if (DISABLED(HOME_Y_BEFORE_X) && doY) homeaxis(Y_AXIS); - #if ENABLED(IMPROVE_HOMING_RELIABILITY) - end_slow_homing(slow_homing); - #endif + TERN_(IMPROVE_HOMING_RELIABILITY, end_slow_homing(slow_homing)); // 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 + TERN_(BLTOUCH, bltouch.init()); - #if HOMING_Z_WITH_PROBE && defined(Z_AFTER_PROBING) - #if Z_AFTER_HOMING > Z_AFTER_PROBING - do_blocking_move_to_z(Z_AFTER_HOMING); - #else - probe.move_z_after_probing(); - #endif - #elif defined(Z_AFTER_HOMING) - do_blocking_move_to_z(Z_AFTER_HOMING); - #endif + TERN(Z_SAFE_HOMING, home_z_safely(), homeaxis(Z_AXIS)); + + probe.move_z_after_homing(); } // doZ @@ -425,9 +394,7 @@ void GcodeSuite::G28() { if (dxc_is_duplicating()) { - #if ENABLED(IMPROVE_HOMING_RELIABILITY) - slow_homing = begin_slow_homing(); - #endif + TERN_(IMPROVE_HOMING_RELIABILITY, slow_homing = begin_slow_homing()); // Always home the 2nd (right) extruder first active_extruder = 1; @@ -448,9 +415,7 @@ void GcodeSuite::G28() { dual_x_carriage_mode = IDEX_saved_mode; stepper.set_directions(); - #if ENABLED(IMPROVE_HOMING_RELIABILITY) - end_slow_homing(slow_homing); - #endif + TERN_(IMPROVE_HOMING_RELIABILITY, end_slow_homing(slow_homing)); } #endif // DUAL_X_CARRIAGE @@ -458,23 +423,19 @@ void GcodeSuite::G28() { endstops.not_homing(); // Clear endstop state for polled stallGuard endstops - #if ENABLED(SPI_ENDSTOPS) - endstops.clear_endstop_state(); - #endif + TERN_(SPI_ENDSTOPS, endstops.clear_endstop_state()); #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 ENABLED(RESTORE_LEVELING_AFTER_G28) - set_bed_leveling_enabled(leveling_was_active); - #endif + TERN_(RESTORE_LEVELING_AFTER_G28, set_bed_leveling_enabled(leveling_was_active)); restore_feedrate_and_scaling(); // Restore the active tool after homing - #if HOTENDS > 1 && (DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE)) + #if HAS_MULTI_HOTEND && (DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE)) tool_change(old_tool_index, NONE(PARKING_EXTRUDER, DUAL_X_CARRIAGE)); // Do move if one of these #endif @@ -496,13 +457,13 @@ void GcodeSuite::G28() { ui.refresh(); + TERN_(DWIN_CREALITY_LCD, DWIN_CompletedHoming()); + report_current_position(); if (ENABLED(NANODLP_Z_SYNC) && (doZ || ENABLED(NANODLP_ALL_AXIS))) SERIAL_ECHOLNPGM(STR_Z_MOVE_COMP); - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G28"); - #if HAS_L64XX // Set L6470 absolute position registers to counts // constexpr *might* move this to PROGMEM. diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index ac2cdf7d4d..53af04d528 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -35,7 +35,7 @@ #include "../../module/probe.h" #endif -#if HOTENDS > 1 +#if HAS_MULTI_HOTEND #include "../../module/tool_change.h" #endif @@ -63,12 +63,7 @@ enum CalEnum : char { // the 7 main calibration points - #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 +TERN_(HAS_MULTI_HOTEND, const uint8_t old_tool_index = active_extruder); float lcd_probe_pt(const xy_pos_t &xy); @@ -79,9 +74,7 @@ void ac_home() { } void ac_setup(const bool reset_bed) { - #if HOTENDS > 1 - tool_change(0, true); - #endif + TERN_(HAS_MULTI_HOTEND, tool_change(0, true)); planner.synchronize(); remember_feedrate_scaling_off(); @@ -91,21 +84,11 @@ void ac_setup(const bool reset_bed) { #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 - probe.stow(); - #endif +void ac_cleanup(TERN_(HAS_MULTI_HOTEND, const uint8_t old_tool_index)) { + TERN_(DELTA_HOME_TO_SAFE_ZONE, do_blocking_move_to_z(delta_clip_start_height)); + TERN_(HAS_BED_PROBE, probe.stow()); restore_feedrate_and_scaling(); - #if HOTENDS > 1 - tool_change(old_tool_index, true); - #endif + TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index, true)); } void print_signed_float(PGM_P const prefix, const float &f) { @@ -465,7 +448,7 @@ void GcodeSuite::G33() { } // Report settings - PGM_P checkingac = PSTR("Checking... AC"); + PGM_P const checkingac = PSTR("Checking... AC"); serialprintPGM(checkingac); if (verbose_level == 0) SERIAL_ECHOPGM(" (DRY-RUN)"); SERIAL_EOL(); @@ -488,7 +471,7 @@ void GcodeSuite::G33() { 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(); + return ac_cleanup(TERN_(HAS_MULTI_HOTEND, old_tool_index)); } zero_std_dev = std_dev_points(z_at_pt, _0p_calibration, _1p_calibration, _4p_calibration, _4p_opposite_points); @@ -641,7 +624,7 @@ void GcodeSuite::G33() { } } else { // dry run - PGM_P enddryrun = PSTR("End DRY-RUN"); + PGM_P const enddryrun = PSTR("End DRY-RUN"); serialprintPGM(enddryrun); SERIAL_ECHO_SP(35); SERIAL_ECHOLNPAIR_F("std dev:", zero_std_dev, 3); @@ -659,7 +642,7 @@ void GcodeSuite::G33() { } while (((zero_std_dev < test_precision && iterations < 31) || iterations <= force_iterations) && zero_std_dev > calibration_precision); - AC_CLEANUP(); + ac_cleanup(TERN_(HAS_MULTI_HOTEND, old_tool_index)); } #endif // DELTA_AUTO_CALIBRATION diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index d1b828d079..3360dc050f 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -32,7 +32,7 @@ #include "../../module/motion.h" #include "../../module/probe.h" -#if HOTENDS > 1 +#if HAS_MULTI_HOTEND #include "../../module/tool_change.h" #endif @@ -47,17 +47,6 @@ #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../core/debug_out.h" -inline void set_all_z_lock(const bool lock) { - stepper.set_z_lock(lock); - stepper.set_z2_lock(lock); - #if NUM_Z_STEPPER_DRIVERS >= 3 - stepper.set_z3_lock(lock); - #if NUM_Z_STEPPER_DRIVERS >= 4 - stepper.set_z4_lock(lock); - #endif - #endif -} - /** * G34: Z-Stepper automatic alignment * @@ -67,10 +56,8 @@ inline void set_all_z_lock(const bool lock) { * R points based on current probe offsets */ void GcodeSuite::G34() { - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPGM(">>> G34"); - log_machine_info(); - } + DEBUG_SECTION(log_G34, "G34", DEBUGGING(LEVELING)); + if (DEBUGGING(LEVELING)) log_machine_info(); do { // break out on error @@ -113,34 +100,24 @@ void GcodeSuite::G34() { // 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 + TERN_(RESTORE_LEVELING_AFTER_G34, const bool leveling_was_active = planner.leveling_active); set_bed_leveling_enabled(false); #endif - #if ENABLED(CNC_WORKSPACE_PLANES) - workspace_plane = PLANE_XY; - #endif + TERN_(CNC_WORKSPACE_PLANES, workspace_plane = PLANE_XY); // Always home with tool 0 active - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND const uint8_t old_tool_index = active_extruder; tool_change(0, true); #endif - #if HAS_DUPLICATION_MODE - extruder_duplication_enabled = false; - #endif + TERN_(HAS_DUPLICATION_MODE, extruder_duplication_enabled = false); - #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 + // 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 * BOTH(BLTOUCH, BLTOUCH_HS_MODE) // Compute a worst-case clearance height to probe from. After the first // iteration this will be re-calculated based on the actual bed position @@ -315,11 +292,14 @@ void GcodeSuite::G34() { // Check for less accuracy compared to last move if (last_z_align_move[zstepper] < z_align_abs * 0.7f) { SERIAL_ECHOLNPGM("Decreasing accuracy detected."); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " last_z_align_move = ", last_z_align_move[zstepper]); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " z_align_abs = ", z_align_abs); adjustment_reverse = !adjustment_reverse; } - // Remember the alignment for the next iteration - last_z_align_move[zstepper] = z_align_abs; + // Remember the alignment for the next iteration, but only if steppers move, + // otherwise it would be just zero (in case this stepper was at z_measured_min already) + if (z_align_abs > 0) last_z_align_move[zstepper] = z_align_abs; #endif // Stop early if all measured points achieve accuracy target @@ -328,23 +308,15 @@ void GcodeSuite::G34() { 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 NUM_Z_STEPPER_DRIVERS >= 3 - case 2: stepper.set_z3_lock(false); break; - #endif - #if NUM_Z_STEPPER_DRIVERS == 4 - case 3: stepper.set_z4_lock(false); break; - #endif - } + stepper.set_all_z_lock(true, zstepper); #if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) // Decreasing accuracy was detected so move was inverted. // Will match reversed Z steppers on dual steppers. Triple will need more work to map. - if (adjustment_reverse) + if (adjustment_reverse) { z_align_move = -z_align_move; + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " correction reversed to ", z_align_move); + } #endif // Do a move to correct part of the misalignment for the current stepper @@ -352,7 +324,7 @@ void GcodeSuite::G34() { } // for (zstepper) // Back to normal stepper operations - set_all_z_lock(false); + stepper.set_all_z_lock(false); stepper.set_separate_multi_axis(false); if (err_break) break; @@ -386,17 +358,13 @@ void GcodeSuite::G34() { #endif // Restore the active tool after homing - #if HOTENDS > 1 - tool_change(old_tool_index, DISABLED(PARKING_EXTRUDER)); // Fetch previous tool for parking extruder - #endif + TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index, DISABLED(PARKING_EXTRUDER))); // Fetch previous tool for parking extruder - #if HAS_LEVELING && ENABLED(RESTORE_LEVELING_AFTER_G34) + #if BOTH(HAS_LEVELING, RESTORE_LEVELING_AFTER_G34) set_bed_leveling_enabled(leveling_was_active); #endif }while(0); - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G34"); } /** diff --git a/Marlin/src/gcode/calibrate/G425.cpp b/Marlin/src/gcode/calibrate/G425.cpp index 42c56fe51d..0ef23d28f9 100644 --- a/Marlin/src/gcode/calibrate/G425.cpp +++ b/Marlin/src/gcode/calibrate/G425.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -51,7 +51,6 @@ #undef CALIBRATION_MEASURE_AT_TOP_EDGES #endif - /** * G425 backs away from the calibration object by various distances * depending on the confidence level: @@ -93,8 +92,6 @@ struct measurements_t { 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 @@ -127,7 +124,7 @@ inline void park_above_object(measurements_t &m, const float uncertainty) { calibration_move(); } -#if HOTENDS > 1 +#if HAS_MULTI_HOTEND inline void set_nozzle(measurements_t &m, const uint8_t extruder) { if (extruder != active_extruder) { park_above_object(m, CALIBRATION_MEASUREMENT_UNKNOWN); @@ -256,7 +253,7 @@ inline void probe_side(measurements_t &m, const float uncertainty, const side_t #endif } - if (AXIS_CAN_CALIBRATE(X) && axis == X_AXIS || AXIS_CAN_CALIBRATE(Y) && axis == Y_AXIS) { + if ((AXIS_CAN_CALIBRATE(X) && axis == X_AXIS) || (AXIS_CAN_CALIBRATE(Y) && axis == Y_AXIS)) { // 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(); @@ -286,37 +283,19 @@ inline void probe_sides(measurements_t &m, const float uncertainty) { probe_side(m, uncertainty, TOP); #endif - #if ENABLED(CALIBRATION_MEASURE_RIGHT) - probe_side(m, uncertainty, RIGHT, probe_top_at_edge); - #endif - - #if ENABLED(CALIBRATION_MEASURE_FRONT) - probe_side(m, uncertainty, FRONT, probe_top_at_edge); - #endif - - #if ENABLED(CALIBRATION_MEASURE_LEFT) - probe_side(m, uncertainty, LEFT, probe_top_at_edge); - #endif - #if ENABLED(CALIBRATION_MEASURE_BACK) - probe_side(m, uncertainty, BACK, probe_top_at_edge); - #endif + TERN_(CALIBRATION_MEASURE_RIGHT, probe_side(m, uncertainty, RIGHT, probe_top_at_edge)); + TERN_(CALIBRATION_MEASURE_FRONT, probe_side(m, uncertainty, FRONT, probe_top_at_edge)); + TERN_(CALIBRATION_MEASURE_LEFT, probe_side(m, uncertainty, LEFT, probe_top_at_edge)); + TERN_(CALIBRATION_MEASURE_BACK, probe_side(m, uncertainty, BACK, probe_top_at_edge)); // 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 + TERN_(HAS_X_CENTER, m.obj_center.x = (m.obj_side[LEFT] + m.obj_side[RIGHT]) / 2); + TERN_(HAS_Y_CENTER, m.obj_center.y = (m.obj_side[FRONT] + m.obj_side[BACK]) / 2); // 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 + TERN_(HAS_X_CENTER, m.nozzle_outer_dimension.x = m.obj_side[RIGHT] - m.obj_side[LEFT] - dimensions.x); + TERN_(HAS_Y_CENTER, m.nozzle_outer_dimension.y = m.obj_side[BACK] - m.obj_side[FRONT] - dimensions.y); park_above_object(m, uncertainty); @@ -506,7 +485,7 @@ inline void calibrate_toolhead(measurements_t &m, const float uncertainty, const TEMPORARY_BACKLASH_CORRECTION(all_on); TEMPORARY_BACKLASH_SMOOTHING(0.0f); - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND set_nozzle(m, extruder); #else UNUSED(extruder); @@ -545,13 +524,9 @@ inline void calibrate_all_toolheads(measurements_t &m, const float uncertainty) HOTEND_LOOP() calibrate_toolhead(m, uncertainty, e); - #if HAS_HOTEND_OFFSET - normalize_hotend_offsets(); - #endif + TERN_(HAS_HOTEND_OFFSET, normalize_hotend_offsets()); - #if HOTENDS > 1 - set_nozzle(m, 0); - #endif + TERN_(HAS_MULTI_HOTEND, set_nozzle(m, 0)); } /** @@ -568,9 +543,7 @@ inline void calibrate_all_toolheads(measurements_t &m, const float uncertainty) inline void calibrate_all() { measurements_t m; - #if HAS_HOTEND_OFFSET - reset_hotend_offsets(); - #endif + TERN_(HAS_HOTEND_OFFSET, reset_hotend_offsets()); TEMPORARY_BACKLASH_CORRECTION(all_on); TEMPORARY_BACKLASH_SMOOTHING(0.0f); @@ -578,12 +551,10 @@ inline void calibrate_all() { // 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 + TERN_(BACKLASH_GCODE, calibrate_backlash(m, CALIBRATION_MEASUREMENT_UNCERTAIN)); // Cycle the toolheads so the servos settle into their "natural" positions - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND HOTEND_LOOP() set_nozzle(m, e); #endif @@ -605,6 +576,11 @@ inline void calibrate_all() { * no args - Perform entire calibration sequence (backlash + position on all toolheads) */ void GcodeSuite::G425() { + + #ifdef CALIBRATION_SCRIPT_PRE + GcodeSuite::process_subcommands_now_P(PSTR(CALIBRATION_SCRIPT_PRE)); + #endif + TEMPORARY_SOFT_ENDSTOP_STATE(false); TEMPORARY_BED_LEVELING_STATE(false); @@ -635,6 +611,10 @@ void GcodeSuite::G425() { #endif else calibrate_all(); + + #ifdef CALIBRATION_SCRIPT_POST + GcodeSuite::process_subcommands_now_P(PSTR(CALIBRATION_SCRIPT_POST)); + #endif } #endif // CALIBRATION_GCODE diff --git a/Marlin/src/gcode/calibrate/G76_M871.cpp b/Marlin/src/gcode/calibrate/G76_M871.cpp index c878f83a17..f2f53d213d 100644 --- a/Marlin/src/gcode/calibrate/G76_M871.cpp +++ b/Marlin/src/gcode/calibrate/G76_M871.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -103,13 +103,19 @@ void GcodeSuite::G76() { return false; }; - auto g76_probe = [](const xy_pos_t &xypos) { - do_blocking_move_to_z(5.0); // Raise nozzle before probing - const float measured_z = probe.probe_at_point(xypos, PROBE_PT_NONE, 0, false); // verbose=0, probe_relative=false + auto g76_probe = [](const TempSensorID sid, uint16_t &targ, const xy_pos_t &nozpos) { + do_z_clearance(5.0); // Raise nozzle before probing + const float measured_z = probe.probe_at_point(nozpos, PROBE_PT_STOW, 0, false); // verbose=0, probe_relative=false if (isnan(measured_z)) SERIAL_ECHOLNPGM("!Received NAN. Aborting."); - else + else { SERIAL_ECHOLNPAIR_F("Measured: ", measured_z); + if (targ == cali_info_init[sid].start_temp) + temp_comp.prepare_new_calibration(measured_z); + else + temp_comp.push_back_new_measurement(sid, measured_z); + targ += cali_info_init[sid].temp_res; + } return measured_z; }; @@ -125,8 +131,9 @@ void GcodeSuite::G76() { // Synchronize with planner planner.synchronize(); - const xyz_pos_t parkpos = { temp_comp.park_point_x, temp_comp.park_point_y, temp_comp.park_point_z }; - const xy_pos_t ppos = { temp_comp.measure_point_x, temp_comp.measure_point_y }; + const xyz_pos_t parkpos = temp_comp.park_point, + probe_pos_xyz = xyz_pos_t(temp_comp.measure_point) + xyz_pos_t({ 0.0f, 0.0f, PTC_PROBE_HEATING_OFFSET }), + noz_pos_xyz = probe_pos_xyz - xy_pos_t(probe.offset_xy); // Nozzle position based on probe position if (do_bed_cal || do_probe_cal) { // Ensure park position is reachable @@ -135,7 +142,7 @@ void GcodeSuite::G76() { SERIAL_ECHOLNPGM("!Park"); else { // Ensure probe position is reachable - reachable = probe.can_reach(ppos); + reachable = probe.can_reach(probe_pos_xyz); if (!reachable) SERIAL_ECHOLNPGM("!Probe"); } @@ -149,8 +156,6 @@ void GcodeSuite::G76() { remember_feedrate_scaling_off(); - // Nozzle position based on probe position - const xy_pos_t noz_pos = ppos - probe.offset_xy; /****************************************** * Calibrate bed temperature offsets @@ -159,9 +164,13 @@ void GcodeSuite::G76() { // Report temperatures every second and handle heating timeouts millis_t next_temp_report = millis() + 1000; + auto report_targets = [&](const uint16_t tb, const uint16_t tp) { + SERIAL_ECHOLNPAIR("Target Bed:", tb, " Probe:", tp); + }; + if (do_bed_cal) { - uint16_t target_bed = temp_comp.cali_info_init[TSI_BED].start_temp, + uint16_t target_bed = cali_info_init[TSI_BED].start_temp, target_probe = temp_comp.bed_calib_probe_temp; SERIAL_ECHOLNPGM("Waiting for cooling."); @@ -169,40 +178,30 @@ void GcodeSuite::G76() { report_temps(next_temp_report); // Disable leveling so it won't mess with us - #if HAS_LEVELING - set_bed_leveling_enabled(false); - #endif + TERN_(HAS_LEVELING, set_bed_leveling_enabled(false)); for (;;) { thermalManager.setTargetBed(target_bed); - SERIAL_ECHOLNPAIR("Target Bed:", target_bed, " Probe:", target_probe); + report_targets(target_bed, target_probe); // Park nozzle do_blocking_move_to(parkpos); // Wait for heatbed to reach target temp and probe to cool below target temp - if (wait_for_temps(target_bed, target_probe, next_temp_report, millis() + 900UL * 1000UL)) { + if (wait_for_temps(target_bed, target_probe, next_temp_report, millis() + MIN_TO_MS(15))) { SERIAL_ECHOLNPGM("!Bed heating timeout."); break; } // Move the nozzle to the probing point and wait for the probe to reach target temp - do_blocking_move_to_xy(noz_pos); + do_blocking_move_to(noz_pos_xyz); SERIAL_ECHOLNPGM("Waiting for probe heating."); while (thermalManager.degProbe() < target_probe) report_temps(next_temp_report); - const float measured_z = g76_probe(noz_pos); - if (isnan(measured_z)) break; - - if (target_bed == temp_comp.cali_info_init[TSI_BED].start_temp) - temp_comp.prepare_new_calibration(measured_z); - else - temp_comp.push_back_new_measurement(TSI_BED, measured_z); - - target_bed += temp_comp.cali_info_init[TSI_BED].temp_res; - if (target_bed > temp_comp.max_bed_temp) break; + const float measured_z = g76_probe(TSI_BED, target_bed, noz_pos_xyz); + if (isnan(measured_z) || target_bed > BED_MAX_TARGET) break; } SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index()); @@ -213,9 +212,7 @@ void GcodeSuite::G76() { // Cleanup thermalManager.setTargetBed(0); - #if HAS_LEVELING - set_bed_leveling_enabled(true); - #endif + TERN_(HAS_LEVELING, set_bed_leveling_enabled(true)); } // do_bed_cal /******************************************** @@ -231,20 +228,20 @@ void GcodeSuite::G76() { const uint16_t target_bed = temp_comp.probe_calib_bed_temp; thermalManager.setTargetBed(target_bed); - uint16_t target_probe = temp_comp.cali_info_init[TSI_PROBE].start_temp; + uint16_t target_probe = cali_info_init[TSI_PROBE].start_temp; + + report_targets(target_bed, target_probe); // Wait for heatbed to reach target temp and probe to cool below target temp wait_for_temps(target_bed, target_probe, next_temp_report); // Disable leveling so it won't mess with us - #if HAS_LEVELING - set_bed_leveling_enabled(false); - #endif + TERN_(HAS_LEVELING, set_bed_leveling_enabled(false)); bool timeout = false; for (;;) { // Move probe to probing point and wait for it to reach target temperature - do_blocking_move_to_xy(noz_pos); + do_blocking_move_to(noz_pos_xyz); SERIAL_ECHOLNPAIR("Waiting for probe heating. Bed:", target_bed, " Probe:", target_probe); const millis_t probe_timeout_ms = millis() + 900UL * 1000UL; @@ -257,16 +254,8 @@ void GcodeSuite::G76() { } if (timeout) break; - const float measured_z = g76_probe(noz_pos); - if (isnan(measured_z)) break; - - if (target_probe == temp_comp.cali_info_init[TSI_PROBE].start_temp) - temp_comp.prepare_new_calibration(measured_z); - else - temp_comp.push_back_new_measurement(TSI_PROBE, measured_z); - - target_probe += temp_comp.cali_info_init[TSI_PROBE].temp_res; - if (target_probe > temp_comp.cali_info_init[TSI_PROBE].end_temp) break; + const float measured_z = g76_probe(TSI_PROBE, target_probe, noz_pos_xyz); + if (isnan(measured_z) || target_probe > cali_info_init[TSI_PROBE].end_temp) break; } SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index()); @@ -278,9 +267,7 @@ void GcodeSuite::G76() { // Cleanup thermalManager.setTargetBed(0); - #if HAS_LEVELING - set_bed_leveling_enabled(true); - #endif + TERN_(HAS_LEVELING, set_bed_leveling_enabled(true)); SERIAL_ECHOLNPGM("Final compensation values:"); temp_comp.print_offsets(); diff --git a/Marlin/src/gcode/calibrate/M100.cpp b/Marlin/src/gcode/calibrate/M100.cpp index 6b8a0de528..ea054125b7 100644 --- a/Marlin/src/gcode/calibrate/M100.cpp +++ b/Marlin/src/gcode/calibrate/M100.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -116,13 +116,18 @@ // 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() { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-local-addr" + +// Location of a variable in its stack frame. +// The returned address will be above the stack (after it returns). +char *top_of_stack() { char x; return &x + 1; // x is pulled on return; } +#pragma GCC diagnostic pop + // 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++) diff --git a/Marlin/src/gcode/calibrate/M12.cpp b/Marlin/src/gcode/calibrate/M12.cpp index 26f15bb892..da24454375 100644 --- a/Marlin/src/gcode/calibrate/M12.cpp +++ b/Marlin/src/gcode/calibrate/M12.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include "../../inc/MarlinConfigPre.h" @@ -28,9 +28,12 @@ #include "../../feature/closedloop.h" void GcodeSuite::M12() { + planner.synchronize(); + if (parser.seenval('S')) - set_closedloop(parser.value_int()); // Force a CLC set + closedloop.set(parser.value_int()); // Force a CLC set + } #endif diff --git a/Marlin/src/gcode/calibrate/M425.cpp b/Marlin/src/gcode/calibrate/M425.cpp index 980152a4b1..3e54186a5f 100644 --- a/Marlin/src/gcode/calibrate/M425.cpp +++ b/Marlin/src/gcode/calibrate/M425.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -46,8 +46,17 @@ void GcodeSuite::M425() { bool noArgs = true; + auto axis_can_calibrate = [](const uint8_t a) { + switch (a) { + default: + case X_AXIS: return AXIS_CAN_CALIBRATE(X); + case Y_AXIS: return AXIS_CAN_CALIBRATE(Y); + case Z_AXIS: return AXIS_CAN_CALIBRATE(Z); + } + }; + LOOP_XYZ(a) { - if (CAN_CALIBRATE(a) && parser.seen(XYZ_CHAR(a))) { + if (AXIS_CAN_CALIBRATE(a) && parser.seen(XYZ_CHAR(a))) { planner.synchronize(); backlash.distance_mm[a] = parser.has_value() ? parser.value_linear_units() : backlash.get_measurement(AxisEnum(a)); noArgs = false; @@ -74,7 +83,7 @@ void GcodeSuite::M425() { 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) if (CAN_CALIBRATE(a)) { + LOOP_XYZ(a) if (axis_can_calibrate(a)) { SERIAL_CHAR(' ', XYZ_CHAR(a)); SERIAL_ECHO(backlash.distance_mm[a]); SERIAL_EOL(); @@ -87,7 +96,7 @@ void GcodeSuite::M425() { #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) SERIAL_ECHOPGM(" Average measured backlash (mm):"); if (backlash.has_any_measurement()) { - LOOP_XYZ(a) if (CAN_CALIBRATE(a) && backlash.has_measurement(AxisEnum(a))) { + LOOP_XYZ(a) if (axis_can_calibrate(a) && backlash.has_measurement(AxisEnum(a))) { SERIAL_CHAR(' ', XYZ_CHAR(a)); SERIAL_ECHO(backlash.get_measurement(AxisEnum(a))); } diff --git a/Marlin/src/gcode/calibrate/M48.cpp b/Marlin/src/gcode/calibrate/M48.cpp index c1e8b0e9f8..47c72eece7 100644 --- a/Marlin/src/gcode/calibrate/M48.cpp +++ b/Marlin/src/gcode/calibrate/M48.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -263,9 +263,7 @@ void GcodeSuite::M48() { restore_feedrate_and_scaling(); // Re-enable bed level correction if it had been on - #if HAS_LEVELING - set_bed_leveling_enabled(was_enabled); - #endif + TERN_(HAS_LEVELING, set_bed_leveling_enabled(was_enabled)); report_current_position(); } diff --git a/Marlin/src/gcode/calibrate/M665.cpp b/Marlin/src/gcode/calibrate/M665.cpp index 0436736b4a..557204cc11 100644 --- a/Marlin/src/gcode/calibrate/M665.cpp +++ b/Marlin/src/gcode/calibrate/M665.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -38,8 +38,11 @@ * R = delta radius * S = segments per second * X = Alpha (Tower 1) angle trim - * Y = Beta (Tower 2) angle trim + * Y = Beta (Tower 2) angle trim * Z = Gamma (Tower 3) angle trim + * A = Alpha (Tower 1) digonal rod trim + * B = Beta (Tower 2) digonal rod trim + * C = Gamma (Tower 3) digonal rod trim */ void GcodeSuite::M665() { if (parser.seen('H')) delta_height = parser.value_linear_units(); @@ -49,6 +52,9 @@ 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(); + if (parser.seen('A')) delta_diagonal_rod_trim.a = parser.value_float(); + if (parser.seen('B')) delta_diagonal_rod_trim.b = parser.value_float(); + if (parser.seen('C')) delta_diagonal_rod_trim.c = parser.value_float(); recalc_delta_settings(); } diff --git a/Marlin/src/gcode/calibrate/M666.cpp b/Marlin/src/gcode/calibrate/M666.cpp index 721cbcfaa0..e915aa8ff7 100644 --- a/Marlin/src/gcode/calibrate/M666.cpp +++ b/Marlin/src/gcode/calibrate/M666.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -38,7 +38,7 @@ * M666: Set delta endstop adjustment */ void GcodeSuite::M666() { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM(">>> M666"); + DEBUG_SECTION(log_M666, "M666", DEBUGGING(LEVELING)); LOOP_XYZ(i) { if (parser.seen(XYZ_CHAR(i))) { const float v = parser.value_linear_units(); @@ -46,7 +46,6 @@ if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("delta_endstop_adj[", XYZ_CHAR(i), "] = ", delta_endstop_adj[i]); } } - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< M666"); } #elif HAS_EXTRA_ENDSTOPS diff --git a/Marlin/src/gcode/calibrate/M852.cpp b/Marlin/src/gcode/calibrate/M852.cpp index 865b03def3..b60f41748f 100644 --- a/Marlin/src/gcode/calibrate/M852.cpp +++ b/Marlin/src/gcode/calibrate/M852.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/config/M200-M205.cpp b/Marlin/src/gcode/config/M200-M205.cpp index b9192198bd..cb17fc45a6 100644 --- a/Marlin/src/gcode/config/M200-M205.cpp +++ b/Marlin/src/gcode/config/M200-M205.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -30,21 +30,42 @@ * 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. + * D - Set filament diameter and enable. D0 disables volumetric. + * S - Turn volumetric ON or OFF. + * L - Volumetric extruder limit (in mm^3/sec). L0 disables the limit. */ 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 + bool vol_enable = parser.volumetric_enabled, + can_enable = true; + + if (parser.seenval('D')) { const float dval = parser.value_linear_units(); - if ( (parser.volumetric_enabled = (dval != 0)) ) + if (dval) { // Set filament size for volumetric calculation planner.set_filament_size(target_extruder, dval); + vol_enable = true; // Dn = enable for compatibility + } + else + can_enable = false; // D0 = disable for compatibility } + + // Enable or disable with S1 / S0 + parser.volumetric_enabled = can_enable && parser.boolval('S', vol_enable); + + #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) + if (parser.seenval('L')) { + // Set volumetric limit (in mm^3/sec) + const float lval = parser.value_float(); + if (WITHIN(lval, 0, 20)) + planner.set_volumetric_extruder_limit(target_extruder, lval); + else + SERIAL_ECHOLNPGM("?L value out of range (0-20)."); + } + #endif + planner.calculate_volumetric_multipliers(); } @@ -60,6 +81,11 @@ void GcodeSuite::M201() { const int8_t target_extruder = get_target_extruder_from_command(); if (target_extruder < 0) return; + #ifdef XY_FREQUENCY_LIMIT + if (parser.seenval('F')) planner.set_frequency_limit(parser.value_byte()); + if (parser.seenval('G')) planner.xy_freq_min_speed_factor = constrain(parser.value_float(), 1, 100) / 100; + #endif + LOOP_XYZE(i) { if (parser.seen(axis_codes[i])) { const uint8_t a = (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i); @@ -121,7 +147,7 @@ void GcodeSuite::M204() { * J = Junction Deviation (mm) (If not using CLASSIC_JERK) */ void GcodeSuite::M205() { - #if DISABLED(CLASSIC_JERK) + #if HAS_JUNCTION_DEVIATION #define J_PARAM "J" #else #define J_PARAM @@ -137,14 +163,12 @@ void GcodeSuite::M205() { 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 HAS_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; - #if ENABLED(LIN_ADVANCE) - planner.recalculate_max_e_jerk(); - #endif + TERN_(LIN_ADVANCE, planner.recalculate_max_e_jerk()); } else SERIAL_ERROR_MSG("?J out of range (0.01 to 0.3)"); diff --git a/Marlin/src/gcode/config/M217.cpp b/Marlin/src/gcode/config/M217.cpp index 44e69c4298..0d049ede16 100644 --- a/Marlin/src/gcode/config/M217.cpp +++ b/Marlin/src/gcode/config/M217.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -27,6 +27,10 @@ #include "../gcode.h" #include "../../module/tool_change.h" +#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) + #include "../../module/motion.h" +#endif + #include "../../MarlinCore.h" // for SP_X_STR, etc. extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[]; @@ -36,15 +40,29 @@ 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(SP_P_STR, LINEAR_UNIT(toolchange_settings.prime_speed)); - SERIAL_ECHOPAIR(" R", LINEAR_UNIT(toolchange_settings.retract_speed)); + SERIAL_ECHOPAIR_P(SP_B_STR, LINEAR_UNIT(toolchange_settings.extra_resume), + SP_E_STR, LINEAR_UNIT(toolchange_settings.extra_prime), + SP_P_STR, LINEAR_UNIT(toolchange_settings.prime_speed)); + SERIAL_ECHOPAIR(" R", LINEAR_UNIT(toolchange_settings.retract_speed), + " U", LINEAR_UNIT(toolchange_settings.unretract_speed), + " F", toolchange_settings.fan_speed, + " G", toolchange_settings.fan_time); + + #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) + SERIAL_ECHOPAIR(" A", int(migration.automode)); + SERIAL_ECHOPAIR(" L", LINEAR_UNIT(migration.last)); + #endif #if ENABLED(TOOLCHANGE_PARK) + SERIAL_ECHOPAIR(" W", LINEAR_UNIT(toolchange_settings.enable_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 + #if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED) + SERIAL_ECHOPAIR(" V", LINEAR_UNIT(enable_first_prime)); + #endif + #else UNUSED(eeprom); @@ -58,48 +76,98 @@ void M217_report(const bool eeprom=false) { /** * M217 - Set SINGLENOZZLE toolchange parameters * + * // Tool change command + * Q Prime active tool and exit + * + * // Tool change settings * S[linear] Swap length - * E[linear] Purge length + * B[linear] Extra Swap length + * E[linear] Prime length * P[linear/m] Prime speed * R[linear/m] Retract speed + * U[linear/m] UnRetract speed + * V[linear] 0/1 Enable auto prime first extruder used + * W[linear] 0/1 Enable park & Z Raise * X[linear] Park X (Requires TOOLCHANGE_PARK) * Y[linear] Park Y (Requires TOOLCHANGE_PARK) * Z[linear] Z Raise + * F[linear] Fan Speed 0-255 + * G[linear/s] Fan time + * + * Tool migration settings + * A[0|1] Enable auto-migration on runout + * L[index] Last extruder to use for auto-migration + * + * Tool migration command + * T[index] Migrate to next extruder or the given extruder */ 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 = TERN(PREVENT_LENGTHY_EXTRUDE, EXTRUDE_MAXLENGTH, 500); - static constexpr float max_extrude = - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - EXTRUDE_MAXLENGTH - #else - 500 - #endif - ; + if (parser.seen('Q')) { tool_change_prime(); return; } if (parser.seenval('S')) { const float v = parser.value_linear_units(); toolchange_settings.swap_length = constrain(v, 0, max_extrude); } + if (parser.seenval('B')) { const float v = parser.value_linear_units(); toolchange_settings.extra_resume = constrain(v, -10, 10); } 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); } + if (parser.seenval('U')) { const int16_t v = parser.value_linear_units(); toolchange_settings.unretract_speed = constrain(v, 10, 5400); } + #if TOOLCHANGE_FS_FAN >= 0 && HAS_FAN + if (parser.seenval('F')) { const int16_t v = parser.value_linear_units(); toolchange_settings.fan_speed = constrain(v, 0, 255); } + if (parser.seenval('G')) { const int16_t v = parser.value_linear_units(); toolchange_settings.fan_time = constrain(v, 1, 30); } + #endif + #endif + + #if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED) + if (parser.seenval('V')) { enable_first_prime = parser.value_linear_units(); } #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(); } + if (parser.seenval('W')) { toolchange_settings.enable_park = parser.value_linear_units(); } + if (parser.seenval('X')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.x = constrain(v, X_MIN_POS, X_MAX_POS); } + if (parser.seenval('Y')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.y = constrain(v, Y_MIN_POS, Y_MAX_POS); } #endif if (parser.seenval('Z')) { toolchange_settings.z_raise = parser.value_linear_units(); } - if (!parser.seen(SPR_PARAM XY_PARAM "Z")) M217_report(); + #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) + migration.target = 0; // 0 = disabled + + if (parser.seenval('L')) { // Last + const int16_t lval = parser.value_int(); + if (WITHIN(lval, 0, EXTRUDERS - 1)) { + migration.last = lval; + migration.automode = (active_extruder < migration.last); + } + } + + if (parser.seen('A')) // Auto on/off + migration.automode = parser.value_bool(); + + if (parser.seen('T')) { // Migrate now + if (parser.has_value()) { + const int16_t tval = parser.value_int(); + if (WITHIN(tval, 0, EXTRUDERS - 1) && tval != active_extruder) { + migration.target = tval + 1; + extruder_migration(); + migration.target = 0; // disable + return; + } + else + migration.target = 0; // disable + } + else { + extruder_migration(); + return; + } + } + + #endif + + M217_report(); } #endif // EXTRUDERS > 1 diff --git a/Marlin/src/gcode/config/M218.cpp b/Marlin/src/gcode/config/M218.cpp index 5c7d5eac71..7701320e9e 100644 --- a/Marlin/src/gcode/config/M218.cpp +++ b/Marlin/src/gcode/config/M218.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/config/M220.cpp b/Marlin/src/gcode/config/M220.cpp index f24c11e23d..1bec6a7782 100644 --- a/Marlin/src/gcode/config/M220.cpp +++ b/Marlin/src/gcode/config/M220.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/config/M221.cpp b/Marlin/src/gcode/config/M221.cpp index 8522b544fc..7ba22d1901 100644 --- a/Marlin/src/gcode/config/M221.cpp +++ b/Marlin/src/gcode/config/M221.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -33,10 +33,8 @@ 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); - } + if (parser.seenval('S')) + planner.set_flow(target_extruder, parser.value_int()); else { SERIAL_ECHO_START(); SERIAL_CHAR('E', '0' + target_extruder); diff --git a/Marlin/src/gcode/config/M281.cpp b/Marlin/src/gcode/config/M281.cpp index e925cd5b12..018ca1c092 100644 --- a/Marlin/src/gcode/config/M281.cpp +++ b/Marlin/src/gcode/config/M281.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include "../../inc/MarlinConfig.h" @@ -26,6 +26,13 @@ #include "../gcode.h" #include "../../module/servo.h" +/** + * M281 - Edit / Report Servo Angles + * + * P - Servo to update + * L - Deploy Angle + * U - Stowed Angle + */ void GcodeSuite::M281() { if (!parser.seenval('P')) return; const int servo_index = parser.value_int(); diff --git a/Marlin/src/gcode/config/M301.cpp b/Marlin/src/gcode/config/M301.cpp index 54d32c8650..7b3f57608b 100644 --- a/Marlin/src/gcode/config/M301.cpp +++ b/Marlin/src/gcode/config/M301.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -30,6 +30,8 @@ /** * M301: Set PID parameters P I D (and optionally C, L) * + * E[extruder] Default: 0 + * * P[float] Kp term * I[float] Ki term (unscaled) * D[float] Kd term (unscaled) @@ -65,6 +67,7 @@ void GcodeSuite::M301() { #endif thermalManager.updatePID(); + SERIAL_ECHO_START(); #if ENABLED(PID_PARAMS_PER_HOTEND) SERIAL_ECHOPAIR(" e:", e); // specify extruder in serial output diff --git a/Marlin/src/gcode/config/M302.cpp b/Marlin/src/gcode/config/M302.cpp index aa178ea206..14fbd9f572 100644 --- a/Marlin/src/gcode/config/M302.cpp +++ b/Marlin/src/gcode/config/M302.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/config/M304.cpp b/Marlin/src/gcode/config/M304.cpp index 2a85149424..10739be3f8 100644 --- a/Marlin/src/gcode/config/M304.cpp +++ b/Marlin/src/gcode/config/M304.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/config/M305.cpp b/Marlin/src/gcode/config/M305.cpp index d45e18f1b3..3e7206aee4 100644 --- a/Marlin/src/gcode/config/M305.cpp +++ b/Marlin/src/gcode/config/M305.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/config/M43.cpp b/Marlin/src/gcode/config/M43.cpp index baf5efb137..1e7374542c 100644 --- a/Marlin/src/gcode/config/M43.cpp +++ b/Marlin/src/gcode/config/M43.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -340,12 +340,8 @@ void GcodeSuite::M43() { #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 + TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M43 Wait Called"), CONTINUE_STR)); + TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("M43 Wait Called"))); #endif for (;;) { @@ -366,9 +362,7 @@ void GcodeSuite::M43() { } } - #if HAS_RESUME_CONTINUE - if (!wait_for_user) break; - #endif + if (TERN0(HAS_RESUME_CONTINUE, !wait_for_user)) break; safe_delay(200); } diff --git a/Marlin/src/gcode/config/M540.cpp b/Marlin/src/gcode/config/M540.cpp index a8ec628d5a..54d52f3a31 100644 --- a/Marlin/src/gcode/config/M540.cpp +++ b/Marlin/src/gcode/config/M540.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/config/M575.cpp b/Marlin/src/gcode/config/M575.cpp index 947af14e30..4144c366d1 100644 --- a/Marlin/src/gcode/config/M575.cpp +++ b/Marlin/src/gcode/config/M575.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -42,7 +42,7 @@ void GcodeSuite::M575() { if (set0) { SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" Serial " - #if NUM_SERIAL > 1 + #if HAS_MULTI_SERIAL , '0', #else "0" @@ -50,7 +50,7 @@ void GcodeSuite::M575() { " baud rate set to ", baud ); } - #if NUM_SERIAL > 1 + #if HAS_MULTI_SERIAL const bool set1 = (port == -99 || port == 1); if (set1) { SERIAL_ECHO_START(); @@ -62,7 +62,7 @@ void GcodeSuite::M575() { if (set0) { MYSERIAL0.end(); MYSERIAL0.begin(baud); } - #if NUM_SERIAL > 1 + #if HAS_MULTI_SERIAL if (set1) { MYSERIAL1.end(); MYSERIAL1.begin(baud); } #endif diff --git a/Marlin/src/gcode/config/M672.cpp b/Marlin/src/gcode/config/M672.cpp index cc160bde66..58dc271770 100644 --- a/Marlin/src/gcode/config/M672.cpp +++ b/Marlin/src/gcode/config/M672.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -51,8 +51,8 @@ * Marlin: M672 R */ -#define M672_PROGBYTE 105 // magic byte to start programming custom sensitivity -#define M672_ERASEBYTE 131 // magic byte to clear custom sensitivity +#define M672_PROGBYTE 105 // magic byte to start programming custom sensitivity +#define M672_ERASEBYTE 131 // magic byte to clear custom sensitivity // // Smart Effector byte send protocol: diff --git a/Marlin/src/gcode/config/M92.cpp b/Marlin/src/gcode/config/M92.cpp index bc86ff4d32..0a7d52b633 100644 --- a/Marlin/src/gcode/config/M92.cpp +++ b/Marlin/src/gcode/config/M92.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -105,7 +105,7 @@ void GcodeSuite::M92() { 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); } + if (best != wanted) { SERIAL_CHAR(','); SERIAL_DECIMAL(best + z_full_step_mm); } SERIAL_CHAR(']'); } SERIAL_ECHOLNPGM(" }"); diff --git a/Marlin/src/gcode/control/M108_M112_M410.cpp b/Marlin/src/gcode/control/M108_M112_M410.cpp index cb4220507d..df145d5d11 100644 --- a/Marlin/src/gcode/control/M108_M112_M410.cpp +++ b/Marlin/src/gcode/control/M108_M112_M410.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -31,9 +31,7 @@ * 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 + TERN_(HAS_RESUME_CONTINUE, wait_for_user = false); wait_for_heatup = false; } diff --git a/Marlin/src/gcode/control/M111.cpp b/Marlin/src/gcode/control/M111.cpp index 20ed44fb2e..e31c3e2fb7 100644 --- a/Marlin/src/gcode/control/M111.cpp +++ b/Marlin/src/gcode/control/M111.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -28,21 +28,18 @@ void GcodeSuite::M111() { if (parser.seen('S')) marlin_debug_flags = parser.byteval('S'); - static const char str_debug_1[] PROGMEM = STR_DEBUG_ECHO, - str_debug_2[] PROGMEM = STR_DEBUG_INFO, - str_debug_4[] PROGMEM = STR_DEBUG_ERRORS, - str_debug_8[] PROGMEM = STR_DEBUG_DRYRUN, - str_debug_16[] PROGMEM = STR_DEBUG_COMMUNICATION - #if ENABLED(DEBUG_LEVELING_FEATURE) - , str_debug_lvl[] PROGMEM = STR_DEBUG_LEVELING - #endif - ; + static PGMSTR(str_debug_1, STR_DEBUG_ECHO); + static PGMSTR(str_debug_2, STR_DEBUG_INFO); + static PGMSTR(str_debug_4, STR_DEBUG_ERRORS); + static PGMSTR(str_debug_8, STR_DEBUG_DRYRUN); + static PGMSTR(str_debug_16, STR_DEBUG_COMMUNICATION); + #if ENABLED(DEBUG_LEVELING_FEATURE) + static PGMSTR(str_debug_lvl, STR_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 + str_debug_1, str_debug_2, str_debug_4, str_debug_8, str_debug_16, + TERN_(DEBUG_LEVELING_FEATURE, str_debug_lvl) }; SERIAL_ECHO_START(); diff --git a/Marlin/src/gcode/control/M120_M121.cpp b/Marlin/src/gcode/control/M120_M121.cpp index b25834cbda..570f2e935b 100644 --- a/Marlin/src/gcode/control/M120_M121.cpp +++ b/Marlin/src/gcode/control/M120_M121.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/control/M17_M18_M84.cpp b/Marlin/src/gcode/control/M17_M18_M84.cpp index d69654a959..499feef715 100644 --- a/Marlin/src/gcode/control/M17_M18_M84.cpp +++ b/Marlin/src/gcode/control/M17_M18_M84.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -25,7 +25,7 @@ #include "../../lcd/ultralcd.h" #include "../../module/stepper.h" -#if BOTH(AUTO_BED_LEVELING_UBL, ULTRA_LCD) +#if ENABLED(AUTO_BED_LEVELING_UBL) #include "../../feature/bedlevel/bedlevel.h" #endif @@ -37,9 +37,7 @@ void GcodeSuite::M17() { if (parser.seen('X')) ENABLE_AXIS_X(); if (parser.seen('Y')) ENABLE_AXIS_Y(); if (parser.seen('Z')) ENABLE_AXIS_Z(); - #if HAS_E_STEPPER_ENABLE - if (parser.seen('E')) enable_e_steppers(); - #endif + if (TERN0(HAS_E_STEPPER_ENABLE, parser.seen('E'))) enable_e_steppers(); } else { LCD_MESSAGEPGM(MSG_NO_MOVE); @@ -52,6 +50,7 @@ void GcodeSuite::M17() { */ void GcodeSuite::M18_M84() { if (parser.seenval('S')) { + reset_stepper_timeout(); stepper_inactive_time = parser.value_millis_from_seconds(); } else { @@ -60,18 +59,11 @@ void GcodeSuite::M18_M84() { if (parser.seen('X')) DISABLE_AXIS_X(); if (parser.seen('Y')) DISABLE_AXIS_Y(); if (parser.seen('Z')) DISABLE_AXIS_Z(); - #if HAS_E_STEPPER_ENABLE - if (parser.seen('E')) disable_e_steppers(); - #endif + if (TERN0(HAS_E_STEPPER_ENABLE, parser.seen('E'))) disable_e_steppers(); } 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 + TERN_(AUTO_BED_LEVELING_UBL, ubl.steppers_were_disabled()); } } diff --git a/Marlin/src/gcode/control/M211.cpp b/Marlin/src/gcode/control/M211.cpp index 3b0a928b8f..ffad722f3f 100644 --- a/Marlin/src/gcode/control/M211.cpp +++ b/Marlin/src/gcode/control/M211.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/control/M226.cpp b/Marlin/src/gcode/control/M226.cpp index 0dfbfd6252..52e0e57a87 100644 --- a/Marlin/src/gcode/control/M226.cpp +++ b/Marlin/src/gcode/control/M226.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/control/M280.cpp b/Marlin/src/gcode/control/M280.cpp index 21a6c9890d..6ccbb7becc 100644 --- a/Marlin/src/gcode/control/M280.cpp +++ b/Marlin/src/gcode/control/M280.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/control/M3-M5.cpp b/Marlin/src/gcode/control/M3-M5.cpp index 56e1e0e4ec..1326c30669 100644 --- a/Marlin/src/gcode/control/M3-M5.cpp +++ b/Marlin/src/gcode/control/M3-M5.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -30,20 +30,16 @@ /** * 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 + * Parameters: + * S - Set power. S0 will turn the spindle/laser off, except in relative mode. + * O - Set power and OCR (oscillator count register) * * If no PWM pin is defined then M3/M4 just turns it on. * @@ -70,31 +66,69 @@ * PWM duty cycle goes from 0 (off) to 255 (always on). */ void GcodeSuite::M3_M4(const bool is_M4) { + auto get_s_power = [] { + if (parser.seenval('S')) { + const float spwr = parser.value_float(); + cutter.unitPower = TERN(SPINDLE_LASER_PWM, + cutter.power_to_range(cutter_power_t(round(spwr))), + spwr > 0 ? 255 : 0); + } + else + cutter.unitPower = cutter.cpwr_to_upwr(SPEED_POWER_STARTUP); + return cutter.unitPower; + }; - #if ENABLED(SPINDLE_FEATURE) - planner.synchronize(); // Wait for movement to complete before changing power + #if ENABLED(LASER_POWER_INLINE) + if (parser.seen('I') == DISABLED(LASER_POWER_INLINE_INVERT)) { + // Laser power in inline mode + cutter.inline_direction(is_M4); // Should always be unused + #if ENABLED(SPINDLE_LASER_PWM) + if (parser.seen('O')) { + cutter.unitPower = cutter.power_to_range(parser.value_byte(), 0); + cutter.inline_ocr_power(cutter.unitPower); // The OCR is a value from 0 to 255 (uint8_t) + } + else + cutter.inline_power(cutter.upower_to_ocr(get_s_power())); + #else + cutter.set_inline_enabled(true); + #endif + return; + } + // Non-inline, standard case + cutter.inline_disable(); // Prevent future blocks re-setting the power #endif + planner.synchronize(); // Wait for previous movement commands (G0/G0/G2/G3) to complete before changing power 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) + if (parser.seenval('O')) { + cutter.unitPower = cutter.power_to_range(parser.value_byte(), 0); + cutter.set_ocr_power(cutter.unitPower); // The OCR is a value from 0 to 255 (uint8_t) + } else - cutter.set_power(parser.intval('S', 255)); + cutter.set_power(cutter.upower_to_ocr(get_s_power())); #else cutter.set_enabled(true); #endif + cutter.menuPower = cutter.unitPower; } /** - * M5 - Cutter OFF + * M5 - Cutter OFF (when moves are complete) */ void GcodeSuite::M5() { - #if ENABLED(SPINDLE_FEATURE) - planner.synchronize(); + #if ENABLED(LASER_POWER_INLINE) + if (parser.seen('I') == DISABLED(LASER_POWER_INLINE_INVERT)) { + cutter.set_inline_enabled(false); // Laser power in inline mode + return; + } + // Non-inline, standard case + cutter.inline_disable(); // Prevent future blocks re-setting the power #endif + planner.synchronize(); cutter.set_enabled(false); + cutter.menuPower = cutter.unitPower; } #endif // HAS_CUTTER diff --git a/Marlin/src/gcode/control/M350_M351.cpp b/Marlin/src/gcode/control/M350_M351.cpp index 54b29a21d3..463bd2ad58 100644 --- a/Marlin/src/gcode/control/M350_M351.cpp +++ b/Marlin/src/gcode/control/M350_M351.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/control/M380_M381.cpp b/Marlin/src/gcode/control/M380_M381.cpp index 756021a59b..3f5b252465 100644 --- a/Marlin/src/gcode/control/M380_M381.cpp +++ b/Marlin/src/gcode/control/M380_M381.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/control/M400.cpp b/Marlin/src/gcode/control/M400.cpp index 3926299807..9a5ad4e9df 100644 --- a/Marlin/src/gcode/control/M400.cpp +++ b/Marlin/src/gcode/control/M400.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/control/M42.cpp b/Marlin/src/gcode/control/M42.cpp index 74625b0318..c88113db49 100644 --- a/Marlin/src/gcode/control/M42.cpp +++ b/Marlin/src/gcode/control/M42.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -24,7 +24,7 @@ #include "../../MarlinCore.h" // for pin_is_protected #include "../../inc/MarlinConfig.h" -#if FAN_COUNT > 0 +#if HAS_FAN #include "../../module/temperature.h" #endif @@ -56,15 +56,14 @@ void GcodeSuite::M42() { #ifdef INPUT_PULLDOWN case 3: pinMode(pin, INPUT_PULLDOWN); break; #endif - default: SERIAL_ECHOLNPGM("Invalid Pin Mode"); + default: SERIAL_ECHOLNPGM("Invalid Pin Mode"); return; } - return; } if (!parser.seenval('S')) return; const byte pin_status = parser.value_byte(); - #if FAN_COUNT > 0 + #if HAS_FAN switch (pin) { #if HAS_FAN0 case FAN0_PIN: thermalManager.fan_speed[0] = pin_status; return; diff --git a/Marlin/src/gcode/control/M605.cpp b/Marlin/src/gcode/control/M605.cpp index ab5efbbb48..5dc36428b5 100644 --- a/Marlin/src/gcode/control/M605.cpp +++ b/Marlin/src/gcode/control/M605.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -92,8 +92,10 @@ 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)); + // Set the X offset, but no less than the safety gap + if (parser.seen('X')) duplicate_extruder_x_offset = _MAX(parser.value_linear_units(), (X2_MIN_POS) - (X1_MIN_POS)); if (parser.seen('R')) duplicate_extruder_temp_offset = parser.value_celsius_diff(); + // Always switch back to tool 0 if (active_extruder != 0) tool_change(0); break; default: diff --git a/Marlin/src/gcode/control/M7-M9.cpp b/Marlin/src/gcode/control/M7-M9.cpp index 1fc8a93e2e..a33e43288b 100644 --- a/Marlin/src/gcode/control/M7-M9.cpp +++ b/Marlin/src/gcode/control/M7-M9.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp index e8d9aa2fdf..0dede7ea64 100644 --- a/Marlin/src/gcode/control/M80_M81.cpp +++ b/Marlin/src/gcode/control/M80_M81.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -72,16 +72,15 @@ #endif #if DISABLED(AUTO_POWER_CONTROL) - delay(PSU_POWERUP_DELAY); // Wait for power to settle + safe_delay(PSU_POWERUP_DELAY); restore_stepper_drivers(); + TERN_(HAS_TRINAMIC_CONFIG, safe_delay(PSU_POWERUP_DELAY)); #endif - #if HAS_LCD_MENU - ui.reset_status(); - #endif + TERN_(HAS_LCD_MENU, ui.reset_status()); } -#endif // ENABLED(PSU_CONTROL) +#endif // PSU_CONTROL /** * M81: Turn off Power, including Power Supply, if there is one. @@ -93,7 +92,7 @@ void GcodeSuite::M81() { print_job_timer.stop(); planner.finish_and_disable(); - #if FAN_COUNT > 0 + #if HAS_FAN thermalManager.zero_fan_speeds(); #if ENABLED(PROBING_FANS_OFF) thermalManager.fans_paused = false; diff --git a/Marlin/src/gcode/control/M85.cpp b/Marlin/src/gcode/control/M85.cpp index 1cdf49f609..9c8c02c59a 100644 --- a/Marlin/src/gcode/control/M85.cpp +++ b/Marlin/src/gcode/control/M85.cpp @@ -16,12 +16,11 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include "../gcode.h" -#include "../../MarlinCore.h" // for max_inactive_time /** * M85: Set inactivity shutdown timer with parameter S. To disable set zero (default) diff --git a/Marlin/src/gcode/control/M997.cpp b/Marlin/src/gcode/control/M997.cpp index 1d9b12204d..6c28d42f41 100644 --- a/Marlin/src/gcode/control/M997.cpp +++ b/Marlin/src/gcode/control/M997.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/control/M999.cpp b/Marlin/src/gcode/control/M999.cpp index 79cd5e1854..53d74322a3 100644 --- a/Marlin/src/gcode/control/M999.cpp +++ b/Marlin/src/gcode/control/M999.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/control/T.cpp b/Marlin/src/gcode/control/T.cpp index e6b3bb5d68..46cdfebf11 100644 --- a/Marlin/src/gcode/control/T.cpp +++ b/Marlin/src/gcode/control/T.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -48,10 +48,11 @@ */ void GcodeSuite::T(const uint8_t tool_index) { - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPAIR(">>> T(", tool_index, ")"); - DEBUG_POS("BEFORE", current_position); - } + DEBUG_SECTION(log_T, "T", DEBUGGING(LEVELING)); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("...(", tool_index, ")"); + + // Count this command as movement / activity + reset_stepper_timeout(); #if ENABLED(PRUSA_MMU2) if (parser.string_arg) { @@ -72,9 +73,4 @@ void GcodeSuite::T(const uint8_t tool_index) { ); #endif - - if (DEBUGGING(LEVELING)) { - DEBUG_POS("AFTER", current_position); - DEBUG_ECHOLNPGM("<<< T()"); - } } diff --git a/Marlin/src/gcode/eeprom/M500-M504.cpp b/Marlin/src/gcode/eeprom/M500-M504.cpp index 17f9ff71fa..5aee68ba99 100644 --- a/Marlin/src/gcode/eeprom/M500-M504.cpp +++ b/Marlin/src/gcode/eeprom/M500-M504.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -58,11 +58,47 @@ void GcodeSuite::M502() { #endif // !DISABLE_M503 #if ENABLED(EEPROM_SETTINGS) + + #if ENABLED(MARLIN_DEV_MODE) + #include "../../libs/hex_print_routines.h" + #endif + /** * M504: Validate EEPROM Contents */ void GcodeSuite::M504() { + #if ENABLED(MARLIN_DEV_MODE) + const bool dowrite = parser.seenval('W'); + if (dowrite || parser.seenval('R')) { + uint8_t val = 0; + int addr = parser.value_ushort(); + if (dowrite) { + val = parser.byteval('V'); + persistentStore.write_data(addr, &val); + SERIAL_ECHOLNPAIR("Wrote address ", addr, " with ", int(val)); + } + else { + if (parser.seenval('T')) { + const int endaddr = parser.value_ushort(); + while (addr <= endaddr) { + persistentStore.read_data(addr, &val); + SERIAL_ECHOLNPAIR("0x", hex_word(addr), ":", hex_byte(val)); + addr++; + safe_delay(10); + } + SERIAL_EOL(); + } + else { + persistentStore.read_data(addr, &val); + SERIAL_ECHOLNPAIR("Read address ", addr, " and got ", int(val)); + } + } + return; + } + #endif + if (settings.validate()) SERIAL_ECHO_MSG("EEPROM OK"); } + #endif diff --git a/Marlin/src/gcode/feature/L6470/M122.cpp b/Marlin/src/gcode/feature/L6470/M122.cpp index ec5f9aea28..d2b7f73997 100644 --- a/Marlin/src/gcode/feature/L6470/M122.cpp +++ b/Marlin/src/gcode/feature/L6470/M122.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/L6470/M906.cpp b/Marlin/src/gcode/feature/L6470/M906.cpp index 497fa75622..cd7fc3dcb5 100644 --- a/Marlin/src/gcode/feature/L6470/M906.cpp +++ b/Marlin/src/gcode/feature/L6470/M906.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/L6470/M916-918.cpp b/Marlin/src/gcode/feature/L6470/M916-918.cpp index a3eaf7b26a..29efc06dd9 100644 --- a/Marlin/src/gcode/feature/L6470/M916-918.cpp +++ b/Marlin/src/gcode/feature/L6470/M916-918.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/advance/M900.cpp b/Marlin/src/gcode/feature/advance/M900.cpp index b3985401cf..5c7155d7c9 100644 --- a/Marlin/src/gcode/feature/advance/M900.cpp +++ b/Marlin/src/gcode/feature/advance/M900.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -134,7 +134,7 @@ void GcodeSuite::M900() { SERIAL_ECHOPGM("Advance K"); LOOP_L_N(i, EXTRUDERS) { SERIAL_CHAR(' ', '0' + i, ':'); - SERIAL_ECHO(planner.extruder_advance_K[i]); + SERIAL_DECIMAL(planner.extruder_advance_K[i]); } SERIAL_EOL(); #endif diff --git a/Marlin/src/gcode/feature/baricuda/M126-M129.cpp b/Marlin/src/gcode/feature/baricuda/M126-M129.cpp index d96ee03af1..edeba0d270 100644 --- a/Marlin/src/gcode/feature/baricuda/M126-M129.cpp +++ b/Marlin/src/gcode/feature/baricuda/M126-M129.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/camera/M240.cpp b/Marlin/src/gcode/feature/camera/M240.cpp index 33ef9bf1a1..9664ce1522 100644 --- a/Marlin/src/gcode/feature/camera/M240.cpp +++ b/Marlin/src/gcode/feature/camera/M240.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -100,9 +100,9 @@ * 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/ + * https://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/ + * See https://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. * diff --git a/Marlin/src/gcode/feature/cancel/M486.cpp b/Marlin/src/gcode/feature/cancel/M486.cpp index 19216b2cb9..1f14ae0fd2 100644 --- a/Marlin/src/gcode/feature/cancel/M486.cpp +++ b/Marlin/src/gcode/feature/cancel/M486.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/caselight/M355.cpp b/Marlin/src/gcode/feature/caselight/M355.cpp index ff793451bd..4d2acd189c 100644 --- a/Marlin/src/gcode/feature/caselight/M355.cpp +++ b/Marlin/src/gcode/feature/caselight/M355.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/clean/G12.cpp b/Marlin/src/gcode/feature/clean/G12.cpp index 6d13a010be..fc99cc5c1d 100644 --- a/Marlin/src/gcode/feature/clean/G12.cpp +++ b/Marlin/src/gcode/feature/clean/G12.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -37,22 +37,32 @@ /** * G12: Clean the nozzle + * + * E : 0=Never or 1=Always apply the "software endstop" limits + * P0 S : Stroke cleaning with S strokes + * P1 Sn T : Zigzag cleaning with S repeats and T zigzags + * P2 Sn R : Circle cleaning with S repeats and R radius */ void GcodeSuite::G12() { // Don't allow nozzle cleaning without homing first if (axis_unhomed_error()) return; + #ifdef WIPE_SEQUENCE_COMMANDS + if (!parser.seen_any()) { + gcode.process_subcommands_now_P(PSTR(WIPE_SEQUENCE_COMMANDS)); + return; + } + #endif + 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 float radius = parser.linearval('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 + | TERN(NOZZLE_CLEAN_NO_Z, 0, (!seenxyz || parser.boolval('Z') ? _BV(Z_AXIS) : 0)) ; #if HAS_LEVELING @@ -60,6 +70,8 @@ void GcodeSuite::G12() { TEMPORARY_BED_LEVELING_STATE(!TEST(cleans, Z_AXIS) && planner.leveling_active); #endif + TEMPORARY_SOFT_ENDSTOP_STATE(parser.boolval('E')); + nozzle.clean(pattern, strokes, radius, objects, cleans); } diff --git a/Marlin/src/gcode/feature/controllerfan/M710.cpp b/Marlin/src/gcode/feature/controllerfan/M710.cpp index e00fa77d62..67d4ad8abf 100644 --- a/Marlin/src/gcode/feature/controllerfan/M710.cpp +++ b/Marlin/src/gcode/feature/controllerfan/M710.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -29,11 +29,11 @@ void M710_report(const bool forReplay) { if (!forReplay) { SERIAL_ECHOLNPGM("; Controller Fan"); SERIAL_ECHO_START(); } - SERIAL_ECHOLNPAIR("M710 " - "S", int(controllerFan.settings.active_speed), - "I", int(controllerFan.settings.idle_speed), - "A", int(controllerFan.settings.auto_mode), - "D", controllerFan.settings.duration, + SERIAL_ECHOLNPAIR(" M710" + " S", int(controllerFan.settings.active_speed), + " I", int(controllerFan.settings.idle_speed), + " A", int(controllerFan.settings.auto_mode), + " D", controllerFan.settings.duration, " ; (", (int(controllerFan.settings.active_speed) * 100) / 255, "%" " ", (int(controllerFan.settings.idle_speed) * 100) / 255, "%)" ); diff --git a/Marlin/src/gcode/feature/digipot/M907-M910.cpp b/Marlin/src/gcode/feature/digipot/M907-M910.cpp index fe8e37ebdd..54599a0451 100644 --- a/Marlin/src/gcode/feature/digipot/M907-M910.cpp +++ b/Marlin/src/gcode/feature/digipot/M907-M910.cpp @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include "../../../inc/MarlinConfig.h" -#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || EITHER(DIGIPOT_I2C, DAC_STEPPER_CURRENT) +#if ANY(HAS_DIGIPOTSS, HAS_MOTOR_CURRENT_PWM, HAS_I2C_DIGIPOT, DAC_STEPPER_CURRENT) #include "../../gcode.h" @@ -30,7 +30,7 @@ #include "../../../module/stepper.h" #endif -#if ENABLED(DIGIPOT_I2C) +#if HAS_I2C_DIGIPOT #include "../../../feature/digipot/digipot.h" #endif @@ -62,7 +62,7 @@ void GcodeSuite::M907() { #endif - #if ENABLED(DIGIPOT_I2C) + #if HAS_I2C_DIGIPOT // 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. @@ -80,18 +80,14 @@ void GcodeSuite::M907() { #endif } -#if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT) +#if EITHER(HAS_DIGIPOTSS, 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 + TERN_(HAS_DIGIPOTSS, stepper.digitalPotWrite(parser.intval('P'), parser.intval('S'))); + TERN_(DAC_STEPPER_CURRENT, dac_current_raw(parser.byteval('P', -1), parser.ushortval('S', 0))); } #endif // HAS_DIGIPOTSS || DAC_STEPPER_CURRENT @@ -103,4 +99,4 @@ void GcodeSuite::M907() { #endif // DAC_STEPPER_CURRENT -#endif // HAS_DIGIPOTSS || DAC_STEPPER_CURRENT || HAS_MOTOR_CURRENT_PWM || DIGIPOT_I2C +#endif // HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || HAS_I2C_DIGIPOT || DAC_STEPPER_CURRENT diff --git a/Marlin/src/gcode/feature/filwidth/M404-M407.cpp b/Marlin/src/gcode/feature/filwidth/M404-M407.cpp index 41e6e90aa1..516289fe27 100644 --- a/Marlin/src/gcode/feature/filwidth/M404-M407.cpp +++ b/Marlin/src/gcode/feature/filwidth/M404-M407.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/fwretract/G10_G11.cpp b/Marlin/src/gcode/feature/fwretract/G10_G11.cpp index 75e5b6a588..05f0150360 100644 --- a/Marlin/src/gcode/feature/fwretract/G10_G11.cpp +++ b/Marlin/src/gcode/feature/fwretract/G10_G11.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/fwretract/M207-M209.cpp b/Marlin/src/gcode/feature/fwretract/M207-M209.cpp index 6c48774c30..538f16cde6 100644 --- a/Marlin/src/gcode/feature/fwretract/M207-M209.cpp +++ b/Marlin/src/gcode/feature/fwretract/M207-M209.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/i2c/M260_M261.cpp b/Marlin/src/gcode/feature/i2c/M260_M261.cpp index ea04d2a293..13c2cd1d10 100644 --- a/Marlin/src/gcode/feature/i2c/M260_M261.cpp +++ b/Marlin/src/gcode/feature/i2c/M260_M261.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -31,7 +31,7 @@ /** * M260: Send data to a I2C slave device * - * This is a PoC, the formating and arguments for the GCODE will + * This is a PoC, the formatting 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 diff --git a/Marlin/src/gcode/feature/leds/M150.cpp b/Marlin/src/gcode/feature/leds/M150.cpp index 656b7e5f90..88f02951ad 100644 --- a/Marlin/src/gcode/feature/leds/M150.cpp +++ b/Marlin/src/gcode/feature/leds/M150.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -34,6 +34,9 @@ * Always sets all 3 or 4 components. If a component is left out, set to 0. * If brightness is left out, no value changed * + * With NEOPIXEL_LED: + * I Set the Neopixel index to affect. Default: All + * * Examples: * * M150 R255 ; Turn LED red @@ -43,8 +46,12 @@ * M150 W ; Turn LED white using a white LED * M150 P127 ; Set LED 50% brightness * M150 P ; Set LED full brightness + * M150 I1 R ; Set NEOPIXEL index 1 to red */ void GcodeSuite::M150() { + #if ENABLED(NEOPIXEL_LED) + neo.set_neo_index(parser.intval('I', -1)); + #endif 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, diff --git a/Marlin/src/gcode/feature/leds/M7219.cpp b/Marlin/src/gcode/feature/leds/M7219.cpp index acbd55957f..a6ee71174b 100644 --- a/Marlin/src/gcode/feature/leds/M7219.cpp +++ b/Marlin/src/gcode/feature/leds/M7219.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/macro/M810-M819.cpp b/Marlin/src/gcode/feature/macro/M810-M819.cpp index c106de298a..7b9e1a13f1 100644 --- a/Marlin/src/gcode/feature/macro/M810-M819.cpp +++ b/Marlin/src/gcode/feature/macro/M810-M819.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/mixing/M163-M165.cpp b/Marlin/src/gcode/feature/mixing/M163-M165.cpp index 61be64edec..a4cb64e7d6 100644 --- a/Marlin/src/gcode/feature/mixing/M163-M165.cpp +++ b/Marlin/src/gcode/feature/mixing/M163-M165.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/mixing/M166.cpp b/Marlin/src/gcode/feature/mixing/M166.cpp index b4618c8111..5f2c4f042a 100644 --- a/Marlin/src/gcode/feature/mixing/M166.cpp +++ b/Marlin/src/gcode/feature/mixing/M166.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/pause/G27.cpp b/Marlin/src/gcode/feature/pause/G27.cpp index 7f2f0d48b7..ea6aadf173 100644 --- a/Marlin/src/gcode/feature/pause/G27.cpp +++ b/Marlin/src/gcode/feature/pause/G27.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/pause/G60.cpp b/Marlin/src/gcode/feature/pause/G60.cpp index 45a8734ca3..6f695b99a9 100644 --- a/Marlin/src/gcode/feature/pause/G60.cpp +++ b/Marlin/src/gcode/feature/pause/G60.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -24,7 +24,6 @@ #if SAVED_POSITIONS -#include "../../../core/language.h" #include "../../gcode.h" #include "../../../module/motion.h" diff --git a/Marlin/src/gcode/feature/pause/G61.cpp b/Marlin/src/gcode/feature/pause/G61.cpp index 60e6bcf040..d8049f02bc 100644 --- a/Marlin/src/gcode/feature/pause/G61.cpp +++ b/Marlin/src/gcode/feature/pause/G61.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -24,7 +24,6 @@ #if SAVED_POSITIONS -#include "../../../core/language.h" #include "../../../module/planner.h" #include "../../gcode.h" #include "../../../module/motion.h" diff --git a/Marlin/src/gcode/feature/pause/M125.cpp b/Marlin/src/gcode/feature/pause/M125.cpp index 206815a200..db78e870d7 100644 --- a/Marlin/src/gcode/feature/pause/M125.cpp +++ b/Marlin/src/gcode/feature/pause/M125.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -56,11 +56,7 @@ */ 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 - ); + const float retract = -ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) : (PAUSE_PARK_RETRACT_LENGTH)); xyz_pos_t park_point = NOZZLE_PARK_POINT; @@ -75,26 +71,17 @@ void GcodeSuite::M125() { park_point += hotend_offset[active_extruder]; #endif - #if ENABLED(SDSUPPORT) - const bool sd_printing = IS_SD_PRINTING(); - #else - constexpr bool sd_printing = false; - #endif + const bool sd_printing = TERN0(SDSUPPORT, IS_SD_PRINTING()); - #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 + TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_PARKING, PAUSE_MODE_PAUSE_PRINT)); + + const bool show_lcd = TERN0(HAS_LCD_MENU, parser.seenval('P')); if (pause_print(retract, park_point, 0, show_lcd)) { - #if ENABLED(POWER_LOSS_RECOVERY) - if (recovery.enabled) recovery.save(true); - #endif - if (!sd_printing || show_lcd) { + TERN_(POWER_LOSS_RECOVERY, if (recovery.enabled) recovery.save(true)); + if (ENABLED(EXTENSIBLE_UI) || !sd_printing || show_lcd) { wait_for_confirmation(false, 0); - resume_print(0, 0, PAUSE_PARK_RETRACT_LENGTH, 0); + resume_print(0, 0, -retract, 0); } } } diff --git a/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin/src/gcode/feature/pause/M600.cpp index fc7702796b..673c7387ef 100644 --- a/Marlin/src/gcode/feature/pause/M600.cpp +++ b/Marlin/src/gcode/feature/pause/M600.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -56,6 +56,7 @@ * 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 + * R[temp] - Resume temperature (in current units) * * Default values are used for omitted arguments. */ @@ -83,7 +84,7 @@ void GcodeSuite::M600() { // 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; + DXC_ext = (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT_STATE) ? 1 : 0; #else DXC_ext = active_extruder; #endif @@ -96,27 +97,19 @@ void GcodeSuite::M600() { #endif #if ENABLED(HOME_BEFORE_FILAMENT_CHANGE) - // Don't allow filament change without homing first - if (axes_need_homing()) home_all_axes(); + // If needed, home before parking for filament change + if (!all_axes_known()) 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); + if (active_extruder != target_extruder && TERN1(DUAL_X_CARRIAGE, !dxc_is_duplicating())) + 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 - ); + const float retract = -ABS(parser.seen('E') ? parser.value_axis_units(E_AXIS) : (PAUSE_PARK_RETRACT_LENGTH)); xyz_pos_t park_point NOZZLE_PARK_POINT; @@ -149,11 +142,9 @@ void GcodeSuite::M600() { : fc_settings[active_extruder].load_length); #endif - const int beep_count = parser.intval('B', + const int beep_count = parser.intval('B', -1 #ifdef FILAMENT_CHANGE_ALERT_BEEPS - FILAMENT_CHANGE_ALERT_BEEPS - #else - -1 + + 1 + FILAMENT_CHANGE_ALERT_BEEPS #endif ); @@ -163,7 +154,8 @@ void GcodeSuite::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); + resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, + beep_count, (parser.seenval('R') ? parser.value_celsius() : 0) DXC_PASS); #endif } @@ -173,9 +165,7 @@ void GcodeSuite::M600() { tool_change(active_extruder_before_filament_change, false); #endif - #if ENABLED(MIXING_EXTRUDER) - mixer.T(old_mixing_tool); // Restore original mixing tool - #endif + TERN_(MIXING_EXTRUDER, mixer.T(old_mixing_tool)); // Restore original mixing tool } #endif // ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/gcode/feature/pause/M603.cpp b/Marlin/src/gcode/feature/pause/M603.cpp index 620b8f4f27..a62b5cd46d 100644 --- a/Marlin/src/gcode/feature/pause/M603.cpp +++ b/Marlin/src/gcode/feature/pause/M603.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/pause/M701_M702.cpp b/Marlin/src/gcode/feature/pause/M701_M702.cpp index aa3c3c4c30..7449787d78 100644 --- a/Marlin/src/gcode/feature/pause/M701_M702.cpp +++ b/Marlin/src/gcode/feature/pause/M701_M702.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -84,9 +84,7 @@ void GcodeSuite::M701() { 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 + TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_LOAD, PAUSE_MODE_LOAD_FILAMENT, target_extruder)); #if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) // Change toolhead if specified @@ -129,14 +127,10 @@ void GcodeSuite::M701() { tool_change(active_extruder_before_filament_change, false); #endif - #if ENABLED(MIXING_EXTRUDER) - mixer.T(old_mixing_tool); // Restore original mixing tool - #endif + TERN_(MIXING_EXTRUDER, mixer.T(old_mixing_tool)); // Restore original mixing tool // Show status screen - #if HAS_LCD_MENU - lcd_pause_show_message(PAUSE_MESSAGE_STATUS); - #endif + TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_STATUS)); } /** @@ -163,16 +157,18 @@ void GcodeSuite::M702() { #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) float mix_multiplier = 1.0; - if (!parser.seenval('T')) { + const bool seenT = parser.seenval('T'); + if (!seenT) { mixer.T(MIXER_AUTORETRACT_TOOL); mix_multiplier = MIXING_STEPPERS; } - else + #else + constexpr bool seenT = true; #endif - { + + if (seenT) { 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(); @@ -188,9 +184,7 @@ void GcodeSuite::M702() { 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 + TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_UNLOAD, PAUSE_MODE_UNLOAD_FILAMENT, target_extruder)); #if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) // Change toolhead if specified @@ -239,14 +233,10 @@ void GcodeSuite::M702() { tool_change(active_extruder_before_filament_change, false); #endif - #if ENABLED(MIXING_EXTRUDER) - mixer.T(old_mixing_tool); // Restore original mixing tool - #endif + TERN_(MIXING_EXTRUDER, mixer.T(old_mixing_tool)); // Restore original mixing tool // Show status screen - #if HAS_LCD_MENU - lcd_pause_show_message(PAUSE_MESSAGE_STATUS); - #endif + TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_STATUS)); } #endif // ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/gcode/feature/power_monitor/M430.cpp b/Marlin/src/gcode/feature/power_monitor/M430.cpp new file mode 100644 index 0000000000..a669f0a76b --- /dev/null +++ b/Marlin/src/gcode/feature/power_monitor/M430.cpp @@ -0,0 +1,70 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_POWER_MONITOR + +#include "../../../feature/power_monitor.h" +#include "../../../MarlinCore.h" +#include "../../gcode.h" + +/** + * M430: Enable/disable current LCD display + * With no parameters report the system current draw (in Amps) + * + * I[bool] - Set Display of current on the LCD + * V[bool] - Set Display of voltage on the LCD + * W[bool] - Set Display of power on the LCD + */ +void GcodeSuite::M430() { + bool do_report = true; + #if HAS_SPI_LCD + #if ENABLED(POWER_MONITOR_CURRENT) + if (parser.seen('I')) { power_monitor.set_current_display(parser.value_bool()); do_report = false; } + #endif + #if HAS_POWER_MONITOR_VREF + if (parser.seen('V')) { power_monitor.set_voltage_display(parser.value_bool()); do_report = false; } + #endif + #if HAS_POWER_MONITOR_WATTS + if (parser.seen('W')) { power_monitor.set_power_display(parser.value_bool()); do_report = false; } + #endif + #endif + if (do_report) { + SERIAL_ECHOLNPAIR( + #if ENABLED(POWER_MONITOR_CURRENT) + "Current: ", power_monitor.getAmps(), "A" + #if HAS_POWER_MONITOR_VREF + " " + #endif + #endif + #if HAS_POWER_MONITOR_VREF + "Voltage: ", power_monitor.getVolts(), "V" + #endif + #if HAS_POWER_MONITOR_WATTS + " Power: ", power_monitor.getPower(), "W" + #endif + ); + } +} + +#endif // HAS_POWER_MONITOR diff --git a/Marlin/src/gcode/feature/powerloss/M1000.cpp b/Marlin/src/gcode/feature/powerloss/M1000.cpp index 8d8cdc7557..58e810e5d0 100644 --- a/Marlin/src/gcode/feature/powerloss/M1000.cpp +++ b/Marlin/src/gcode/feature/powerloss/M1000.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -41,7 +41,7 @@ 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"); + DEBUG_ECHOLNPGM(" Job Recovery Data"); #else UNUSED(prefix); #endif @@ -74,9 +74,7 @@ void GcodeSuite::M1000() { #else recovery.cancel(); #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPrintTimerStopped(); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onPrintTimerStopped()); } else recovery.resume(); diff --git a/Marlin/src/gcode/feature/powerloss/M413.cpp b/Marlin/src/gcode/feature/powerloss/M413.cpp index 67e756d5d2..5a08053e7c 100644 --- a/Marlin/src/gcode/feature/powerloss/M413.cpp +++ b/Marlin/src/gcode/feature/powerloss/M413.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -50,6 +50,9 @@ void GcodeSuite::M413() { if (parser.seen("RL")) recovery.load(); if (parser.seen('W')) recovery.save(true); if (parser.seen('P')) recovery.purge(); + #if PIN_EXISTS(POWER_LOSS) + if (parser.seen('O')) recovery._outage(); + #endif 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 diff --git a/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp b/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp index 0a9c519451..91e35dbf65 100644 --- a/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp +++ b/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/runout/M412.cpp b/Marlin/src/gcode/feature/runout/M412.cpp index f746dddfa1..130f9c83e3 100644 --- a/Marlin/src/gcode/feature/runout/M412.cpp +++ b/Marlin/src/gcode/feature/runout/M412.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -29,15 +29,17 @@ /** * M412: Enable / Disable filament runout detection + * + * Parameters + * R : Reset the runout sensor + * S : Reset and enable/disable the runout sensor + * H : Enable/disable host handling of filament runout + * D : Extra distance to continue after runout is triggered */ void GcodeSuite::M412() { if (parser.seen("RS" - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - "D" - #endif - #if ENABLED(HOST_ACTION_COMMANDS) - "H" - #endif + TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, "D") + TERN_(HOST_ACTION_COMMANDS, "H") )) { #if ENABLED(HOST_ACTION_COMMANDS) if (parser.seen('H')) runout.host_handling = parser.value_bool(); @@ -45,7 +47,7 @@ void GcodeSuite::M412() { 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 HAS_FILAMENT_RUNOUT_DISTANCE if (parser.seen('D')) runout.set_runout_distance(parser.value_linear_units()); #endif } @@ -53,7 +55,7 @@ void GcodeSuite::M412() { SERIAL_ECHO_START(); SERIAL_ECHOPGM("Filament runout "); serialprintln_onoff(runout.enabled); - #ifdef FILAMENT_RUNOUT_DISTANCE_MM + #if HAS_FILAMENT_RUNOUT_DISTANCE SERIAL_ECHOLNPAIR("Filament runout distance (mm): ", runout.runout_distance()); #endif } diff --git a/Marlin/src/gcode/feature/trinamic/M122.cpp b/Marlin/src/gcode/feature/trinamic/M122.cpp index 0eb93a8006..46e4365f38 100644 --- a/Marlin/src/gcode/feature/trinamic/M122.cpp +++ b/Marlin/src/gcode/feature/trinamic/M122.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -26,6 +26,7 @@ #include "../../gcode.h" #include "../../../feature/tmc_util.h" +#include "../../../module/stepper/indirection.h" /** * M122: Debug TMC drivers @@ -37,11 +38,14 @@ void GcodeSuite::M122() { if (print_all) LOOP_XYZE(i) print_axis[i] = true; + if (parser.boolval('I')) restore_stepper_drivers(); + #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)); + uint16_t interval = MONITOR_DRIVER_STATUS_INTERVAL_MS; + if (parser.seen('S') && !parser.value_bool()) interval = 0; + if (parser.seenval('P')) NOMORE(interval, parser.value_ushort()); + tmc_set_report_interval(interval); #endif if (parser.seen('V')) diff --git a/Marlin/src/gcode/feature/trinamic/M569.cpp b/Marlin/src/gcode/feature/trinamic/M569.cpp index f88e116839..e72d03e767 100644 --- a/Marlin/src/gcode/feature/trinamic/M569.cpp +++ b/Marlin/src/gcode/feature/trinamic/M569.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/trinamic/M906.cpp b/Marlin/src/gcode/feature/trinamic/M906.cpp index 95ad310ed0..e834ebd67d 100644 --- a/Marlin/src/gcode/feature/trinamic/M906.cpp +++ b/Marlin/src/gcode/feature/trinamic/M906.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp index 582e779cc2..8c840db5bf 100644 --- a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp +++ b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 1f9d710bb4..7f00ec5a34 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -53,9 +53,16 @@ GcodeSuite gcode; #include "../feature/cancel_object.h" #endif +#if ENABLED(LASER_MOVE_POWER) + #include "../feature/spindle_laser.h" +#endif + #include "../MarlinCore.h" // for idle() -millis_t GcodeSuite::previous_move_ms; +// Inactivity shutdown +millis_t GcodeSuite::previous_move_ms = 0, + GcodeSuite::max_inactive_time = 0, + GcodeSuite::stepper_inactive_time = SEC_TO_MS(DEFAULT_STEPPER_DEACTIVE_TIME); // Relative motion mode for each logical axis static constexpr xyze_bool_t ar_init = AXIS_RELATIVE_MODES; @@ -66,7 +73,7 @@ uint8_t GcodeSuite::axis_relative = ( | (ar_init.e ? _BV(REL_E) : 0) ); -#if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) +#if EITHER(HAS_AUTO_REPORTING, HOST_KEEPALIVE_FEATURE) bool GcodeSuite::autoreport_paused; // = false #endif @@ -172,6 +179,16 @@ void GcodeSuite::get_destination_from_command() { #if BOTH(MIXING_EXTRUDER, DIRECT_MIXING_IN_G1) M165(); #endif + + #if ENABLED(LASER_MOVE_POWER) + // Set the laser power in the planner to configure this move + if (parser.seen('S')) { + const float spwr = parser.value_float(); + cutter.inline_power(TERN(SPINDLE_LASER_PWM, cutter.power_to_range(cutter_power_t(round(spwr))), spwr > 0 ? 255 : 0)); + } + else if (ENABLED(LASER_MOVE_G0_OFF) && parser.codenum == 0) // G0 + cutter.set_inline_enabled(false); + #endif } /** @@ -186,7 +203,7 @@ void GcodeSuite::dwell(millis_t time) { * 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) +#if BOTH(HAS_LEVELING, G29_RETRY_AND_RECOVER) #ifndef G29_MAX_RETRIES #define G29_MAX_RETRIES 0 @@ -202,9 +219,7 @@ void GcodeSuite::dwell(millis_t time) { } } - #if ENABLED(HOST_PROMPT_SUPPORT) - host_action_prompt_end(); - #endif + TERN_(HOST_PROMPT_SUPPORT, host_action_prompt_end()); #ifdef G29_SUCCESS_COMMANDS process_subcommands_now_P(PSTR(G29_SUCCESS_COMMANDS)); @@ -247,6 +262,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 5: G5(); break; // G5: Cubic B_spline #endif + #if ENABLED(DIRECT_STEPPING) + case 6: G6(); break; // G6: Direct Stepper Move + #endif + #if ENABLED(FWRETRACT) case 10: G10(); break; // G10: Retract / Swap Retract case 11: G11(); break; // G11: Recover / Swap Recover @@ -305,15 +324,14 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 34: G34(); break; // G34: Z Stepper automatic alignment using probe #endif + #if ENABLED(ASSISTED_TRAMMING) + case 35: G35(); break; // G35: Read four bed corners to help adjust bed screws + #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 + if (WITHIN(parser.subcode, 2, TERN(G38_PROBE_AWAY, 5, 3))) + G38(parser.subcode); // G38.4, G38.5: Probe away from target break; #endif @@ -453,7 +471,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 105: M105(); return; // M105: Report Temperatures (and say "ok") - #if FAN_COUNT > 0 + #if HAS_FAN case 106: M106(); break; // M106: Fan On case 107: M107(); break; // M107: Fan Off #endif @@ -465,14 +483,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { 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 + TERN_(HOST_PROMPT_SUPPORT, case 876:) // M876: Handle Host prompt responses #else case 108: case 112: case 410: - #if ENABLED(HOST_PROMPT_SUPPORT) - case 876: - #endif + TERN_(HOST_PROMPT_SUPPORT, case 876:) break; #endif @@ -490,7 +504,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 191: M191(); break; // M191: Wait for chamber temperature to reach target #endif - #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR + #if BOTH(AUTO_REPORT_TEMPERATURES, HAS_TEMP_SENSOR) case 155: M155(); break; // M155: Set temperature auto-report interval #endif @@ -530,7 +544,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 120: M120(); break; // M120: Enable endstops case 121: M121(); break; // M121: Disable endstops - #if HOTENDS && HAS_LCD_MENU + #if PREHEAT_COUNT case 145: M145(); break; // M145: Set material heatup parameters #endif @@ -649,6 +663,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 305: M305(); break; // M305: Set user thermistor parameters #endif + #if ENABLED(REPETIER_GCODE_M360) + case 360: M360(); break; // M360: Firmware settings + #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 @@ -700,6 +718,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 428: M428(); break; // M428: Apply current_position to home_offset #endif + #if HAS_POWER_MONITOR + case 430: M430(); break; // M430: Read the system current (A), voltage (V), and power (W) + #endif + #if ENABLED(CANCEL_OBJECTS) case 486: M486(); break; // M486: Identify and cancel objects #endif @@ -778,9 +800,9 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 900: M900(); break; // M900: Set advance K factor. #endif - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || EITHER(DIGIPOT_I2C, DAC_STEPPER_CURRENT) + #if ANY(HAS_DIGIPOTSS, HAS_MOTOR_CURRENT_PWM, HAS_I2C_DIGIPOT, DAC_STEPPER_CURRENT) case 907: M907(); break; // M907: Set digital trimpot motor current using axis codes. - #if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT) + #if EITHER(HAS_DIGIPOTSS, 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 @@ -972,7 +994,7 @@ void GcodeSuite::process_subcommands_now(char * gcode) { break; } } - next_busy_signal_ms = ms + host_keepalive_interval * 1000UL; + next_busy_signal_ms = ms + SEC_TO_MS(host_keepalive_interval); } #endif // HOST_KEEPALIVE_FEATURE diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 8e5d054d99..b3f339e295 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -31,9 +31,9 @@ * ----------------- * * Helpful G-code references: - * - http://marlinfw.org/meta/gcode + * - https://marlinfw.org/meta/gcode * - https://reprap.org/wiki/G-code - * - http://linuxcnc.org/docs/html/gcode.html + * - https://linuxcnc.org/docs/html/gcode.html * * Help to document Marlin's G-codes online: * - https://github.com/MarlinFirmware/MarlinDocumentation @@ -65,6 +65,7 @@ * 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) + * G35 - Read bed corners to help adjust bed screws: T (Requires ASSISTED_TRAMMING) * 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) * G60 - Save current position. (Requires SAVED_POSITIONS) @@ -217,6 +218,7 @@ * 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) + * M430 - Read the system current, voltage, and power (Requires POWER_MONITOR_CURRENT, POWER_MONITOR_VOLTAGE, or POWER_MONITOR_FIXED_VOLTAGE) * M486 - Identify and cancel objects. (Requires CANCEL_OBJECTS) * M500 - Store parameters in EEPROM. (Requires EEPROM_SETTINGS) * M501 - Restore parameters from EEPROM. (Requires EEPROM_SETTINGS) @@ -332,8 +334,14 @@ public: 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 millis_t previous_move_ms, max_inactive_time, stepper_inactive_time; + FORCE_INLINE static void reset_stepper_timeout(const millis_t ms=millis()) { previous_move_ms = ms; } + FORCE_INLINE static bool stepper_max_timed_out(const millis_t ms=millis()) { + return max_inactive_time && ELAPSED(ms, previous_move_ms + max_inactive_time); + } + FORCE_INLINE static bool stepper_inactive_timeout(const millis_t ms=millis()) { + return ELAPSED(ms, previous_move_ms + stepper_inactive_time); + } static int8_t get_target_extruder_from_command(); static int8_t get_target_e_stepper_from_command(); @@ -351,7 +359,7 @@ public: process_subcommands_now_P(G28_STR); } - #if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) + #if EITHER(HAS_AUTO_REPORTING, HOST_KEEPALIVE_FEATURE) static bool autoreport_paused; static inline bool set_autoreport_paused(const bool p) { const bool was = autoreport_paused; @@ -396,24 +404,20 @@ private: #endif ); - #if ENABLED(ARC_SUPPORT) - static void G2_G3(const bool clockwise); - #endif + TERN_(ARC_SUPPORT, static void G2_G3(const bool clockwise)); static void G4(); - #if ENABLED(BEZIER_CURVE_SUPPORT) - static void G5(); - #endif + TERN_(BEZIER_CURVE_SUPPORT, static void G5()); + + TERN_(DIRECT_STEPPING, static void G6()); #if ENABLED(FWRETRACT) static void G10(); static void G11(); #endif - #if ENABLED(NOZZLE_CLEAN_FEATURE) - static void G12(); - #endif + TERN_(NOZZLE_CLEAN_FEATURE, static void G12()); #if ENABLED(CNC_WORKSPACE_PLANES) static void G17(); @@ -426,13 +430,9 @@ private: static void G21(); #endif - #if ENABLED(G26_MESH_VALIDATION) - static void G26(); - #endif + TERN_(G26_MESH_VALIDATION, static void G26()); - #if ENABLED(NOZZLE_PARK_FEATURE) - static void G27(); - #endif + TERN_(NOZZLE_PARK_FEATURE, static void G27()); static void G28(); @@ -454,22 +454,18 @@ private: #endif #endif - #if ENABLED(DELTA_AUTO_CALIBRATION) - static void G33(); - #endif + TERN_(DELTA_AUTO_CALIBRATION, static void G33()); #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 + TERN_(ASSISTED_TRAMMING, static void G35()); - #if HAS_MESH - static void G42(); - #endif + TERN_(G38_PROBE_TARGET, static void G38(const int8_t subcode)); + + TERN_(HAS_MESH, static void G42()); #if ENABLED(CNC_COORDINATE_SYSTEMS) static void G53(); @@ -481,28 +477,20 @@ private: static void G59(); #endif - #if ENABLED(PROBE_TEMP_COMPENSATION) - static void G76(); - #endif + TERN_(PROBE_TEMP_COMPENSATION, static void G76()); #if SAVED_POSITIONS static void G60(); static void G61(); #endif - #if ENABLED(GCODE_MOTION_MODES) - static void G80(); - #endif + TERN_(GCODE_MOTION_MODES, static void G80()); static void G92(); - #if ENABLED(CALIBRATION_GCODE) - static void G425(); - #endif + TERN_(CALIBRATION_GCODE, static void G425()); - #if HAS_RESUME_CONTINUE - static void M0_M1(); - #endif + TERN_(HAS_RESUME_CONTINUE, static void M0_M1()); #if HAS_CUTTER static void M3_M4(const bool is_M4); @@ -510,22 +498,14 @@ private: #endif #if ENABLED(COOLANT_CONTROL) - #if ENABLED(COOLANT_MIST) - static void M7(); - #endif - #if ENABLED(COOLANT_FLOOD) - static void M8(); - #endif + TERN_(COOLANT_MIST, static void M7()); + TERN_(COOLANT_FLOOD, static void M8()); static void M9(); #endif - #if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) - static void M12(); - #endif + TERN_(EXTERNAL_CLOSED_LOOP_CONTROLLER, static void M12()); - #if ENABLED(EXPECTED_PRINTER_CHECK) - static void M16(); - #endif + TERN_(EXPECTED_PRINTER_CHECK, static void M16()); static void M17(); @@ -549,9 +529,7 @@ private: #if ENABLED(SDSUPPORT) static void M32(); - #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - static void M33(); - #endif + TERN_(LONG_FILENAME_HOST_SUPPORT, static void M33()); #if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE) static void M34(); #endif @@ -559,29 +537,19 @@ private: static void M42(); - #if ENABLED(PINS_DEBUGGING) - static void M43(); - #endif + TERN_(PINS_DEBUGGING, static void M43()); - #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - static void M48(); - #endif + TERN_(Z_MIN_PROBE_REPEATABILITY_TEST, static void M48()); - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - static void M73(); - #endif + TERN_(LCD_SET_PROGRESS_MANUALLY, static void M73()); static void M75(); static void M76(); static void M77(); - #if ENABLED(PRINTCOUNTER) - static void M78(); - #endif + TERN_(PRINTCOUNTER, static void M78()); - #if ENABLED(PSU_CONTROL) - static void M80(); - #endif + TERN_(PSU_CONTROL, static void M80()); static void M81(); static void M82(); @@ -589,9 +557,7 @@ private: static void M85(); static void M92(); - #if ENABLED(M100_FREE_MEMORY_WATCHER) - static void M100(); - #endif + TERN_(M100_FREE_MEMORY_WATCHER, static void M100()); #if EXTRUDERS static void M104(); @@ -600,7 +566,7 @@ private: static void M105(); - #if FAN_COUNT > 0 + #if HAS_FAN static void M106(); static void M107(); #endif @@ -609,17 +575,13 @@ private: static void M108(); static void M112(); static void M410(); - #if ENABLED(HOST_PROMPT_SUPPORT) - static void M876(); - #endif + TERN_(HOST_PROMPT_SUPPORT, static void M876()); #endif static void M110(); static void M111(); - #if ENABLED(HOST_KEEPALIVE_FEATURE) - static void M113(); - #endif + TERN_(HOST_KEEPALIVE_FEATURE, static void M113()); static void M114(); static void M115(); @@ -629,9 +591,7 @@ private: static void M120(); static void M121(); - #if ENABLED(PARK_HEAD_ON_PAUSE) - static void M125(); - #endif + TERN_(PARK_HEAD_ON_PAUSE, static void M125()); #if ENABLED(BARICUDA) #if HAS_HEATER_1 @@ -654,31 +614,23 @@ private: static void M191(); #endif - #if HOTENDS && HAS_LCD_MENU + #if PREHEAT_COUNT static void M145(); #endif - #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - static void M149(); - #endif + TERN_(TEMPERATURE_UNITS_SUPPORT, static void M149()); - #if HAS_COLOR_LEDS - static void M150(); - #endif + TERN_(HAS_COLOR_LEDS, static void M150()); - #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR + #if BOTH(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 + TERN_(DIRECT_MIXING_IN_G1, static void M165()); + TERN_(GRADIENT_MIX, static void M166()); #endif static void M200(); @@ -692,16 +644,12 @@ private: static void M204(); static void M205(); - #if HAS_M206_COMMAND - static void M206(); - #endif + TERN_(HAS_M206_COMMAND, static void M206()); #if ENABLED(FWRETRACT) static void M207(); static void M208(); - #if ENABLED(FWRETRACT_AUTORETRACT) - static void M209(); - #endif + TERN_(FWRETRACT_AUTORETRACT, static void M209()); #endif static void M211(); @@ -710,9 +658,7 @@ private: static void M217(); #endif - #if HAS_HOTEND_OFFSET - static void M218(); - #endif + TERN_(HAS_HOTEND_OFFSET, static void M218()); static void M220(); @@ -722,13 +668,9 @@ private: static void M226(); - #if ENABLED(PHOTO_GCODE) - static void M240(); - #endif + TERN_(PHOTO_GCODE, static void M240()); - #if HAS_LCD_CONTRAST - static void M250(); - #endif + TERN_(HAS_LCD_CONTRAST, static void M250()); #if ENABLED(EXPERIMENTAL_I2CBUS) static void M260(); @@ -737,47 +679,31 @@ private: #if HAS_SERVOS static void M280(); - #if ENABLED(EDITABLE_SERVO_ANGLES) - static void M281(); - #endif + TERN_(EDITABLE_SERVO_ANGLES, static void M281()); #endif - #if ENABLED(BABYSTEPPING) - static void M290(); - #endif + TERN_(BABYSTEPPING, static void M290()); - #if HAS_BUZZER - static void M300(); - #endif + TERN_(HAS_BUZZER, static void M300()); - #if ENABLED(PIDTEMP) - static void M301(); - #endif + TERN_(PIDTEMP, static void M301()); - #if ENABLED(PREVENT_COLD_EXTRUSION) - static void M302(); - #endif + TERN_(PREVENT_COLD_EXTRUSION, static void M302()); - #if HAS_PID_HEATING - static void M303(); - #endif + TERN_(HAS_PID_HEATING, static void M303()); - #if ENABLED(PIDTEMPBED) - static void M304(); - #endif + TERN_(PIDTEMPBED, static void M304()); - #if HAS_USER_THERMISTORS - static void M305(); - #endif + TERN_(HAS_USER_THERMISTORS, static void M305()); #if HAS_MICROSTEPS static void M350(); static void M351(); #endif - #if HAS_CASE_LIGHT - static void M355(); - #endif + TERN_(HAS_CASE_LIGHT, static void M355()); + + TERN_(REPETIER_GCODE_M360, static void M360()); #if ENABLED(MORGAN_SCARA) static bool M360(); @@ -799,9 +725,7 @@ private: static void M402(); #endif - #if ENABLED(PRUSA_MMU2) - static void M403(); - #endif + TERN_(PRUSA_MMU2, static void M403()); #if ENABLED(FILAMENT_WIDTH_SENSOR) static void M404(); @@ -810,26 +734,20 @@ private: static void M407(); #endif - #if HAS_FILAMENT_SENSOR - static void M412(); - #endif + TERN_(HAS_FILAMENT_SENSOR, static void M412()); #if HAS_LEVELING static void M420(); static void M421(); #endif - #if ENABLED(BACKLASH_GCODE) - static void M425(); - #endif + TERN_(BACKLASH_GCODE, static void M425()); - #if HAS_M206_COMMAND - static void M428(); - #endif + TERN_(HAS_M206_COMMAND, static void M428()); - #if ENABLED(CANCEL_OBJECTS) - static void M486(); - #endif + TERN_(HAS_POWER_MONITOR, static void M430()); + + TERN_(CANCEL_OBJECTS, static void M486()); static void M500(); static void M501(); @@ -837,34 +755,22 @@ private: #if DISABLED(DISABLE_M503) static void M503(); #endif - #if ENABLED(EEPROM_SETTINGS) - static void M504(); - #endif + TERN_(EEPROM_SETTINGS, static void M504()); - #if ENABLED(SDSUPPORT) - static void M524(); - #endif + TERN_(SDSUPPORT, static void M524()); - #if ENABLED(SD_ABORT_ON_ENDSTOP_HIT) - static void M540(); - #endif + TERN_(SD_ABORT_ON_ENDSTOP_HIT, static void M540()); - #if ENABLED(BAUD_RATE_GCODE) - static void M575(); - #endif + TERN_(BAUD_RATE_GCODE, static void M575()); #if ENABLED(ADVANCED_PAUSE_FEATURE) static void M600(); static void M603(); #endif - #if HAS_DUPLICATION_MODE - static void M605(); - #endif + TERN_(HAS_DUPLICATION_MODE, static void M605()); - #if IS_KINEMATIC - static void M665(); - #endif + TERN_(IS_KINEMATIC, static void M665()); #if ENABLED(DELTA) || HAS_EXTRA_ENDSTOPS static void M666(); @@ -879,17 +785,11 @@ private: static void M702(); #endif - #if ENABLED(GCODE_MACROS) - static void M810_819(); - #endif + TERN_(GCODE_MACROS, static void M810_819()); - #if HAS_BED_PROBE - static void M851(); - #endif + TERN_(HAS_BED_PROBE, static void M851()); - #if ENABLED(SKEW_CORRECTION_GCODE) - static void M852(); - #endif + TERN_(SKEW_CORRECTION_GCODE, static void M852()); #if ENABLED(I2C_POSITION_ENCODERS) FORCE_INLINE static void M860() { I2CPEM.M860(); } @@ -904,30 +804,20 @@ private: FORCE_INLINE static void M869() { I2CPEM.M869(); } #endif - #if ENABLED(PROBE_TEMP_COMPENSATION) - static void M871(); - #endif + TERN_(PROBE_TEMP_COMPENSATION, static void M871()); - #if ENABLED(LIN_ADVANCE) - static void M900(); - #endif + TERN_(LIN_ADVANCE, static void M900()); #if HAS_TRINAMIC_CONFIG static void M122(); static void M906(); - #if HAS_STEALTHCHOP - static void M569(); - #endif + TERN_(HAS_STEALTHCHOP, static void M569()); #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 + TERN_(HYBRID_THRESHOLD, static void M913()); + TERN_(USE_SENSORLESS, static void M914()); #endif #if HAS_L64XX @@ -938,9 +828,9 @@ private: static void M918(); #endif - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || EITHER(DIGIPOT_I2C, DAC_STEPPER_CURRENT) + #if ANY(HAS_DIGIPOTSS, HAS_MOTOR_CURRENT_PWM, HAS_I2C_DIGIPOT, DAC_STEPPER_CURRENT) static void M907(); - #if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT) + #if EITHER(HAS_DIGIPOTSS, DAC_STEPPER_CURRENT) static void M908(); #if ENABLED(DAC_STEPPER_CURRENT) static void M909(); @@ -949,17 +839,11 @@ private: #endif #endif - #if ENABLED(SDSUPPORT) - static void M928(); - #endif + TERN_(SDSUPPORT, static void M928()); - #if ENABLED(MAGNETIC_PARKING_EXTRUDER) - static void M951(); - #endif + TERN_(MAGNETIC_PARKING_EXTRUDER, static void M951()); - #if ENABLED(PLATFORM_M997_SUPPORT) - static void M997(); - #endif + TERN_(PLATFORM_M997_SUPPORT, static void M997()); static void M999(); @@ -968,17 +852,11 @@ private: static void M1000(); #endif - #if ENABLED(SDSUPPORT) - static void M1001(); - #endif + TERN_(SDSUPPORT, static void M1001()); - #if ENABLED(MAX7219_GCODE) - static void M7219(); - #endif + TERN_(MAX7219_GCODE, static void M7219()); - #if ENABLED(CONTROLLER_FAN_EDITABLE) - static void M710(); - #endif + TERN_(CONTROLLER_FAN_EDITABLE, static void M710()); static void T(const uint8_t tool_index); diff --git a/Marlin/src/gcode/geometry/G17-G19.cpp b/Marlin/src/gcode/geometry/G17-G19.cpp index 14f3e80bbc..7510eaba8c 100644 --- a/Marlin/src/gcode/geometry/G17-G19.cpp +++ b/Marlin/src/gcode/geometry/G17-G19.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/geometry/G53-G59.cpp b/Marlin/src/gcode/geometry/G53-G59.cpp index e24247b2c5..05bc522768 100644 --- a/Marlin/src/gcode/geometry/G53-G59.cpp +++ b/Marlin/src/gcode/geometry/G53-G59.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/geometry/G92.cpp b/Marlin/src/gcode/geometry/G92.cpp index 91a746dd76..1a0382ed7c 100644 --- a/Marlin/src/gcode/geometry/G92.cpp +++ b/Marlin/src/gcode/geometry/G92.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -99,5 +99,7 @@ void GcodeSuite::G92() { if (sync_XYZ) sync_plan_position(); else if (sync_E) sync_plan_position_e(); - report_current_position(); + #if DISABLED(DIRECT_STEPPING) + report_current_position(); + #endif } diff --git a/Marlin/src/gcode/geometry/M206_M428.cpp b/Marlin/src/gcode/geometry/M206_M428.cpp index 13e82a0c73..2a007427a7 100644 --- a/Marlin/src/gcode/geometry/M206_M428.cpp +++ b/Marlin/src/gcode/geometry/M206_M428.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/host/M110.cpp b/Marlin/src/gcode/host/M110.cpp index f7b6dfd4f4..b12b38ea0f 100644 --- a/Marlin/src/gcode/host/M110.cpp +++ b/Marlin/src/gcode/host/M110.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -27,5 +27,8 @@ * M110: Set Current Line Number */ void GcodeSuite::M110() { - if (parser.seenval('N')) queue.last_N = parser.value_long(); + + if (parser.seenval('N')) + queue.last_N[queue.command_port()] = parser.value_long(); + } diff --git a/Marlin/src/gcode/host/M113.cpp b/Marlin/src/gcode/host/M113.cpp index 872986561d..ce826d6acd 100644 --- a/Marlin/src/gcode/host/M113.cpp +++ b/Marlin/src/gcode/host/M113.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/host/M114.cpp b/Marlin/src/gcode/host/M114.cpp index ec5b950b64..85a38f6462 100644 --- a/Marlin/src/gcode/host/M114.cpp +++ b/Marlin/src/gcode/host/M114.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -38,11 +38,12 @@ char str[12]; LOOP_L_N(a, n) { SERIAL_CHAR(' ', axis_codes[a], ':'); + if (pos[a] >= 0) 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); } + inline void report_xyz(const xyze_pos_t &pos) { report_xyze(pos, XYZ); } void report_xyz(const xyz_pos_t &pos, const uint8_t precision=3) { char str[12]; @@ -178,7 +179,7 @@ report_xyze(from_steppers); const xyze_float_t diff = from_steppers - leveled; - SERIAL_ECHOPGM("Diff: "); + SERIAL_ECHOPGM("Diff: "); report_xyze(diff); } @@ -213,8 +214,6 @@ void GcodeSuite::M114() { if (parser.seen('R')) { report_real_position(); return; } #endif - #if ENABLED(M114_LEGACY) - planner.synchronize(); - #endif + TERN_(M114_LEGACY, planner.synchronize()); report_current_position_projected(); } diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index d74f909c47..c3ff9c8c1a 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -16,13 +16,17 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include "../gcode.h" #include "../../inc/MarlinConfig.h" +#if ENABLED(M115_GEOMETRY_REPORT) + #include "../../module/motion.h" +#endif + #if ENABLED(EXTENDED_CAPABILITIES_REPORT) static void cap_line(PGM_P const name, bool ena=false) { SERIAL_ECHOPGM("Cap:"); @@ -44,14 +48,10 @@ void GcodeSuite::M115() { #if ENABLED(EXTENDED_CAPABILITIES_REPORT) // PAREN_COMMENTS - #if ENABLED(PAREN_COMMENTS) - cap_line(PSTR("PAREN_COMMENTS"), true); - #endif + TERN_(PAREN_COMMENTS, cap_line(PSTR("PAREN_COMMENTS"), true)); // QUOTED_STRINGS - #if ENABLED(GCODE_QUOTED_STRINGS) - cap_line(PSTR("QUOTED_STRINGS"), true); - #endif + TERN_(GCODE_QUOTED_STRINGS, cap_line(PSTR("QUOTED_STRINGS"), true)); // SERIAL_XON_XOFF cap_line(PSTR("SERIAL_XON_XOFF"), ENABLED(SERIAL_XON_XOFF)); @@ -77,6 +77,9 @@ void GcodeSuite::M115() { // AUTOLEVEL (G29) cap_line(PSTR("AUTOLEVEL"), ENABLED(HAS_AUTOLEVEL)); + // RUNOUT (M412, M600) + cap_line(PSTR("RUNOUT"), ENABLED(FILAMENT_RUNOUT_SENSOR)); + // Z_PROBE (G30) cap_line(PSTR("Z_PROBE"), ENABLED(HAS_BED_PROBE)); @@ -89,10 +92,9 @@ void GcodeSuite::M115() { // SOFTWARE_POWER (M80, M81) cap_line(PSTR("SOFTWARE_POWER"), ENABLED(PSU_CONTROL)); - // CASE LIGHTS (M355) + // TOGGLE_LIGHTS (M355) cap_line(PSTR("TOGGLE_LIGHTS"), ENABLED(HAS_CASE_LIGHT)); - - cap_line(PSTR("CASE_LIGHT_BRIGHTNESS"), TERN(HAS_CASE_LIGHT, PWM_PIN(CASE_LIGHT_PIN), 0)); + cap_line(PSTR("CASE_LIGHT_BRIGHTNESS"), TERN0(HAS_CASE_LIGHT, PWM_PIN(CASE_LIGHT_PIN))); // EMERGENCY_PARSER (M108, M112, M410, M876) cap_line(PSTR("EMERGENCY_PARSER"), ENABLED(EMERGENCY_PARSER)); @@ -100,17 +102,52 @@ void GcodeSuite::M115() { // PROMPT SUPPORT (M876) cap_line(PSTR("PROMPT_SUPPORT"), ENABLED(HOST_PROMPT_SUPPORT)); + // SDCARD (M20, M23, M24, etc.) + cap_line(PSTR("SDCARD"), ENABLED(SDSUPPORT)); + // AUTOREPORT_SD_STATUS (M27 extension) cap_line(PSTR("AUTOREPORT_SD_STATUS"), ENABLED(AUTO_REPORT_SD_STATUS)); + // LONG_FILENAME_HOST_SUPPORT (M33) + cap_line(PSTR("LONG_FILENAME"), ENABLED(LONG_FILENAME_HOST_SUPPORT)); + // THERMAL_PROTECTION cap_line(PSTR("THERMAL_PROTECTION"), ENABLED(THERMALLY_SAFE)); // MOTION_MODES (M80-M89) cap_line(PSTR("MOTION_MODES"), ENABLED(GCODE_MOTION_MODES)); + // ARC_SUPPORT (G2-G3) + cap_line(PSTR("ARCS"), ENABLED(ARC_SUPPORT)); + + // BABYSTEPPING (M290) + cap_line(PSTR("BABYSTEPPING"), ENABLED(BABYSTEPPING)); + // CHAMBER_TEMPERATURE (M141, M191) cap_line(PSTR("CHAMBER_TEMPERATURE"), ENABLED(HAS_HEATED_CHAMBER)); + // Machine Geometry + #if ENABLED(M115_GEOMETRY_REPORT) + const xyz_pos_t dmin = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }, + dmax = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS }; + xyz_pos_t cmin = dmin, cmax = dmax; + apply_motion_limits(cmin); + apply_motion_limits(cmax); + const xyz_pos_t lmin = dmin.asLogical(), lmax = dmax.asLogical(), + wmin = cmin.asLogical(), wmax = cmax.asLogical(); + SERIAL_ECHOLNPAIR( + "area:{" + "full:{" + "min:{x:", lmin.x, ",y:", lmin.y, ",z:", lmin.z, "}," + "max:{x:", lmax.x, ",y:", lmax.y, ",z:", lmax.z, "}" + "}," + "work:{" + "min:{x:", wmin.x, ",y:", wmin.y, ",z:", wmin.z, "}," + "max:{x:", wmax.x, ",y:", wmax.y, ",z:", wmax.z, "}", + "}" + "}" + ); + #endif + #endif // EXTENDED_CAPABILITIES_REPORT } diff --git a/Marlin/src/gcode/host/M118.cpp b/Marlin/src/gcode/host/M118.cpp index ba52a4f816..3be2902541 100644 --- a/Marlin/src/gcode/host/M118.cpp +++ b/Marlin/src/gcode/host/M118.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -34,7 +34,7 @@ */ void GcodeSuite::M118() { bool hasE = false, hasA = false; - #if NUM_SERIAL > 1 + #if HAS_MULTI_SERIAL int8_t port = -1; // Assume no redirect #endif char *p = parser.string_arg; @@ -44,7 +44,7 @@ void GcodeSuite::M118() { switch (p[0]) { case 'A': hasA = true; break; case 'E': hasE = true; break; - #if NUM_SERIAL > 1 + #if HAS_MULTI_SERIAL case 'P': port = p[1] - '0'; break; #endif } @@ -52,7 +52,7 @@ void GcodeSuite::M118() { while (*p == ' ') ++p; } - #if NUM_SERIAL > 1 + #if HAS_MULTI_SERIAL const int8_t old_serial = serial_port_index; if (WITHIN(port, 0, NUM_SERIAL)) serial_port_index = ( @@ -69,7 +69,5 @@ void GcodeSuite::M118() { if (hasA) SERIAL_ECHOPGM("// "); SERIAL_ECHOLN(p); - #if NUM_SERIAL > 1 - serial_port_index = old_serial; - #endif + TERN_(HAS_MULTI_SERIAL, serial_port_index = old_serial); } diff --git a/Marlin/src/gcode/host/M119.cpp b/Marlin/src/gcode/host/M119.cpp index b3cb7290b3..f0066bddff 100644 --- a/Marlin/src/gcode/host/M119.cpp +++ b/Marlin/src/gcode/host/M119.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/host/M16.cpp b/Marlin/src/gcode/host/M16.cpp index fd3320db93..1ac8580396 100644 --- a/Marlin/src/gcode/host/M16.cpp +++ b/Marlin/src/gcode/host/M16.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -33,7 +33,7 @@ void GcodeSuite::M16() { if (strcmp_P(parser.string_arg, PSTR(MACHINE_NAME))) - kill(GET_TEXT(MSG_EXPECTED_PRINTER)); + kill(GET_TEXT(MSG_KILL_EXPECTED_PRINTER)); } diff --git a/Marlin/src/gcode/host/M360.cpp b/Marlin/src/gcode/host/M360.cpp new file mode 100644 index 0000000000..87ca23becd --- /dev/null +++ b/Marlin/src/gcode/host/M360.cpp @@ -0,0 +1,188 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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(REPETIER_GCODE_M360) + +#include "../gcode.h" + +#include "../../module/motion.h" +#include "../../module/planner.h" + +static void config_prefix(PGM_P const name, PGM_P const pref=nullptr) { + SERIAL_ECHOPGM("Config:"); + if (pref) serialprintPGM(pref); + serialprintPGM(name); + SERIAL_CHAR(':'); +} +static void config_line(PGM_P const name, const float val, PGM_P const pref=nullptr) { + config_prefix(name, pref); + SERIAL_ECHOLN(val); +} + +/** + * M360: Report Firmware configuration + * in RepRapFirmware-compatible format + */ +void GcodeSuite::M360() { + PGMSTR(X_STR, "X"); + PGMSTR(Y_STR, "Y"); + PGMSTR(Z_STR, "Z"); + PGMSTR(JERK_STR, "Jerk"); + + // + // Basics and Enabled items + // + config_line(PSTR("Baudrate"), BAUDRATE); + config_line(PSTR("InputBuffer"), MAX_CMD_SIZE); + config_line(PSTR("PrintlineCache"), BUFSIZE); + config_line(PSTR("MixingExtruder"), ENABLED(MIXING_EXTRUDER)); + config_line(PSTR("SDCard"), ENABLED(SDSUPPORT)); + config_line(PSTR("Fan"), ENABLED(HAS_FAN)); + config_line(PSTR("LCD"), ENABLED(HAS_DISPLAY)); + config_line(PSTR("SoftwarePowerSwitch"), 1); + config_line(PSTR("SupportLocalFilamentchange"), ENABLED(ADVANCED_PAUSE_FEATURE)); + config_line(PSTR("CaseLights"), ENABLED(CASE_LIGHT_ENABLE)); + config_line(PSTR("ZProbe"), ENABLED(HAS_BED_PROBE)); + config_line(PSTR("Autolevel"), ENABLED(HAS_LEVELING)); + config_line(PSTR("EEPROM"), ENABLED(EEPROM_SETTINGS)); + + // + // Homing Directions + // + PGMSTR(H_DIR_STR, "HomeDir"); + config_line(H_DIR_STR, X_HOME_DIR, X_STR); + config_line(H_DIR_STR, Y_HOME_DIR, Y_STR); + config_line(H_DIR_STR, Z_HOME_DIR, Z_STR); + + // + // XYZ Axis Jerk + // + #if HAS_CLASSIC_JERK + if (planner.max_jerk.x == planner.max_jerk.y) + config_line(PSTR("XY"), planner.max_jerk.x, JERK_STR); + else { + config_line(X_STR, planner.max_jerk.x, JERK_STR); + config_line(Y_STR, planner.max_jerk.y, JERK_STR); + } + config_line(Z_STR, planner.max_jerk.z, JERK_STR); + #endif + + // + // Firmware Retraction + // + config_line(PSTR("SupportG10G11"), ENABLED(FWRETRACT)); + #if ENABLED(FWRETRACT) + PGMSTR(RET_STR, "Retraction"); + PGMSTR(UNRET_STR, "RetractionUndo"); + PGMSTR(SPEED_STR, "Speed"); + // M10 Retract with swap (long) moves + config_line(PSTR("Length"), fwretract.settings.retract_length, RET_STR); + config_line(SPEED_STR, fwretract.settings.retract_feedrate_mm_s, RET_STR); + config_line(PSTR("ZLift"), fwretract.settings.retract_zraise, RET_STR); + config_line(PSTR("LongLength"), fwretract.settings.swap_retract_length, RET_STR); + // M11 Recover (undo) with swap (long) moves + config_line(SPEED_STR, fwretract.settings.retract_recover_feedrate_mm_s, UNRET_STR); + config_line(PSTR("ExtraLength"), fwretract.settings.retract_recover_extra, UNRET_STR); + config_line(PSTR("ExtraLongLength"), fwretract.settings.swap_retract_recover_extra, UNRET_STR); + config_line(PSTR("LongSpeed"), fwretract.settings.swap_retract_recover_feedrate_mm_s, UNRET_STR); + #endif + + // + // Workspace boundaries + // + const xyz_pos_t dmin = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }, + dmax = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS }; + xyz_pos_t cmin = dmin, cmax = dmax; + apply_motion_limits(cmin); + apply_motion_limits(cmax); + const xyz_pos_t wmin = cmin.asLogical(), wmax = cmax.asLogical(); + + PGMSTR(MIN_STR, "Min"); + PGMSTR(MAX_STR, "Max"); + PGMSTR(SIZE_STR, "Size"); + config_line(MIN_STR, wmin.x, X_STR); + config_line(MIN_STR, wmin.y, Y_STR); + config_line(MIN_STR, wmin.z, Z_STR); + config_line(MAX_STR, wmax.x, X_STR); + config_line(MAX_STR, wmax.y, Y_STR); + config_line(MAX_STR, wmax.z, Z_STR); + config_line(SIZE_STR, wmax.x - wmin.x, X_STR); + config_line(SIZE_STR, wmax.y - wmin.y, Y_STR); + config_line(SIZE_STR, wmax.z - wmin.z, Z_STR); + + // + // Print and Travel Acceleration + // + #define _ACCEL(A,B) _MIN(planner.settings.max_acceleration_mm_per_s2[A##_AXIS], planner.settings.B) + PGMSTR(P_ACC_STR, "PrintAccel"); + PGMSTR(T_ACC_STR, "TravelAccel"); + config_line(P_ACC_STR, _ACCEL(X, acceleration), X_STR); + config_line(P_ACC_STR, _ACCEL(Y, acceleration), Y_STR); + config_line(P_ACC_STR, _ACCEL(Z, acceleration), Z_STR); + config_line(T_ACC_STR, _ACCEL(X, travel_acceleration), X_STR); + config_line(T_ACC_STR, _ACCEL(Y, travel_acceleration), Y_STR); + config_line(T_ACC_STR, _ACCEL(Z, travel_acceleration), Z_STR); + + config_prefix(PSTR("PrinterType")); + SERIAL_ECHOLNPGM( + TERN_(DELTA, "Delta") + TERN_(IS_SCARA, "SCARA") + TERN_(IS_CORE, "Core") + TERN_(IS_CARTESIAN, "Cartesian") + ); + + // + // Heated Bed + // + config_line(PSTR("HeatedBed"), ENABLED(HAS_HEATED_BED)); + #if HAS_HEATED_BED + config_line(PSTR("MaxBedTemp"), BED_MAX_TARGET); + #endif + + // + // Per-Extruder settings + // + config_line(PSTR("NumExtruder"), EXTRUDERS); + #if EXTRUDERS + #define DIAM_VALUE(N) TERN(NO_VOLUMETRICS, DEFAULT_NOMINAL_FILAMENT_DIA, planner.filament_size[N]) + #if HAS_LINEAR_E_JERK + #define E_JERK_VAL(N) planner.max_e_jerk[E_INDEX_N(N)] + #elif HAS_CLASSIC_JERK + #define E_JERK_VAL(N) planner.max_jerk.e + #else + #define E_JERK_VAL(N) DEFAULT_EJERK + #endif + #define _EXTR_ITEM(N) do{ \ + PGMSTR(EXTR_STR, "Extr." STRINGIFY(INCREMENT(N)) ":"); \ + config_line(JERK_STR, E_JERK_VAL(N), EXTR_STR); \ + config_line(PSTR("MaxSpeed"), planner.settings.max_feedrate_mm_s[E_AXIS_N(N)], EXTR_STR); \ + config_line(PSTR("Acceleration"), planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(N)], EXTR_STR); \ + config_line(PSTR("Diameter"), DIAM_VALUE(N), EXTR_STR); \ + config_line(PSTR("MaxTemp"), (HEATER_##N##_MAXTEMP) - (HOTEND_OVERSHOOT), EXTR_STR); \ + }while(0) + + REPEAT(EXTRUDERS, _EXTR_ITEM); + #endif +} + +#endif diff --git a/Marlin/src/gcode/host/M876.cpp b/Marlin/src/gcode/host/M876.cpp index fe0ca1541a..0d8256cf08 100644 --- a/Marlin/src/gcode/host/M876.cpp +++ b/Marlin/src/gcode/host/M876.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/gcode/lcd/M0_M1.cpp b/Marlin/src/gcode/lcd/M0_M1.cpp index 190023b090..1d18b70602 100644 --- a/Marlin/src/gcode/lcd/M0_M1.cpp +++ b/Marlin/src/gcode/lcd/M0_M1.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -77,15 +77,11 @@ void GcodeSuite::M0_M1() { #endif - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? PSTR("M1 Stop") : PSTR("M0 Stop"), CONTINUE_STR); - #endif + TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? PSTR("M1 Stop") : PSTR("M0 Stop"), CONTINUE_STR)); wait_for_user_response(ms); - #if HAS_LCD_MENU - ui.reset_status(); - #endif + TERN_(HAS_LCD_MENU, ui.reset_status()); } #endif // HAS_RESUME_CONTINUE diff --git a/Marlin/src/gcode/lcd/M117.cpp b/Marlin/src/gcode/lcd/M117.cpp index 7e314731f8..8459135f30 100644 --- a/Marlin/src/gcode/lcd/M117.cpp +++ b/Marlin/src/gcode/lcd/M117.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/lcd/M145.cpp b/Marlin/src/gcode/lcd/M145.cpp index 3116727533..abd4dcc743 100644 --- a/Marlin/src/gcode/lcd/M145.cpp +++ b/Marlin/src/gcode/lcd/M145.cpp @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include "../../inc/MarlinConfig.h" -#if HOTENDS && HAS_LCD_MENU +#if PREHEAT_COUNT #include "../gcode.h" #include "../../lcd/ultralcd.h" @@ -37,25 +37,23 @@ */ void GcodeSuite::M145() { const uint8_t material = (uint8_t)parser.intval('S'); - if (material >= COUNT(ui.preheat_hotend_temp)) + if (material >= PREHEAT_COUNT) SERIAL_ERROR_MSG(STR_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); - } + preheat_t &mat = ui.material_preset[material]; + #if HAS_HOTEND + if (parser.seenval('H')) + mat.hotend_temp = constrain(parser.value_int(), EXTRUDE_MINTEMP, (HEATER_0_MAXTEMP) - (HOTEND_OVERSHOOT)); + #endif + #if HAS_HEATED_BED + if (parser.seenval('B')) + mat.bed_temp = constrain(parser.value_int(), BED_MINTEMP, BED_MAX_TARGET); + #endif + #if HAS_FAN + if (parser.seenval('F')) + mat.fan_speed = constrain(parser.value_int(), 0, 255); #endif } } -#endif // HOTENDS && HAS_LCD_MENU +#endif // PREHEAT_COUNT diff --git a/Marlin/src/gcode/lcd/M250.cpp b/Marlin/src/gcode/lcd/M250.cpp index 839fd25969..f42daaeac4 100644 --- a/Marlin/src/gcode/lcd/M250.cpp +++ b/Marlin/src/gcode/lcd/M250.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/lcd/M300.cpp b/Marlin/src/gcode/lcd/M300.cpp index 5d7e766b2d..56d9ee5d73 100644 --- a/Marlin/src/gcode/lcd/M300.cpp +++ b/Marlin/src/gcode/lcd/M300.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/lcd/M73.cpp b/Marlin/src/gcode/lcd/M73.cpp index 347c42c442..7a5454419d 100644 --- a/Marlin/src/gcode/lcd/M73.cpp +++ b/Marlin/src/gcode/lcd/M73.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -33,9 +33,6 @@ * * Example: * M73 P25 ; Set progress to 25% - * - * Notes: - * This has no effect during an SD print job */ void GcodeSuite::M73() { if (parser.seen('P')) diff --git a/Marlin/src/gcode/motion/G0_G1.cpp b/Marlin/src/gcode/motion/G0_G1.cpp index 069d76fdad..3aa082c25e 100644 --- a/Marlin/src/gcode/motion/G0_G1.cpp +++ b/Marlin/src/gcode/motion/G0_G1.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -69,7 +69,7 @@ void GcodeSuite::G0_G1( #endif #endif - get_destination_from_command(); // Process X Y Z E F parameters + get_destination_from_command(); // Get X Y Z E F (and set cutter power) #ifdef G0_FEEDRATE if (fast_move) { diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index b0fb299ab2..59a5346356 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -70,14 +70,12 @@ void plan_arc( 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], + start_L = current_position[l_axis], + linear_travel = cart[l_axis] - start_L, 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. @@ -105,17 +103,22 @@ void plan_arc( const feedRate_t scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s); - #ifdef ARC_SEGMENTS_PER_R - float seg_length = MM_PER_ARC_SEGMENT * radius; - LIMIT(seg_length, MM_PER_ARC_SEGMENT, ARC_SEGMENTS_PER_R); - #elif ARC_SEGMENTS_PER_SEC - float seg_length = scaled_fr_mm_s * RECIPROCAL(ARC_SEGMENTS_PER_SEC); - NOLESS(seg_length, MM_PER_ARC_SEGMENT); - #else - constexpr float seg_length = MM_PER_ARC_SEGMENT; - #endif + // Start with a nominal segment length + float seg_length = ( + #ifdef ARC_SEGMENTS_PER_R + constrain(MM_PER_ARC_SEGMENT * radius, MM_PER_ARC_SEGMENT, ARC_SEGMENTS_PER_R) + #elif ARC_SEGMENTS_PER_SEC + _MAX(scaled_fr_mm_s * RECIPROCAL(ARC_SEGMENTS_PER_SEC), MM_PER_ARC_SEGMENT) + #else + MM_PER_ARC_SEGMENT + #endif + ); + // Divide total travel by nominal segment length uint16_t segments = FLOOR(mm_of_travel / seg_length); - NOLESS(segments, min_segments); + if (segments < min_segments) { // Too few segments? + segments = min_segments; // More segments + } + seg_length = mm_of_travel / segments; /** * Vector rotation by transformation matrix: r is the original vector, r_T is the rotated vector, @@ -148,8 +151,9 @@ void plan_arc( 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 + sq_theta_per_segment = sq(theta_per_segment), + sin_T = theta_per_segment - sq_theta_per_segment*theta_per_segment/6, + cos_T = 1 - 0.5f * sq_theta_per_segment; // Small angle approximation // Initialize the linear axis raw[l_axis] = current_position[l_axis]; @@ -157,7 +161,6 @@ void plan_arc( // Initialize the extruder axis raw.e = current_position.e; - #if ENABLED(SCARA_FEEDRATE_SCALING) const float inv_duration = scaled_fr_mm_s / seg_length; #endif @@ -216,19 +219,16 @@ void plan_arc( planner.apply_leveling(raw); #endif - if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, seg_length + if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, 0 #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif - )) - break; + )) break; } // Ensure last segment arrives at target location. raw = cart; - #if ENABLED(AUTO_BED_LEVELING_UBL) - raw[l_axis] = start_L; - #endif + TERN_(AUTO_BED_LEVELING_UBL, raw[l_axis] = start_L); apply_motion_limits(raw); @@ -242,10 +242,9 @@ void plan_arc( #endif ); - #if ENABLED(AUTO_BED_LEVELING_UBL) - raw[l_axis] = start_L; - #endif + TERN_(AUTO_BED_LEVELING_UBL, raw[l_axis] = start_L); current_position = raw; + } // plan_arc /** @@ -283,11 +282,9 @@ void GcodeSuite::G2_G3(const bool clockwise) { relative_mode = true; #endif - get_destination_from_command(); + get_destination_from_command(); // Get X Y Z E F (and set cutter power) - #if ENABLED(SF_ARC_FIX) - relative_mode = relative_mode_backup; - #endif + TERN_(SF_ARC_FIX, relative_mode = relative_mode_backup); ab_float_t arc_offset = { 0, 0 }; if (parser.seenval('R')) { diff --git a/Marlin/src/gcode/motion/G4.cpp b/Marlin/src/gcode/motion/G4.cpp index d157face90..3a37fe5b2c 100644 --- a/Marlin/src/gcode/motion/G4.cpp +++ b/Marlin/src/gcode/motion/G4.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/motion/G5.cpp b/Marlin/src/gcode/motion/G5.cpp index 89b45ce8fc..35cc428023 100644 --- a/Marlin/src/gcode/motion/G5.cpp +++ b/Marlin/src/gcode/motion/G5.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/motion/G6.cpp b/Marlin/src/gcode/motion/G6.cpp new file mode 100644 index 0000000000..168dc28abd --- /dev/null +++ b/Marlin/src/gcode/motion/G6.cpp @@ -0,0 +1,61 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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(DIRECT_STEPPING) + +#include "../../feature/direct_stepping.h" + +#include "../gcode.h" +#include "../../module/planner.h" + +/** + * G6: Direct Stepper Move + */ +void GcodeSuite::G6() { + // TODO: feedrate support? + if (parser.seen('R')) + planner.last_page_step_rate = parser.value_ulong(); + + if (!DirectStepping::Config::DIRECTIONAL) { + if (parser.seen('X')) planner.last_page_dir.x = !!parser.value_byte(); + if (parser.seen('Y')) planner.last_page_dir.y = !!parser.value_byte(); + if (parser.seen('Z')) planner.last_page_dir.z = !!parser.value_byte(); + if (parser.seen('E')) planner.last_page_dir.e = !!parser.value_byte(); + } + + // No index means we just set the state + if (!parser.seen('I')) return; + + // No speed is set, can't schedule the move + if (!planner.last_page_step_rate) return; + + const page_idx_t page_idx = (page_idx_t) parser.value_ulong(); + + uint16_t num_steps = DirectStepping::Config::TOTAL_STEPS; + if (parser.seen('S')) num_steps = parser.value_ushort(); + + planner.buffer_page(page_idx, 0, num_steps); + reset_stepper_timeout(); +} + +#endif // DIRECT_STEPPING diff --git a/Marlin/src/gcode/motion/G80.cpp b/Marlin/src/gcode/motion/G80.cpp index 700038df0f..f674596ddd 100644 --- a/Marlin/src/gcode/motion/G80.cpp +++ b/Marlin/src/gcode/motion/G80.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/motion/M290.cpp b/Marlin/src/gcode/motion/M290.cpp index 5fef948fa4..7158525ed9 100644 --- a/Marlin/src/gcode/motion/M290.cpp +++ b/Marlin/src/gcode/motion/M290.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -41,14 +41,10 @@ #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 - ) { + if (TERN1(BABYSTEP_HOTEND_Z_OFFSET, active_extruder == 0)) { probe.offset.z += offs; SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(STR_PROBE_OFFSET STR_Z ": ", probe.offset.z); + SERIAL_ECHOLNPAIR(STR_PROBE_OFFSET " " STR_Z, probe.offset.z); } else { #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) diff --git a/Marlin/src/gcode/parser.cpp b/Marlin/src/gcode/parser.cpp index 4ece6ede46..91a24d1dd0 100644 --- a/Marlin/src/gcode/parser.cpp +++ b/Marlin/src/gcode/parser.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -28,7 +28,7 @@ #include "../MarlinCore.h" -#if NUM_SERIAL > 1 +#if HAS_MULTI_SERIAL #include "queue.h" #endif @@ -83,9 +83,7 @@ void GCodeParser::reset() { string_arg = nullptr; // No whole line argument command_letter = '?'; // No command letter codenum = 0; // No command code - #if ENABLED(USE_GCODE_SUBCODES) - subcode = 0; // No command sub-code - #endif + TERN_(USE_GCODE_SUBCODES, subcode = 0); // No command sub-code #if ENABLED(FASTER_GCODE_PARSER) codebits = 0; // No codes yet //ZERO(param); // No parameters (should be safe to comment out this line) @@ -119,9 +117,8 @@ void GCodeParser::parse(char *p) { reset(); // No codes to report auto uppercase = [](char c) { - #if ENABLED(GCODE_CASE_INSENSITIVE) - if (WITHIN(c, 'a', 'z')) c += 'A' - 'a'; - #endif + if (TERN0(GCODE_CASE_INSENSITIVE, WITHIN(c, 'a', 'z'))) + c += 'A' - 'a'; return c; }; @@ -130,9 +127,7 @@ void GCodeParser::parse(char *p) { // Skip N[-0-9] if included in the command line if (uppercase(*p) == 'N' && NUMERIC_SIGNED(p[1])) { - #if ENABLED(FASTER_GCODE_PARSER) - //set('N', p + 1); // (optional) Set the 'N' parameter value - #endif + //TERN_(FASTER_GCODE_PARSER, set('N', p + 1)); // (optional) Set the 'N' parameter value p += 2; // skip N[-0-9] while (NUMERIC(*p)) ++p; // skip [0-9]* while (*p == ' ') ++p; // skip [ ]* @@ -213,9 +208,7 @@ void GCodeParser::parse(char *p) { ) ) { motion_mode_codenum = codenum; - #if ENABLED(USE_GCODE_SUBCODES) - motion_mode_subcode = subcode; - #endif + TERN_(USE_GCODE_SUBCODES, motion_mode_subcode = subcode); } #endif @@ -232,9 +225,7 @@ void GCodeParser::parse(char *p) { if (motion_mode_codenum < 0) return; command_letter = 'G'; codenum = motion_mode_codenum; - #if ENABLED(USE_GCODE_SUBCODES) - subcode = motion_mode_subcode; - #endif + TERN_(USE_GCODE_SUBCODES, subcode = motion_mode_subcode); p--; // Back up one character to use the current parameter break; #endif // GCODE_MOTION_MODES @@ -331,13 +322,9 @@ void GCodeParser::parse(char *p) { #endif } - #if ENABLED(DEBUG_GCODE_PARSER) - if (debug) SERIAL_EOL(); - #endif + if (TERN0(DEBUG_GCODE_PARSER, debug)) SERIAL_EOL(); - #if ENABLED(FASTER_GCODE_PARSER) - set(param, valptr); // Set parameter exists and pointer (nullptr for no value) - #endif + TERN_(FASTER_GCODE_PARSER, set(param, valptr)); // Set parameter exists and pointer (nullptr for no value) } else if (!string_arg) { // Not A-Z? First time, keep as the string_arg string_arg = p - 1; diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index 06e41ccf13..5474e5e5f3 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/gcode/probe/G30.cpp b/Marlin/src/gcode/probe/G30.cpp index 21d56b3fd4..4347f55aa8 100644 --- a/Marlin/src/gcode/probe/G30.cpp +++ b/Marlin/src/gcode/probe/G30.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -46,22 +46,19 @@ void GcodeSuite::G30() { if (!probe.can_reach(pos)) return; // Disable leveling so the planner won't mess with us - #if HAS_LEVELING - set_bed_leveling_enabled(false); - #endif + TERN_(HAS_LEVELING, set_bed_leveling_enabled(false)); remember_feedrate_scaling_off(); const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE; const float measured_z = probe.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)); + SERIAL_ECHOLNPAIR("Bed X: ", pos.x, " Y: ", pos.y, " Z: ", measured_z); restore_feedrate_and_scaling(); - #ifdef Z_AFTER_PROBING - if (raise_after == PROBE_PT_STOW) probe.move_z_after_probing(); - #endif + if (raise_after == PROBE_PT_STOW) + probe.move_z_after_probing(); report_current_position(); } diff --git a/Marlin/src/gcode/probe/G31_G32.cpp b/Marlin/src/gcode/probe/G31_G32.cpp index e2e43e35ed..af44257d61 100644 --- a/Marlin/src/gcode/probe/G31_G32.cpp +++ b/Marlin/src/gcode/probe/G31_G32.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/probe/G38.cpp b/Marlin/src/gcode/probe/G38.cpp index 512e1ff89f..b06cd47359 100644 --- a/Marlin/src/gcode/probe/G38.cpp +++ b/Marlin/src/gcode/probe/G38.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/probe/M401_M402.cpp b/Marlin/src/gcode/probe/M401_M402.cpp index a0a6c1cec5..8e9bd11b81 100644 --- a/Marlin/src/gcode/probe/M401_M402.cpp +++ b/Marlin/src/gcode/probe/M401_M402.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -41,9 +41,7 @@ void GcodeSuite::M401() { */ void GcodeSuite::M402() { probe.stow(); - #ifdef Z_AFTER_PROBING - probe.move_z_after_probing(); - #endif + probe.move_z_after_probing(); report_current_position(); } diff --git a/Marlin/src/gcode/probe/M851.cpp b/Marlin/src/gcode/probe/M851.cpp index c2e746cf0b..ee60e9ebc0 100644 --- a/Marlin/src/gcode/probe/M851.cpp +++ b/Marlin/src/gcode/probe/M851.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/probe/M951.cpp b/Marlin/src/gcode/probe/M951.cpp index c7e4ea8a70..f461fc2b07 100644 --- a/Marlin/src/gcode/probe/M951.cpp +++ b/Marlin/src/gcode/probe/M951.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -46,9 +46,7 @@ void mpe_settings_init() { 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 + TERN_(HAS_HOME_OFFSET, set_home_offset(X_AXIS, mpe_settings.grab_distance * -1)); 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 @@ -61,9 +59,7 @@ void GcodeSuite::M951() { 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 + TERN_(HAS_HOME_OFFSET, set_home_offset(X_AXIS, mpe_settings.grab_distance * -1)); } 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()); diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index abb50b960d..c77db0bf2a 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -52,7 +52,7 @@ GCodeQueue queue; * sending commands to Marlin, and lines will be checked for sequentiality. * M110 N sets the current line number. */ -long gcode_N, GCodeQueue::last_N; +long GCodeQueue::last_N[NUM_SERIAL]; /** * GCode Command Queue @@ -72,7 +72,7 @@ char GCodeQueue::command_buffer[BUFSIZE][MAX_CMD_SIZE]; /* * The port that the command was received on */ -#if NUM_SERIAL > 1 +#if HAS_MULTI_SERIAL int16_t GCodeQueue::port[BUFSIZE]; #endif @@ -86,11 +86,15 @@ 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. + * Next Injected PROGMEM Command pointer. (nullptr == empty) + * Internal commands are enqueued ahead of serial / SD commands. */ -static PGM_P injected_commands_P = nullptr; +PGM_P GCodeQueue::injected_commands_P; // = nullptr + +/** + * Injected SRAM Commands + */ +char GCodeQueue::injected_commands[64]; // = { 0 } GCodeQueue::GCodeQueue() { // Send "ok" after commands by default @@ -101,7 +105,7 @@ GCodeQueue::GCodeQueue() { * Check whether there are any commands yet to be executed */ bool GCodeQueue::has_commands_queued() { - return queue.length || injected_commands_P; + return queue.length || injected_commands_P || injected_commands[0]; } /** @@ -115,17 +119,13 @@ void GCodeQueue::clear() { * 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 + #if HAS_MULTI_SERIAL , 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 + TERN_(HAS_MULTI_SERIAL, port[index_w] = p); + TERN_(POWER_LOSS_RECOVERY, recovery.commit_sdpos(index_w)); if (++index_w >= BUFSIZE) index_w = 0; length++; } @@ -136,14 +136,14 @@ void GCodeQueue::_commit_command(bool say_ok * 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 + #if HAS_MULTI_SERIAL , 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 + #if HAS_MULTI_SERIAL , pn #endif ); @@ -172,11 +172,10 @@ bool GCodeQueue::enqueue_one(const char* cmd) { } /** - * Process the next "immediate" command. - * Return 'true' if any commands were processed, - * or remain to process. + * Process the next "immediate" command from PROGMEM. + * Return 'true' if any commands were processed. */ -bool GCodeQueue::process_injected_command() { +bool GCodeQueue::process_injected_command_P() { if (injected_commands_P == nullptr) return false; char c; @@ -198,12 +197,32 @@ bool GCodeQueue::process_injected_command() { } /** - * 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 + * Process the next "immediate" command from SRAM. + * Return 'true' if any commands were processed. */ -void GCodeQueue::inject_P(PGM_P const pgcode) { injected_commands_P = pgcode; } +bool GCodeQueue::process_injected_command() { + if (injected_commands[0] == '\0') return false; + + char c; + size_t i = 0; + while ((c = injected_commands[i]) && c != '\n') i++; + + // Execute a non-blank command + if (i) { + injected_commands[i] = '\0'; + parser.parse(injected_commands); + gcode.process_parsed_command(); + } + + // Copy the next command into place + for ( + uint8_t d = 0, s = i + !!c; // dst, src + (injected_commands[d] = injected_commands[s]); // copy, exit if 0 + d++, s++ // next dst, src + ); + + return true; +} /** * Enqueue and return only when commands are actually enqueued. @@ -255,8 +274,8 @@ void GCodeQueue::enqueue_now_P(PGM_P const pgcode) { * B Block queue space remaining */ void GCodeQueue::ok_to_send() { - #if NUM_SERIAL > 1 - const int16_t pn = port[index_r]; + #if HAS_MULTI_SERIAL + const int16_t pn = command_port(); if (pn < 0) return; PORT_REDIRECT(pn); // Reply to the serial port that sent the command #endif @@ -270,8 +289,8 @@ void GCodeQueue::ok_to_send() { while (NUMERIC_SIGNED(*p)) SERIAL_ECHO(*p++); } - SERIAL_ECHOPAIR_P(SP_P_STR, int(planner.moves_free())); - SERIAL_ECHOPAIR(" B", int(BUFSIZE - length)); + SERIAL_ECHOPAIR_P(SP_P_STR, int(planner.moves_free()), + SP_B_STR, int(BUFSIZE - length)); #endif SERIAL_EOL(); } @@ -281,30 +300,25 @@ void GCodeQueue::ok_to_send() { * indicate that a command needs to be re-sent. */ void GCodeQueue::flush_and_request_resend() { - #if NUM_SERIAL > 1 - const int16_t pn = port[index_r]; + const int16_t pn = command_port(); + #if HAS_MULTI_SERIAL if (pn < 0) return; PORT_REDIRECT(pn); // Reply to the serial port that sent the command #endif SERIAL_FLUSH(); SERIAL_ECHOPGM(STR_RESEND); - SERIAL_ECHOLN(last_N + 1); + SERIAL_ECHOLN(last_N[pn] + 1); ok_to_send(); } inline bool serial_data_available() { - return false - || MYSERIAL0.available() - #if NUM_SERIAL > 1 - || MYSERIAL1.available() - #endif - ; + return MYSERIAL0.available() || TERN0(HAS_MULTI_SERIAL, MYSERIAL1.available()); } inline int read_serial(const uint8_t index) { switch (index) { case 0: return MYSERIAL0.read(); - #if NUM_SERIAL > 1 + #if HAS_MULTI_SERIAL case 1: return MYSERIAL1.read(); #endif default: return -1; @@ -315,7 +329,7 @@ void GCodeQueue::gcode_line_error(PGM_P const err, const int8_t pn) { PORT_REDIRECT(pn); // Reply to the serial port that sent the command SERIAL_ERROR_START(); serialprintPGM(err); - SERIAL_ECHOLN(last_N); + SERIAL_ECHOLN(last_N[pn]); while (read_serial(pn) != -1); // Clear out the RX buffer flush_and_request_resend(); serial_count[pn] = 0; @@ -373,9 +387,15 @@ inline void process_stream_char(const char c, uint8_t &sis, char (&buff)[MAX_CMD } #endif - buff[ind++] = c; - if (ind >= MAX_CMD_SIZE - 1) - sis = PS_EOL; // Skip the rest on overflow + // Backspace erases previous characters + if (c == 0x08) { + if (ind) buff[--ind] = '\0'; + } + else { + buff[ind++] = c; + if (ind >= MAX_CMD_SIZE - 1) + sis = PS_EOL; // Skip the rest on overflow + } } /** @@ -454,9 +474,9 @@ void GCodeQueue::get_serial_commands() { if (n2pos) npos = n2pos; } - gcode_N = strtol(npos + 1, nullptr, 10); + const long gcode_N = strtol(npos + 1, nullptr, 10); - if (gcode_N != last_N + 1 && !M110) + if (gcode_N != last_N[i] + 1 && !M110) return gcode_line_error(PSTR(STR_ERR_LINE_NO), i); char *apos = strrchr(command, '*'); @@ -469,7 +489,7 @@ void GCodeQueue::get_serial_commands() { else return gcode_line_error(PSTR(STR_ERR_NO_CHECKSUM), i); - last_N = gcode_N; + last_N[i] = gcode_N; } #if ENABLED(SDSUPPORT) // Pronterface "M29" and "M29 " has no line number @@ -502,14 +522,12 @@ void GCodeQueue::get_serial_commands() { #if DISABLED(EMERGENCY_PARSER) // Process critical commands early - if (strcmp(command, "M108") == 0) { + if (strcmp_P(command, PSTR("M108")) == 0) { wait_for_heatup = false; - #if HAS_LCD_MENU - wait_for_user = false; - #endif + TERN_(HAS_LCD_MENU, wait_for_user = false); } - if (strcmp(command, "M112") == 0) kill(M112_KILL_STR, nullptr, true); - if (strcmp(command, "M410") == 0) quickstop_stepper(); + if (strcmp_P(command, PSTR("M112")) == 0) kill(M112_KILL_STR, nullptr, true); + if (strcmp_P(command, PSTR("M410")) == 0) quickstop_stepper(); #endif #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0 @@ -518,7 +536,7 @@ void GCodeQueue::get_serial_commands() { // Add the command to the queue _enqueue(serial_line_buffer[i], true - #if NUM_SERIAL > 1 + #if HAS_MULTI_SERIAL , i #endif ); @@ -575,7 +593,7 @@ void GCodeQueue::get_serial_commands() { /** * Add to the circular command queue the next command from: - * - The command-injection queue (injected_commands_P) + * - The command-injection queues (injected_commands_P, injected_commands) * - The active serial input (usually USB) * - The SD card file being actively printed */ @@ -583,9 +601,7 @@ void GCodeQueue::get_available_commands() { get_serial_commands(); - #if ENABLED(SDSUPPORT) - get_sdcard_commands(); - #endif + TERN_(SDSUPPORT, get_sdcard_commands()); } /** @@ -594,7 +610,7 @@ void GCodeQueue::get_available_commands() { void GCodeQueue::advance() { // Process immediate commands - if (process_injected_command()) return; + if (process_injected_command_P() || process_injected_command()) return; // Return if the G-code buffer is empty if (!length) return; diff --git a/Marlin/src/gcode/queue.h b/Marlin/src/gcode/queue.h index 6a87d47ac8..966af2871f 100644 --- a/Marlin/src/gcode/queue.h +++ b/Marlin/src/gcode/queue.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -35,7 +35,8 @@ public: * commands to Marlin, and lines will be checked for sequentiality. * M110 N sets the current line number. */ - static long last_N; + + static long last_N[NUM_SERIAL]; /** * GCode Command Queue @@ -51,13 +52,17 @@ public: static char command_buffer[BUFSIZE][MAX_CMD_SIZE]; - /* + /** * The port that the command was received on */ - #if NUM_SERIAL > 1 + #if HAS_MULTI_SERIAL static int16_t port[BUFSIZE]; #endif + static int16_t command_port() { + return TERN0(HAS_MULTI_SERIAL, port[index_r]); + } + GCodeQueue(); /** @@ -66,11 +71,30 @@ public: 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. + * Next Injected Command (PROGMEM) pointer. (nullptr == empty) + * Internal commands are enqueued ahead of serial / SD commands. */ - static void inject_P(PGM_P const pgcode); + static PGM_P injected_commands_P; + + /** + * Injected Commands (SRAM) + */ + static char injected_commands[64]; + + /** + * Enqueue command(s) to run from PROGMEM. Drained by process_injected_command_P(). + * Don't inject comments or use leading spaces! + * Aborts the current PROGMEM queue so only use for one or two commands. + */ + static inline void inject_P(PGM_P const pgcode) { injected_commands_P = pgcode; } + + /** + * Enqueue command(s) to run from SRAM. Drained by process_injected_command(). + * Aborts the current SRAM queue so only use for one or two commands. + */ + static inline void inject(char * const gcode) { + strncpy(injected_commands, gcode, sizeof(injected_commands) - 1); + } /** * Enqueue and return only when commands are actually enqueued @@ -134,18 +158,21 @@ private: #endif static void _commit_command(bool say_ok - #if NUM_SERIAL > 1 + #if HAS_MULTI_SERIAL , int16_t p=-1 #endif ); static bool _enqueue(const char* cmd, bool say_ok=false - #if NUM_SERIAL > 1 + #if HAS_MULTI_SERIAL , int16_t p=-1 #endif ); - // Process the next "immediate" command + // Process the next "immediate" command (PROGMEM) + static bool process_injected_command_P(); + + // Process the next "immediate" command (SRAM) static bool process_injected_command(); /** diff --git a/Marlin/src/gcode/scara/M360-M364.cpp b/Marlin/src/gcode/scara/M360-M364.cpp index cd901d5dd4..562beee4f9 100644 --- a/Marlin/src/gcode/scara/M360-M364.cpp +++ b/Marlin/src/gcode/scara/M360-M364.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/sd/M1001.cpp b/Marlin/src/gcode/sd/M1001.cpp index 4261b57f97..54bc452f97 100644 --- a/Marlin/src/gcode/sd/M1001.cpp +++ b/Marlin/src/gcode/sd/M1001.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -27,6 +27,10 @@ #include "../gcode.h" #include "../../module/printcounter.h" +#ifdef SD_FINISHED_RELEASECOMMAND + #include "../queue.h" +#endif + #if EITHER(LCD_SET_PROGRESS_MANUALLY, SD_REPRINT_LAST_SELECTED_FILE) #include "../../lcd/ultralcd.h" #endif @@ -36,6 +40,7 @@ #endif #if HAS_LEDS_OFF_FLAG + #include "../../MarlinCore.h" // for wait_for_user_response #include "../../feature/leds/printer_event_leds.h" #endif @@ -47,10 +52,6 @@ #include "../../feature/host_actions.h" #endif -#if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND) - #include "../../module/planner.h" -#endif - #ifndef PE_LEDS_COMPLETED_TIME #define PE_LEDS_COMPLETED_TIME (30*60) #endif @@ -68,14 +69,10 @@ void GcodeSuite::M1001() { gcode.process_subcommands_now_P(PSTR("M77")); // Set the progress bar "done" state - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - ui.set_progress_done(); - #endif + TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress_done()); // Purge the recovery file - #if ENABLED(POWER_LOSS_RECOVERY) - recovery.purge(); - #endif + TERN_(POWER_LOSS_RECOVERY, recovery.purge()); // Announce SD file completion SERIAL_ECHOLNPGM(STR_FILE_PRINTED); @@ -84,26 +81,20 @@ void GcodeSuite::M1001() { #if HAS_LEDS_OFF_FLAG if (long_print) { printerEventLEDs.onPrintCompleted(); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_PRINT_DONE)); - #endif - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_PRINT_DONE), CONTINUE_STR); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_PRINT_DONE))); + TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_PRINT_DONE), CONTINUE_STR)); wait_for_user_response(1000UL * TERN(HAS_LCD_MENU, PE_LEDS_COMPLETED_TIME, 30)); printerEventLEDs.onResumeAfterWait(); } #endif - // Wait for the queue to empty (and "clean"), inject SD_FINISHED_RELEASECOMMAND - #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND) - planner.finish_and_disable(); + // Inject SD_FINISHED_RELEASECOMMAND, if any + #ifdef SD_FINISHED_RELEASECOMMAND + queue.inject_P(PSTR(SD_FINISHED_RELEASECOMMAND)); #endif // Re-select the last printed file in the UI - #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - ui.reselect_last_file(); - #endif + TERN_(SD_REPRINT_LAST_SELECTED_FILE, ui.reselect_last_file()); } #endif // SDSUPPORT diff --git a/Marlin/src/gcode/sd/M20.cpp b/Marlin/src/gcode/sd/M20.cpp index c45fcb038a..6d4c55752c 100644 --- a/Marlin/src/gcode/sd/M20.cpp +++ b/Marlin/src/gcode/sd/M20.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/sd/M21_M22.cpp b/Marlin/src/gcode/sd/M21_M22.cpp index 2d5bccaf84..77df751fc7 100644 --- a/Marlin/src/gcode/sd/M21_M22.cpp +++ b/Marlin/src/gcode/sd/M21_M22.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/sd/M23.cpp b/Marlin/src/gcode/sd/M23.cpp index 4bf8105f60..b88f66b591 100644 --- a/Marlin/src/gcode/sd/M23.cpp +++ b/Marlin/src/gcode/sd/M23.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -38,9 +38,7 @@ void GcodeSuite::M23() { for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0'; card.openFileRead(parser.string_arg); - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - ui.set_progress(0); - #endif + TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress(0)); } #endif // SDSUPPORT diff --git a/Marlin/src/gcode/sd/M24_M25.cpp b/Marlin/src/gcode/sd/M24_M25.cpp index c1e6dde8de..c27e03862c 100644 --- a/Marlin/src/gcode/sd/M24_M25.cpp +++ b/Marlin/src/gcode/sd/M24_M25.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -31,7 +31,6 @@ #if ENABLED(PARK_HEAD_ON_PAUSE) #include "../../feature/pause.h" - #include "../queue.h" #endif #if ENABLED(HOST_ACTION_COMMANDS) @@ -64,18 +63,14 @@ void GcodeSuite::M24() { 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 + TERN_(POWER_LOSS_RECOVERY, recovery.prepare()); } #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"), DISMISS_STR); - #endif + TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, PSTR("Resuming SD"), DISMISS_STR)); #endif ui.reset_status(); @@ -86,28 +81,27 @@ void GcodeSuite::M24() { */ 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 + // 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(POWER_LOSS_RECOVERY) if (recovery.enabled) recovery.save(true); #endif print_job_timer.pause(); - ui.reset_status(); + + TERN(DWIN_CREALITY_LCD,,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 + TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_PAUSE_RESUME, PSTR("Pause SD"), PSTR("Resume"))); #ifdef ACTION_ON_PAUSE host_action_pause(); #endif diff --git a/Marlin/src/gcode/sd/M26.cpp b/Marlin/src/gcode/sd/M26.cpp index d2e9e8e72a..e0557bfa14 100644 --- a/Marlin/src/gcode/sd/M26.cpp +++ b/Marlin/src/gcode/sd/M26.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/sd/M27.cpp b/Marlin/src/gcode/sd/M27.cpp index 9c71e510a6..8592b8af25 100644 --- a/Marlin/src/gcode/sd/M27.cpp +++ b/Marlin/src/gcode/sd/M27.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/sd/M28_M29.cpp b/Marlin/src/gcode/sd/M28_M29.cpp index 9dc192c09b..6f3f2450a1 100644 --- a/Marlin/src/gcode/sd/M28_M29.cpp +++ b/Marlin/src/gcode/sd/M28_M29.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -27,7 +27,7 @@ #include "../gcode.h" #include "../../sd/cardreader.h" -#if NUM_SERIAL > 1 +#if HAS_MULTI_SERIAL #include "../queue.h" #endif @@ -49,9 +49,7 @@ void GcodeSuite::M28() { // 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 + TERN_(HAS_MULTI_SERIAL, card.transfer_port_index = queue.port[queue.index_r]); } else card.openFileWrite(p); diff --git a/Marlin/src/gcode/sd/M30.cpp b/Marlin/src/gcode/sd/M30.cpp index 2fd407341b..b95a895f1e 100644 --- a/Marlin/src/gcode/sd/M30.cpp +++ b/Marlin/src/gcode/sd/M30.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/sd/M32.cpp b/Marlin/src/gcode/sd/M32.cpp index 35a6fb1d64..a6f9fbcd8d 100644 --- a/Marlin/src/gcode/sd/M32.cpp +++ b/Marlin/src/gcode/sd/M32.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/sd/M33.cpp b/Marlin/src/gcode/sd/M33.cpp index 7c6654a02e..b611c8bc08 100644 --- a/Marlin/src/gcode/sd/M33.cpp +++ b/Marlin/src/gcode/sd/M33.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/sd/M34.cpp b/Marlin/src/gcode/sd/M34.cpp index ff1a8939a0..2dd7dc580c 100644 --- a/Marlin/src/gcode/sd/M34.cpp +++ b/Marlin/src/gcode/sd/M34.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/sd/M524.cpp b/Marlin/src/gcode/sd/M524.cpp index 4013303614..b27814cc38 100644 --- a/Marlin/src/gcode/sd/M524.cpp +++ b/Marlin/src/gcode/sd/M524.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/sd/M928.cpp b/Marlin/src/gcode/sd/M928.cpp index b8b9175f02..03a7877a90 100644 --- a/Marlin/src/gcode/sd/M928.cpp +++ b/Marlin/src/gcode/sd/M928.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/stats/M31.cpp b/Marlin/src/gcode/stats/M31.cpp index 019598cb83..b39108bb90 100644 --- a/Marlin/src/gcode/stats/M31.cpp +++ b/Marlin/src/gcode/stats/M31.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/stats/M75-M78.cpp b/Marlin/src/gcode/stats/M75-M78.cpp index 41d550cb59..908e6e5a31 100644 --- a/Marlin/src/gcode/stats/M75-M78.cpp +++ b/Marlin/src/gcode/stats/M75-M78.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/temp/M104_M109.cpp b/Marlin/src/gcode/temp/M104_M109.cpp index 434c6c9663..a289983b92 100644 --- a/Marlin/src/gcode/temp/M104_M109.cpp +++ b/Marlin/src/gcode/temp/M104_M109.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -50,7 +50,12 @@ #endif /** - * M104: Set hot end temperature + * M104: Set Hotend Temperature target and return immediately + * + * Parameters: + * I : Material Preset index (if material presets are defined) + * T : Tool index. If omitted, applies to the active tool + * S : The target temperature in current units */ void GcodeSuite::M104() { @@ -63,9 +68,26 @@ void GcodeSuite::M104() { if (target_extruder < 0) return; #endif - if (parser.seenval('S')) { - const int16_t temp = parser.value_celsius(); - #if ENABLED(SINGLENOZZLE) + bool got_temp = false; + int16_t temp = 0; + + // Accept 'I' if temperature presets are defined + #if PREHEAT_COUNT + got_temp = parser.seenval('I'); + if (got_temp) { + const uint8_t index = parser.value_byte(); + temp = ui.material_preset[_MIN(index, PREHEAT_COUNT - 1)].hotend_temp; + } + #endif + + // If no 'I' get the temperature from 'S' + if (!got_temp) { + got_temp = parser.seenval('S'); + if (got_temp) temp = parser.value_celsius(); + } + + if (got_temp) { + #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) singlenozzle_temp[target_extruder] = temp; if (target_extruder != active_extruder) return; #endif @@ -87,16 +109,29 @@ void GcodeSuite::M104() { #endif } - #if ENABLED(AUTOTEMP) - planner.autotemp_M104_M109(); - #endif + TERN_(AUTOTEMP, planner.autotemp_M104_M109()); } /** - * M109: Sxxx Wait for hotend(s) to reach temperature. Waits only when heating. - * Rxxx Wait for hotend(s) to reach temperature. Waits when heating and cooling. + * M109: Set Hotend Temperature target and wait * - * With PRINTJOB_TIMER_AUTOSTART also start the job timer on heating and stop it if turned off. + * Parameters + * I : Material Preset index (if material presets are defined) + * T : Tool index. If omitted, applies to the active tool + * S : The target temperature in current units. Wait for heating only. + * R : The target temperature in current units. Wait for heating and cooling. + * + * With AUTOTEMP... + * F : Autotemp Scaling Factor. Set non-zero to enable Auto-temp. + * S : Minimum temperature, in current units. + * B : Maximum temperature, in current units. + * + * Examples + * M109 S100 : Set target to 100°. Wait until the hotend is at or above 100°. + * M109 R150 : Set target to 150°. Wait until the hotend gets close to 150°. + * + * With PRINTJOB_TIMER_AUTOSTART turning on heaters will start the print job timer + * (used by printingIsActive, etc.) and turning off heaters will stop the timer. */ void GcodeSuite::M109() { @@ -109,11 +144,28 @@ void GcodeSuite::M109() { 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) + bool got_temp = false; + int16_t temp = 0; + + // Accept 'I' if temperature presets are defined + #if PREHEAT_COUNT + got_temp = parser.seenval('I'); + if (got_temp) { + const uint8_t index = parser.value_byte(); + temp = ui.material_preset[_MIN(index, PREHEAT_COUNT - 1)].hotend_temp; + } + #endif + + // Get the temperature from 'S' or 'R' + bool no_wait_for_cooling = false; + if (!got_temp) { + no_wait_for_cooling = parser.seenval('S'); + got_temp = no_wait_for_cooling || parser.seenval('R'); + if (got_temp) temp = int16_t(parser.value_celsius()); + } + + if (got_temp) { + #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) singlenozzle_temp[target_extruder] = temp; if (target_extruder != active_extruder) return; #endif @@ -139,11 +191,9 @@ void GcodeSuite::M109() { #endif } - #if ENABLED(AUTOTEMP) - planner.autotemp_M104_M109(); - #endif + TERN_(AUTOTEMP, planner.autotemp_M104_M109()); - if (set_temp) + if (got_temp) (void)thermalManager.wait_for_hotend(target_extruder, no_wait_for_cooling); } diff --git a/Marlin/src/gcode/temp/M105.cpp b/Marlin/src/gcode/temp/M105.cpp index 7d68ccadc0..eefc3ae9f1 100644 --- a/Marlin/src/gcode/temp/M105.cpp +++ b/Marlin/src/gcode/temp/M105.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/temp/M106_M107.cpp b/Marlin/src/gcode/temp/M106_M107.cpp index 2415484d51..17ff8c3c8f 100644 --- a/Marlin/src/gcode/temp/M106_M107.cpp +++ b/Marlin/src/gcode/temp/M106_M107.cpp @@ -16,18 +16,22 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include "../../inc/MarlinConfig.h" -#if FAN_COUNT > 0 +#if HAS_FAN #include "../gcode.h" #include "../../module/motion.h" #include "../../module/temperature.h" +#if PREHEAT_COUNT + #include "../../lcd/ultralcd.h" +#endif + #if ENABLED(SINGLENOZZLE) #define _ALT_P active_extruder #define _CNT_P EXTRUDERS @@ -39,6 +43,7 @@ /** * M106: Set Fan Speed * + * I Material Preset index (if material presets are defined) * S Speed between 0-255 * P Fan index, if more than one fan * @@ -50,19 +55,32 @@ * 3-255 = Set the speed for use with T2 */ void GcodeSuite::M106() { - const uint8_t p = parser.byteval('P', _ALT_P); + const uint8_t pfan = parser.byteval('P', _ALT_P); - if (p < _CNT_P) { + if (pfan < _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); + if (t > 0) return thermalManager.set_temp_fan_speed(pfan, 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); + const uint16_t dspeed = parser.seen('A') ? thermalManager.fan_speed[active_extruder] : 255; + + uint16_t speed = dspeed; + + // Accept 'I' if temperature presets are defined + #if PREHEAT_COUNT + const bool got_preset = parser.seenval('I'); + if (got_preset) speed = ui.material_preset[_MIN(parser.value_byte(), PREHEAT_COUNT - 1)].fan_speed; + #else + constexpr bool got_preset = false; + #endif + + if (!got_preset && parser.seenval('S')) + speed = parser.value_ushort(); + + // Set speed, with constraint + thermalManager.set_fan_speed(pfan, speed); } } @@ -74,4 +92,4 @@ void GcodeSuite::M107() { thermalManager.set_fan_speed(p, 0); } -#endif // FAN_COUNT > 0 +#endif // HAS_FAN diff --git a/Marlin/src/gcode/temp/M140_M190.cpp b/Marlin/src/gcode/temp/M140_M190.cpp index 2da438707b..9438b9e0c2 100644 --- a/Marlin/src/gcode/temp/M140_M190.cpp +++ b/Marlin/src/gcode/temp/M140_M190.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -47,38 +47,88 @@ /** * M140: Set bed temperature + * + * I : Preset index (if material presets are defined) + * S : The target temperature in current units */ void GcodeSuite::M140() { if (DEBUGGING(DRYRUN)) return; - if (parser.seenval('S')) thermalManager.setTargetBed(parser.value_celsius()); - #if ENABLED(PRINTJOB_TIMER_AUTOSTART) - /** - * Stop the timer at the end of print. Both hotend and bed target - * temperatures need to be set below mintemp. Order of M140 and M104 - * at the end of the print does not matter. - */ - thermalManager.check_timer_autostart(false, true); + bool got_temp = false; + int16_t temp = 0; + + // Accept 'I' if temperature presets are defined + #if PREHEAT_COUNT + got_temp = parser.seenval('I'); + if (got_temp) { + const uint8_t index = parser.value_byte(); + temp = ui.material_preset[_MIN(index, PREHEAT_COUNT - 1)].bed_temp; + } #endif + + // If no 'I' get the temperature from 'S' + if (!got_temp) { + got_temp = parser.seenval('S'); + if (got_temp) temp = parser.value_celsius(); + } + + if (got_temp) { + thermalManager.setTargetBed(temp); + + #if ENABLED(PRINTJOB_TIMER_AUTOSTART) + /** + * Stop the timer at the end of print. Hotend, bed target, and chamber + * temperatures need to be set below mintemp. Order of M140, M104, and M141 + * at the end of the print does not matter. + */ + thermalManager.check_timer_autostart(false, true); + #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 + * M190 - Set Bed Temperature target and wait * - * With PRINTJOB_TIMER_AUTOSTART also start the job timer on heating. + * Parameters: + * I : Preset index (if material presets are defined) + * S : The target temperature in current units. Wait for heating only. + * R : The target temperature in current units. Wait for heating and cooling. + * + * Examples: + * M190 S60 : Set target to 60°. Wait until the bed is at or above 60°. + * M190 R40 : Set target to 40°. Wait until the bed gets close to 40°. + * + * With PRINTJOB_TIMER_AUTOSTART turning on heaters will start the print job timer + * (used by printingIsActive, etc.) and turning off heaters will stop the timer. */ 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) - thermalManager.check_timer_autostart(true, false); - #endif + bool got_temp = false; + int16_t temp = 0; + + // Accept 'I' if temperature presets are defined + #if PREHEAT_COUNT + got_temp = parser.seenval('I'); + if (got_temp) { + const uint8_t index = parser.value_byte(); + temp = ui.material_preset[_MIN(index, PREHEAT_COUNT - 1)].bed_temp; + } + #endif + + // Get the temperature from 'S' or 'R' + bool no_wait_for_cooling = false; + if (!got_temp) { + no_wait_for_cooling = parser.seenval('S'); + got_temp = no_wait_for_cooling || parser.seenval('R'); + if (got_temp) temp = int16_t(parser.value_celsius()); } - else return; + + if (!got_temp) return; + + thermalManager.setTargetBed(temp); + + TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.check_timer_autostart(true, false)); ui.set_status_P(thermalManager.isHeatingBed() ? GET_TEXT(MSG_BED_HEATING) : GET_TEXT(MSG_BED_COOLING)); diff --git a/Marlin/src/gcode/temp/M141_M191.cpp b/Marlin/src/gcode/temp/M141_M191.cpp index 3f02836476..41a79825aa 100644 --- a/Marlin/src/gcode/temp/M141_M191.cpp +++ b/Marlin/src/gcode/temp/M141_M191.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -51,7 +51,18 @@ */ void GcodeSuite::M141() { if (DEBUGGING(DRYRUN)) return; - if (parser.seenval('S')) thermalManager.setTargetChamber(parser.value_celsius()); + if (parser.seenval('S')) { + thermalManager.setTargetChamber(parser.value_celsius()); + + #if ENABLED(PRINTJOB_TIMER_AUTOSTART) + /** + * Stop the timer at the end of print. Hotend, bed target, and chamber + * temperatures need to be set below mintemp. Order of M140, M104, and M141 + * at the end of the print does not matter. + */ + thermalManager.check_timer_autostart(false, true); + #endif + } } /** @@ -64,9 +75,7 @@ void GcodeSuite::M191() { 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) - thermalManager.check_timer_autostart(true, false); - #endif + TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.check_timer_autostart(true, false)); } else return; diff --git a/Marlin/src/gcode/temp/M155.cpp b/Marlin/src/gcode/temp/M155.cpp index 52f9ef2be5..30129a0e6f 100644 --- a/Marlin/src/gcode/temp/M155.cpp +++ b/Marlin/src/gcode/temp/M155.cpp @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include "../../inc/MarlinConfig.h" -#if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR +#if BOTH(AUTO_REPORT_TEMPERATURES, HAS_TEMP_SENSOR) #include "../gcode.h" #include "../../module/temperature.h" diff --git a/Marlin/src/gcode/temp/M303.cpp b/Marlin/src/gcode/temp/M303.cpp index 358a1436b1..3340e4fa49 100644 --- a/Marlin/src/gcode/temp/M303.cpp +++ b/Marlin/src/gcode/temp/M303.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -25,6 +25,7 @@ #if HAS_PID_HEATING #include "../gcode.h" +#include "../../lcd/ultralcd.h" #include "../../module/temperature.h" #if ENABLED(EXTENSIBLE_UI) @@ -59,34 +60,26 @@ void GcodeSuite::M303() { } #endif - #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 + #define SI TERN(PIDTEMPBED, H_BED, H_E0) + #define EI TERN(PIDTEMP, HOTENDS - 1, H_BED) const heater_ind_t e = (heater_ind_t)parser.intval('E'); if (!WITHIN(e, SI, EI)) { SERIAL_ECHOLNPGM(STR_PID_BAD_EXTRUDER_NUM); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPidTuning(ExtUI::result_t::PID_BAD_EXTRUDER_NUM); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::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); + const int16_t temp = parser.celsiusval('S', e < 0 ? PREHEAT_1_TEMP_BED : PREHEAT_1_TEMP_HOTEND); #if DISABLED(BUSY_WHILE_HEATING) KEEPALIVE_STATE(NOT_BUSY); #endif + ui.set_status(GET_TEXT(MSG_PID_AUTOTUNE)); thermalManager.PID_autotune(temp, e, c, u); + ui.reset_status(); } #endif // HAS_PID_HEATING diff --git a/Marlin/src/gcode/units/G20_G21.cpp b/Marlin/src/gcode/units/G20_G21.cpp index 4961ae1601..6f1d5adbcc 100644 --- a/Marlin/src/gcode/units/G20_G21.cpp +++ b/Marlin/src/gcode/units/G20_G21.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/units/M149.cpp b/Marlin/src/gcode/units/M149.cpp index d8d962c5be..5d9f832069 100644 --- a/Marlin/src/gcode/units/M149.cpp +++ b/Marlin/src/gcode/units/M149.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/gcode/units/M82_M83.cpp b/Marlin/src/gcode/units/M82_M83.cpp index bf5aff0b85..d93f0ea5ad 100644 --- a/Marlin/src/gcode/units/M82_M83.cpp +++ b/Marlin/src/gcode/units/M82_M83.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index dd1f13fae0..66e83c5299 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -35,7 +35,15 @@ #define IS_CARTESIAN 1 #endif -#if ENABLED(CARTESIO_UI) +#if ENABLED(MKS_LCD12864) + #define MKS_MINI_12864 +#endif + +#if EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) + + #define MINIPANEL + +#elif ENABLED(CARTESIO_UI) #define DOGLCD #define IS_ULTIPANEL @@ -98,15 +106,9 @@ #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 + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) #elif ENABLED(MKS_12864OLED) @@ -118,9 +120,26 @@ #define IS_RRD_SC #define IS_U8GLIB_SSD1306 -#elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) +#elif ENABLED(FYSETC_242_OLED_12864) - #define MINIPANEL + #define IS_RRD_SC + #define U8GLIB_SH1106 + + #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 + + #if ENABLED(PSU_CONTROL) + #define LED_BACKLIGHT_TIMEOUT 10000 + #endif #elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1) @@ -236,11 +255,18 @@ #define IS_ULTIPANEL #endif +// LVGL UI, SPI or FSMC +#if EITHER(TFT_LVGL_UI_SPI, TFT_LVGL_UI_FSMC) + #define HAS_TFT_LVGL_UI 1 +#endif + // FSMC/SPI TFT Panels #if ENABLED(FSMC_GRAPHICAL_TFT) #define DOGLCD #define IS_ULTIPANEL #define DELAYED_BACKLIGHT_INIT +#elif ENABLED(TFT_LVGL_UI_SPI) + #define DELAYED_BACKLIGHT_INIT #endif /** @@ -335,9 +361,7 @@ #endif #if ENABLED(ULTIPANEL) #define IS_ULTRA_LCD - #ifndef NEWPANEL - #define NEWPANEL - #endif + #define NEWPANEL #endif #if ENABLED(IS_ULTRA_LCD) @@ -361,7 +385,7 @@ #define HAS_DGUS_LCD 1 #endif -// Extensible UI serial touch screens. (See src/lcd/extensible_ui) +// Extensible UI serial touch screens. (See src/lcd/extui) #if ANY(HAS_DGUS_LCD, MALYAN_LCD, TOUCH_UI_FTDI_EVE) #define IS_EXTUI #define EXTENSIBLE_UI @@ -380,6 +404,14 @@ #endif #endif +#if ENABLED(SR_LCD_3W_NL) + // Feature checks for SR_LCD_3W_NL +#elif EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) + #define USES_LIQUIDTWI2 +#elif ANY(HAS_CHARACTER_LCD, LCD_I2C_TYPE_PCF8575, LCD_I2C_TYPE_PCA8574, SR_LCD_2W_NL, LCM1602) + #define USES_LIQUIDCRYSTAL +#endif + #if ENABLED(ULTIPANEL) && DISABLED(NO_LCD_MENUS) #define HAS_LCD_MENU 1 #endif @@ -408,13 +440,15 @@ */ #if EXTRUDERS == 0 - #undef DISTINCT_E_FACTORS + #undef EXTRUDERS + #define EXTRUDERS 0 #undef SINGLENOZZLE #undef SWITCHING_EXTRUDER #undef SWITCHING_NOZZLE #undef MIXING_EXTRUDER #undef MK2_MULTIPLEXER #undef PRUSA_MMU2 + #undef HOTEND_IDLE_TIMEOUT #endif #if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS @@ -431,7 +465,9 @@ #elif ENABLED(MIXING_EXTRUDER) #define E_STEPPERS MIXING_STEPPERS #define E_MANUAL 1 - #define DUAL_MIXING_EXTRUDER (MIXING_STEPPERS == 2) + #if MIXING_STEPPERS == 2 + #define HAS_DUAL_MIXING 1 + #endif #elif ENABLED(SWITCHING_TOOLHEAD) #define E_STEPPERS EXTRUDERS #define E_MANUAL EXTRUDERS @@ -466,6 +502,19 @@ #define E_MANUAL EXTRUDERS #endif +#if HOTENDS + #define HAS_HOTEND 1 + #ifndef HOTEND_OVERSHOOT + #define HOTEND_OVERSHOOT 15 + #endif + #if HOTENDS > 1 + #define HAS_MULTI_HOTEND 1 + #define HAS_HOTEND_OFFSET 1 + #endif +#else + #undef PID_PARAMS_PER_HOTEND +#endif + // Helper macros for extruder and hotend arrays #define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++) #define ARRAY_BY_EXTRUDERS(V...) ARRAY_N(EXTRUDERS, V) @@ -481,10 +530,6 @@ #define SWITCHING_NOZZLE_TWO_SERVOS 1 #endif -#if HOTENDS > 1 - #define HAS_HOTEND_OFFSET 1 -#endif - /** * Default hotend offsets, if not defined */ @@ -504,16 +549,29 @@ * DISTINCT_E_FACTORS affects how some E factors are accessed */ #if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1 + #define DISTINCT_E E_STEPPERS #define XYZE_N (XYZ + E_STEPPERS) + #define E_INDEX_N(E) (E) #define E_AXIS_N(E) AxisEnum(E_AXIS + E) #define UNUSED_E(E) NOOP #else #undef DISTINCT_E_FACTORS + #define DISTINCT_E 1 #define XYZE_N XYZE + #define E_INDEX_N(E) 0 #define E_AXIS_N(E) E_AXIS #define UNUSED_E(E) UNUSED(E) #endif +#if ENABLED(DWIN_CREALITY_LCD) + #define SERIAL_CATCHALL 0 +#endif + +// Pressure sensor with a BLTouch-like interface +#if ENABLED(CREALITY_TOUCH) + #define BLTOUCH +#endif + /** * The BLTouch Probe emulates a servo probe * and uses "special" angles for its state. @@ -544,21 +602,13 @@ #define NUM_SERVOS 0 #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 (or BLTouch) */ #if defined(Z_PROBE_SERVO_NR) && Z_PROBE_SERVO_NR >= 0 #define HAS_Z_SERVO_PROBE 1 #endif -#if HAS_Z_SERVO_PROBE || EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE) +#if ANY(HAS_Z_SERVO_PROBE, SWITCHING_EXTRUDER, SWITCHING_NOZZLE) #define HAS_SERVO_ANGLES 1 #endif #if !HAS_SERVO_ANGLES @@ -572,7 +622,7 @@ #define HAS_BED_PROBE 1 #endif -#if HAS_BED_PROBE || EITHER(PROBE_MANUALLY, MESH_BED_LEVELING) +#if ANY(HAS_BED_PROBE, PROBE_MANUALLY, MESH_BED_LEVELING) #define PROBE_SELECTED 1 #endif @@ -583,7 +633,7 @@ #if DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) #define HAS_CUSTOM_PROBE_PIN 1 #endif - #if Z_HOME_DIR < 0 && !HAS_CUSTOM_PROBE_PIN + #if Z_HOME_DIR < 0 && (!HAS_CUSTOM_PROBE_PIN || ENABLED(USE_PROBE_FOR_Z_HOMING)) #define HOMING_Z_WITH_PROBE 1 #endif #ifndef Z_PROBE_LOW_POINT @@ -593,7 +643,7 @@ #define PROBE_TRIGGERED_WHEN_STOWED_TEST 1 // Extra test for Allen Key Probe #endif #if MULTIPLE_PROBING > 1 - #if EXTRA_PROBING + #if EXTRA_PROBING > 0 #define TOTAL_PROBING (MULTIPLE_PROBING + EXTRA_PROBING) #else #define TOTAL_PROBING MULTIPLE_PROBING @@ -670,10 +720,14 @@ #endif // This flag indicates some kind of jerk storage is needed -#if ENABLED(CLASSIC_JERK) || IS_KINEMATIC +#if EITHER(CLASSIC_JERK, IS_KINEMATIC) #define HAS_CLASSIC_JERK 1 #endif +#if DISABLED(CLASSIC_JERK) + #define HAS_JUNCTION_DEVIATION 1 +#endif + // E jerk exists with JD disabled (of course) but also when Linear Advance is disabled on Delta/SCARA #if ENABLED(CLASSIC_JERK) || (IS_KINEMATIC && DISABLED(LIN_ADVANCE)) #define HAS_CLASSIC_E_JERK 1 @@ -694,3 +748,10 @@ #ifndef EXTRUDE_MINTEMP #define EXTRUDE_MINTEMP 170 #endif + +/** + * To check if we need the folder src/features/leds + */ +#if ANY(TEMP_STAT_LEDS, HAS_COLOR_LEDS, HAS_CASE_LIGHT, PRINTER_EVENT_LEDS, LED_BACKLIGHT_TIMEOUT, PCA9632_BUZZER, LED_CONTROL_MENU) + #define HAS_LED_FEATURE 1 +#endif diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index a52ae1af29..85cb26dadb 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -56,6 +56,10 @@ #undef SHOW_TEMP_ADC_VALUES #endif +#if ENABLED(MIXING_EXTRUDER) && (ENABLED(RETRACT_SYNC_MIXING) || BOTH(FILAMENT_LOAD_UNLOAD_GCODES, FILAMENT_UNLOAD_ALL_EXTRUDERS)) + #define HAS_MIXER_SYNC_CHANNEL 1 +#endif + #if EITHER(DUAL_X_CARRIAGE, MULTI_NOZZLE_DUPLICATION) #define HAS_DUPLICATION_MODE 1 #endif @@ -66,6 +70,18 @@ #if ENABLED(FILAMENT_RUNOUT_SENSOR) #define HAS_FILAMENT_SENSOR 1 + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + #define HAS_FILAMENT_RUNOUT_DISTANCE 1 + #endif +#endif + +// Let SD_FINISHED_RELEASECOMMAND stand in for SD_FINISHED_STEPPERRELEASE +#if ENABLED(SD_FINISHED_STEPPERRELEASE) + #ifndef SD_FINISHED_RELEASECOMMAND + #define SD_FINISHED_RELEASECOMMAND "M84" // planner.finish_and_disable() + #endif +#else + #undef SD_FINISHED_RELEASECOMMAND #endif #if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY) @@ -93,7 +109,7 @@ #if EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS) #define HAS_SOFTWARE_ENDSTOPS 1 #endif -#if ANY(EXTENSIBLE_UI, NEWPANEL, EMERGENCY_PARSER, HAS_ADC_BUTTONS) +#if ANY(EXTENSIBLE_UI, NEWPANEL, EMERGENCY_PARSER, HAS_ADC_BUTTONS, DWIN_CREALITY_LCD) #define HAS_RESUME_CONTINUE 1 #endif @@ -104,6 +120,10 @@ #define HAS_LEDS_OFF_FLAG 1 #endif +#if EITHER(DIGIPOT_MCP4018, DIGIPOT_MCP4451) + #define HAS_I2C_DIGIPOT 1 +#endif + // Multiple Z steppers #ifndef NUM_Z_STEPPER_DRIVERS #define NUM_Z_STEPPER_DRIVERS 1 @@ -116,7 +136,23 @@ #define Z_STEPPER_ALIGN_AMP 1.0 #endif -#define HAS_CUTTER EITHER(SPINDLE_FEATURE, LASER_FEATURE) +// +// Spindle/Laser power display types +// Defined here so sanity checks can use them +// +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define HAS_CUTTER 1 + #define _CUTTER_POWER_PWM255 1 + #define _CUTTER_POWER_PERCENT 2 + #define _CUTTER_POWER_RPM 3 + #define _CUTTER_POWER(V) _CAT(_CUTTER_POWER_, V) + #define CUTTER_UNIT_IS(V) (_CUTTER_POWER(CUTTER_POWER_UNIT) == _CUTTER_POWER(V)) +#endif + +// Add features that need hardware PWM here +#if ANY(FAST_PWM_FAN, SPINDLE_LASER_PWM) + #define NEEDS_HARDWARE_PWM 1 +#endif #if !defined(__AVR__) || !defined(USBCON) // Define constants and variables for buffering serial data. @@ -172,7 +208,7 @@ #endif #endif -#if ENABLED(FYSETC_MINI_12864_2_1) +#if EITHER(FYSETC_MINI_12864_2_1, FYSETC_242_OLED_12864) #define LED_CONTROL_MENU #define LED_USER_PRESET_STARTUP #define LED_COLOR_PRESETS @@ -226,11 +262,10 @@ #endif /** - * Driver Timings + * Driver Timings (in nanoseconds) * NOTE: Driver timing order is longest-to-shortest duration. * Preserve this ordering when adding new drivers. */ - #ifndef MINIMUM_STEPPER_POST_DIR_DELAY #if HAS_DRIVER(TB6560) #define MINIMUM_STEPPER_POST_DIR_DELAY 15000 @@ -245,7 +280,7 @@ #elif HAS_DRIVER(A4988) #define MINIMUM_STEPPER_POST_DIR_DELAY 200 #elif HAS_TRINAMIC_CONFIG || HAS_TRINAMIC_STANDALONE - #define MINIMUM_STEPPER_POST_DIR_DELAY 20 + #define MINIMUM_STEPPER_POST_DIR_DELAY 60 #else #define MINIMUM_STEPPER_POST_DIR_DELAY 0 // Expect at least 10µS since one Stepper ISR must transpire #endif @@ -290,3 +325,45 @@ #define MAXIMUM_STEPPER_RATE 250000 #endif #endif + +#if ENABLED(DIRECT_STEPPING) + #ifndef STEPPER_PAGES + #define STEPPER_PAGES 16 + #endif + #ifndef STEPPER_PAGE_FORMAT + #define STEPPER_PAGE_FORMAT SP_4x2_256 + #endif + #ifndef PAGE_MANAGER + #define PAGE_MANAGER SerialPageManager + #endif +#endif + +// +// SD Card connection methods +// Defined here so pins and sanity checks can use them +// +#if ENABLED(SDSUPPORT) + #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)) +#else + #define SD_CONNECTION_IS(...) 0 +#endif + +// Power Monitor sensors +#if EITHER(POWER_MONITOR_CURRENT, POWER_MONITOR_VOLTAGE) + #define HAS_POWER_MONITOR 1 +#endif +#if ENABLED(POWER_MONITOR_CURRENT) && defined(POWER_MONITOR_FIXED_VOLTAGE) + #define HAS_POWER_MONITOR_VREF 1 +#endif +#if BOTH(HAS_POWER_MONITOR_VREF, POWER_MONITOR_CURRENT) + #define HAS_POWER_MONITOR_WATTS 1 +#endif + +// Flag if an EEPROM type is pre-selected +#if ENABLED(EEPROM_SETTINGS) && NONE(I2C_EEPROM, SPI_EEPROM, QSPI_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION) + #define NO_EEPROM_SELECTED 1 +#endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 9ea298f02d..e12310e07c 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -30,8 +30,15 @@ // Extras for CI testing #endif +// ADC +#ifdef BOARD_ADC_VREF + #define ADC_VREF BOARD_ADC_VREF +#else + #define ADC_VREF HAL_ADC_VREF +#endif + // Linear advance uses Jerk since E is an isolated axis -#if DISABLED(CLASSIC_JERK) && ENABLED(LIN_ADVANCE) +#if BOTH(HAS_JUNCTION_DEVIATION, LIN_ADVANCE) #define HAS_LINEAR_E_JERK 1 #endif @@ -39,8 +46,12 @@ #if ENABLED(EEPROM_SETTINGS) // EEPROM type may be defined by compile flags, configs, HALs, or pins // Set additional flags to let HALs choose in their Conditionals_post.h - #if NONE(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION) && ANY(I2C_EEPROM, SPI_EEPROM, QSPI_EEPROM) + #if ANY(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION, QSPI_EEPROM) + #define USE_EMULATED_EEPROM 1 + #elif ANY(I2C_EEPROM, SPI_EEPROM) #define USE_WIRED_EEPROM 1 + #elif ENABLED(IIC_BL24CXX_EEPROM) + // nothing #else #define USE_FALLBACK_EEPROM 1 #endif @@ -51,6 +62,7 @@ #undef SDCARD_EEPROM_EMULATION #undef SRAM_EEPROM_EMULATION #undef FLASH_EEPROM_EMULATION + #undef IIC_BL24CXX_EEPROM #endif #ifdef TEENSYDUINO @@ -147,7 +159,7 @@ #define Z_AXIS_INDEX 2 #define CAN_CALIBRATE(A,B) (A##_AXIS_INDEX == B##_INDEX) #else - #define CAN_CALIBRATE(...) 1 + #define CAN_CALIBRATE(A,B) 1 #endif #endif #define AXIS_CAN_CALIBRATE(A) CAN_CALIBRATE(A,NORMAL_AXIS) @@ -258,6 +270,13 @@ #define MAX_AUTORETRACT 99 #endif +/** + * Provide a DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT in case NO_VOLUMETRICS is enabled + */ +#ifndef DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT + #define DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT 0.00 +#endif + /** * LCD Contrast for Graphical Displays */ @@ -278,7 +297,7 @@ #elif ENABLED(AZSMZ_12864) #define _LCD_CONTRAST_MIN 120 #define _LCD_CONTRAST_INIT 190 -#elif ENABLED(MKS_LCD12864B) +#elif ENABLED(MKS_LCD12864) #define _LCD_CONTRAST_MIN 120 #define _LCD_CONTRAST_INIT 205 #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) @@ -289,8 +308,10 @@ #elif ENABLED(ULTI_CONTROLLER) #define _LCD_CONTRAST_INIT 127 #define _LCD_CONTRAST_MAX 254 -#elif EITHER(MAKRPANEL, MINIPANEL) +#elif ENABLED(MAKRPANEL) #define _LCD_CONTRAST_INIT 17 +#elif ENABLED(MINIPANEL) + #define _LCD_CONTRAST_INIT 150 #endif #ifdef _LCD_CONTRAST_INIT @@ -324,17 +345,36 @@ /** * Override the SD_DETECT_STATE set in Configuration_adv.h + * and enable sharing of onboard SD host drives (all platforms but AGCM4) */ #if ENABLED(SDSUPPORT) - #if HAS_LCD_MENU && (SD_CONNECTION_IS(LCD) || !defined(SDCARD_CONNECTION)) - #undef SD_DETECT_STATE - #if ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #define SD_DETECT_STATE HIGH + + #if SD_CONNECTION_IS(ONBOARD) && DISABLED(NO_SD_HOST_DRIVE) && !defined(ARDUINO_GRAND_CENTRAL_M4) + // + // 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 HAS_SHARED_MEDIA 1 + #endif + + #if PIN_EXISTS(SD_DETECT) + #if HAS_LCD_MENU && (SD_CONNECTION_IS(LCD) || !defined(SDCARD_CONNECTION)) + #undef SD_DETECT_STATE + #if ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) + #define SD_DETECT_STATE HIGH + #endif + #endif + #ifndef SD_DETECT_STATE + #define SD_DETECT_STATE LOW #endif #endif - #ifndef SD_DETECT_STATE - #define SD_DETECT_STATE LOW - #endif + +#endif + +#if EITHER(LCD_USE_DMA_FSMC, FSMC_GRAPHICAL_TFT) || !PIN_EXISTS(SD_DETECT) + #define NO_LCD_REINIT 1 // Suppress LCD re-initialization #endif /** @@ -367,7 +407,7 @@ #endif #if !defined(PSU_POWERUP_DELAY) && ENABLED(PSU_CONTROL) - #define PSU_POWERUP_DELAY 100 + #define PSU_POWERUP_DELAY 250 #endif /** @@ -376,7 +416,9 @@ #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_6 == (n) || TEMP_SENSOR_7 == (n) || TEMP_SENSOR_BED == (n) || TEMP_SENSOR_PROBE == (n) || TEMP_SENSOR_CHAMBER == (n)) -#define HAS_USER_THERMISTORS ANY_TEMP_SENSOR_IS(1000) +#if ANY_TEMP_SENSOR_IS(1000) + #define HAS_USER_THERMISTORS 1 +#endif #if TEMP_SENSOR_0 == -5 || TEMP_SENSOR_0 == -3 || TEMP_SENSOR_0 == -2 #define HEATER_0_USES_MAX6675 @@ -617,20 +659,22 @@ */ #if ENABLED(X_DUAL_ENDSTOPS) #if X_HOME_DIR > 0 - #if X2_USE_ENDSTOP == _XMIN_ - #define X2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #elif X2_USE_ENDSTOP == _XMAX_ - #define X2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #elif X2_USE_ENDSTOP == _YMIN_ - #define X2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #elif X2_USE_ENDSTOP == _YMAX_ - #define X2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #elif X2_USE_ENDSTOP == _ZMIN_ - #define X2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #elif X2_USE_ENDSTOP == _ZMAX_ - #define X2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #else - #define X2_MAX_ENDSTOP_INVERTING false + #ifndef X2_MAX_ENDSTOP_INVERTING + #if X2_USE_ENDSTOP == _XMIN_ + #define X2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING + #elif X2_USE_ENDSTOP == _XMAX_ + #define X2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING + #elif X2_USE_ENDSTOP == _YMIN_ + #define X2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING + #elif X2_USE_ENDSTOP == _YMAX_ + #define X2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING + #elif X2_USE_ENDSTOP == _ZMIN_ + #define X2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING + #elif X2_USE_ENDSTOP == _ZMAX_ + #define X2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING + #else + #define X2_MAX_ENDSTOP_INVERTING false + #endif #endif #ifndef X2_MAX_PIN #if X2_USE_ENDSTOP == _XMIN_ @@ -669,23 +713,27 @@ #define X2_MAX_PIN E7_DIAG_PIN #endif #endif - #define X2_MIN_ENDSTOP_INVERTING false - #else - #if X2_USE_ENDSTOP == _XMIN_ - #define X2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #elif X2_USE_ENDSTOP == _XMAX_ - #define X2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #elif X2_USE_ENDSTOP == _YMIN_ - #define X2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #elif X2_USE_ENDSTOP == _YMAX_ - #define X2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #elif X2_USE_ENDSTOP == _ZMIN_ - #define X2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #elif X2_USE_ENDSTOP == _ZMAX_ - #define X2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #else + #ifndef X2_MIN_ENDSTOP_INVERTING #define X2_MIN_ENDSTOP_INVERTING false #endif + #else + #ifndef X2_MIN_ENDSTOP_INVERTING + #if X2_USE_ENDSTOP == _XMIN_ + #define X2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING + #elif X2_USE_ENDSTOP == _XMAX_ + #define X2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING + #elif X2_USE_ENDSTOP == _YMIN_ + #define X2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING + #elif X2_USE_ENDSTOP == _YMAX_ + #define X2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING + #elif X2_USE_ENDSTOP == _ZMIN_ + #define X2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING + #elif X2_USE_ENDSTOP == _ZMAX_ + #define X2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING + #else + #define X2_MIN_ENDSTOP_INVERTING false + #endif + #endif #ifndef X2_MIN_PIN #if X2_USE_ENDSTOP == _XMIN_ #define X2_MIN_PIN X_MIN_PIN @@ -723,7 +771,9 @@ #define X2_MIN_PIN E7_DIAG_PIN #endif #endif - #define X2_MAX_ENDSTOP_INVERTING false + #ifndef X2_MAX_ENDSTOP_INVERTING + #define X2_MAX_ENDSTOP_INVERTING false + #endif #endif #endif @@ -732,20 +782,22 @@ */ #if ENABLED(Y_DUAL_ENDSTOPS) #if Y_HOME_DIR > 0 - #if Y2_USE_ENDSTOP == _XMIN_ - #define Y2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #elif Y2_USE_ENDSTOP == _XMAX_ - #define Y2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #elif Y2_USE_ENDSTOP == _YMIN_ - #define Y2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #elif Y2_USE_ENDSTOP == _YMAX_ - #define Y2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #elif Y2_USE_ENDSTOP == _ZMIN_ - #define Y2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #elif Y2_USE_ENDSTOP == _ZMAX_ - #define Y2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #else - #define Y2_MAX_ENDSTOP_INVERTING false + #ifndef Y2_MAX_ENDSTOP_INVERTING + #if Y2_USE_ENDSTOP == _XMIN_ + #define Y2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING + #elif Y2_USE_ENDSTOP == _XMAX_ + #define Y2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING + #elif Y2_USE_ENDSTOP == _YMIN_ + #define Y2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING + #elif Y2_USE_ENDSTOP == _YMAX_ + #define Y2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING + #elif Y2_USE_ENDSTOP == _ZMIN_ + #define Y2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING + #elif Y2_USE_ENDSTOP == _ZMAX_ + #define Y2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING + #else + #define Y2_MAX_ENDSTOP_INVERTING false + #endif #endif #ifndef Y2_MAX_PIN #if Y2_USE_ENDSTOP == _XMIN_ @@ -784,23 +836,27 @@ #define Y2_MAX_PIN E7_DIAG_PIN #endif #endif - #define Y2_MIN_ENDSTOP_INVERTING false - #else - #if Y2_USE_ENDSTOP == _XMIN_ - #define Y2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #elif Y2_USE_ENDSTOP == _XMAX_ - #define Y2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #elif Y2_USE_ENDSTOP == _YMIN_ - #define Y2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #elif Y2_USE_ENDSTOP == _YMAX_ - #define Y2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #elif Y2_USE_ENDSTOP == _ZMIN_ - #define Y2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #elif Y2_USE_ENDSTOP == _ZMAX_ - #define Y2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #else + #ifndef Y2_MIN_ENDSTOP_INVERTING #define Y2_MIN_ENDSTOP_INVERTING false #endif + #else + #ifndef Y2_MIN_ENDSTOP_INVERTING + #if Y2_USE_ENDSTOP == _XMIN_ + #define Y2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING + #elif Y2_USE_ENDSTOP == _XMAX_ + #define Y2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING + #elif Y2_USE_ENDSTOP == _YMIN_ + #define Y2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING + #elif Y2_USE_ENDSTOP == _YMAX_ + #define Y2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING + #elif Y2_USE_ENDSTOP == _ZMIN_ + #define Y2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING + #elif Y2_USE_ENDSTOP == _ZMAX_ + #define Y2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING + #else + #define Y2_MIN_ENDSTOP_INVERTING false + #endif + #endif #ifndef Y2_MIN_PIN #if Y2_USE_ENDSTOP == _XMIN_ #define Y2_MIN_PIN X_MIN_PIN @@ -838,7 +894,9 @@ #define Y2_MIN_PIN E7_DIAG_PIN #endif #endif - #define Y2_MAX_ENDSTOP_INVERTING false + #ifndef Y2_MAX_ENDSTOP_INVERTING + #define Y2_MAX_ENDSTOP_INVERTING false + #endif #endif #endif @@ -848,20 +906,22 @@ #if ENABLED(Z_MULTI_ENDSTOPS) #if Z_HOME_DIR > 0 - #if Z2_USE_ENDSTOP == _XMIN_ - #define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #elif Z2_USE_ENDSTOP == _XMAX_ - #define Z2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #elif Z2_USE_ENDSTOP == _YMIN_ - #define Z2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #elif Z2_USE_ENDSTOP == _YMAX_ - #define Z2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #elif Z2_USE_ENDSTOP == _ZMIN_ - #define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #elif Z2_USE_ENDSTOP == _ZMAX_ - #define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #else - #define Z2_MAX_ENDSTOP_INVERTING false + #ifndef Z2_MAX_ENDSTOP_INVERTING + #if Z2_USE_ENDSTOP == _XMIN_ + #define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING + #elif Z2_USE_ENDSTOP == _XMAX_ + #define Z2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING + #elif Z2_USE_ENDSTOP == _YMIN_ + #define Z2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING + #elif Z2_USE_ENDSTOP == _YMAX_ + #define Z2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING + #elif Z2_USE_ENDSTOP == _ZMIN_ + #define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING + #elif Z2_USE_ENDSTOP == _ZMAX_ + #define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING + #else + #define Z2_MAX_ENDSTOP_INVERTING false + #endif #endif #ifndef Z2_MAX_PIN #if Z2_USE_ENDSTOP == _XMIN_ @@ -900,23 +960,27 @@ #define Z2_MAX_PIN E7_DIAG_PIN #endif #endif - #define Z2_MIN_ENDSTOP_INVERTING false - #else - #if Z2_USE_ENDSTOP == _XMIN_ - #define Z2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #elif Z2_USE_ENDSTOP == _XMAX_ - #define Z2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #elif Z2_USE_ENDSTOP == _YMIN_ - #define Z2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #elif Z2_USE_ENDSTOP == _YMAX_ - #define Z2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #elif Z2_USE_ENDSTOP == _ZMIN_ - #define Z2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #elif Z2_USE_ENDSTOP == _ZMAX_ - #define Z2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #else + #ifndef Z2_MIN_ENDSTOP_INVERTING #define Z2_MIN_ENDSTOP_INVERTING false #endif + #else + #ifndef Z2_MIN_ENDSTOP_INVERTING + #if Z2_USE_ENDSTOP == _XMIN_ + #define Z2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING + #elif Z2_USE_ENDSTOP == _XMAX_ + #define Z2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING + #elif Z2_USE_ENDSTOP == _YMIN_ + #define Z2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING + #elif Z2_USE_ENDSTOP == _YMAX_ + #define Z2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING + #elif Z2_USE_ENDSTOP == _ZMIN_ + #define Z2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING + #elif Z2_USE_ENDSTOP == _ZMAX_ + #define Z2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING + #else + #define Z2_MIN_ENDSTOP_INVERTING false + #endif + #endif #ifndef Z2_MIN_PIN #if Z2_USE_ENDSTOP == _XMIN_ #define Z2_MIN_PIN X_MIN_PIN @@ -954,25 +1018,29 @@ #define Z2_MIN_PIN E7_DIAG_PIN #endif #endif - #define Z2_MAX_ENDSTOP_INVERTING false + #ifndef Z2_MAX_ENDSTOP_INVERTING + #define Z2_MAX_ENDSTOP_INVERTING false + #endif #endif #if NUM_Z_STEPPER_DRIVERS >= 3 #if Z_HOME_DIR > 0 - #if Z3_USE_ENDSTOP == _XMIN_ - #define Z3_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #elif Z3_USE_ENDSTOP == _XMAX_ - #define Z3_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #elif Z3_USE_ENDSTOP == _YMIN_ - #define Z3_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #elif Z3_USE_ENDSTOP == _YMAX_ - #define Z3_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #elif Z3_USE_ENDSTOP == _ZMIN_ - #define Z3_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #elif Z3_USE_ENDSTOP == _ZMAX_ - #define Z3_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #else - #define Z3_MAX_ENDSTOP_INVERTING false + #ifndef Z3_MAX_ENDSTOP_INVERTING + #if Z3_USE_ENDSTOP == _XMIN_ + #define Z3_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING + #elif Z3_USE_ENDSTOP == _XMAX_ + #define Z3_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING + #elif Z3_USE_ENDSTOP == _YMIN_ + #define Z3_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING + #elif Z3_USE_ENDSTOP == _YMAX_ + #define Z3_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING + #elif Z3_USE_ENDSTOP == _ZMIN_ + #define Z3_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING + #elif Z3_USE_ENDSTOP == _ZMAX_ + #define Z3_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING + #else + #define Z3_MAX_ENDSTOP_INVERTING false + #endif #endif #ifndef Z3_MAX_PIN #if Z3_USE_ENDSTOP == _XMIN_ @@ -1011,23 +1079,27 @@ #define Z3_MAX_PIN E7_DIAG_PIN #endif #endif - #define Z3_MIN_ENDSTOP_INVERTING false - #else - #if Z3_USE_ENDSTOP == _XMIN_ - #define Z3_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #elif Z3_USE_ENDSTOP == _XMAX_ - #define Z3_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #elif Z3_USE_ENDSTOP == _YMIN_ - #define Z3_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #elif Z3_USE_ENDSTOP == _YMAX_ - #define Z3_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #elif Z3_USE_ENDSTOP == _ZMIN_ - #define Z3_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #elif Z3_USE_ENDSTOP == _ZMAX_ - #define Z3_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #else + #ifndef Z3_MIN_ENDSTOP_INVERTING #define Z3_MIN_ENDSTOP_INVERTING false #endif + #else + #ifndef Z3_MIN_ENDSTOP_INVERTING + #if Z3_USE_ENDSTOP == _XMIN_ + #define Z3_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING + #elif Z3_USE_ENDSTOP == _XMAX_ + #define Z3_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING + #elif Z3_USE_ENDSTOP == _YMIN_ + #define Z3_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING + #elif Z3_USE_ENDSTOP == _YMAX_ + #define Z3_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING + #elif Z3_USE_ENDSTOP == _ZMIN_ + #define Z3_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING + #elif Z3_USE_ENDSTOP == _ZMAX_ + #define Z3_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING + #else + #define Z3_MIN_ENDSTOP_INVERTING false + #endif + #endif #ifndef Z3_MIN_PIN #if Z3_USE_ENDSTOP == _XMIN_ #define Z3_MIN_PIN X_MIN_PIN @@ -1065,26 +1137,30 @@ #define Z3_MIN_PIN E7_DIAG_PIN #endif #endif - #define Z3_MAX_ENDSTOP_INVERTING false + #ifndef Z3_MAX_ENDSTOP_INVERTING + #define Z3_MAX_ENDSTOP_INVERTING false + #endif #endif #endif #if NUM_Z_STEPPER_DRIVERS >= 4 #if Z_HOME_DIR > 0 - #if Z4_USE_ENDSTOP == _XMIN_ - #define Z4_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #elif Z4_USE_ENDSTOP == _XMAX_ - #define Z4_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #elif Z4_USE_ENDSTOP == _YMIN_ - #define Z4_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #elif Z4_USE_ENDSTOP == _YMAX_ - #define Z4_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #elif Z4_USE_ENDSTOP == _ZMIN_ - #define Z4_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #elif Z4_USE_ENDSTOP == _ZMAX_ - #define Z4_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #else - #define Z4_MAX_ENDSTOP_INVERTING false + #ifndef Z4_MAX_ENDSTOP_INVERTING + #if Z4_USE_ENDSTOP == _XMIN_ + #define Z4_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING + #elif Z4_USE_ENDSTOP == _XMAX_ + #define Z4_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING + #elif Z4_USE_ENDSTOP == _YMIN_ + #define Z4_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING + #elif Z4_USE_ENDSTOP == _YMAX_ + #define Z4_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING + #elif Z4_USE_ENDSTOP == _ZMIN_ + #define Z4_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING + #elif Z4_USE_ENDSTOP == _ZMAX_ + #define Z4_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING + #else + #define Z4_MAX_ENDSTOP_INVERTING false + #endif #endif #ifndef Z4_MAX_PIN #if Z4_USE_ENDSTOP == _XMIN_ @@ -1123,23 +1199,27 @@ #define Z4_MAX_PIN E7_DIAG_PIN #endif #endif - #define Z4_MIN_ENDSTOP_INVERTING false - #else - #if Z4_USE_ENDSTOP == _XMIN_ - #define Z4_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #elif Z4_USE_ENDSTOP == _XMAX_ - #define Z4_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #elif Z4_USE_ENDSTOP == _YMIN_ - #define Z4_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #elif Z4_USE_ENDSTOP == _YMAX_ - #define Z4_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #elif Z4_USE_ENDSTOP == _ZMIN_ - #define Z4_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #elif Z4_USE_ENDSTOP == _ZMAX_ - #define Z4_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #else + #ifndef Z4_MIN_ENDSTOP_INVERTING #define Z4_MIN_ENDSTOP_INVERTING false #endif + #else + #ifndef Z4_MIN_ENDSTOP_INVERTING + #if Z4_USE_ENDSTOP == _XMIN_ + #define Z4_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING + #elif Z4_USE_ENDSTOP == _XMAX_ + #define Z4_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING + #elif Z4_USE_ENDSTOP == _YMIN_ + #define Z4_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING + #elif Z4_USE_ENDSTOP == _YMAX_ + #define Z4_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING + #elif Z4_USE_ENDSTOP == _ZMIN_ + #define Z4_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING + #elif Z4_USE_ENDSTOP == _ZMAX_ + #define Z4_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING + #else + #define Z4_MIN_ENDSTOP_INVERTING false + #endif + #endif #ifndef Z4_MIN_PIN #if Z4_USE_ENDSTOP == _XMIN_ #define Z4_MIN_PIN X_MIN_PIN @@ -1177,7 +1257,9 @@ #define Z4_MIN_PIN E7_DIAG_PIN #endif #endif - #define Z4_MAX_ENDSTOP_INVERTING false + #ifndef Z4_MAX_ENDSTOP_INVERTING + #define Z4_MAX_ENDSTOP_INVERTING false + #endif #endif #endif @@ -1236,96 +1318,243 @@ */ // 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)) +#if PIN_EXISTS(X_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X)) + #define HAS_X_ENABLE 1 +#endif +#if PIN_EXISTS(X_DIR) + #define HAS_X_DIR 1 +#endif +#if PIN_EXISTS(X_STEP) + #define HAS_X_STEP 1 +#endif +#if PIN_EXISTS(X_MS1) + #define HAS_X_MS_PINS 1 +#endif -#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)) +#if PIN_EXISTS(X2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X2)) + #define HAS_X2_ENABLE 1 +#endif +#if PIN_EXISTS(X2_DIR) + #define HAS_X2_DIR 1 +#endif +#if PIN_EXISTS(X2_STEP) + #define HAS_X2_STEP 1 +#endif +#if PIN_EXISTS(X2_MS1) + #define HAS_X2_MS_PINS 1 +#endif -#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)) +#if PIN_EXISTS(Y_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y)) + #define HAS_Y_ENABLE 1 +#endif +#if PIN_EXISTS(Y_DIR) + #define HAS_Y_DIR 1 +#endif +#if PIN_EXISTS(Y_STEP) + #define HAS_Y_STEP 1 +#endif +#if PIN_EXISTS(Y_MS1) + #define HAS_Y_MS_PINS 1 +#endif -#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)) +#if PIN_EXISTS(Y2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2)) + #define HAS_Y2_ENABLE 1 +#endif +#if PIN_EXISTS(Y2_DIR) + #define HAS_Y2_DIR 1 +#endif +#if PIN_EXISTS(Y2_STEP) + #define HAS_Y2_STEP 1 +#endif +#if PIN_EXISTS(Y2_MS1) + #define HAS_Y2_MS_PINS 1 +#endif -#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)) +#if PIN_EXISTS(Z_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z)) + #define HAS_Z_ENABLE 1 +#endif +#if PIN_EXISTS(Z_DIR) + #define HAS_Z_DIR 1 +#endif +#if PIN_EXISTS(Z_STEP) + #define HAS_Z_STEP 1 +#endif +#if PIN_EXISTS(Z_MS1) + #define HAS_Z_MS_PINS 1 +#endif -#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)) +#if PIN_EXISTS(Z2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2)) + #define HAS_Z2_ENABLE 1 +#endif +#if PIN_EXISTS(Z2_DIR) + #define HAS_Z2_DIR 1 +#endif +#if PIN_EXISTS(Z2_STEP) + #define HAS_Z2_STEP 1 +#endif +#if PIN_EXISTS(Z2_MS1) + #define HAS_Z2_MS_PINS 1 +#endif -#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)) +#if PIN_EXISTS(Z3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3)) + #define HAS_Z3_ENABLE 1 +#endif +#if PIN_EXISTS(Z3_DIR) + #define HAS_Z3_DIR 1 +#endif +#if PIN_EXISTS(Z3_STEP) + #define HAS_Z3_STEP 1 +#endif +#if PIN_EXISTS(Z3_MS1) + #define HAS_Z3_MS_PINS 1 +#endif -#define HAS_Z4_ENABLE (PIN_EXISTS(Z4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z4))) -#define HAS_Z4_DIR (PIN_EXISTS(Z4_DIR)) -#define HAS_Z4_STEP (PIN_EXISTS(Z4_STEP)) -#define HAS_Z4_MICROSTEPS (PIN_EXISTS(Z4_MS1)) +#if PIN_EXISTS(Z4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z4)) + #define HAS_Z4_ENABLE 1 +#endif +#if PIN_EXISTS(Z4_DIR) + #define HAS_Z4_DIR 1 +#endif +#if PIN_EXISTS(Z4_STEP) + #define HAS_Z4_STEP 1 +#endif +#if PIN_EXISTS(Z4_MS1) + #define HAS_Z4_MS_PINS 1 +#endif // 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)) +#if PIN_EXISTS(E0_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0)) + #define HAS_E0_ENABLE 1 +#endif +#if PIN_EXISTS(E0_DIR) + #define HAS_E0_DIR 1 +#endif +#if PIN_EXISTS(E0_STEP) + #define HAS_E0_STEP 1 +#endif +#if PIN_EXISTS(E0_MS1) + #define HAS_E0_MS_PINS 1 +#endif +#if PIN_EXISTS(SOL0) + #define HAS_SOLENOID_0 1 +#endif -#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)) +#if PIN_EXISTS(E1_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1)) + #define HAS_E1_ENABLE 1 +#endif +#if PIN_EXISTS(E1_DIR) + #define HAS_E1_DIR 1 +#endif +#if PIN_EXISTS(E1_STEP) + #define HAS_E1_STEP 1 +#endif +#if PIN_EXISTS(E1_MS1) + #define HAS_E1_MS_PINS 1 +#endif +#if PIN_EXISTS(SOL1) + #define HAS_SOLENOID_1 1 +#endif -#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)) +#if PIN_EXISTS(E2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2)) + #define HAS_E2_ENABLE 1 +#endif +#if PIN_EXISTS(E2_DIR) + #define HAS_E2_DIR 1 +#endif +#if PIN_EXISTS(E2_STEP) + #define HAS_E2_STEP 1 +#endif +#if PIN_EXISTS(E2_MS1) + #define HAS_E2_MS_PINS 1 +#endif +#if PIN_EXISTS(SOL2) + #define HAS_SOLENOID_2 1 +#endif -#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)) +#if PIN_EXISTS(E3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3)) + #define HAS_E3_ENABLE 1 +#endif +#if PIN_EXISTS(E3_DIR) + #define HAS_E3_DIR 1 +#endif +#if PIN_EXISTS(E3_STEP) + #define HAS_E3_STEP 1 +#endif +#if PIN_EXISTS(E3_MS1) + #define HAS_E3_MS_PINS 1 +#endif +#if PIN_EXISTS(SOL3) + #define HAS_SOLENOID_3 1 +#endif -#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)) +#if PIN_EXISTS(E4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4)) + #define HAS_E4_ENABLE 1 +#endif +#if PIN_EXISTS(E4_DIR) + #define HAS_E4_DIR 1 +#endif +#if PIN_EXISTS(E4_STEP) + #define HAS_E4_STEP 1 +#endif +#if PIN_EXISTS(E4_MS1) + #define HAS_E4_MS_PINS 1 +#endif +#if PIN_EXISTS(SOL4) + #define HAS_SOLENOID_4 1 +#endif -#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)) +#if PIN_EXISTS(E5_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5)) + #define HAS_E5_ENABLE 1 +#endif +#if PIN_EXISTS(E5_DIR) + #define HAS_E5_DIR 1 +#endif +#if PIN_EXISTS(E5_STEP) + #define HAS_E5_STEP 1 +#endif +#if PIN_EXISTS(E5_MS1) + #define HAS_E5_MS_PINS 1 +#endif +#if PIN_EXISTS(SOL5) + #define HAS_SOLENOID_5 1 +#endif -#define HAS_E6_ENABLE (PIN_EXISTS(E6_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6))) -#define HAS_E6_DIR (PIN_EXISTS(E6_DIR)) -#define HAS_E6_STEP (PIN_EXISTS(E6_STEP)) -#define HAS_E6_MICROSTEPS (PIN_EXISTS(E6_MS1)) -#define HAS_SOLENOID_6 (PIN_EXISTS(SOL6)) +#if PIN_EXISTS(E6_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6)) + #define HAS_E6_ENABLE 1 +#endif +#if PIN_EXISTS(E6_DIR) + #define HAS_E6_DIR 1 +#endif +#if PIN_EXISTS(E6_STEP) + #define HAS_E6_STEP 1 +#endif +#if PIN_EXISTS(E6_MS1) + #define HAS_E6_MS_PINS 1 +#endif +#if PIN_EXISTS(SOL6) + #define HAS_SOLENOID_6 1 +#endif -#define HAS_E7_ENABLE (PIN_EXISTS(E7_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7))) -#define HAS_E7_DIR (PIN_EXISTS(E7_DIR)) -#define HAS_E7_STEP (PIN_EXISTS(E7_STEP)) -#define HAS_E7_MICROSTEPS (PIN_EXISTS(E7_MS1)) -#define HAS_SOLENOID_7 (PIN_EXISTS(SOL7)) +#if PIN_EXISTS(E7_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7)) + #define HAS_E7_ENABLE 1 +#endif +#if PIN_EXISTS(E7_DIR) + #define HAS_E7_DIR 1 +#endif +#if PIN_EXISTS(E7_STEP) + #define HAS_E7_STEP 1 +#endif +#if PIN_EXISTS(E7_MS1) + #define HAS_E7_MS_PINS 1 +#endif +#if PIN_EXISTS(SOL7) + #define HAS_SOLENOID_7 1 +#endif +// // Trinamic Stepper Drivers +// + #if HAS_TRINAMIC_CONFIG #if ANY(STEALTHCHOP_XY, STEALTHCHOP_Z, STEALTHCHOP_E) #define STEALTHCHOP_ENABLED 1 @@ -1336,6 +1565,9 @@ // Disable Z axis sensorless homing if a probe is used to home the Z axis #if HOMING_Z_WITH_PROBE #undef Z_STALL_SENSITIVITY + #undef Z2_STALL_SENSITIVITY + #undef Z3_STALL_SENSITIVITY + #undef Z4_STALL_SENSITIVITY #endif #if defined(X_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(X) #define X_SENSORLESS 1 @@ -1368,10 +1600,18 @@ #endif #endif -#define HAS_E_STEPPER_ENABLE (HAS_E_DRIVER(TMC2660) \ +#if (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 ) \ -) + && E0_ENABLE_PIN != Y_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN ) ) + #define HAS_E_STEPPER_ENABLE 1 +#endif + +#if ANY_AXIS_HAS(HW_SERIAL) + #define HAS_TMC_HW_SERIAL 1 +#endif +#if ANY_AXIS_HAS(SW_SERIAL) + #define HAS_TMC_SW_SERIAL 1 +#endif // // Endstops and bed probe @@ -1386,66 +1626,163 @@ #define IS_Z4_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4 && Z4_USE_ENDSTOP == _##A##M##_) #define _HAS_STOP(A,M) (PIN_EXISTS(A##_##M) && !IS_PROBE_PIN(A,M) && !IS_X2_ENDSTOP(A,M) && !IS_Y2_ENDSTOP(A,M) && !IS_Z2_ENDSTOP(A,M) && !IS_Z3_ENDSTOP(A,M) && !IS_Z4_ENDSTOP(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_Z4_MIN (PIN_EXISTS(Z4_MIN)) -#define HAS_Z4_MAX (PIN_EXISTS(Z4_MAX)) -#define HAS_Z_MIN_PROBE_PIN (HAS_CUSTOM_PROBE_PIN && PIN_EXISTS(Z_MIN_PROBE)) +#if _HAS_STOP(X,MIN) + #define HAS_X_MIN 1 +#endif +#if _HAS_STOP(X,MAX) + #define HAS_X_MAX 1 +#endif +#if _HAS_STOP(Y,MIN) + #define HAS_Y_MIN 1 +#endif +#if _HAS_STOP(Y,MAX) + #define HAS_Y_MAX 1 +#endif +#if _HAS_STOP(Z,MIN) + #define HAS_Z_MIN 1 +#endif +#if _HAS_STOP(Z,MAX) + #define HAS_Z_MAX 1 +#endif +#if _HAS_STOP(X,STOP) + #define HAS_X_STOP 1 +#endif +#if _HAS_STOP(Y,STOP) + #define HAS_Y_STOP 1 +#endif +#if _HAS_STOP(Z,STOP) + #define HAS_Z_STOP 1 +#endif +#if PIN_EXISTS(X2_MIN) + #define HAS_X2_MIN 1 +#endif +#if PIN_EXISTS(X2_MAX) + #define HAS_X2_MAX 1 +#endif +#if PIN_EXISTS(Y2_MIN) + #define HAS_Y2_MIN 1 +#endif +#if PIN_EXISTS(Y2_MAX) + #define HAS_Y2_MAX 1 +#endif +#if PIN_EXISTS(Z2_MIN) + #define HAS_Z2_MIN 1 +#endif +#if PIN_EXISTS(Z2_MAX) + #define HAS_Z2_MAX 1 +#endif +#if PIN_EXISTS(Z3_MIN) + #define HAS_Z3_MIN 1 +#endif +#if PIN_EXISTS(Z3_MAX) + #define HAS_Z3_MAX 1 +#endif +#if PIN_EXISTS(Z4_MIN) + #define HAS_Z4_MIN 1 +#endif +#if PIN_EXISTS(Z4_MAX) + #define HAS_Z4_MAX 1 +#endif +#if HAS_CUSTOM_PROBE_PIN && PIN_EXISTS(Z_MIN_PROBE) + #define HAS_Z_MIN_PROBE_PIN 1 +#endif // // 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_6 HAS_ADC_TEST(6) -#define HAS_TEMP_ADC_7 HAS_ADC_TEST(7) -#define HAS_TEMP_ADC_BED HAS_ADC_TEST(BED) -#define HAS_TEMP_ADC_PROBE HAS_ADC_TEST(PROBE) -#define HAS_TEMP_ADC_CHAMBER HAS_ADC_TEST(CHAMBER) +#if HAS_ADC_TEST(0) + #define HAS_TEMP_ADC_0 1 +#endif +#if HAS_ADC_TEST(1) + #define HAS_TEMP_ADC_1 1 +#endif +#if HAS_ADC_TEST(2) + #define HAS_TEMP_ADC_2 1 +#endif +#if HAS_ADC_TEST(3) + #define HAS_TEMP_ADC_3 1 +#endif +#if HAS_ADC_TEST(4) + #define HAS_TEMP_ADC_4 1 +#endif +#if HAS_ADC_TEST(5) + #define HAS_TEMP_ADC_5 1 +#endif +#if HAS_ADC_TEST(6) + #define HAS_TEMP_ADC_6 1 +#endif +#if HAS_ADC_TEST(7) + #define HAS_TEMP_ADC_7 1 +#endif +#if HAS_ADC_TEST(BED) + #define HAS_TEMP_ADC_BED 1 +#endif +#if HAS_ADC_TEST(PROBE) + #define HAS_TEMP_ADC_PROBE 1 +#endif +#if HAS_ADC_TEST(CHAMBER) + #define HAS_TEMP_ADC_CHAMBER 1 +#endif -#define HAS_TEMP_HOTEND ((HAS_TEMP_ADC_0 || ENABLED(HEATER_0_USES_MAX6675)) && HOTENDS) +#if HAS_HOTEND && EITHER(HAS_TEMP_ADC_0, HEATER_0_USES_MAX6675) + #define HAS_TEMP_HOTEND 1 +#endif #define HAS_TEMP_BED HAS_TEMP_ADC_BED #define HAS_TEMP_PROBE HAS_TEMP_ADC_PROBE #define HAS_TEMP_CHAMBER HAS_TEMP_ADC_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) + #if PIN_EXISTS(JOY_X) + #define HAS_JOY_ADC_X 1 + #endif + #if PIN_EXISTS(JOY_Y) + #define HAS_JOY_ADC_Y 1 + #endif + #if PIN_EXISTS(JOY_Z) + #define HAS_JOY_ADC_Z 1 + #endif + #if PIN_EXISTS(JOY_EN) + #define HAS_JOY_ADC_EN 1 + #endif #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_6 (PIN_EXISTS(HEATER_6)) -#define HAS_HEATER_7 (PIN_EXISTS(HEATER_7)) -#define HAS_HEATER_BED (PIN_EXISTS(HEATER_BED)) +#if PIN_EXISTS(HEATER_0) + #define HAS_HEATER_0 1 +#endif +#if PIN_EXISTS(HEATER_1) + #define HAS_HEATER_1 1 +#endif +#if PIN_EXISTS(HEATER_2) + #define HAS_HEATER_2 1 +#endif +#if PIN_EXISTS(HEATER_3) + #define HAS_HEATER_3 1 +#endif +#if PIN_EXISTS(HEATER_4) + #define HAS_HEATER_4 1 +#endif +#if PIN_EXISTS(HEATER_5) + #define HAS_HEATER_5 1 +#endif +#if PIN_EXISTS(HEATER_6) + #define HAS_HEATER_6 1 +#endif +#if PIN_EXISTS(HEATER_7) + #define HAS_HEATER_7 1 +#endif +#if PIN_EXISTS(HEATER_BED) + #define HAS_HEATER_BED 1 +#endif // Shorthand for common combinations #if HAS_TEMP_BED && HAS_HEATER_BED #define HAS_HEATED_BED 1 + #ifndef BED_OVERSHOOT + #define BED_OVERSHOOT 10 + #endif + #define BED_MAX_TARGET (BED_MAXTEMP - (BED_OVERSHOOT)) #endif #if HAS_HEATED_BED || HAS_TEMP_CHAMBER #define BED_OR_CHAMBER 1 @@ -1469,7 +1806,7 @@ #endif // Thermal protection -#if HAS_HEATED_BED && ENABLED(THERMAL_PROTECTION_BED) +#if BOTH(HAS_HEATED_BED, THERMAL_PROTECTION_BED) #define HAS_THERMALLY_PROTECTED_BED 1 #endif #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0 @@ -1478,7 +1815,7 @@ #if HAS_THERMALLY_PROTECTED_BED && WATCH_BED_TEMP_PERIOD > 0 #define WATCH_BED 1 #endif -#if HAS_HEATED_CHAMBER && ENABLED(THERMAL_PROTECTION_CHAMBER) && WATCH_CHAMBER_TEMP_PERIOD > 0 +#if BOTH(HAS_HEATED_CHAMBER, THERMAL_PROTECTION_CHAMBER) && WATCH_CHAMBER_TEMP_PERIOD > 0 #define WATCH_CHAMBER 1 #endif #if (ENABLED(THERMAL_PROTECTION_HOTENDS) || !EXTRUDERS) \ @@ -1488,52 +1825,111 @@ #endif // 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_FAN_6 (HOTENDS > 6 && PIN_EXISTS(E6_AUTO_FAN)) -#define HAS_AUTO_FAN_7 (HOTENDS > 7 && PIN_EXISTS(E7_AUTO_FAN)) -#define HAS_AUTO_CHAMBER_FAN (HAS_TEMP_CHAMBER && PIN_EXISTS(CHAMBER_AUTO_FAN)) +#if HAS_HOTEND && PIN_EXISTS(E0_AUTO_FAN) + #define HAS_AUTO_FAN_0 1 +#endif +#if HAS_MULTI_HOTEND && PIN_EXISTS(E1_AUTO_FAN) + #define HAS_AUTO_FAN_1 1 +#endif +#if HOTENDS > 2 && PIN_EXISTS(E2_AUTO_FAN) + #define HAS_AUTO_FAN_2 1 +#endif +#if HOTENDS > 3 && PIN_EXISTS(E3_AUTO_FAN) + #define HAS_AUTO_FAN_3 1 +#endif +#if HOTENDS > 4 && PIN_EXISTS(E4_AUTO_FAN) + #define HAS_AUTO_FAN_4 1 +#endif +#if HOTENDS > 5 && PIN_EXISTS(E5_AUTO_FAN) + #define HAS_AUTO_FAN_5 1 +#endif +#if HOTENDS > 6 && PIN_EXISTS(E6_AUTO_FAN) + #define HAS_AUTO_FAN_6 1 +#endif +#if HOTENDS > 7 && PIN_EXISTS(E7_AUTO_FAN) + #define HAS_AUTO_FAN_7 1 +#endif +#if HAS_TEMP_CHAMBER && PIN_EXISTS(CHAMBER_AUTO_FAN) + #define HAS_AUTO_CHAMBER_FAN 1 +#endif -#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_FAN_6 || HAS_AUTO_FAN_7 || HAS_AUTO_CHAMBER_FAN) +#if ANY(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_FAN_6, HAS_AUTO_FAN_7, HAS_AUTO_CHAMBER_FAN) + #define HAS_AUTO_FAN 1 +#endif #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) || _FANOVERLAP(CHAMBER,6) || _FANOVERLAP(CHAMBER,7)) +#if HAS_AUTO_FAN && (_FANOVERLAP(CHAMBER,0) || _FANOVERLAP(CHAMBER,1) || _FANOVERLAP(CHAMBER,2) || _FANOVERLAP(CHAMBER,3) || _FANOVERLAP(CHAMBER,4) || _FANOVERLAP(CHAMBER,5) || _FANOVERLAP(CHAMBER,6) || _FANOVERLAP(CHAMBER,7)) + #define AUTO_CHAMBER_IS_E 1 #endif #if !HAS_TEMP_SENSOR #undef AUTO_REPORT_TEMPERATURES #endif -#define HAS_AUTO_REPORTING EITHER(AUTO_REPORT_TEMPERATURES, AUTO_REPORT_SD_STATUS) +#if EITHER(AUTO_REPORT_TEMPERATURES, AUTO_REPORT_SD_STATUS) + #define HAS_AUTO_REPORTING 1 +#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_FAN(P) (PIN_EXISTS(FAN##P) && CONTROLLER_FAN_PIN != FAN##P##_PIN && E0_AUTO_FAN_PIN != FAN##P##_PIN && E1_AUTO_FAN_PIN != FAN##P##_PIN && E2_AUTO_FAN_PIN != FAN##P##_PIN && E3_AUTO_FAN_PIN != FAN##P##_PIN && E4_AUTO_FAN_PIN != FAN##P##_PIN && E5_AUTO_FAN_PIN != FAN##P##_PIN && E6_AUTO_FAN_PIN != FAN##P##_PIN && E7_AUTO_FAN_PIN != FAN##P##_PIN) -#define HAS_FAN1 _HAS_FAN(1) -#define HAS_FAN2 _HAS_FAN(2) -#define HAS_FAN3 _HAS_FAN(3) -#define HAS_FAN4 _HAS_FAN(4) -#define HAS_FAN5 _HAS_FAN(5) -#define HAS_FAN6 _HAS_FAN(6) -#define HAS_FAN7 _HAS_FAN(7) -#define HAS_CONTROLLER_FAN (PIN_EXISTS(CONTROLLER_FAN)) +#if PIN_EXISTS(FAN) + #define HAS_FAN0 1 +#endif +#define _NOT_E_AUTO(N,F) (E##N##_AUTO_FAN_PIN != FAN##F##_PIN) +#define _HAS_FAN(F) (PIN_EXISTS(FAN##F) && CONTROLLER_FAN_PIN != FAN##F##_PIN && _NOT_E_AUTO(0,F) && _NOT_E_AUTO(1,F) && _NOT_E_AUTO(2,F) && _NOT_E_AUTO(3,F) && _NOT_E_AUTO(4,F) && _NOT_E_AUTO(5,F) && _NOT_E_AUTO(6,F) && _NOT_E_AUTO(7,F)) +#if _HAS_FAN(1) + #define HAS_FAN1 1 +#endif +#if _HAS_FAN(2) + #define HAS_FAN2 1 +#endif +#if _HAS_FAN(3) + #define HAS_FAN3 1 +#endif +#if _HAS_FAN(4) + #define HAS_FAN4 1 +#endif +#if _HAS_FAN(5) + #define HAS_FAN5 1 +#endif +#if _HAS_FAN(6) + #define HAS_FAN6 1 +#endif +#if _HAS_FAN(7) + #define HAS_FAN7 1 +#endif +#undef _NOT_E_AUTO +#undef _HAS_FAN +#if PIN_EXISTS(CONTROLLER_FAN) + #define HAS_CONTROLLER_FAN 1 +#endif + +#if BED_OR_CHAMBER || HAS_FAN0 + #define BED_OR_CHAMBER_OR_FAN 1 +#endif // 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 PIN_EXISTS(SERVO0) && NUM_SERVOS > 0 + #define HAS_SERVO_0 1 +#endif +#if PIN_EXISTS(SERVO1) && NUM_SERVOS > 1 + #define HAS_SERVO_1 1 +#endif +#if PIN_EXISTS(SERVO2) && NUM_SERVOS > 2 + #define HAS_SERVO_2 1 +#endif +#if PIN_EXISTS(SERVO3) && NUM_SERVOS > 3 + #define HAS_SERVO_3 1 +#endif +#if NUM_SERVOS > 0 + #define HAS_SERVOS 1 +#endif // Sensors -#define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH)) +#if PIN_EXISTS(FILWIDTH) + #define HAS_FILAMENT_WIDTH_SENSOR 1 +#endif // User Interface #if PIN_EXISTS(HOME) @@ -1548,12 +1944,6 @@ #if PIN_EXISTS(PHOTOGRAPH) #define HAS_PHOTOGRAPH 1 #endif -#if PIN_EXISTS(BEEPER) || EITHER(LCD_USE_I2C_BUZZER, PCA9632_BUZZER) - #define HAS_BUZZER 1 -#endif -#if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER, PCA9632_BUZZER) - #define USE_BEEPER 1 -#endif #if PIN_EXISTS(CASE_LIGHT) && ENABLED(CASE_LIGHT_ENABLE) #define HAS_CASE_LIGHT 1 #endif @@ -1569,13 +1959,13 @@ #define HAS_MOTOR_CURRENT_PWM 1 #endif -#if HAS_Z_MICROSTEPS || HAS_Z2_MICROSTEPS || HAS_Z3_MICROSTEPS || HAS_Z4_MICROSTEPS - #define HAS_SOME_Z_MICROSTEPS 1 +#if ANY(HAS_Z_MS_PINS, HAS_Z2_MS_PINS, HAS_Z3_MS_PINS, HAS_Z4_MS_PINS) + #define HAS_SOME_Z_MS_PINS 1 #endif -#if HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS || HAS_E5_MICROSTEPS || HAS_E6_MICROSTEPS || HAS_E7_MICROSTEPS - #define HAS_SOME_E_MICROSTEPS 1 +#if ANY(HAS_E0_MS_PINS, HAS_E1_MS_PINS, HAS_E2_MS_PINS, HAS_E3_MS_PINS, HAS_E4_MS_PINS, HAS_E5_MS_PINS, HAS_E6_MS_PINS, HAS_E7_MS_PINS) + #define HAS_SOME_E_MS_PINS 1 #endif -#if HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS || HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS || HAS_SOME_Z_MICROSTEPS || HAS_SOME_E_MICROSTEPS +#if ANY(HAS_X_MS_PINS, HAS_X2_MS_PINS, HAS_Y_MS_PINS, HAS_Y2_MS_PINS, HAS_SOME_Z_MS_PINS, HAS_SOME_E_MS_PINS) #define HAS_MICROSTEPS 1 #endif @@ -1619,14 +2009,30 @@ #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) + #ifdef MICROSTEP1 + #define HAS_MICROSTEP1 1 + #endif + #ifdef MICROSTEP2 + #define HAS_MICROSTEP2 1 + #endif + #ifdef MICROSTEP4 + #define HAS_MICROSTEP4 1 + #endif + #ifdef MICROSTEP8 + #define HAS_MICROSTEP8 1 + #endif + #ifdef MICROSTEP16 + #define HAS_MICROSTEP16 1 + #endif + #ifdef MICROSTEP32 + #define HAS_MICROSTEP32 1 + #endif + #ifdef MICROSTEP64 + #define HAS_MICROSTEP64 1 + #endif + #ifdef MICROSTEP128 + #define HAS_MICROSTEP128 1 + #endif #endif // HAS_MICROSTEPS @@ -1664,7 +2070,7 @@ */ #define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, (v) ^ HEATER_0_INVERTING) -#if HOTENDS > 1 || ENABLED(HEATERS_PARALLEL) +#if EITHER(HAS_MULTI_HOTEND, 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) @@ -1684,7 +2090,7 @@ #endif // HOTENDS > 4 #endif // HOTENDS > 3 #endif // HOTENDS > 2 -#endif // HOTENDS > 1 +#endif // HAS_MULTI_HOTEND || HEATERS_PARALLEL #if ENABLED(HEATERS_PARALLEL) #define WRITE_HEATER_0(v) { WRITE_HEATER_0P(v); WRITE_HEATER_1(v); } #else @@ -1724,6 +2130,24 @@ #define WRITE_HEATER_CHAMBER(v) WRITE(HEATER_CHAMBER_PIN, (v) ^ HEATER_CHAMBER_INVERTING) #endif +#if HAS_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER + #define HAS_TEMPERATURE 1 +#endif + +#if HAS_TEMPERATURE && EITHER(HAS_LCD_MENU, DWIN_CREALITY_LCD) + #ifdef PREHEAT_5_LABEL + #define PREHEAT_COUNT 5 + #elif defined(PREHEAT_4_LABEL) + #define PREHEAT_COUNT 4 + #elif defined(PREHEAT_3_LABEL) + #define PREHEAT_COUNT 3 + #elif defined(PREHEAT_2_LABEL) + #define PREHEAT_COUNT 2 + #elif defined(PREHEAT_1_LABEL) + #define PREHEAT_COUNT 1 + #endif +#endif + /** * Up to 3 PWM fans */ @@ -1752,13 +2176,16 @@ #endif #if FAN_COUNT > 0 + #define HAS_FAN 1 #define WRITE_FAN(n, v) WRITE(FAN##n##_PIN, (v) ^ FAN_INVERTING) #endif /** * Part Cooling fan multipliexer */ -#define HAS_FANMUX PIN_EXISTS(FANMUX0) +#if PIN_EXISTS(FANMUX0) + #define HAS_FANMUX 1 +#endif /** * MIN/MAX fan PWM scaling @@ -1808,7 +2235,7 @@ * Bed Probe dependencies */ #if HAS_BED_PROBE - #if ENABLED(ENDSTOPPULLUPS) && HAS_Z_MIN_PROBE_PIN + #if BOTH(ENDSTOPPULLUPS, HAS_Z_MIN_PROBE_PIN) #define ENDSTOPPULLUP_ZMIN_PROBE #endif #ifndef Z_PROBE_OFFSET_RANGE_MIN @@ -1877,15 +2304,19 @@ #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 HAS_BED_PROBE && (EITHER(PROBING_HEATERS_OFF, PROBING_FANS_OFF) || DELAY_BEFORE_PROBING > 0) + #define QUIET_PROBING 1 +#endif +#if EITHER(ADVANCED_PAUSE_FEATURE, PROBING_HEATERS_OFF) + #define HEATER_IDLE_HANDLER 1 +#endif #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 +#if EXTRUDERS > 1 && !defined(TOOLCHANGE_FS_EXTRA_PRIME) + #define TOOLCHANGE_FS_EXTRA_PRIME 0 #endif /** @@ -1902,31 +2333,31 @@ * Bed Probing bounds */ -#ifndef MIN_PROBE_EDGE - #define MIN_PROBE_EDGE 0 +#ifndef PROBING_MARGIN + #define PROBING_MARGIN 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 - #define MIN_PROBE_EDGE_LEFT 0 - #define MIN_PROBE_EDGE_RIGHT 0 - #define MIN_PROBE_EDGE_FRONT 0 - #define MIN_PROBE_EDGE_BACK 0 + #undef PROBING_MARGIN_LEFT + #undef PROBING_MARGIN_RIGHT + #undef PROBING_MARGIN_FRONT + #undef PROBING_MARGIN_BACK + #define PROBING_MARGIN_LEFT 0 + #define PROBING_MARGIN_RIGHT 0 + #define PROBING_MARGIN_FRONT 0 + #define PROBING_MARGIN_BACK 0 #else - #ifndef MIN_PROBE_EDGE_LEFT - #define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + #ifndef PROBING_MARGIN_LEFT + #define PROBING_MARGIN_LEFT PROBING_MARGIN #endif - #ifndef MIN_PROBE_EDGE_RIGHT - #define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + #ifndef PROBING_MARGIN_RIGHT + #define PROBING_MARGIN_RIGHT PROBING_MARGIN #endif - #ifndef MIN_PROBE_EDGE_FRONT - #define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + #ifndef PROBING_MARGIN_FRONT + #define PROBING_MARGIN_FRONT PROBING_MARGIN #endif - #ifndef MIN_PROBE_EDGE_BACK - #define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE + #ifndef PROBING_MARGIN_BACK + #define PROBING_MARGIN_BACK PROBING_MARGIN #endif #endif @@ -1992,13 +2423,24 @@ #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 _POINT_COUNT (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)) +#if _POINT_COUNT == 6 #define HAS_FIXED_3POINT 1 +#elif _POINT_COUNT > 0 + #error "For 3-Point Leveling all XY points must be defined (or none for the defaults)." #endif +#undef _POINT_COUNT /** * Buzzer/Speaker */ +#if PIN_EXISTS(BEEPER) || EITHER(LCD_USE_I2C_BUZZER, PCA9632_BUZZER) + #define HAS_BUZZER 1 + #if DISABLED(LCD_USE_I2C_BUZZER, PCA9632_BUZZER) + #define USE_BEEPER 1 + #endif +#endif + #if ENABLED(LCD_USE_I2C_BUZZER) #ifndef LCD_FEEDBACK_FREQUENCY_HZ #define LCD_FEEDBACK_FREQUENCY_HZ 1000 @@ -2015,6 +2457,10 @@ #endif #endif +#if HAS_BUZZER && LCD_FEEDBACK_FREQUENCY_DURATION_MS && LCD_FEEDBACK_FREQUENCY_HZ + #define HAS_CHIRP 1 +#endif + /** * Make sure DOGLCD_SCK and DOGLCD_MOSI are defined. */ @@ -2094,7 +2540,11 @@ #endif // Number of VFAT entries used. Each entry has 13 UTF-16 characters -#define MAX_VFAT_ENTRIES TERN(SCROLL_LONG_FILENAMES, 5, 2) +#if EITHER(SCROLL_LONG_FILENAMES, DWIN_CREALITY_LCD) + #define MAX_VFAT_ENTRIES (5) +#else + #define MAX_VFAT_ENTRIES (2) +#endif // Nozzle park for Delta #if BOTH(NOZZLE_PARK_FEATURE, DELTA) @@ -2153,21 +2603,8 @@ #endif #endif -#if ENABLED(SDSUPPORT) - #if SD_CONNECTION_IS(ONBOARD) && DISABLED(NO_SD_HOST_DRIVE) && !defined(ARDUINO_GRAND_CENTRAL_M4) - // - // 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 +#elif NUM_SERIAL > 1 + #define HAS_MULTI_SERIAL 1 #endif diff --git a/Marlin/src/inc/MarlinConfig.h b/Marlin/src/inc/MarlinConfig.h index c1655015e0..d1184cff5f 100644 --- a/Marlin/src/inc/MarlinConfig.h +++ b/Marlin/src/inc/MarlinConfig.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -30,6 +30,7 @@ #include "../HAL/HAL.h" #include "../pins/pins.h" +#include HAL_PATH(../HAL, timers.h) #include HAL_PATH(../HAL, spi_pins.h) #include "Conditionals_post.h" diff --git a/Marlin/src/inc/MarlinConfigPre.h b/Marlin/src/inc/MarlinConfigPre.h index d84f751200..1b15d49817 100644 --- a/Marlin/src/inc/MarlinConfigPre.h +++ b/Marlin/src/inc/MarlinConfigPre.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 2fd61d4be1..2cba0fecf2 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -262,7 +262,7 @@ #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 +#elif defined(PID_FAN_SCALING) && !HAS_FAN #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." @@ -283,9 +283,9 @@ #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." + #error "Remove DELTA_PROBEABLE_RADIUS and use PROBING_MARGIN 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." + #error "Remove DELTA_CALIBRATION_RADIUS and use PROBING_MARGIN 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) @@ -294,14 +294,24 @@ #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(MIN_PROBE_EDGE) + #error "MIN_PROBE_EDGE is now called PROBING_MARGIN. Please update your configuration." +#elif defined(MIN_PROBE_EDGE_LEFT) + #error "MIN_PROBE_EDGE_LEFT is now called PROBING_MARGIN_LEFT. Please update your configuration." +#elif defined(MIN_PROBE_EDGE_RIGHT) + #error "MIN_PROBE_EDGE_RIGHT is now called PROBING_MARGIN_RIGHT. Please update your configuration." +#elif defined(MIN_PROBE_EDGE_FRONT) + #error "MIN_PROBE_EDGE_FRONT is now called PROBING_MARGIN_FRONT. Please update your configuration." +#elif defined(MIN_PROBE_EDGE_BACK) + #error "MIN_PROBE_EDGE_BACK is now called PROBING_MARGIN_BACK. Please update your configuration." #elif defined(LEFT_PROBE_BED_POSITION) - #error "LEFT_PROBE_BED_POSITION has been replaced by MIN_PROBE_EDGE_LEFT. Please update your configuration." + #error "LEFT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_LEFT instead." #elif defined(RIGHT_PROBE_BED_POSITION) - #error "RIGHT_PROBE_BED_POSITION has been replaced by MIN_PROBE_EDGE_RIGHT. Please update your configuration." + #error "RIGHT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_RIGHT instead." #elif defined(FRONT_PROBE_BED_POSITION) - #error "FRONT_PROBE_BED_POSITION has been replaced by MIN_PROBE_EDGE_FRONT. Please update your configuration." + #error "FRONT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_FRONT instead." #elif defined(BACK_PROBE_BED_POSITION) - #error "BACK_PROBE_BED_POSITION has been replaced by MIN_PROBE_EDGE_BACK. Please update your configuration." + #error "BACK_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_BACK instead." #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) @@ -355,7 +365,7 @@ #error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values. 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) +#elif HAS_JUNCTION_DEVIATION && 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." @@ -411,6 +421,8 @@ #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(CUTTER_POWER_DISPLAY) + #error "CUTTER_POWER_DISPLAY is now CUTTER_POWER_UNIT. 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) @@ -437,6 +449,10 @@ #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(TFT_LVGL_UI) + #error "TFT_LVGL_UI is now TFT_LVGL_UI_FSMC. Please update your configuration." +#elif defined(SPI_GRAPHICAL_TFT) + #error "SPI_GRAPHICAL_TFT is now TFT_LVGL_UI_SPI. 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) @@ -489,6 +505,42 @@ #error "Z_QUAD_ENDSTOPS is now Z_MULTI_ENDSTOPS. Please update Configuration_adv.h." #elif defined(DUGS_UI_MOVE_DIS_OPTION) #error "DUGS_UI_MOVE_DIS_OPTION is spelled DGUS_UI_MOVE_DIS_OPTION. Please update Configuration_adv.h." +#elif defined(ORIG_E0_AUTO_FAN_PIN) || defined(ORIG_E1_AUTO_FAN_PIN) || defined(ORIG_E2_AUTO_FAN_PIN) || defined(ORIG_E3_AUTO_FAN_PIN) || defined(ORIG_E4_AUTO_FAN_PIN) || defined(ORIG_E5_AUTO_FAN_PIN) || defined(ORIG_E6_AUTO_FAN_PIN) || defined(ORIG_E7_AUTO_FAN_PIN) + #error "ORIG_Ex_AUTO_FAN_PIN is now just Ex_AUTO_FAN_PIN. Make sure your pins are up to date." +#elif defined(ORIG_CHAMBER_AUTO_FAN_PIN) + #error "ORIG_CHAMBER_AUTO_FAN_PIN is now just CHAMBER_AUTO_FAN_PIN. Make sure your pins are up to date." +#elif defined(HOMING_BACKOFF_MM) + #error "HOMING_BACKOFF_MM is now HOMING_BACKOFF_POST_MM. Please update Configuration_adv.h." +#elif defined(X_HOME_BUMP_MM) || defined(Y_HOME_BUMP_MM) || defined(Z_HOME_BUMP_MM) + #error "[XYZ]_HOME_BUMP_MM is now HOMING_BUMP_MM. Please update Configuration_adv.h." +#elif defined(DIGIPOT_I2C) + #error "DIGIPOT_I2C is now DIGIPOT_MCP4451 (or DIGIPOT_MCP4018). Please update Configuration_adv.h." +#endif + +#ifdef FIL_RUNOUT_INVERTING + #if FIL_RUNOUT_INVERTING + #warning "FIL_RUNOUT_INVERTING true is now FIL_RUNOUT_STATE HIGH. Please update Configuration.h." + #else + #warning "FIL_RUNOUT_INVERTING false is now FIL_RUNOUT_STATE LOW. Please update Configuration.h." + #endif + #ifndef FIL_RUNOUT_STATE + #define FIL_RUNOUT_STATE ((FIL_RUNOUT_INVERTING) ? HIGH : LOW) + #endif +#endif + +/** + * Probe temp compensation requirements + */ +#if ENABLED(PROBE_TEMP_COMPENSATION) + #if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z) + #error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array). Please update Configuration_adv.h." + #elif !defined(PTC_PARK_POS) + #error "PROBE_TEMP_COMPENSATION requires PTC_PARK_POS." + #elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y) + #error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array). Please update Configuration_adv.h." + #elif !defined(PTC_PROBE_POS) + #error "PROBE_TEMP_COMPENSATION requires PTC_PROBE_POS." + #endif #endif /** @@ -637,7 +689,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #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) +#elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && NONE(HAS_GRAPHICAL_LCD, EXTENSIBLE_UI) #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Graphical LCD, or EXTENSIBLE_UI." #endif @@ -648,7 +700,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * Custom Boot and Status screens */ -#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && !(HAS_GRAPHICAL_LCD || ENABLED(TOUCH_UI_FTDI_EVE)) +#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && NONE(HAS_GRAPHICAL_LCD, 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." @@ -723,6 +775,15 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #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." + #elif !defined(BABYSTEP_MULTIPLICATOR_Z) + #error "BABYSTEPPING requires BABYSTEP_MULTIPLICATOR_Z." + #elif ENABLED(BABYSTEP_XY) && !defined(BABYSTEP_MULTIPLICATOR_XY) + #error "BABYSTEP_XY requires BABYSTEP_MULTIPLICATOR_XY." + #elif ENABLED(BABYSTEP_MILLIMETER_UNITS) + static_assert(BABYSTEP_MULTIPLICATOR_Z <= 0.1f, "BABYSTEP_MULTIPLICATOR_Z must be less or equal to 0.1mm."); + #if ENABLED(BABYSTEP_XY) + static_assert(BABYSTEP_MULTIPLICATOR_XY <= 0.25f, "BABYSTEP_MULTIPLICATOR_XY must be less than or equal to 0.25mm."); + #endif #endif #endif @@ -781,6 +842,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #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."); + constexpr xyz_pos_t npp_xyz = NOZZLE_PARK_POINT; + static_assert(WITHIN(npp_xyz.x, X_MIN_POS, X_MAX_POS), "NOZZLE_PARK_POINT.X is out of bounds (X_MIN_POS, X_MAX_POS)."); + static_assert(WITHIN(npp_xyz.y, Y_MIN_POS, Y_MAX_POS), "NOZZLE_PARK_POINT.Y is out of bounds (Y_MIN_POS, Y_MAX_POS)."); + static_assert(WITHIN(npp_xyz.z, Z_MIN_POS, Z_MAX_POS), "NOZZLE_PARK_POINT.Z is out of bounds (Z_MIN_POS, Z_MAX_POS)."); #endif /** @@ -804,14 +869,15 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #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." + #ifndef TOOLCHANGE_FS_LENGTH + #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_LENGTH. Please update your Configuration_adv.h." + #elif !defined(TOOLCHANGE_FS_RETRACT_SPEED) + #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_RETRACT_SPEED. Please update your Configuration_adv.h." + #elif !defined(TOOLCHANGE_FS_PRIME_SPEED) + #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_PRIME_SPEED. Please update your Configuration_adv.h." #endif #endif + #if ENABLED(TOOLCHANGE_PARK) #ifndef TOOLCHANGE_PARK_XY #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY. Please update your Configuration." @@ -935,6 +1001,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS 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)." ); + #if ENABLED(S_CURVE_ACCELERATION) && DISABLED(EXPERIMENTAL_SCURVE) + #error "LIN_ADVANCE and S_CURVE_ACCELERATION may not play well together! Enable EXPERIMENTAL_SCURVE to continue." + #endif #endif /** @@ -1104,7 +1173,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * Junction deviation is incompatible with kinematic systems. */ -#if DISABLED(CLASSIC_JERK) && IS_KINEMATIC +#if HAS_JUNCTION_DEVIATION && IS_KINEMATIC #error "CLASSIC_JERK is required for DELTA and SCARA." #endif @@ -1120,7 +1189,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS + ENABLED(FIX_MOUNTED_PROBE) \ + ENABLED(NOZZLE_AS_PROBE) \ + (HAS_Z_SERVO_PROBE && DISABLED(BLTOUCH)) \ - + ENABLED(BLTOUCH) \ + + ENABLED(BLTOUCH) && DISABLED(CREALITY_TOUCH) \ + + ENABLED(CREALITY_TOUCH) \ + ENABLED(TOUCH_MI_PROBE) \ + ENABLED(SOLENOID_PROBE) \ + ENABLED(Z_PROBE_ALLEN_KEY) \ @@ -1230,13 +1300,21 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #if DISABLED(NOZZLE_AS_PROBE) - static_assert(MIN_PROBE_EDGE >= 0, "MIN_PROBE_EDGE must be >= 0."); - static_assert(MIN_PROBE_EDGE_BACK >= 0, "MIN_PROBE_EDGE_BACK must be >= 0."); - static_assert(MIN_PROBE_EDGE_FRONT >= 0, "MIN_PROBE_EDGE_FRONT must be >= 0."); - static_assert(MIN_PROBE_EDGE_LEFT >= 0, "MIN_PROBE_EDGE_LEFT must be >= 0."); - static_assert(MIN_PROBE_EDGE_RIGHT >= 0, "MIN_PROBE_EDGE_RIGHT must be >= 0."); + static_assert(PROBING_MARGIN >= 0, "PROBING_MARGIN must be >= 0."); + static_assert(PROBING_MARGIN_BACK >= 0, "PROBING_MARGIN_BACK must be >= 0."); + static_assert(PROBING_MARGIN_FRONT >= 0, "PROBING_MARGIN_FRONT must be >= 0."); + static_assert(PROBING_MARGIN_LEFT >= 0, "PROBING_MARGIN_LEFT must be >= 0."); + static_assert(PROBING_MARGIN_RIGHT >= 0, "PROBING_MARGIN_RIGHT must be >= 0."); #endif + #define _MARGIN(A) TERN(IS_SCARA, SCARA_PRINTABLE_RADIUS, TERN(DELTA, DELTA_PRINTABLE_RADIUS, A##_CENTER)) + static_assert(PROBING_MARGIN < _MARGIN(X), "PROBING_MARGIN is too large."); + static_assert(PROBING_MARGIN_BACK < _MARGIN(Y), "PROBING_MARGIN_BACK is too large."); + static_assert(PROBING_MARGIN_FRONT < _MARGIN(Y), "PROBING_MARGIN_FRONT is too large."); + static_assert(PROBING_MARGIN_LEFT < _MARGIN(X), "PROBING_MARGIN_LEFT is too large."); + static_assert(PROBING_MARGIN_RIGHT < _MARGIN(X), "PROBING_MARGIN_RIGHT is too large."); + #undef _MARGIN + /** * Make sure Z raise values are set */ @@ -1252,8 +1330,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "Probes need Z_AFTER_PROBING >= 0." #endif - #if MULTIPLE_PROBING || EXTRA_PROBING - #if !MULTIPLE_PROBING + #if MULTIPLE_PROBING > 0 || EXTRA_PROBING > 0 + #if MULTIPLE_PROBING == 0 #error "EXTRA_PROBING requires MULTIPLE_PROBING." #elif MULTIPLE_PROBING < 2 #error "MULTIPLE_PROBING must be 2 or more." @@ -1350,15 +1428,19 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #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." +#if HAS_MESH && HAS_CLASSIC_JERK + static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling."); #endif -#if ENABLED(MESH_EDIT_GFX_OVERLAY) && !(ENABLED(AUTO_BED_LEVELING_UBL) && HAS_GRAPHICAL_LCD) +#if ENABLED(G26_MESH_VALIDATION) + #if !EXTRUDERS + #error "G26_MESH_VALIDATION requires at least one extruder." + #elif !HAS_MESH + #error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL." + #endif +#endif + +#if ENABLED(MESH_EDIT_GFX_OVERLAY) && !BOTH(AUTO_BED_LEVELING_UBL, HAS_GRAPHICAL_LCD) #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL and a Graphical LCD." #endif @@ -1384,9 +1466,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * 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 +constexpr float hbm[] = HOMING_BUMP_MM; +static_assert(COUNT(hbm) == XYZ, "HOMING_BUMP_MM requires X, Y, and Z elements."); +static_assert(hbm[X_AXIS] >= 0, "HOMING_BUMP_MM.X must be greater than or equal to 0."); +static_assert(hbm[Y_AXIS] >= 0, "HOMING_BUMP_MM.Y must be greater than or equal to 0."); +static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal to 0."); #if ENABLED(CODEPENDENT_XY_HOMING) #if ENABLED(QUICK_HOME) @@ -1424,6 +1508,28 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif +/** + * System Power Sensor + */ +#if ENABLED(POWER_MONITOR_CURRENT) && !PIN_EXISTS(POWER_MONITOR_CURRENT) + #error "POWER_MONITOR_CURRENT requires a valid POWER_MONITOR_CURRENT_PIN." +#elif ENABLED(POWER_MONITOR_VOLTAGE) && !PIN_EXISTS(POWER_MONITOR_VOLTAGE) + #error "POWER_MONITOR_VOLTAGE requires POWER_MONITOR_VOLTAGE_PIN to be defined." +#elif BOTH(POWER_MONITOR_CURRENT, POWER_MONITOR_VOLTAGE) && POWER_MONITOR_CURRENT_PIN == POWER_MONITOR_VOLTAGE_PIN + #error "POWER_MONITOR_CURRENT_PIN and POWER_MONITOR_VOLTAGE_PIN must be different." +#endif + +/** + * Volumetric Extruder Limit + */ +#if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) + #if ENABLED(NO_VOLUMETRICS) + #error "VOLUMETRIC_EXTRUDER_LIMIT requires NO_VOLUMETRICS to be disabled." + #elif MIN_STEPS_PER_SEGMENT > 1 + #error "VOLUMETRIC_EXTRUDER_LIMIT is not compatible with MIN_STEPS_PER_SEGMENT greater than 1." + #endif +#endif + /** * ULTIPANEL encoder */ @@ -1451,7 +1557,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * 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" + #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY." #endif /** @@ -1547,28 +1653,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif /** - * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set. + * A Sensor ID has to be set for each heater */ -#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__)) && !PINS_EXIST(E0_STEP, E0_DIR)) - #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board." -#elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PINS_EXIST(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 HAS_MULTI_HOTEND #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 @@ -1690,9 +1778,13 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "TEMP_SENSOR_7 shouldn't be set with only 1 HOTEND." #endif +#if TEMP_SENSOR_CHAMBER && !PIN_EXISTS(TEMP_CHAMBER) + #error "TEMP_SENSOR_CHAMBER requires TEMP_CHAMBER_PIN. Please add it to your configuration." +#endif + #if TEMP_SENSOR_PROBE #if !PIN_EXISTS(TEMP_PROBE) - #error "TEMP_SENSOR_PROBE requires TEMP_PROBE_PIN." + #error "TEMP_SENSOR_PROBE requires TEMP_PROBE_PIN. Please add it to your configuration." #elif !HAS_TEMP_ADC_PROBE #error "TEMP_PROBE_PIN must be an ADC pin." #elif !ENABLED(FIX_MOUNTED_PROBE) @@ -1704,6 +1796,30 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT." #endif +/** + * Test Heater, Temp Sensor, and Extruder Pins + */ +#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__)) && !PINS_EXIST(E0_STEP, E0_DIR)) + #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board." +#elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PINS_EXIST(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 if there are 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 HAS_HOTEND && !HAS_TEMP_HOTEND + #error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board." +#elif EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1 + #error "HEATER_1_PIN is not defined. TEMP_SENSOR_1 might not be set, or the board (not EEB / EEF?) doesn't define a pin." +#endif + /** * Temperature status LEDs */ @@ -1792,8 +1908,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * 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)) +#define _PLUG_UNUSED_TEST(A,P) (DISABLED(USE_##P##MIN_PLUG, USE_##P##MAX_PLUG) \ + && !(ENABLED(A##_DUAL_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) \ + && !(ENABLED(A##_MULTI_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) ) +#define _AXIS_PLUG_UNUSED_TEST(A) (_PLUG_UNUSED_TEST(A,X) && _PLUG_UNUSED_TEST(A,Y) && _PLUG_UNUSED_TEST(A,Z)) // At least 3 endstop plugs must be used #if _AXIS_PLUG_UNUSED_TEST(X) @@ -1818,8 +1936,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "Enable USE_YMAX_PLUG when homing Y to MAX." #endif #endif -#if Z_HOME_DIR < 0 && DISABLED(USE_ZMIN_PLUG) + +// Z homing direction and plug usage flags +#if Z_HOME_DIR < 0 && NONE(USE_ZMIN_PLUG, HOMING_Z_WITH_PROBE) #error "Enable USE_ZMIN_PLUG when homing Z to MIN." +#elif Z_HOME_DIR > 0 && ENABLED(USE_PROBE_FOR_Z_HOMING) + #error "Z_HOME_DIR must be -1 when homing Z with the probe." #elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG) #error "Enable USE_ZMAX_PLUG when homing Z to MAX." #endif @@ -1984,35 +2106,64 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #undef _RGB_TEST +#if DISABLED(NO_COMPILE_TIME_PWM) + #define _TEST_PWM(P) PWM_PIN(P) +#else + #define _TEST_PWM(P) 1 // pass +#endif + /** * Auto Fan check for PWM pins */ -#if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255 && DISABLED(NO_COMPILE_TIME_PWM) +#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); + static_assert(_TEST_PWM(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); + static_assert(_TEST_PWM(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); + static_assert(_TEST_PWM(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); + static_assert(_TEST_PWM(E3_AUTO_FAN_PIN), "E3" AF_ERR_SUFF); #elif HAS_AUTO_FAN_4 - static_assert(PWM_PIN(E4_AUTO_FAN_PIN), "E4" AF_ERR_SUFF); + static_assert(_TEST_PWM(E4_AUTO_FAN_PIN), "E4" AF_ERR_SUFF); #elif HAS_AUTO_FAN_5 - static_assert(PWM_PIN(E5_AUTO_FAN_PIN), "E5" AF_ERR_SUFF); + static_assert(_TEST_PWM(E5_AUTO_FAN_PIN), "E5" AF_ERR_SUFF); #elif HAS_AUTO_FAN_6 - static_assert(PWM_PIN(E6_AUTO_FAN_PIN), "E6" AF_ERR_SUFF); + static_assert(_TEST_PWM(E6_AUTO_FAN_PIN), "E6" AF_ERR_SUFF); #elif HAS_AUTO_FAN_7 - static_assert(PWM_PIN(E7_AUTO_FAN_PIN), "E7" AF_ERR_SUFF); + static_assert(_TEST_PWM(E7_AUTO_FAN_PIN), "E7" AF_ERR_SUFF); #endif #endif /** * Make sure only one EEPROM type is enabled */ -#if ENABLED(EEPROM_SETTINGS) && 1 < ENABLED(SDCARD_EEPROM_EMULATION) + ENABLED(FLASH_EEPROM_EMULATION) + ENABLED(SRAM_EEPROM_EMULATION) - #error "Please select only one of SDCARD, FLASH, or SRAM_EEPROM_EMULATION." +#if ENABLED(EEPROM_SETTINGS) + #if 1 < 0 \ + + ENABLED(I2C_EEPROM) \ + + ENABLED(SPI_EEPROM) \ + + ENABLED(QSPI_EEPROM) \ + + ENABLED(SDCARD_EEPROM_EMULATION) \ + + ENABLED(FLASH_EEPROM_EMULATION) \ + + ENABLED(SRAM_EEPROM_EMULATION) \ + + ENABLED(IIC_BL24CXX_EEPROM) + #error "Please select only one method of EEPROM Persistent Storage." + #endif +#endif + +/** + * Make sure features that need to write to the SD card are + * disabled unless write support is enabled. + */ +#if ENABLED(SDCARD_READONLY) + #if ENABLED(POWER_LOSS_RECOVERY) + #error "POWER_LOSS_RECOVERY is incompatible with SDCARD_READONLY." + #elif ENABLED(BINARY_FILE_TRANSFER) + #error "BINARY_FILE_TRANSFER is incompatible with SDCARD_READONLY." + #elif ENABLED(SDCARD_EEPROM_EMULATION) + #error "SDCARD_EEPROM_EMULATION is incompatible with SDCARD_READONLY." + #endif #endif /** @@ -2024,6 +2175,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS + (ENABLED(ULTRA_LCD) && DISABLED(IS_ULTRA_LCD)) \ + (ENABLED(U8GLIB_SSD1306) && DISABLED(IS_U8GLIB_SSD1306)) \ + (ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864, ENDER2_STOCKDISPLAY)) \ + + (ENABLED(MKS_MINI_12864) && DISABLED(MKS_LCD12864)) \ + (ENABLED(EXTENSIBLE_UI) && DISABLED(IS_EXTUI)) \ + (ENABLED(ULTIPANEL) && DISABLED(IS_ULTIPANEL)) \ + ENABLED(RADDS_DISPLAY) \ @@ -2050,7 +2202,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS + ENABLED(CARTESIO_UI) \ + ENABLED(LCD_FOR_MELZI) \ + ENABLED(ULTI_CONTROLLER) \ - + ENABLED(MKS_MINI_12864) \ + + ENABLED(MKS_LCD12864) \ + ENABLED(ENDER2_STOCKDISPLAY) \ + ENABLED(FYSETC_MINI_12864_X_X) \ + ENABLED(FYSETC_MINI_12864_1_2) \ @@ -2058,6 +2210,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS + ENABLED(FYSETC_MINI_12864_2_1) \ + ENABLED(FYSETC_GENERIC_12864_1_1) \ + ENABLED(CR10_STOCKDISPLAY) \ + + ENABLED(DWIN_CREALITY_LCD) \ + ENABLED(ANET_FULL_GRAPHICS_LCD) \ + ENABLED(AZSMZ_12864) \ + ENABLED(SILVER_GATE_GLCD_CONTROLLER) \ @@ -2067,12 +2220,15 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS + ENABLED(MKS_12864OLED_SSD1306) \ + ENABLED(U8GLIB_SH1106_EINSTART) \ + ENABLED(OVERLORD_OLED) \ + + ENABLED(FYSETC_242_OLED_12864) \ + ENABLED(DGUS_LCD_UI_ORIGIN) \ + ENABLED(DGUS_LCD_UI_FYSETC) \ + ENABLED(DGUS_LCD_UI_HIPRECY) \ + ENABLED(MALYAN_LCD) \ + ENABLED(TOUCH_UI_FTDI_EVE) \ - + ENABLED(FSMC_GRAPHICAL_TFT) + + ENABLED(FSMC_GRAPHICAL_TFT) \ + + ENABLED(TFT_LVGL_UI_FSMC) \ + + ENABLED(TFT_LVGL_UI_SPI) #error "Please select no more than one LCD controller option." #endif @@ -2084,6 +2240,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #undef IS_EXTUI #undef IS_ULTIPANEL +#if 1 < ENABLED(LCD_SCREEN_ROT_0) + ENABLED(LCD_SCREEN_ROT_90) + ENABLED(LCD_SCREEN_ROT_180) + ENABLED(LCD_SCREEN_ROT_270) + #error "Please enable only one LCD_SCREEN_ROT_* option: 0, 90, 180, or 270." +#endif + /** * FYSETC Mini 12864 RGB backlighting required */ @@ -2414,10 +2574,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * 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." +#if HAS_I2C_DIGIPOT + #if BOTH(DIGIPOT_MCP4018, DIGIPOT_MCP4451) + #error "Enable only one of DIGIPOT_MCP4018 or DIGIPOT_MCP4451." + #elif !MB(MKS_SBASE) \ + && (!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/4451 requires DIGIPOTS_I2C_SDA_* pins to be defined." #endif #endif @@ -2654,9 +2816,9 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #if ENABLED(BACKLASH_COMPENSATION) #ifndef BACKLASH_DISTANCE_MM - #error "BACKLASH_COMPENSATION requires BACKLASH_DISTANCE_MM" + #error "BACKLASH_COMPENSATION requires BACKLASH_DISTANCE_MM." #elif !defined(BACKLASH_CORRECTION) - #error "BACKLASH_COMPENSATION requires BACKLASH_CORRECTION" + #error "BACKLASH_COMPENSATION requires BACKLASH_CORRECTION." #elif IS_CORE constexpr float backlash_arr[] = BACKLASH_DISTANCE_MM; static_assert(!backlash_arr[CORE_AXIS_1] && !backlash_arr[CORE_AXIS_2], @@ -2689,10 +2851,14 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) * Prusa MMU2 requirements */ #if ENABLED(PRUSA_MMU2) - #if DISABLED(NOZZLE_PARK_FEATURE) - #error "PRUSA_MMU2 requires NOZZLE_PARK_FEATURE." - #elif EXTRUDERS != 5 + #if EXTRUDERS != 5 #error "PRUSA_MMU2 requires EXTRUDERS = 5." + #elif DISABLED(NOZZLE_PARK_FEATURE) + #error "PRUSA_MMU2 requires NOZZLE_PARK_FEATURE. Enable it to continue." + #elif EITHER(PRUSA_MMU2_S_MODE, MMU_EXTRUDER_SENSOR) && DISABLED(FILAMENT_RUNOUT_SENSOR) + #error "PRUSA_MMU2_S_MODE or MMU_EXTRUDER_SENSOR requires FILAMENT_RUNOUT_SENSOR. Enable it to continue." + #elif BOTH(PRUSA_MMU2_S_MODE, MMU_EXTRUDER_SENSOR) + #error "Enable only one of PRUSA_MMU2_S_MODE or MMU_EXTRUDER_SENSOR." #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 @@ -2736,6 +2902,45 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #endif #if HAS_CUTTER + #ifndef CUTTER_POWER_UNIT + #error "CUTTER_POWER_UNIT is required with a spindle or laser. Please update your Configuration_adv.h." + #elif !CUTTER_UNIT_IS(PWM255) && !CUTTER_UNIT_IS(PERCENT) && !CUTTER_UNIT_IS(RPM) + #error "CUTTER_POWER_UNIT must be PWM255, PERCENT, or RPM. Please update your Configuration_adv.h." + #endif + + #if ENABLED(LASER_POWER_INLINE) + #if ENABLED(SPINDLE_CHANGE_DIR) + #error "SPINDLE_CHANGE_DIR and LASER_POWER_INLINE are incompatible." + #elif ENABLED(LASER_MOVE_G0_OFF) && DISABLED(LASER_MOVE_POWER) + #error "LASER_MOVE_G0_OFF requires LASER_MOVE_POWER. Please update your Configuration_adv.h." + #endif + #if ENABLED(LASER_POWER_INLINE_TRAPEZOID) + #if DISABLED(SPINDLE_LASER_PWM) + #error "LASER_POWER_INLINE_TRAPEZOID requires SPINDLE_LASER_PWM to function." + #elif ENABLED(S_CURVE_ACCELERATION) + //#ifndef LASER_POWER_INLINE_S_CURVE_ACCELERATION_WARN + // #define LASER_POWER_INLINE_S_CURVE_ACCELERATION_WARN + // #warning "Combining LASER_POWER_INLINE_TRAPEZOID with S_CURVE_ACCELERATION may result in unintended behavior." + //#endif + #endif + #endif + #if ENABLED(LASER_POWER_INLINE_INVERT) + //#ifndef LASER_POWER_INLINE_INVERT_WARN + // #define LASER_POWER_INLINE_INVERT_WARN + // #warning "Enabling LASER_POWER_INLINE_INVERT means that `M5` won't kill the laser immediately; use `M5 I` instead." + //#endif + #endif + #else + #if 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 ENABLED(LASER_MOVE_POWER) + #error "LASER_MOVE_POWER requires LASER_POWER_INLINE." + #elif ANY(LASER_POWER_INLINE_TRAPEZOID, LASER_POWER_INLINE_INVERT, LASER_MOVE_G0_OFF, LASER_MOVE_POWER) + #error "Enabled an inline laser feature without inline laser power being enabled." + #endif + #endif #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." @@ -2746,15 +2951,11 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #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) + #elif !_TEST_PWM(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) + #elif !(defined(SPEED_POWER_INTERCEPT) && defined(SPEED_POWER_MIN) && defined(SPEED_POWER_MAX) && defined(SPEED_POWER_STARTUP)) #error "SPINDLE_LASER_PWM equation constant(s) missing." #elif _PIN_CONFLICT(X_MIN) #error "SPINDLE_LASER_PWM pin conflicts with X_MIN_PIN." @@ -2817,8 +3018,8 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #endif #endif -#if HAS_ADC_BUTTONS && defined(ADC_BUTTON_DEBOUNCE_DELAY) && !WITHIN(ADC_BUTTON_DEBOUNCE_DELAY, 16, 255) - #error "ADC_BUTTON_DEBOUNCE_DELAY must be an integer from 16 to 255." +#if HAS_ADC_BUTTONS && defined(ADC_BUTTON_DEBOUNCE_DELAY) && ADC_BUTTON_DEBOUNCE_DELAY < 16 + #error "ADC_BUTTON_DEBOUNCE_DELAY must be greater than 16." #endif /** @@ -2833,3 +3034,22 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #if SAVED_POSITIONS > 256 #error "SAVED_POSITIONS must be an integer from 0 to 256." #endif + +/** + * Sanity checks for stepper chunk support + */ +#if ENABLED(DIRECT_STEPPING) + #if ENABLED(LIN_ADVANCE) + #error "DIRECT_STEPPING is incompatible with LIN_ADVANCE. Enable in external planner if possible." + #endif +#endif + +/** + * Sanity check for WIFI + */ +#if ENABLED(ESP3D_WIFISUPPORT) && DISABLED(ARDUINO_ARCH_ESP32) + #error "ESP3D_WIFISUPPORT requires an ESP32 controller. Use WIFISUPPORT for standalone ESP3D modules." +#endif + +// Misc. Cleanup +#undef _TEST_PWM diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 33d867acac..8513cd759e 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -33,7 +33,7 @@ * vendor name, download location, GitHub account, etc. */ #ifndef DETAILED_BUILD_VERSION - #define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (GitHub)" + #define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION #endif /** @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-07-09" + #define STRING_DISTRIBUTION_DATE "2020-07-27" #endif /** @@ -52,7 +52,7 @@ * to alert users to major changes. */ -#define MARLIN_HEX_VERSION 020005 +#define MARLIN_HEX_VERSION 020006 #ifndef REQUIRED_CONFIGURATION_H_VERSION #define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION #endif @@ -97,7 +97,7 @@ * documentation about a specific Marlin release. Displayed in the Info Menu. */ #ifndef WEBSITE_URL - #define WEBSITE_URL "http://marlinfw.org" + #define WEBSITE_URL "https://marlinfw.org" #endif /** diff --git a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp index a1258a3b10..9ba9b871ec 100644 --- a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp +++ b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp @@ -23,10 +23,6 @@ #include -#ifndef LCD_CLASS - #include - #define LCD_CLASS LiquidCrystal -#endif extern LCD_CLASS lcd; int lcd_glyph_height() { return 1; } @@ -678,6 +674,8 @@ static const hd44780_charmap_t g_hd44780_charmap_common[] PROGMEM = { {IV('ď'), 'd', 0}, // 010F {IV('đ'), 'd', 0}, // 0111 {IV('ę'), 'e', 0}, // 0119 + {IV('Ě'), 'E', 0}, // 011A + {IV('ě'), 'e', 0}, // 011B {IV('ğ'), 'g', 0}, // 011F {IV('İ'), 'I', 0}, // 0130 {IV('ı'), 'i', 0}, // 0131 @@ -688,6 +686,7 @@ static const hd44780_charmap_t g_hd44780_charmap_common[] PROGMEM = { {IV('ń'), 'n', 0}, // 0144 {IV('ň'), 'n', 0}, // 0148 + {IV('Ř'), 'R', 0}, // 0158 {IV('ř'), 'r', 0}, // 0159 {IV('Ś'), 'S', 0}, // 015A {IV('ś'), 's', 0}, // 015B @@ -924,6 +923,7 @@ static const hd44780_charmap_t g_hd44780_charmap_common[] PROGMEM = { {IV('ю'), '|', 'o'}, {IV('я'), 'g', 0}, // 044F {IV('ё'), 'e', 0}, // 0451 + #endif {IV('•'), '.', 0}, // 2022 · diff --git a/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp b/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp index ee025f6585..a924528c30 100644 --- a/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -275,7 +275,7 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS #endif // LCD_PROGRESS_BAR - #if ENABLED(SDSUPPORT) && HAS_LCD_MENU + #if BOTH(SDSUPPORT, HAS_LCD_MENU) // CHARSET_MENU const static PROGMEM byte refresh[8] = { @@ -325,7 +325,7 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS #endif { createChar_P(LCD_STR_UPLEVEL[0], uplevel); - #if ENABLED(SDSUPPORT) && HAS_LCD_MENU + #if BOTH(SDSUPPORT, HAS_LCD_MENU) // SD Card sub-menu special characters createChar_P(LCD_STR_REFRESH[0], refresh); createChar_P(LCD_STR_FOLDER[0], folder); @@ -367,11 +367,11 @@ void MarlinUI::init_lcd() { } bool MarlinUI::detected() { - return true + return (true #if EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) && defined(DETECT_DEVICE) && lcd.LcdDetected() == 1 #endif - ; + ); } #if HAS_SLOW_BUTTONS @@ -745,7 +745,7 @@ void MarlinUI::draw_status_screen() { // // Hotend 1 or Bed Temperature // - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND lcd_moveto(8, 0); _draw_heater_status(H_E1, LCD_STR_THERMOMETER[0], blink); #elif HAS_HEATED_BED @@ -763,7 +763,7 @@ void MarlinUI::draw_status_screen() { // // Hotend 1 or Bed Temperature // - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND lcd_moveto(10, 0); _draw_heater_status(H_E1, LCD_STR_THERMOMETER[0], blink); #elif HAS_HEATED_BED @@ -791,7 +791,7 @@ void MarlinUI::draw_status_screen() { // 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 || (HAS_MULTI_HOTEND && HAS_HEATED_BED) #if HOTENDS > 2 _draw_heater_status(H_E2, LCD_STR_THERMOMETER[0], blink); @@ -802,7 +802,7 @@ void MarlinUI::draw_status_screen() { #else // HOTENDS <= 2 && (HOTENDS <= 1 || !HAS_HEATED_BED) - #if DUAL_MIXING_EXTRUDER + #if HAS_DUAL_MIXING // Two-component mix / gradient instead of XY @@ -822,19 +822,11 @@ void MarlinUI::draw_status_screen() { 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 + #else // !HAS_DUAL_MIXING - if (true - #if ENABLED(LCD_SHOW_E_TOTAL) - && !printingIsActive() - #endif - ) { - const xy_pos_t lpos = current_position.asLogical(); - _draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink); - lcd_put_wchar(' '); - _draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink); - } - else { + const bool show_e_total = TERN0(LCD_SHOW_E_TOTAL, printingIsActive() || marlin_state == MF_SD_COMPLETE); + + if (show_e_total) { #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 @@ -842,8 +834,14 @@ void MarlinUI::draw_status_screen() { lcd_put_u8str(tmp); #endif } + else { + const xy_pos_t lpos = current_position.asLogical(); + _draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink); + lcd_put_wchar(' '); + _draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink); + } - #endif // !DUAL_MIXING_EXTRUDER + #endif // !HAS_DUAL_MIXING #endif // HOTENDS <= 2 && (HOTENDS <= 1 || !HAS_HEATED_BED) @@ -924,7 +922,7 @@ void MarlinUI::draw_status_screen() { 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) + #if HAS_LEVELING && (HAS_MULTI_HOTEND || !HAS_HEATED_BED) lcd_put_wchar(LCD_WIDTH - 1, 0, planner.leveling_active || blink ? '_' : ' '); #endif @@ -934,7 +932,7 @@ void MarlinUI::draw_status_screen() { // Hotend 1 or Bed Temperature // lcd_moveto(0, 1); - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND _draw_heater_status(H_E1, LCD_STR_THERMOMETER[0], blink); #elif HAS_HEATED_BED _draw_bed_status(blink); @@ -952,7 +950,7 @@ void MarlinUI::draw_status_screen() { lcd_moveto(0, 2); #if HOTENDS > 2 _draw_heater_status(H_E2, LCD_STR_THERMOMETER[0], blink); - #elif HOTENDS > 1 && HAS_HEATED_BED + #elif HAS_MULTI_HOTEND && HAS_HEATED_BED _draw_bed_status(blink); #elif HAS_PRINT_PROGRESS #define DREW_PRINT_PROGRESS @@ -1006,7 +1004,7 @@ void MarlinUI::draw_status_screen() { 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); + n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, n); if (valstr) n -= lcd_put_u8str_max(valstr, n); for (; n > 0; --n) lcd_put_wchar(' '); } @@ -1014,33 +1012,32 @@ void MarlinUI::draw_status_screen() { // 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); + uint8_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, 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; + void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const inStr, const bool pgm) { + const uint8_t vlen = inStr ? (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)) : 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); + uint8_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, 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); + if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr); } } // 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); + uint8_t n = lcd_put_u8str_ind_P(0, 1, pstr, itemIndex, itemString, 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_wchar(':'); n--; + const uint8_t len = utf8_strlen(value) + 1; // Plus one for a leading space + const lcd_uint_t valrow = n < len ? 2 : 1; // Value on the next row if it won't fit + lcd_put_wchar(LCD_WIDTH - len, valrow, ' '); // Right-justified, padded, leading space lcd_put_u8str(value); } } @@ -1073,46 +1070,22 @@ void MarlinUI::draw_status_screen() { static uint8_t ledsprev = 0; uint8_t leds = 0; - #if HAS_HEATED_BED - if (thermalManager.degTargetBed() > 0) leds |= LED_A; - #endif + if (TERN0(HAS_HEATED_BED, thermalManager.degTargetBed() > 0)) leds |= LED_A; + if (TERN0(HAS_HOTEND, thermalManager.degTargetHotend(0) > 0)) leds |= LED_B; - #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 - #if HAS_FAN3 - || thermalManager.fan_speed[3] - #endif - #if HAS_FAN4 - || thermalManager.fan_speed[4] - #endif - #if HAS_FAN5 - || thermalManager.fan_speed[5] - #endif - #if HAS_FAN6 - || thermalManager.fan_speed[6] - #endif - #if HAS_FAN7 - || thermalManager.fan_speed[7] - #endif + #if HAS_FAN + if ( TERN0(HAS_FAN0, thermalManager.fan_speed[0]) + || TERN0(HAS_FAN1, thermalManager.fan_speed[1]) + || TERN0(HAS_FAN2, thermalManager.fan_speed[2]) + || TERN0(HAS_FAN3, thermalManager.fan_speed[3]) + || TERN0(HAS_FAN4, thermalManager.fan_speed[4]) + || TERN0(HAS_FAN5, thermalManager.fan_speed[5]) + || TERN0(HAS_FAN6, thermalManager.fan_speed[6]) + || TERN0(HAS_FAN7, thermalManager.fan_speed[7]) ) leds |= LED_C; - #endif // FAN_COUNT > 0 + #endif // HAS_FAN - #if HOTENDS > 1 - if (thermalManager.degTargetHotend(1) > 0) leds |= LED_C; - #endif + if (TERN0(HAS_MULTI_HOTEND, thermalManager.degTargetHotend(1) > 0)) leds |= LED_C; if (leds != ledsprev) { lcd.setBacklight(leds); diff --git a/Marlin/src/lcd/HD44780/ultralcd_HD44780.h b/Marlin/src/lcd/HD44780/ultralcd_HD44780.h index 12bf86a161..604d26a029 100644 --- a/Marlin/src/lcd/HD44780/ultralcd_HD44780.h +++ b/Marlin/src/lcd/HD44780/ultralcd_HD44780.h @@ -16,32 +16,19 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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. + * Hitachi HD44780 display defines and headers */ #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 @@ -58,6 +45,7 @@ #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 @@ -69,40 +57,45 @@ #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 + // NewLiquidCrystal didn't work, so this uses + // https://github.com/mikeshub/SailfishLCD #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" diff --git a/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h b/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h index 4ab165c7a0..1511c69933 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h +++ b/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h index 25224934c5..df7f8dd44b 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h +++ b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/dogm/dogm_Bootscreen.h b/Marlin/src/lcd/dogm/dogm_Bootscreen.h index f4bf5f5f69..c9001119d9 100644 --- a/Marlin/src/lcd/dogm/dogm_Bootscreen.h +++ b/Marlin/src/lcd/dogm/dogm_Bootscreen.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Standard Marlin Boot Screen bitmaps * * Use the Marlin Bitmap Converter to make your own: - * http://marlinfw.org/tools/u8glib/converter.html + * https://marlinfw.org/tools/u8glib/converter.html */ #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/lcd/dogm/dogm_Statusscreen.h b/Marlin/src/lcd/dogm/dogm_Statusscreen.h index 3384f5798a..70802f905e 100644 --- a/Marlin/src/lcd/dogm/dogm_Statusscreen.h +++ b/Marlin/src/lcd/dogm/dogm_Statusscreen.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Standard Marlin Status Screen bitmaps * * Use the Marlin Bitmap Converter to make your own: - * http://marlinfw.org/tools/u8glib/converter.html + * https://marlinfw.org/tools/u8glib/converter.html */ #include "../../inc/MarlinConfig.h" @@ -278,7 +278,7 @@ // // Status Screen Hotends bitmaps // - #if HOTENDS + #if HAS_HOTEND #define STATUS_HOTEND1_WIDTH 16 @@ -860,12 +860,10 @@ #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)) +#if !HAS_FAN0 || (HOTENDS == 5 || (HOTENDS == 4 && BED_OR_CHAMBER) || BOTH(STATUS_COMBINE_HEATERS, HAS_HEATED_CHAMBER)) #undef STATUS_FAN_FRAMES #elif !STATUS_FAN_FRAMES #define STATUS_FAN_FRAMES 2 @@ -1343,7 +1341,7 @@ #undef STATUS_LOGO_WIDTH #endif - #if (HOTENDS > 1 && STATUS_LOGO_WIDTH && BED_OR_CHAMBER_OR_FAN) || (HOTENDS >= 3 && !BED_OR_CHAMBER_OR_FAN) + #if (HAS_MULTI_HOTEND && 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 @@ -1372,7 +1370,7 @@ #define STATUS_LOGO_X 0 #endif #ifndef STATUS_LOGO_Y - #define STATUS_LOGO_Y _MIN(0U, (10 - (STATUS_LOGO_HEIGHT) / 2)) + #define STATUS_LOGO_Y _MIN(0U, (20 - (STATUS_LOGO_HEIGHT)) / 2) #endif #ifndef STATUS_LOGO_HEIGHT #define STATUS_LOGO_HEIGHT (sizeof(status_logo_bmp) / (STATUS_LOGO_BYTEWIDTH)) @@ -1393,7 +1391,7 @@ ((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 + #if BOTH(STATUS_COMBINE_HEATERS, HAS_HEATED_BED) && HOTENDS <= 4 #define STATUS_HEATERS_X 5 #else #define STATUS_HEATERS_X 8 // Like the included bitmaps @@ -1425,8 +1423,14 @@ #ifndef STATUS_HOTEND6_WIDTH #define STATUS_HOTEND6_WIDTH STATUS_HOTEND5_WIDTH #endif + #ifndef STATUS_HOTEND7_WIDTH + #define STATUS_HOTEND7_WIDTH STATUS_HOTEND6_WIDTH + #endif + #ifndef STATUS_HOTEND8_WIDTH + #define STATUS_HOTEND8_WIDTH STATUS_HOTEND7_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); + 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, STATUS_HOTEND7_WIDTH, STATUS_HOTEND8_WIDTH); #define STATUS_HOTEND_WIDTH(N) status_hotend_width[N] #ifndef STATUS_HOTEND1_BYTEWIDTH @@ -1447,8 +1451,14 @@ #ifndef STATUS_HOTEND6_BYTEWIDTH #define STATUS_HOTEND6_BYTEWIDTH BW(STATUS_HOTEND6_WIDTH) #endif + #ifndef STATUS_HOTEND7_BYTEWIDTH + #define STATUS_HOTEND7_BYTEWIDTH BW(STATUS_HOTEND7_WIDTH) + #endif + #ifndef STATUS_HOTEND8_BYTEWIDTH + #define STATUS_HOTEND8_BYTEWIDTH BW(STATUS_HOTEND8_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); + 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, STATUS_HOTEND7_BYTEWIDTH, STATUS_HOTEND8_BYTEWIDTH); #define STATUS_HOTEND_BYTEWIDTH(N) status_hotend_bytewidth[N] #ifndef STATUS_HOTEND1_X @@ -1471,10 +1481,16 @@ #ifndef STATUS_HOTEND6_X #define STATUS_HOTEND6_X STATUS_HOTEND5_X + STATUS_HEATERS_XSPACE #endif + #ifndef STATUS_HOTEND7_X + #define STATUS_HOTEND7_X STATUS_HOTEND6_X + STATUS_HEATERS_XSPACE + #endif + #ifndef STATUS_HOTEND8_X + #define STATUS_HOTEND8_X STATUS_HOTEND7_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); + 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, STATUS_HOTEND7_X, STATUS_HOTEND8_X); #define STATUS_HOTEND_X(N) status_hotend_x[N] - #elif HOTENDS > 1 + #elif HAS_MULTI_HOTEND #define STATUS_HOTEND_X(N) ((N) ? STATUS_HOTEND2_X : STATUS_HOTEND1_X) #else #define STATUS_HOTEND_X(N) STATUS_HOTEND1_X @@ -1497,7 +1513,13 @@ #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); + #ifndef STATUS_HOTEND7_TEXT_X + #define STATUS_HOTEND7_TEXT_X STATUS_HOTEND6_TEXT_X + STATUS_HEATERS_XSPACE + #endif + #ifndef STATUS_HOTEND8_TEXT_X + #define STATUS_HOTEND8_TEXT_X STATUS_HOTEND7_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, STATUS_HOTEND7_TEXT_X, STATUS_HOTEND8_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)) @@ -1731,16 +1753,36 @@ #endif #endif -#define DO_DRAW_LOGO (STATUS_LOGO_WIDTH && ENABLED(CUSTOM_STATUS_SCREEN_IMAGE)) -#define DO_DRAW_HOTENDS (HOTENDS > 0) -#define DO_DRAW_BED (HAS_HEATED_BED && HOTENDS <= 4) -#define DO_DRAW_CUTTER (HAS_CUTTER && !DO_DRAW_BED) -#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 STATUS_LOGO_WIDTH && ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) + #define DO_DRAW_LOGO 1 +#endif +#if HOTENDS > 0 + #define DO_DRAW_HOTENDS 1 +#endif +#if HAS_HEATED_BED && HOTENDS <= 4 + #define DO_DRAW_BED 1 +#endif +#if HAS_CUTTER && !DO_DRAW_BED + #define DO_DRAW_CUTTER 1 +#endif +#if HAS_TEMP_CHAMBER && STATUS_CHAMBER_WIDTH && HOTENDS <= 4 + #define DO_DRAW_CHAMBER 1 +#endif +#if HAS_FAN0 && STATUS_FAN_WIDTH && HOTENDS <= 4 && defined(STATUS_FAN_FRAMES) + #define DO_DRAW_FAN 1 +#endif +#if BOTH(HAS_HOTEND, STATUS_HOTEND_ANIM) + #define ANIM_HOTEND 1 +#endif +#if BOTH(DO_DRAW_BED, STATUS_BED_ANIM) + #define ANIM_BED 1 +#endif +#if BOTH(DO_DRAW_CHAMBER, STATUS_CHAMBER_ANIM) + #define ANIM_CHAMBER 1 +#endif +#if BOTH(DO_DRAW_CUTTER, STATUS_CUTTER_ANIM) + #define ANIM_CUTTER 1 +#endif +#if ANIM_HOTEND || ANIM_BED || ANIM_CHAMBER || ANIM_CUTTER + #define ANIM_HBCC 1 +#endif diff --git a/Marlin/src/lcd/dogm/fontdata/fontdata_6x9_marlin.h b/Marlin/src/lcd/dogm/fontdata/fontdata_6x9_marlin.h index fd07e4af1e..2aca88ca79 100644 --- a/Marlin/src/lcd/dogm/fontdata/fontdata_6x9_marlin.h +++ b/Marlin/src/lcd/dogm/fontdata/fontdata_6x9_marlin.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h b/Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h index e3087a55df..451383045b 100644 --- a/Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h +++ b/Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include @@ -26,14 +26,14 @@ 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 + Font Bounding box w=12 h=15 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, + 0x00,0x0c,0x0f,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, @@ -124,14 +124,14 @@ const u8g_fntpgm_uint8_t ISO10646_1_5x7[1325] U8G_FONT_SECTION("ISO10646_1_5x7") 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 + Font Bounding box w=12 h=15 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, + 0x00,0x0c,0x0f,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, diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_bg.h b/Marlin/src/lcd/dogm/fontdata/langdata_bg.h index 81444d9969..5fd7931f23 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_bg.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_bg.h @@ -6,7 +6,7 @@ #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,0x0c,0x0f,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, @@ -14,11 +14,11 @@ const u8g_fntpgm_uint8_t fontpage_8_144_149[96] U8G_FONT_SECTION("fontpage_8_144 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,0x0c,0x0f,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,0x0c,0x0f,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, @@ -30,11 +30,11 @@ const u8g_fntpgm_uint8_t fontpage_8_154_164[160] U8G_FONT_SECTION("fontpage_8_15 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,0x0c,0x0f,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,0x0c,0x0f,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, @@ -52,15 +52,15 @@ const u8g_fntpgm_uint8_t fontpage_8_175_195[260] U8G_FONT_SECTION("fontpage_8_17 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_cz.h b/Marlin/src/lcd/dogm/fontdata/langdata_cz.h index e132dc8160..998536fea1 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_cz.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_cz.h @@ -6,35 +6,37 @@ #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,0x0c,0x0f,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,0x0c,0x0f,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_154_155[47] U8G_FONT_SECTION("fontpage_2_154_155") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9a,0x9b,0x00,0x0a,0x00,0x00, + 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0xf8,0x80,0x80,0xf0,0x80,0x80, + 0xf8,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,0x0c,0x0f,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,0x0c,0x0f,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_224_225[47] U8G_FONT_SECTION("fontpage_2_224_225") = { + 0x00,0x0c,0x0f,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_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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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}; @@ -42,10 +44,10 @@ const u8g_fntpgm_uint8_t fontpage_2_253_254[47] U8G_FONT_SECTION("fontpage_2_253 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, 154, 155, fontpage_2_154_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, 224, 225, fontpage_2_224_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/src/lcd/dogm/fontdata/langdata_el.h b/Marlin/src/lcd/dogm/fontdata/langdata_el.h index 858ec0f84f..284706a817 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_el.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_el.h @@ -6,11 +6,11 @@ #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,0x0c,0x0f,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,0x0c,0x0f,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, @@ -23,35 +23,35 @@ const u8g_fntpgm_uint8_t fontpage_7_145_157[186] U8G_FONT_SECTION("fontpage_7_14 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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, @@ -67,15 +67,15 @@ const u8g_fntpgm_uint8_t fontpage_7_183_199[226] U8G_FONT_SECTION("fontpage_7_18 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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 } diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_el_gr.h b/Marlin/src/lcd/dogm/fontdata/langdata_el_gr.h index 76a5c66cd9..6d864c9c9a 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_el_gr.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_el_gr.h @@ -6,11 +6,11 @@ #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,0x0c,0x0f,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,0x0c,0x0f,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, @@ -23,32 +23,32 @@ const u8g_fntpgm_uint8_t fontpage_7_145_157[186] U8G_FONT_SECTION("fontpage_7_14 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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, @@ -64,15 +64,15 @@ const u8g_fntpgm_uint8_t fontpage_7_183_199[226] U8G_FONT_SECTION("fontpage_7_18 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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 } diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_hr.h b/Marlin/src/lcd/dogm/fontdata/langdata_hr.h index 63fea945b2..6337c9226a 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_hr.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_hr.h @@ -6,20 +6,20 @@ #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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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 } diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_hu.h b/Marlin/src/lcd/dogm/fontdata/langdata_hu.h new file mode 100644 index 0000000000..29060b252a --- /dev/null +++ b/Marlin/src/lcd/dogm/fontdata/langdata_hu.h @@ -0,0 +1,15 @@ +/** + * 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_241_241[31] U8G_FONT_SECTION("fontpage_2_241_241") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf1,0xf1,0x00,0x08,0x00,0x00, + 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x48,0x90,0x00,0x88,0x88,0x88,0x88,0x70}; + +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } +static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { + FONTDATA_ITEM(2, 241, 241, fontpage_2_241_241), // 'ű' -- 'ű' +}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_ko_KR.h b/Marlin/src/lcd/dogm/fontdata/langdata_ko_KR.h index 9f20e7b401..e920b61631 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_ko_KR.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_ko_KR.h @@ -77,14 +77,14 @@ const u8g_fntpgm_uint8_t fontpage_360_152_152[45] U8G_FONT_SECTION("fontpage_360 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_156_156[45] U8G_FONT_SECTION("fontpage_360_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,0x7c,0x80,0x40,0x80,0x40,0x80,0x7c,0x80,0x10, + 0x80,0x10,0x80,0xff,0x80,0x00,0x80,0x20,0x00,0x20,0x00,0x3f,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, @@ -101,6 +101,10 @@ const u8g_fntpgm_uint8_t fontpage_366_252_252[45] U8G_FONT_SECTION("fontpage_366 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_367_236_236[34] U8G_FONT_SECTION("fontpage_367_236_236") = { + 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xec,0xec,0x00,0x09,0xfe,0x00, + 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf1,0x09,0x09,0xf1,0x87,0x81,0x81,0xf9,0x01, + 0x01,0x01}; 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, @@ -125,6 +129,10 @@ const u8g_fntpgm_uint8_t fontpage_371_172_172[34] U8G_FONT_SECTION("fontpage_371 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_176_176[34] U8G_FONT_SECTION("fontpage_371_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,0xf9,0x81,0x81,0xfd,0x01,0x20, + 0x20,0x3f}; 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, @@ -133,10 +141,6 @@ const u8g_fntpgm_uint8_t fontpage_371_193_193[34] U8G_FONT_SECTION("fontpage_371 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, @@ -153,6 +157,14 @@ const u8g_fntpgm_uint8_t fontpage_373_168_168[41] U8G_FONT_SECTION("fontpage_373 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_373_187_187[45] U8G_FONT_SECTION("fontpage_373_187_187") = { + 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xbb,0xbb,0x00,0x09,0xfe,0x00, + 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x3f,0x00,0x20,0x80,0x20,0x80,0x3f,0x00,0x04, + 0x00,0xff,0xc0,0x00,0x00,0x04,0x00,0x0c,0x00,0x1a,0x00,0x61,0x80}; +const u8g_fntpgm_uint8_t fontpage_375_248_248[34] U8G_FONT_SECTION("fontpage_375_248_248") = { + 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xf8,0xf8,0x00,0x09,0xfe,0x00, + 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x89,0x89,0x89,0x89,0x89,0x89,0xf9,0x01, + 0x01,0x01}; 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, @@ -173,14 +185,18 @@ const u8g_fntpgm_uint8_t fontpage_377_168_168[34] U8G_FONT_SECTION("fontpage_377 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_377_248_248[45] U8G_FONT_SECTION("fontpage_377_248_248") = { + 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xf8,0xf8,0x00,0x09,0xfe,0x00, + 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x20,0x80,0x20,0x80,0x3f,0x00,0x20,0x80,0x3f, + 0x00,0x04,0x00,0xff,0xc0,0x00,0x00,0x20,0x00,0x20,0x00,0x3f,0x80}; 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_172_172[45] U8G_FONT_SECTION("fontpage_385_172_172") = { + 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xac,0xac,0x00,0x09,0xfe,0x00, + 0x00,0x09,0x0b,0x16,0x0a,0x01,0xfe,0x21,0x00,0x21,0x00,0x21,0x00,0x21,0x00,0x61, + 0x80,0x51,0x00,0x99,0x00,0x89,0x00,0x01,0x00,0x01,0x00,0x01,0x00}; 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, @@ -193,10 +209,6 @@ const u8g_fntpgm_uint8_t fontpage_386_164_164[34] U8G_FONT_SECTION("fontpage_386 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, @@ -287,6 +299,10 @@ const u8g_fntpgm_uint8_t fontpage_399_144_145[73] U8G_FONT_SECTION("fontpage_399 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_152_152[45] U8G_FONT_SECTION("fontpage_399_152_152") = { + 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x98,0x98,0x00,0x09,0xfe,0x00, + 0x00,0x09,0x0b,0x16,0x0a,0x01,0xfe,0xf9,0x00,0x11,0x00,0x11,0x80,0x79,0x00,0x85, + 0x00,0x00,0x00,0x7e,0x00,0x01,0x00,0x7e,0x00,0x40,0x00,0x7f,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, @@ -367,10 +383,6 @@ const u8g_fntpgm_uint8_t fontpage_412_244_244[45] U8G_FONT_SECTION("fontpage_412 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, @@ -444,36 +456,39 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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, 156, 156, fontpage_360_156_156), // '된' -- '된' 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(367, 236, 236, fontpage_367_236_236), // '러' -- '러' 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, 176, 176, fontpage_371_176_176), // '린' -- '린' 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(373, 187, 187, fontpage_373_187_187), // '못' -- '못' + FONTDATA_ITEM(375, 248, 248, fontpage_375_248_248), // '미' -- '미' 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(377, 248, 248, fontpage_377_248_248), // '본' -- '본' FONTDATA_ITEM(380, 196, 196, fontpage_380_196_196), // '비' -- '비' + FONTDATA_ITEM(385, 172, 172, fontpage_385_172_172), // '사' -- '사' 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), // '슬' -- '슬' @@ -495,6 +510,7 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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, 152, 152, fontpage_399_152_152), // '잘' -- '잘' 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), // '저' -- '저' @@ -515,7 +531,6 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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), // '터' -- '터' diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_pl.h b/Marlin/src/lcd/dogm/fontdata/langdata_pl.h index 0cc607468e..9a41b13a5a 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_pl.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_pl.h @@ -5,32 +5,33 @@ */ #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_132_133[45] U8G_FONT_SECTION("fontpage_2_132_133") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x84,0x85,0x00,0x07,0xfe,0x00, + 0x00,0x05,0x09,0x09,0x06,0x00,0xfe,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x10,0x08, + 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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, 132, 133, fontpage_2_132_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), // 'Ł' -- 'ń' diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_ro.h b/Marlin/src/lcd/dogm/fontdata/langdata_ro.h new file mode 100644 index 0000000000..ffda82764f --- /dev/null +++ b/Marlin/src/lcd/dogm/fontdata/langdata_ro.h @@ -0,0 +1,9 @@ +/** + * 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/src/lcd/dogm/fontdata/langdata_ru.h b/Marlin/src/lcd/dogm/fontdata/langdata_ru.h index 85a0bde3ab..cd0efda12f 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_ru.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_ru.h @@ -6,7 +6,7 @@ #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,0x0c,0x0f,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, @@ -16,7 +16,7 @@ const u8g_fntpgm_uint8_t fontpage_8_144_152[135] U8G_FONT_SECTION("fontpage_8_14 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,0x0c,0x0f,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, @@ -31,12 +31,12 @@ const u8g_fntpgm_uint8_t fontpage_8_154_168[214] U8G_FONT_SECTION("fontpage_8_15 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,0x0c,0x0f,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,0x0c,0x0f,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, @@ -58,13 +58,13 @@ const u8g_fntpgm_uint8_t fontpage_8_175_201[334] U8G_FONT_SECTION("fontpage_8_17 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,0x0c,0x0f,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,0x0c,0x0f,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 } diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_sk.h b/Marlin/src/lcd/dogm/fontdata/langdata_sk.h index a75fa2c926..6bcafb64ed 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_sk.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_sk.h @@ -6,51 +6,43 @@ #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,0x0c,0x0f,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, +const u8g_fntpgm_uint8_t fontpage_2_186_186[33] U8G_FONT_SECTION("fontpage_2_186_186") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xba,0xba,0x00,0x0a,0x00,0x00, + 0x00,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, +const u8g_fntpgm_uint8_t fontpage_2_190_190[33] U8G_FONT_SECTION("fontpage_2_190_190") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbe,0xbe,0x00,0x0a,0x00,0x00, + 0x00,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,0x0c,0x0f,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,0x0c,0x0f,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, +const u8g_fntpgm_uint8_t fontpage_2_229_229[33] U8G_FONT_SECTION("fontpage_2_229_229") = { + 0x00,0x0c,0x0f,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_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,0x0c,0x0f,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, 186, 186, fontpage_2_186_186), // 'ĺ' -- 'ĺ' + FONTDATA_ITEM(2, 190, 190, fontpage_2_190_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, 229, 229, fontpage_2_229_229), // 'ť' -- 'ť' FONTDATA_ITEM(2, 253, 254, fontpage_2_253_254), // 'Ž' -- 'ž' }; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_test.h b/Marlin/src/lcd/dogm/fontdata/langdata_test.h index 033188359d..85a3cf5553 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_test.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_test.h @@ -6,7 +6,7 @@ #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,0x0c,0x0f,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, @@ -111,8 +111,8 @@ const u8g_fntpgm_uint8_t fontpage_8_128_255[1677] U8G_FONT_SECTION("fontpage_8_1 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, +const u8g_fntpgm_uint8_t fontpage_97_129_191[911] U8G_FONT_SECTION("fontpage_97_129_191") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x81,0xbf,0x00,0x0d,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, @@ -140,82 +140,88 @@ const u8g_fntpgm_uint8_t fontpage_97_129_191[870] U8G_FONT_SECTION("fontpage_97_ 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}; + 0x04,0x00,0x04,0x00,0x08,0x00,0x10,0x00,0xff,0xff,0xff,0xff,0x04,0x03,0x03,0x06, + 0x00,0x05,0x20,0x90,0x40,0xff,0x04,0x03,0x03,0x06,0x00,0x05,0x20,0x90,0x40,0x03, + 0x03,0x03,0x06,0x00,0x05,0x40,0xa0,0x40,0xff,0xff,0xff,0x05,0x03,0x03,0x06,0x00, + 0x03,0xf8,0x00,0xf8,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,0x04,0x05,0x05,0x06,0x00,0x00,0x20,0xf0,0x90,0x10,0x20,0x05, + 0x07,0x07,0x06,0x00,0x00,0x20,0xf8,0x88,0x88,0x08,0x10,0x60,0x03,0x04,0x04,0x06, + 0x00,0x00,0xe0,0x40,0x40,0xe0,0x05,0x06,0x06,0x06,0x00,0x00,0xf8,0x20,0x20,0x20, + 0x20,0xf8,0x04,0x05,0x05,0x06,0x00,0x00,0x20,0xf0,0x20,0x60,0xa0,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,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x08, + 0x40,0x40,0xf8,0x48,0x50,0x40,0x38,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}; +const u8g_fntpgm_uint8_t fontpage_97_193_255[822] U8G_FONT_SECTION("fontpage_97_193_255") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc1,0xff,0x00,0x09,0x00,0x00, + 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x10,0x60,0x20,0xf8,0x20,0x20,0x40,0x05,0x09, + 0x09,0x06,0x00,0x00,0x28,0x08,0x10,0x60,0x20,0xf8,0x20,0x20,0x40,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,0x05,0x09,0x09, + 0x06,0x00,0x00,0x18,0x18,0x00,0x80,0x90,0xe0,0x80,0x80,0x70,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,0x05, + 0x08,0x08,0x06,0x00,0x01,0x18,0x18,0x00,0x60,0xa0,0x10,0x10,0x08,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,0x05,0x09,0x09,0x06,0x00,0x00,0x18, + 0x18,0x20,0xf8,0x20,0xa8,0xa8,0xa8,0x20,0x05,0x06,0x06,0x06,0x00,0x00,0xf8,0x08, + 0x08,0x50,0x20,0x10,0x04,0x06,0x06,0x06,0x01,0x00,0xe0,0x00,0xe0,0x00,0xc0,0x30, + 0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,0x20,0x40,0x48,0xf8,0x08,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,0x04,0x05,0x05,0x06,0x00,0x00, + 0xf0,0x90,0x10,0x10,0x60,0x05,0x06,0x06,0x06,0x00,0x00,0xf8,0x88,0x88,0x08,0x10, + 0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x10,0xf8,0x50,0x50,0xf8,0x10,0x10,0x05,0x06, + 0x06,0x06,0x00,0x00,0x70,0x10,0x20,0x20,0x20,0xf8,0x05,0x06,0x06,0x06,0x00,0x00, + 0xf8,0x08,0xf8,0x08,0x10,0x60,0x05,0x06,0x06,0x06,0x00,0x00,0xc0,0x08,0x08,0x08, + 0x10,0xe0,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x08,0x20,0xf8,0x88,0x88,0x08,0x10, + 0x60,0x04,0x05,0x05,0x06,0x00,0x00,0x40,0xf0,0x50,0x50,0xb0,0x04,0x05,0x05,0x06, + 0x00,0x00,0x80,0xf0,0xa0,0x20,0x40,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x28,0x00, + 0xf8,0x88,0x88,0x08,0x10,0x60,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x08,0x10,0xf8, + 0x50,0x50,0xf8,0x10,0x10,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x28,0x00,0x70,0x10, + 0x20,0x20,0x20,0xf8,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x28,0x00,0xf8,0x08,0xf8, + 0x08,0x10,0x60,0x02,0x02,0x02,0x06,0x02,0x03,0xc0,0xc0,0x05,0x02,0x02,0x06,0x00, + 0x03,0x80,0x78,0x05,0x04,0x04,0x06,0x00,0x02,0x80,0x60,0x10,0x08,0x05,0x07,0x07, + 0x06,0x00,0x02,0x28,0x28,0x00,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 = { diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_tr.h b/Marlin/src/lcd/dogm/fontdata/langdata_tr.h index b85a19f547..454fc7cc67 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_tr.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_tr.h @@ -5,22 +5,23 @@ */ #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, +const u8g_fntpgm_uint8_t fontpage_2_158_159[49] U8G_FONT_SECTION("fontpage_2_158_159") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9e,0x9f,0x00,0x0a,0xfe,0x00, + 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x88,0x70,0x00,0x70,0x88,0x80,0x80,0x98,0x88, + 0x70,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,0x0c,0x0f,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,0x0c,0x0f,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, 158, 159, fontpage_2_158_159), // 'Ğ' -- 'ğ' FONTDATA_ITEM(2, 176, 177, fontpage_2_176_177), // 'İ' -- 'ı' FONTDATA_ITEM(2, 222, 223, fontpage_2_222_223), // 'Ş' -- 'ş' }; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_uk.h b/Marlin/src/lcd/dogm/fontdata/langdata_uk.h index d6e8337fd8..5d34d1b994 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_uk.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_uk.h @@ -6,25 +6,25 @@ #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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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, @@ -34,14 +34,14 @@ const u8g_fntpgm_uint8_t fontpage_8_156_164[134] U8G_FONT_SECTION("fontpage_8_15 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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, @@ -63,17 +63,17 @@ const u8g_fntpgm_uint8_t fontpage_8_176_201[321] U8G_FONT_SECTION("fontpage_8_17 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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 } diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_vi.h b/Marlin/src/lcd/dogm/fontdata/langdata_vi.h index 7c309907cd..bebf3251c1 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_vi.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_vi.h @@ -6,178 +6,174 @@ #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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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 }; @@ -203,7 +199,6 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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), // 'ể' -- 'ể' diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_zh_CN.h b/Marlin/src/lcd/dogm/fontdata/langdata_zh_CN.h index 87183cd5df..de697cbef4 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_zh_CN.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_zh_CN.h @@ -5,1105 +5,1540 @@ */ #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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_141_141[45] U8G_FONT_SECTION("fontpage_156_141_141") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8d,0x8d,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xff,0xe0,0x02,0x00,0x02,0x00,0x04,0x00,0x0d, + 0x00,0x14,0x80,0x24,0x40,0x44,0x20,0x84,0x00,0x04,0x00,0x04,0x00}; +const u8g_fntpgm_uint8_t fontpage_156_147_147[45] U8G_FONT_SECTION("fontpage_156_147_147") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x93,0x93,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x3f,0xc0,0x04,0x00,0x04,0x00,0xff, + 0xe0,0x08,0x00,0x1f,0xc0,0x00,0x80,0x0d,0x00,0x02,0x00,0x01,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_186_187[73] U8G_FONT_SECTION("fontpage_156_186_187") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xba,0xbb,0x00,0x0a,0xff,0x00, + 0x00,0x09,0x0b,0x16,0x0c,0x01,0xff,0x48,0x00,0x28,0x00,0x08,0x00,0xff,0x80,0x08, + 0x80,0x0c,0x80,0x12,0x80,0x12,0x80,0x20,0x80,0x44,0x80,0x83,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_201_201[45] U8G_FONT_SECTION("fontpage_156_201_201") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc9,0xc9,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x08,0x80,0x24,0x80,0x24,0x80,0x21,0x00,0x11, + 0x00,0x12,0x00,0x0a,0x00,0x04,0x00,0x0a,0x00,0x31,0x80,0xc0,0x60}; 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,0x0c,0x0f,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,0x0c,0x0f,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_140_140[39] U8G_FONT_SECTION("fontpage_157_140_140") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8c,0x8c,0x00,0x08,0x00,0x00, + 0x00,0x0b,0x08,0x10,0x0c,0x00,0x00,0x7f,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0xff,0xe0}; 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,0x0c,0x0f,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_164_164[45] U8G_FONT_SECTION("fontpage_157_164_164") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa4,0xa4,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x00,0x00,0x11,0x00,0x20, + 0x80,0x51,0x40,0x11,0x00,0x0a,0x00,0x04,0x00,0x1b,0x00,0x60,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,0x0c,0x0f,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,0x0c,0x0f,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, +const u8g_fntpgm_uint8_t fontpage_157_228_229[73] U8G_FONT_SECTION("fontpage_157_228_229") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe4,0xe5,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}; + 0x80,0xc2,0x60,0x3f,0x80,0x01,0x00,0x0a,0x00,0x04,0x00,0x02,0x00,0x0a,0x0b,0x16, + 0x0c,0x01,0xff,0x01,0x00,0x81,0x00,0x91,0x00,0x89,0x00,0x89,0x00,0x81,0x00,0x91, + 0x00,0xa1,0x00,0xc2,0x80,0x84,0x40,0x18,0x40}; +const u8g_fntpgm_uint8_t fontpage_157_246_246[45] U8G_FONT_SECTION("fontpage_157_246_246") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf6,0xf6,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x15,0x00,0x25,0x00,0x2f,0xc0,0x71, + 0x00,0xa1,0x00,0x2f,0xe0,0x21,0x00,0x21,0x00,0x21,0x00,0x21,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,0x0c,0x0f,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,0x0c,0x0f,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_160_160[45] U8G_FONT_SECTION("fontpage_158_160_160") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa0,0xa0,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x11,0x00,0x27,0xe0,0x21,0x00,0x6f, + 0xe0,0xa2,0x00,0x27,0xe0,0x20,0x40,0x22,0x80,0x21,0x00,0x20,0x80}; 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,0x0c,0x0f,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_211_211[45] U8G_FONT_SECTION("fontpage_158_211_211") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd3,0xd3,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x22,0x00,0x5f,0xc0,0x42,0x00,0xc7, + 0x00,0x4a,0x80,0x52,0x40,0x62,0x20,0x4f,0x80,0x42,0x00,0x42,0x00}; +const u8g_fntpgm_uint8_t fontpage_158_217_217[45] U8G_FONT_SECTION("fontpage_158_217_217") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd9,0xd9,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x0a,0x00,0x11,0x00,0x20,0x80,0xdf, + 0x60,0x04,0x00,0x7f,0xc0,0x04,0x00,0x15,0x00,0x24,0x80,0x4c,0x40}; 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,0x0c,0x0f,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_158_255_255[45] U8G_FONT_SECTION("fontpage_158_255_255") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x1f,0xe0,0x21,0x00,0x2f,0xe0,0x69, + 0x20,0xaf,0xe0,0x29,0x00,0x25,0x00,0x22,0x00,0x25,0x80,0x38,0x60}; 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,0x0c,0x0f,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_181_181[45] U8G_FONT_SECTION("fontpage_159_181_181") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb5,0xb5,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x2f,0xc0,0x20,0x40,0x4f,0xc0,0x40,0x40,0xdf, + 0xe0,0x50,0x20,0x4f,0xc0,0x44,0x80,0x43,0x00,0x44,0x80,0x58,0x60}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_190_190[45] U8G_FONT_SECTION("fontpage_160_190_190") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbe,0xbe,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x13,0xe0,0x19,0x00,0x2b,0xe0,0x2e,0x20,0x6a, + 0xa0,0xaa,0xa0,0x2a,0xa0,0x2e,0xa0,0x2a,0xa0,0x21,0x40,0x26,0x20}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_161_207_207[45] U8G_FONT_SECTION("fontpage_161_207_207") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcf,0xcf,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x13,0xc0,0x14,0x80,0x2f,0xe0,0x35,0x20,0x67, + 0xe0,0xa2,0x20,0x2d,0x40,0x22,0x80,0x2d,0xc0,0x22,0xa0,0x2d,0x80}; 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,0x0c,0x0f,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, +const u8g_fntpgm_uint8_t fontpage_162_200_201[73] U8G_FONT_SECTION("fontpage_162_200_201") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc8,0xc9,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}; + 0x00,0xff,0xe0,0x12,0x00,0x12,0x00,0x12,0x20,0x22,0x20,0xc1,0xe0,0x0b,0x0b,0x16, + 0x0c,0x00,0xff,0x04,0x00,0x44,0x40,0x24,0x80,0x04,0x00,0xff,0xe0,0x12,0x00,0x12, + 0x00,0x12,0x20,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_151_151[43] U8G_FONT_SECTION("fontpage_163_151_151") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x97,0x97,0x00,0x09,0xff,0x00, + 0x00,0x0b,0x0a,0x14,0x0c,0x00,0xff,0x7f,0xe0,0x40,0x20,0x9f,0x40,0x11,0x00,0x11, + 0x00,0x11,0x00,0x11,0x00,0x21,0x20,0x41,0x20,0x80,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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, +const u8g_fntpgm_uint8_t fontpage_164_134_135[73] U8G_FONT_SECTION("fontpage_164_134_135") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x86,0x87,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}; + 0x40,0xbf,0xa0,0x08,0x80,0x08,0x80,0x10,0x80,0x20,0x80,0xc3,0x00,0x0b,0x0b,0x16, + 0x0c,0x00,0xff,0x20,0x00,0x27,0xe0,0x21,0x20,0x39,0x20,0xe1,0x20,0x21,0x20,0x29, + 0x20,0x32,0x20,0x22,0x20,0x04,0x20,0x08,0xc0}; 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,0x0c,0x0f,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,0x0c,0x0f,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_171_171[45] U8G_FONT_SECTION("fontpage_164_171_171") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xab,0xab,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7c,0x20,0x44,0x20,0x44,0xa0,0x7c,0xa0,0x10, + 0xa0,0xfe,0xa0,0x12,0xa0,0x22,0xa0,0x22,0x20,0x42,0x20,0x8c,0xe0}; 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,0x0c,0x0f,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,0x0c,0x0f,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_242_242[45] U8G_FONT_SECTION("fontpage_164_242_242") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf2,0xf2,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x20,0xfe,0x20,0x92,0xa0,0x7c,0xa0,0x10, + 0xa0,0x7c,0xa0,0x10,0xa0,0xfe,0xa0,0x44,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,0x0c,0x0f,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_159_160[73] U8G_FONT_SECTION("fontpage_165_159_160") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9f,0xa0,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x01,0x00,0x01,0x00,0xf9,0x00,0x27,0xe0,0x21, + 0x20,0x21,0x20,0x21,0x20,0x3a,0x20,0xc2,0x20,0x04,0x20,0x18,0xc0,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,0x0c,0x0f,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,0x0c,0x0f,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_199_199[45] U8G_FONT_SECTION("fontpage_166_199_199") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc7,0xc7,0x00,0x0a,0xff,0x00, + 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x0d,0x00,0x71,0x00,0x11,0x00,0x11,0x00,0x11, + 0x00,0xff,0xc0,0x11,0x00,0x11,0x00,0x21,0x00,0x41,0x00,0x81,0x00}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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, +const u8g_fntpgm_uint8_t fontpage_166_240_241[73] U8G_FONT_SECTION("fontpage_166_240_241") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf0,0xf1,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}; + 0x40,0x84,0x40,0x84,0x40,0x94,0x40,0xe5,0x80,0x84,0x00,0x04,0x00,0x0b,0x0b,0x16, + 0x0c,0x00,0xff,0x10,0x00,0x1f,0x80,0x21,0x00,0x7f,0xe0,0x20,0x00,0x2f,0x80,0x28, + 0x80,0x28,0x80,0x2b,0x20,0x48,0x20,0x87,0xe0}; +const u8g_fntpgm_uint8_t fontpage_166_244_244[45] U8G_FONT_SECTION("fontpage_166_244_244") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x00,0x11,0xe0,0x7d,0x20,0x11,0x20,0x11, + 0x20,0xff,0x20,0x11,0x20,0x21,0x20,0x4d,0x60,0x75,0x00,0x01,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,0x0c,0x0f,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_139_139[45] U8G_FONT_SECTION("fontpage_167_139_139") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8b,0x8b,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x3f,0xe0,0x20,0x00,0x22,0x00,0x22,0x00,0x22, + 0x00,0x3f,0xc0,0x22,0x00,0x22,0x80,0x42,0x40,0x42,0x00,0xbf,0xe0}; 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,0x0c,0x0f,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, +const u8g_fntpgm_uint8_t fontpage_167_204_205[71] U8G_FONT_SECTION("fontpage_167_204_205") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcc,0xcd,0x00,0x0a,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}; + 0x40,0x11,0x40,0x28,0x80,0x45,0x80,0x82,0x40,0x04,0x20,0x0b,0x0b,0x16,0x0c,0x00, + 0xff,0x01,0xc0,0x3e,0x00,0x20,0x00,0x20,0x00,0x3f,0xc0,0x28,0x80,0x25,0x00,0x22, + 0x00,0x45,0x00,0x48,0x80,0xb0,0x60}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_131_131[45] U8G_FONT_SECTION("fontpage_168_131_131") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x83,0x83,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x02,0x00,0xf2,0x00,0x97,0xe0,0x98,0x00,0x97, + 0xc0,0x90,0x80,0x91,0x00,0xf2,0x00,0x94,0x20,0x04,0x20,0x03,0xe0}; 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,0x0c,0x0f,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_141_142[73] U8G_FONT_SECTION("fontpage_168_141_142") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8d,0x8e,0x00,0x0a,0xff,0x00, + 0x00,0x0a,0x0b,0x16,0x0c,0x00,0xff,0x10,0x00,0x1f,0xc0,0x10,0x80,0x29,0x00,0x46, + 0x00,0x04,0x00,0x1f,0xc0,0xf0,0x40,0x10,0x40,0x10,0x40,0x1f,0xc0,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_145_145[45] U8G_FONT_SECTION("fontpage_168_145_145") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x91,0x91,0x00,0x0a,0xff,0x00, + 0x00,0x0a,0x0b,0x16,0x0c,0x00,0xff,0x08,0x00,0x10,0x00,0xff,0xc0,0x80,0x40,0x9e, + 0x40,0x92,0x40,0x92,0x40,0x9e,0x40,0x80,0x40,0x80,0x40,0x81,0xc0}; +const u8g_fntpgm_uint8_t fontpage_168_166_166[45] U8G_FONT_SECTION("fontpage_168_166_166") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa6,0xa6,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xff,0xe0,0x04,0x00,0x0d,0x80,0x34,0x40,0xc4, + 0x20,0x04,0x00,0x3f,0xc0,0x20,0x40,0x20,0x40,0x3f,0xc0,0x20,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,0x0c,0x0f,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_202_202[45] U8G_FONT_SECTION("fontpage_168_202_202") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xca,0xca,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x24,0x00,0x24,0x00,0x3f,0xc0,0x44,0x00,0x04, + 0x00,0xff,0xe0,0x00,0x00,0x3f,0x80,0x20,0x80,0x20,0x80,0x3f,0x80}; +const u8g_fntpgm_uint8_t fontpage_168_232_232[45] U8G_FONT_SECTION("fontpage_168_232_232") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe8,0xe8,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x3f,0xe0,0x22,0x20,0x2f,0xa0,0x22,0x20,0x3f, + 0xe0,0x20,0x20,0x2f,0xa0,0x28,0xa0,0x4f,0xa0,0x40,0x20,0x80,0x60}; 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,0x0c,0x0f,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,0x0c,0x0f,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_169_205_205[45] U8G_FONT_SECTION("fontpage_169_205_205") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcd,0xcd,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x01,0x00,0x02,0x00,0xef,0xe0,0xa8,0x20,0xab, + 0xa0,0xaa,0xa0,0xaa,0xa0,0xeb,0xa0,0x08,0x20,0x08,0x20,0x08,0x60}; 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,0x0c,0x0f,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,0x0c,0x0f,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_172_232_232[45] U8G_FONT_SECTION("fontpage_172_232_232") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe8,0xe8,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7b,0xc0,0x4a,0x40,0x4a,0x40,0x7b,0xc0,0x04, + 0x80,0xff,0xe0,0x11,0x00,0xfb,0xe0,0x4a,0x40,0x4a,0x40,0x7b,0xc0}; 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,0x0c,0x0f,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,0x0c,0x0f,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_250_250[45] U8G_FONT_SECTION("fontpage_173_250_250") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfa,0xfa,0x00,0x0a,0xff,0x00, + 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0xff,0xc0,0x88,0x40,0x88,0x40,0xff,0x40,0x88, + 0x40,0xbe,0x40,0xa2,0x40,0xa2,0x40,0xbe,0x40,0x80,0x40,0xff,0xc0}; 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,0x0c,0x0f,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,0x0c,0x0f,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_207_207[45] U8G_FONT_SECTION("fontpage_174_207_207") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcf,0xcf,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x00,0x2f,0xe0,0x20,0x80,0xf8,0x80,0x21, + 0x00,0x21,0x80,0x23,0x40,0x35,0x20,0xc9,0x20,0x01,0x00,0x01,0x00}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_178_180_180[45] U8G_FONT_SECTION("fontpage_178_180_180") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb4,0xb4,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x12,0x00,0x0a,0x00,0x22,0x00,0x12,0x00,0x02, + 0x00,0xff,0xe0,0x02,0x00,0x05,0x00,0x08,0x80,0x10,0x40,0x60,0x20}; +const u8g_fntpgm_uint8_t fontpage_178_253_253[45] U8G_FONT_SECTION("fontpage_178_253_253") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfd,0xfd,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x00,0x23,0xe0,0xf8,0x40,0x28,0x80,0x28, + 0x80,0x4f,0xe0,0x50,0x80,0x30,0x80,0x28,0x80,0x48,0x80,0x83,0x80}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_171_171[45] U8G_FONT_SECTION("fontpage_183_171_171") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xab,0xab,0x00,0x0a,0xff,0x00, + 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0xff,0xc0,0x80,0x40,0x3f,0x00,0x21, + 0x00,0x3f,0x00,0x00,0x00,0x7f,0x80,0x40,0x80,0x7f,0x80,0x40,0x80}; 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,0x0c,0x0f,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_134_134[45] U8G_FONT_SECTION("fontpage_184_134_134") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x86,0x86,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x27,0xc0,0xa4,0x80,0x6b,0x00,0x22, + 0x80,0x24,0x80,0x6f,0xe0,0xa4,0x80,0x22,0x80,0x20,0x80,0x21,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_238_238[45] U8G_FONT_SECTION("fontpage_187_238_238") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x80,0x09,0x00,0xff,0xe0,0x04,0x00,0x7f, + 0xc0,0x08,0x00,0xff,0xe0,0x10,0x00,0x2f,0x80,0x42,0x00,0xbf,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_131_131[45] U8G_FONT_SECTION("fontpage_190_131_131") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x83,0x83,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x08,0x00,0x10,0x80,0x3f, + 0xc0,0x11,0x00,0xff,0xe0,0x11,0x00,0x11,0x00,0x21,0x00,0x41,0x00}; +const u8g_fntpgm_uint8_t fontpage_190_143_143[45] U8G_FONT_SECTION("fontpage_190_143_143") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8f,0x8f,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x02,0x80,0x02,0x40,0x02,0x00,0xff,0xe0,0x02, + 0x00,0x7a,0x00,0x12,0x00,0x11,0x00,0x11,0x20,0x18,0xa0,0xe0,0x60}; +const u8g_fntpgm_uint8_t fontpage_190_149_149[45] U8G_FONT_SECTION("fontpage_190_149_149") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x95,0x95,0x00,0x0a,0xff,0x00, + 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0xfc,0x40,0x04,0x40,0x04,0x40,0x7c,0x40,0x40, + 0x40,0xfc,0x40,0x04,0x40,0x04,0x40,0x04,0x40,0x28,0x40,0x10,0x40}; +const u8g_fntpgm_uint8_t fontpage_190_185_185[45] U8G_FONT_SECTION("fontpage_190_185_185") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb9,0xb9,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xe4,0x40,0x22,0x80,0x2f,0xe0,0xe9,0x20,0x8f, + 0xe0,0x89,0x20,0xef,0xe0,0x21,0x00,0x2f,0xe0,0xa1,0x00,0x41,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,0x0c,0x0f,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,0x0c,0x0f,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_170_170[45] U8G_FONT_SECTION("fontpage_191_170_170") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaa,0xaa,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x1f,0xe0,0x28,0x80,0x4f,0xe0,0x98,0x80,0x2b, + 0xe0,0x6a,0x20,0xab,0xe0,0x2a,0x20,0x2b,0xe0,0x2a,0x20,0x33,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,0x0c,0x0f,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,0x0c,0x0f,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_191_253_253[45] U8G_FONT_SECTION("fontpage_191_253_253") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfd,0xfd,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x00,0x3f,0xc0,0x2a,0x40,0x4a,0x40,0x14, + 0x40,0x28,0x40,0x05,0x80,0x12,0x40,0x50,0xa0,0x50,0xa0,0x8f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_194_159_159[45] U8G_FONT_SECTION("fontpage_194_159_159") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9f,0x9f,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x01,0x40,0x7f,0xe0,0x41,0x00,0x7f,0x40,0x5d, + 0x40,0x52,0x80,0x9d,0xa0,0x82,0x60,0x24,0x40,0xa2,0xa0,0x9f,0x80}; +const u8g_fntpgm_uint8_t fontpage_196_143_144[73] U8G_FONT_SECTION("fontpage_196_143_144") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8f,0x90,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x02,0x80,0x7a,0x40,0x0a,0x00,0x4f,0xe0,0x2a, + 0x00,0x12,0x40,0x12,0x80,0x29,0x00,0x41,0x20,0x86,0xa0,0x00,0x60,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_165_165[45] U8G_FONT_SECTION("fontpage_197_165_165") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa5,0xa5,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x27,0xc0,0x24,0x40,0xfc,0x40,0x25,0x80,0x2c, + 0x00,0x37,0xe0,0x65,0x40,0xa5,0x40,0x24,0x80,0x25,0x40,0xe6,0x20}; +const u8g_fntpgm_uint8_t fontpage_197_172_172[45] U8G_FONT_SECTION("fontpage_197_172_172") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xac,0xac,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x21,0x00,0xfa,0x40,0x27,0xa0,0x28, + 0x20,0x30,0x00,0x67,0xe0,0xa4,0x20,0x24,0x20,0x27,0xe0,0xe4,0x20}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_223_223[45] U8G_FONT_SECTION("fontpage_198_223_223") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdf,0xdf,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x23,0xc0,0x22,0x40,0xfb,0xc0,0x20,0x00,0x2f, + 0xe0,0x34,0x20,0x65,0x20,0xa5,0x20,0x25,0x20,0x22,0x80,0xec,0x60}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_165_165[45] U8G_FONT_SECTION("fontpage_199_165_165") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa5,0xa5,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x2f,0xe0,0xf4,0x40,0x22,0x80,0x2f, + 0xe0,0x31,0x00,0x6f,0xe0,0xa2,0x40,0x26,0x80,0x21,0x40,0xee,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,0x0c,0x0f,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_208_208[45] U8G_FONT_SECTION("fontpage_199_208_208") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd0,0xd0,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x27,0xc0,0x24,0x40,0xff,0xc0,0x24,0x40,0x27, + 0xc0,0x30,0x00,0x6f,0xe0,0xa5,0x00,0x25,0xe0,0x2b,0x00,0xf1,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_242_242[45] U8G_FONT_SECTION("fontpage_202_242_242") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf2,0xf2,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x80,0xfe,0xe0,0x00,0x80,0x78,0x80,0x4b, + 0xe0,0x79,0x40,0x01,0x40,0xff,0x40,0xaa,0x80,0xbb,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,0x0c,0x0f,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_135_135[45] U8G_FONT_SECTION("fontpage_203_135_135") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x87,0x87,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x08,0x00,0x04,0x00,0xff,0xe0,0x11,0x00,0x11, + 0x00,0x11,0x00,0x0a,0x00,0x0a,0x00,0x04,0x00,0x1b,0x00,0xe0,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,0x0c,0x0f,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,0x0c,0x0f,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_173_173[45] U8G_FONT_SECTION("fontpage_203_173_173") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xad,0xad,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x60,0xd5,0x80,0xb9,0x00,0x91,0x00,0xfd, + 0xe0,0xb1,0x40,0xd9,0x40,0xd5,0x40,0x91,0x40,0xfa,0x40,0x04,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,0x0c,0x0f,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_185_185[45] U8G_FONT_SECTION("fontpage_203_185_185") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb9,0xb9,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x08,0x00,0x04,0x00,0xff,0xe0,0x08,0x00,0x08, + 0x00,0x0f,0x80,0x10,0x80,0x10,0x80,0x20,0x80,0x40,0x80,0x87,0x00}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_175_175[45] U8G_FONT_SECTION("fontpage_204_175_175") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaf,0xaf,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x1f,0x80,0x10,0x80,0x1f,0x80,0x10,0x80,0x1f, + 0x80,0x00,0x00,0xff,0xe0,0x24,0x00,0x27,0x80,0x54,0x00,0x8f,0xe0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_159_159[45] U8G_FONT_SECTION("fontpage_206_159_159") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9f,0x9f,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x49,0xe0,0xfd,0x20,0x49,0x20,0x79,0xe0,0x49, + 0x20,0x79,0x20,0x49,0xe0,0xfd,0x20,0x01,0x20,0x49,0x20,0x86,0x60}; 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,0x0c,0x0f,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,0x0c,0x0f,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_223_223[45] U8G_FONT_SECTION("fontpage_206_223_223") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdf,0xdf,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x04,0x00,0x3f,0x80,0x24, + 0x80,0x24,0x80,0x3f,0x80,0x0e,0x00,0x15,0x00,0x24,0x80,0xc4,0x60}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_151_151[45] U8G_FONT_SECTION("fontpage_207_151_151") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x97,0x97,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x21,0x00,0xff,0xe0,0x21,0x00,0x71, + 0x00,0x6b,0x80,0xa5,0x40,0xa9,0x20,0x21,0x00,0x21,0x00,0x21,0x00}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_175_175[45] U8G_FONT_SECTION("fontpage_209_175_175") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaf,0xaf,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x24,0x40,0x22,0x80,0x27,0xc0,0xf9,0x40,0x27, + 0xc0,0x75,0x00,0x6f,0xe0,0xa3,0x20,0x25,0x20,0x29,0xc0,0x21,0x00}; 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,0x0c,0x0f,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,0x0c,0x0f,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_161_161[45] U8G_FONT_SECTION("fontpage_212_161_161") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa1,0xa1,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x80,0x2f,0xe0,0xf2,0x80,0x27,0xc0,0x34, + 0x40,0x6f,0xc0,0x64,0x40,0xaf,0xe0,0x21,0x00,0x22,0x80,0x2c,0x60}; 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,0x0c,0x0f,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, +const u8g_fntpgm_uint8_t fontpage_214_226_227[71] U8G_FONT_SECTION("fontpage_214_226_227") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe2,0xe3,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}; + 0x80,0x24,0x00,0x24,0x00,0x24,0x00,0x24,0x00,0x24,0x00,0xff,0xc0,0x0b,0x0a,0x14, + 0x0c,0x00,0xff,0xff,0xe0,0x04,0x00,0x04,0x00,0x24,0x00,0x27,0xc0,0x24,0x00,0x24, + 0x00,0x24,0x00,0x24,0x00,0xff,0xe0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_217_232_232[45] U8G_FONT_SECTION("fontpage_217_232_232") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe8,0xe8,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x42,0x00,0x21,0x00,0x8f,0xe0,0x51,0x00,0x11, + 0x00,0x21,0x00,0x27,0xc0,0xc1,0x00,0x41,0x00,0x41,0x00,0x4f,0xe0}; +const u8g_fntpgm_uint8_t fontpage_218_151_151[45] U8G_FONT_SECTION("fontpage_218_151_151") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x97,0x97,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x25,0x00,0x87,0xc0,0x49,0x00,0x21, + 0x00,0x3f,0xe0,0x42,0x80,0xc2,0x80,0x44,0xa0,0x48,0xa0,0x50,0xe0}; 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,0x0c,0x0f,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_193_193[45] U8G_FONT_SECTION("fontpage_218_193_193") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc1,0xc1,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x82,0x00,0x5f,0xe0,0x04,0x00,0x88,0x80,0x5f, + 0xc0,0x20,0x40,0x2a,0x80,0xca,0x80,0x4a,0xa0,0x4a,0xa0,0x52,0x60}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_219_247_247[45] U8G_FONT_SECTION("fontpage_219_247_247") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf7,0xf7,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x4f,0xc0,0x28,0x40,0x0f,0xc0,0x88,0x40,0x5f, + 0xc0,0x29,0x20,0x29,0x40,0xcf,0x80,0x49,0x20,0x4b,0x20,0x4c,0xe0}; 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,0x0c,0x0f,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,0x0c,0x0f,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_220_184_184[45] U8G_FONT_SECTION("fontpage_220_184_184") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb8,0xb8,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x48,0x80,0x24,0xe0,0x1f,0x00,0x88,0xe0,0x5e, + 0x20,0x2a,0x40,0x2b,0xe0,0xca,0x40,0x4a,0x40,0x52,0x40,0x66,0xc0}; 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,0x0c,0x0f,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_162_162[45] U8G_FONT_SECTION("fontpage_221_162_162") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa2,0xa2,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x44,0x40,0x22,0x80,0x0f,0xe0,0x82,0x80,0x44, + 0x40,0x28,0x20,0x3f,0xe0,0xca,0xa0,0x4a,0xa0,0x4a,0xa0,0x5f,0xe0}; +const u8g_fntpgm_uint8_t fontpage_221_209_209[45] U8G_FONT_SECTION("fontpage_221_209_209") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd1,0xd1,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x47,0xc0,0x24,0x40,0x07,0x40,0x85,0x40,0x5f, + 0xe0,0x34,0x60,0x27,0xc0,0xc4,0x40,0x47,0xc0,0x44,0x40,0x44,0xc0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_233_233[45] U8G_FONT_SECTION("fontpage_228_233_233") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe9,0xe9,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0xa2,0x00,0xa7,0xe0,0xfa,0xa0,0xa2, + 0xa0,0x32,0xa0,0x64,0xa0,0xa9,0x20,0x22,0x20,0x25,0x20,0x28,0xc0}; 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,0x0c,0x0f,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,0x0c,0x0f,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_231_175_175[45] U8G_FONT_SECTION("fontpage_231_175_175") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaf,0xaf,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x07,0xe0,0xf9,0x00,0x21,0x00,0x23,0x00,0x73, + 0x80,0x25,0x40,0x25,0x20,0x39,0x20,0xc1,0x00,0x01,0x00,0x01,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,0x0c,0x0f,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,0x0c,0x0f,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_234_229_229[45] U8G_FONT_SECTION("fontpage_234_229_229") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe5,0xe5,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x02,0x00,0xfb,0xc0,0xae,0x40,0xa9,0x80,0xfa, + 0x40,0xac,0x20,0xab,0xc0,0xaa,0x40,0xfa,0x40,0x8b,0xc0,0x02,0x40}; 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,0x0c,0x0f,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,0x0c,0x0f,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_209_209[45] U8G_FONT_SECTION("fontpage_237_209_209") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd1,0xd1,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x0a,0x00,0x4a,0x00,0x4b,0xe0,0x4a,0x00,0x4c, + 0x80,0x48,0x40,0x08,0x00,0x7f,0xc0,0x4a,0x40,0x4a,0x40,0xff,0xe0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_240_238_238[45] U8G_FONT_SECTION("fontpage_240_238_238") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x02,0x00,0xf3,0xc0,0x24,0x80,0x4f,0xe0,0xf5, + 0x20,0x57,0xe0,0x55,0x20,0x57,0xe0,0x75,0x20,0x45,0x20,0x08,0x60}; +const u8g_fntpgm_uint8_t fontpage_243_187_187[45] U8G_FONT_SECTION("fontpage_243_187_187") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbb,0xbb,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x2a,0x80,0x24,0x80,0x2a, + 0x80,0x3f,0x80,0x04,0x00,0x7f,0xc0,0x49,0x40,0x5f,0x40,0x40,0xc0}; 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,0x0c,0x0f,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_250_250[45] U8G_FONT_SECTION("fontpage_244_250_250") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfa,0xfa,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xe0,0x40,0x20,0x89,0x00,0x10, + 0x80,0x60,0x40,0x1f,0x80,0x04,0x00,0x04,0x00,0x04,0x00,0x7f,0xe0}; 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,0x0c,0x0f,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_172_172[45] U8G_FONT_SECTION("fontpage_246_172_172") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xac,0xac,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x42,0x00,0x7b,0xe0,0x54,0x80,0xbf,0xc0,0x04, + 0x40,0x7f,0xc0,0x44,0x00,0x7f,0xe0,0x14,0x20,0x24,0xc0,0xc4,0x00}; 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,0x0c,0x0f,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_247_128_128[45] U8G_FONT_SECTION("fontpage_247_128_128") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x42,0x00,0x7b,0xe0,0x94,0x80,0x27,0xc0,0x50, + 0x40,0x4f,0x40,0x49,0x40,0x4f,0x40,0x49,0x40,0x4f,0x40,0x40,0xc0}; +const u8g_fntpgm_uint8_t fontpage_247_177_177[45] U8G_FONT_SECTION("fontpage_247_177_177") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb1,0xb1,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x3d,0xe0,0x4a,0x80,0x94,0x40,0x7f, + 0xc0,0x12,0x40,0x3b,0xc0,0x56,0x40,0x93,0xc0,0x12,0x40,0x13,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,0x0c,0x0f,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_162_162[45] U8G_FONT_SECTION("fontpage_250_162_162") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa2,0xa2,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xc0,0x04,0x00,0xff,0xe0,0x91, + 0x20,0x3e,0x00,0x08,0x80,0x7f,0xc0,0x04,0x40,0x24,0x80,0xcc,0x60}; 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,0x0c,0x0f,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,0x0c,0x0f,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_167_167[45] U8G_FONT_SECTION("fontpage_253_167_167") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa7,0xa7,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x2f,0xc0,0x22,0x40,0x4a,0x40,0x52,0x80,0xe2, + 0xe0,0x22,0x20,0x42,0x20,0xf5,0x40,0x0c,0x80,0x35,0x40,0xca,0x20}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_211_211[45] U8G_FONT_SECTION("fontpage_253_211_211") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd3,0xd3,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x21,0x00,0x4f,0xe0,0x51,0x00,0xe7, + 0xc0,0x20,0x00,0x47,0xc0,0xf4,0x40,0x0c,0x40,0x37,0xc0,0xc4,0x40}; +const u8g_fntpgm_uint8_t fontpage_253_217_217[45] U8G_FONT_SECTION("fontpage_253_217_217") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd9,0xd9,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x21,0x00,0x42,0x80,0x54,0x40,0xe8, + 0x20,0x27,0xc0,0x40,0x00,0xf7,0xc0,0x0c,0x40,0x34,0x40,0xc7,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_133_133[45] U8G_FONT_SECTION("fontpage_256_133_133") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x85,0x85,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x3f,0x40,0x04,0x80,0x05,0x00,0xff, + 0xe0,0x08,0x00,0x3f,0x80,0xd0,0x80,0x1f,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,0x0c,0x0f,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_257_253_253[45] U8G_FONT_SECTION("fontpage_257_253_253") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfd,0xfd,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x49,0x40,0xfd,0x80,0x01,0x20,0x7d, + 0xe0,0x44,0x00,0x7d,0x40,0x45,0x80,0x7d,0x20,0x45,0x20,0x4d,0xe0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_269_199_199[45] U8G_FONT_SECTION("fontpage_269_199_199") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc7,0xc7,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x20,0x80,0x27,0xe0,0xfc,0x20,0xaa, + 0x00,0xaa,0x40,0xfb,0x80,0x22,0x00,0x2a,0x20,0x3a,0x20,0xc9,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_129_129[45] U8G_FONT_SECTION("fontpage_275_129_129") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x81,0x81,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xff,0xe0,0x0a,0x00,0x7f,0xc0,0x4a,0x40,0x7f, + 0xc0,0x08,0x00,0xff,0xe0,0x11,0x00,0x3a,0x00,0x0f,0x00,0x70,0xc0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_279_251_251[45] U8G_FONT_SECTION("fontpage_279_251_251") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfb,0xfb,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x27,0xc0,0x01,0x00,0xef,0xe0,0x22, + 0xa0,0x25,0x80,0x22,0x80,0x2f,0xe0,0x31,0x80,0x22,0x40,0x0c,0x20}; 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,0x0c,0x0f,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,0x0c,0x0f,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_282_170_170[45] U8G_FONT_SECTION("fontpage_282_170_170") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaa,0xaa,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x0a,0x00,0x35,0x80,0xdf,0x60,0x01, + 0x00,0x3f,0x80,0x24,0x80,0x24,0x80,0x2a,0x80,0x11,0x00,0x60,0xc0}; +const u8g_fntpgm_uint8_t fontpage_282_247_247[45] U8G_FONT_SECTION("fontpage_282_247_247") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf7,0xf7,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x00,0x13,0xc0,0x7c,0x40,0x10,0x40,0xff, + 0xc0,0x12,0x00,0x52,0x20,0x5e,0x20,0x53,0xe0,0xb0,0x00,0x8f,0xe0}; +const u8g_fntpgm_uint8_t fontpage_283_133_133[45] U8G_FONT_SECTION("fontpage_283_133_133") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x85,0x85,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x17,0xc0,0x11,0x40,0x7d,0x40,0x12,0xc0,0xfc, + 0x00,0x13,0xc0,0x5e,0x40,0x52,0x40,0x73,0xc0,0x98,0x00,0x87,0xe0}; +const u8g_fntpgm_uint8_t fontpage_283_221_221[45] U8G_FONT_SECTION("fontpage_283_221_221") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdd,0xdd,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7b,0xe0,0x4a,0x00,0x4a,0x00,0x7b,0xe0,0x12, + 0x20,0x52,0x20,0x5a,0x20,0x53,0xe0,0x52,0x00,0x5e,0x00,0xe3,0xe0}; +const u8g_fntpgm_uint8_t fontpage_286_236_236[45] U8G_FONT_SECTION("fontpage_286_236_236") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xec,0xec,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0xf7,0xc0,0x41,0x00,0x6f,0xe0,0xa2, + 0x00,0xf7,0xc0,0x20,0x40,0x3a,0x80,0xe1,0x00,0x20,0x80,0x20,0x80}; +const u8g_fntpgm_uint8_t fontpage_286_239_239[45] U8G_FONT_SECTION("fontpage_286_239_239") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xef,0xef,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x42,0x00,0x42,0x00,0xfb,0xe0,0x42,0x20,0xa5, + 0x40,0xf9,0x00,0x21,0x00,0x3a,0x80,0xe2,0x80,0x24,0x40,0x28,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_287_222_222[45] U8G_FONT_SECTION("fontpage_287_222_222") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xde,0xde,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x42,0x00,0x2f,0xe0,0x22,0x00,0x05,0x00,0xef, + 0xc0,0x21,0x00,0x2f,0xe0,0x21,0x00,0x21,0x00,0x51,0x00,0x8f,0xe0}; +const u8g_fntpgm_uint8_t fontpage_287_247_247[45] U8G_FONT_SECTION("fontpage_287_247_247") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf7,0xf7,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x29,0x20,0x25,0x40,0x01,0x00,0xef, + 0xe0,0x21,0x00,0x23,0x80,0x25,0x40,0x29,0x20,0x51,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_290_205_205[45] U8G_FONT_SECTION("fontpage_290_205_205") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcd,0xcd,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xfb,0xe0,0x50,0x20,0x50,0x20,0xf8,0x20,0xab, + 0xe0,0xda,0x00,0x8a,0x00,0xfa,0x00,0x8a,0x20,0xfa,0x20,0x8b,0xe0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_220_220[45] U8G_FONT_SECTION("fontpage_298_220_220") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdc,0xdc,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x4f,0xe0,0x72,0x80,0x8f,0xe0,0xf4, + 0x40,0x27,0xc0,0xf4,0x40,0x27,0xc0,0x2a,0x80,0x32,0xa0,0x2c,0x60}; 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,0x0c,0x0f,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,0x0c,0x0f,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_242_242[45] U8G_FONT_SECTION("fontpage_299_242_242") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf2,0xf2,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x4f,0xe0,0x20,0x20,0x84,0x20,0x84,0x20,0xbf, + 0xa0,0x84,0x20,0x8e,0x20,0x95,0x20,0xa4,0xa0,0x84,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,0x0c,0x0f,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_136_136[45] U8G_FONT_SECTION("fontpage_300_136_136") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x27,0xe0,0x11,0x20,0x82,0xa0,0xbf,0xe0,0x82, + 0x20,0xba,0xa0,0xaa,0xa0,0xb9,0x20,0x81,0x20,0xba,0xa0,0x84,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,0x0c,0x0f,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,0x0c,0x0f,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_300_233_233[45] U8G_FONT_SECTION("fontpage_300_233_233") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe9,0xe9,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xf1,0x00,0x92,0x80,0xa4,0x40,0xc8,0x20,0xa7, + 0xc0,0x90,0x00,0x9a,0x40,0xd5,0x40,0xa5,0x40,0x80,0x80,0x8f,0xe0}; +const u8g_fntpgm_uint8_t fontpage_301_246_246[45] U8G_FONT_SECTION("fontpage_301_246_246") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf6,0xf6,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xc0,0x04,0x00,0xff,0xe0,0x95,0x20,0x0e, + 0x00,0x31,0x80,0xc4,0x60,0x3f,0x80,0x01,0x00,0x0e,0x00,0x03,0x00}; +const u8g_fntpgm_uint8_t fontpage_302_128_128[45] U8G_FONT_SECTION("fontpage_302_128_128") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xc0,0x04,0x00,0xff,0xe0,0xb5,0xa0,0x04, + 0x00,0xff,0xe0,0x08,0x00,0x7f,0xc0,0x4a,0x40,0x4a,0x40,0x4a,0xc0}; 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,0x0c,0x0f,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,0x0c,0x0f,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_224_224[45] U8G_FONT_SECTION("fontpage_302_224_224") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe0,0xe0,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x24,0x00,0x3f,0xc0,0x44,0x00,0xff,0xe0,0x20, + 0x80,0x3f,0x80,0x0a,0x00,0xfb,0xe0,0x0a,0x00,0xfb,0xe0,0x0a,0x00}; +const u8g_fntpgm_uint8_t fontpage_302_226_226[45] U8G_FONT_SECTION("fontpage_302_226_226") = { + 0x00,0x0c,0x0f,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_245_245[45] U8G_FONT_SECTION("fontpage_304_245_245") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf5,0xf5,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xff,0xe0,0x04,0x00,0x3f,0x80,0x20,0x80,0x24, + 0x80,0x24,0x80,0x24,0x80,0x26,0x80,0x09,0x00,0x10,0xc0,0x60,0x40}; 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,0x0c,0x0f,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,0x0c,0x0f,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_145_145[45] U8G_FONT_SECTION("fontpage_305_145_145") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x91,0x91,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x13,0xe0,0x50,0x80,0x5f,0xe0,0x52,0x20,0xfe, + 0xa0,0x12,0xa0,0x56,0xa0,0x5a,0xa0,0x92,0xa0,0x21,0x40,0xc6,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_236_236[45] U8G_FONT_SECTION("fontpage_308_236_236") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xec,0xec,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0x80,0x00,0x80,0x10,0x80,0x11,0x00,0x21, + 0x00,0x3f,0xe0,0x00,0x20,0x00,0x20,0xff,0x20,0x00,0x20,0x00,0xc0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_318_208_208[45] U8G_FONT_SECTION("fontpage_318_208_208") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd0,0xd0,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x10,0x80,0x09,0x00,0x06, + 0x00,0x19,0x80,0xe0,0x60,0x09,0x00,0x09,0x00,0x11,0x00,0x61,0x00}; 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,0x0c,0x0f,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, 141, 141, fontpage_156_141_141), // '不' -- '不' + FONTDATA_ITEM(156, 147, 147, fontpage_156_147_147), // '专' -- '专' 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, 186, 187, fontpage_156_186_187), // '为' -- '主' + FONTDATA_ITEM(156, 201, 201, fontpage_156_201_201), // '义' -- '义' FONTDATA_ITEM(156, 203, 203, fontpage_156_203_203), // '之' -- '之' FONTDATA_ITEM(157, 134, 134, fontpage_157_134_134), // '了' -- '了' + FONTDATA_ITEM(157, 140, 140, fontpage_157_140_140), // '二' -- '二' FONTDATA_ITEM(157, 142, 142, fontpage_157_142_142), // '于' -- '于' + FONTDATA_ITEM(157, 164, 164, fontpage_157_164_164), // '交' -- '交' 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, 228, 229, fontpage_157_228_229), // '令' -- '以' + FONTDATA_ITEM(157, 246, 246, fontpage_157_246_246), // '件' -- '件' FONTDATA_ITEM(157, 253, 253, fontpage_157_253_253), // '份' -- '份' FONTDATA_ITEM(158, 145, 145, fontpage_158_145_145), // '休' -- '休' + FONTDATA_ITEM(158, 160, 160, fontpage_158_160_160), // '传' -- '传' FONTDATA_ITEM(158, 205, 206, fontpage_158_205_206), // '位' -- '低' + FONTDATA_ITEM(158, 211, 211, fontpage_158_211_211), // '体' -- '体' + FONTDATA_ITEM(158, 217, 217, fontpage_158_217_217), // '余' -- '余' FONTDATA_ITEM(158, 220, 220, fontpage_158_220_220), // '作' -- '作' + FONTDATA_ITEM(158, 255, 255, fontpage_158_255_255), // '使' -- '使' FONTDATA_ITEM(159, 155, 155, fontpage_159_155_155), // '供' -- '供' + FONTDATA_ITEM(159, 181, 181, fontpage_159_181_181), // '侵' -- '侵' 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, 190, 190, fontpage_160_190_190), // '倾' -- '倾' 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(161, 207, 207, fontpage_161_207_207), // '像' -- '像' FONTDATA_ITEM(162, 197, 197, fontpage_162_197_197), // '充' -- '充' - FONTDATA_ITEM(162, 200, 200, fontpage_162_200_200), // '先' -- '先' + FONTDATA_ITEM(162, 200, 201, fontpage_162_200_201), // '先' -- '光' 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, 151, 151, fontpage_163_151_151), // '冗' -- '冗' 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, 134, 135, fontpage_164_134_135), // '分' -- '切' FONTDATA_ITEM(164, 155, 155, fontpage_164_155_155), // '创' -- '创' FONTDATA_ITEM(164, 157, 157, fontpage_164_157_157), // '初' -- '初' + FONTDATA_ITEM(164, 171, 171, fontpage_164_171_171), // '别' -- '别' FONTDATA_ITEM(164, 176, 176, fontpage_164_176_176), // '到' -- '到' FONTDATA_ITEM(164, 182, 183, fontpage_164_182_183), // '制' -- '刷' + FONTDATA_ITEM(164, 242, 242, fontpage_164_242_242), // '割' -- '割' FONTDATA_ITEM(165, 155, 155, fontpage_165_155_155), // '力' -- '力' - FONTDATA_ITEM(165, 160, 160, fontpage_165_160_160), // '加' -- '加' + FONTDATA_ITEM(165, 159, 160, fontpage_165_159_160), // '功' -- '加' FONTDATA_ITEM(165, 168, 168, fontpage_165_168_168), // '动' -- '动' FONTDATA_ITEM(166, 150, 150, fontpage_166_150_150), // '化' -- '化' + FONTDATA_ITEM(166, 199, 199, fontpage_166_199_199), // '升' -- '升' 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, 240, 241, fontpage_166_240_241), // '印' -- '危' + FONTDATA_ITEM(166, 244, 244, fontpage_166_244_244), // '却' -- '却' FONTDATA_ITEM(166, 248, 248, fontpage_166_248_248), // '卸' -- '卸' + FONTDATA_ITEM(167, 139, 139, fontpage_167_139_139), // '压' -- '压' FONTDATA_ITEM(167, 159, 159, fontpage_167_159_159), // '原' -- '原' - FONTDATA_ITEM(167, 204, 204, fontpage_167_204_204), // '双' -- '双' + FONTDATA_ITEM(167, 204, 205, fontpage_167_204_205), // '双' -- '反' 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, 131, 131, fontpage_168_131_131), // '吃' -- '吃' FONTDATA_ITEM(168, 136, 136, fontpage_168_136_136), // '合' -- '合' - FONTDATA_ITEM(168, 142, 142, fontpage_168_142_142), // '后' -- '后' + FONTDATA_ITEM(168, 141, 142, fontpage_168_141_142), // '名' -- '后' + FONTDATA_ITEM(168, 145, 145, fontpage_168_145_145), // '向' -- '向' + FONTDATA_ITEM(168, 166, 166, fontpage_168_166_166), // '否' -- '否' FONTDATA_ITEM(168, 175, 175, fontpage_168_175_175), // '启' -- '启' + FONTDATA_ITEM(168, 202, 202, fontpage_168_202_202), // '告' -- '告' + FONTDATA_ITEM(168, 232, 232, fontpage_168_232_232), // '周' -- '周' FONTDATA_ITEM(168, 253, 253, fontpage_168_253_253), // '命' -- '命' FONTDATA_ITEM(169, 140, 140, fontpage_169_140_140), // '和' -- '和' + FONTDATA_ITEM(169, 205, 205, fontpage_169_205_205), // '响' -- '响' 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(172, 232, 232, fontpage_172_232_232), // '器' -- '器' FONTDATA_ITEM(173, 222, 222, fontpage_173_222_222), // '回' -- '回' FONTDATA_ITEM(173, 224, 224, fontpage_173_224_224), // '因' -- '因' + FONTDATA_ITEM(173, 250, 250, fontpage_173_250_250), // '固' -- '固' FONTDATA_ITEM(173, 254, 254, fontpage_173_254_254), // '图' -- '图' FONTDATA_ITEM(174, 168, 168, fontpage_174_168_168), // '在' -- '在' + FONTDATA_ITEM(174, 207, 207, fontpage_174_207_207), // '坏' -- '坏' 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), // '垫' -- '垫' @@ -1116,6 +1551,8 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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(178, 180, 180, fontpage_178_180_180), // '头' -- '头' + FONTDATA_ITEM(178, 253, 253, fontpage_178_253_253), // '好' -- '好' 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), // '存' -- '存' @@ -1123,12 +1560,14 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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, 171, 171, fontpage_183_171_171), // '宫' -- '宫' FONTDATA_ITEM(183, 249, 249, fontpage_183_249_249), // '对' -- '对' + FONTDATA_ITEM(184, 134, 134, fontpage_184_134_134), // '将' -- '将' 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, 238, 238, fontpage_187_238_238), // '差' -- '差' 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), // '并' -- '并' @@ -1137,15 +1576,22 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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, 131, 131, fontpage_190_131_131), // '弃' -- '弃' + FONTDATA_ITEM(190, 143, 143, fontpage_190_143_143), // '式' -- '式' + FONTDATA_ITEM(190, 149, 149, fontpage_190_149_149), // '引' -- '引' + FONTDATA_ITEM(190, 185, 185, fontpage_190_185_185), // '弹' -- '弹' FONTDATA_ITEM(190, 210, 210, fontpage_190_210_210), // '归' -- '归' FONTDATA_ITEM(191, 132, 133, fontpage_191_132_133), // '径' -- '待' + FONTDATA_ITEM(191, 170, 170, fontpage_191_170_170), // '循' -- '循' FONTDATA_ITEM(191, 174, 174, fontpage_191_174_174), // '微' -- '微' FONTDATA_ITEM(191, 195, 195, fontpage_191_195_195), // '心' -- '心' + FONTDATA_ITEM(191, 253, 253, fontpage_191_253_253), // '忽' -- '忽' 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(194, 159, 159, fontpage_194_159_159), // '感' -- '感' + FONTDATA_ITEM(196, 143, 144, fontpage_196_143_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), // '扇' -- '扇' @@ -1154,80 +1600,114 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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, 165, 165, fontpage_197_165_165), // '报' -- '报' + FONTDATA_ITEM(197, 172, 172, fontpage_197_172_172), // '抬' -- '抬' 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, 223, 223, fontpage_198_223_223), // '损' -- '损' 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, 165, 165, fontpage_199_165_165), // '接' -- '接' FONTDATA_ITEM(199, 167, 167, fontpage_199_167_167), // '控' -- '控' + FONTDATA_ITEM(199, 208, 208, fontpage_199_208_208), // '提' -- '提' 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, 242, 242, fontpage_202_242_242), // '敲' -- '敲' FONTDATA_ITEM(202, 244, 244, fontpage_202_244_244), // '整' -- '整' + FONTDATA_ITEM(203, 135, 135, fontpage_203_135_135), // '文' -- '文' FONTDATA_ITEM(203, 153, 153, fontpage_203_153_153), // '料' -- '料' FONTDATA_ITEM(203, 156, 156, fontpage_203_156_156), // '斜' -- '斜' + FONTDATA_ITEM(203, 173, 173, fontpage_203_173_173), // '断' -- '断' FONTDATA_ITEM(203, 176, 176, fontpage_203_176_176), // '新' -- '新' + FONTDATA_ITEM(203, 185, 185, fontpage_203_185_185), // '方' -- '方' 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(204, 175, 175, fontpage_204_175_175), // '是' -- '是' 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, 159, 159, fontpage_206_159_159), // '期' -- '期' FONTDATA_ITEM(206, 186, 186, fontpage_206_186_186), // '机' -- '机' FONTDATA_ITEM(206, 192, 192, fontpage_206_192_192), // '杀' -- '杀' + FONTDATA_ITEM(206, 223, 223, fontpage_206_223_223), // '束' -- '束' 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, 151, 151, fontpage_207_151_151), // '林' -- '林' 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, 175, 175, fontpage_209_175_175), // '梯' -- '梯' FONTDATA_ITEM(209, 192, 192, fontpage_209_192_192), // '检' -- '检' FONTDATA_ITEM(211, 253, 253, fontpage_211_253_253), // '槽' -- '槽' + FONTDATA_ITEM(212, 161, 161, fontpage_212_161_161), // '模' -- '模' FONTDATA_ITEM(212, 217, 217, fontpage_212_217_217), // '橙' -- '橙' - FONTDATA_ITEM(214, 226, 226, fontpage_214_226_226), // '止' -- '止' + FONTDATA_ITEM(214, 226, 227, fontpage_214_226_227), // '止' -- '正' 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(217, 232, 232, fontpage_217_232_232), // '注' -- '注' + FONTDATA_ITEM(218, 151, 151, fontpage_218_151_151), // '洗' -- '洗' FONTDATA_ITEM(218, 187, 187, fontpage_218_187_187), // '活' -- '活' + FONTDATA_ITEM(218, 193, 193, fontpage_218_193_193), // '流' -- '流' 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(219, 247, 247, fontpage_219_247_247), // '混' -- '混' FONTDATA_ITEM(220, 133, 133, fontpage_220_133_133), // '清' -- '清' FONTDATA_ITEM(220, 169, 169, fontpage_220_169_169), // '温' -- '温' + FONTDATA_ITEM(220, 184, 184, fontpage_220_184_184), // '游' -- '游' FONTDATA_ITEM(221, 144, 144, fontpage_221_144_144), // '源' -- '源' + FONTDATA_ITEM(221, 162, 162, fontpage_221_162_162), // '溢' -- '溢' + FONTDATA_ITEM(221, 209, 209, fontpage_221_209_209), // '滑' -- '滑' 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, 233, 233, fontpage_228_233_233), // '物' -- '物' FONTDATA_ITEM(228, 249, 249, fontpage_228_249_249), // '特' -- '特' FONTDATA_ITEM(231, 135, 135, fontpage_231_135_135), // '率' -- '率' + FONTDATA_ITEM(231, 175, 175, fontpage_231_175_175), // '环' -- '环' FONTDATA_ITEM(234, 168, 168, fontpage_234_168_168), // '用' -- '用' FONTDATA_ITEM(234, 181, 181, fontpage_234_181_181), // '电' -- '电' + FONTDATA_ITEM(234, 229, 229, fontpage_234_229_229), // '略' -- '略' FONTDATA_ITEM(236, 253, 253, fontpage_236_253_253), // '白' -- '白' FONTDATA_ITEM(237, 132, 132, fontpage_237_132_132), // '的' -- '的' + FONTDATA_ITEM(237, 209, 209, fontpage_237_209_209), // '监' -- '监' 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(240, 238, 238, fontpage_240_238_238), // '确' -- '确' + FONTDATA_ITEM(243, 187, 187, fontpage_243_187_187), // '离' -- '离' FONTDATA_ITEM(243, 251, 251, fontpage_243_251_251), // '移' -- '移' + FONTDATA_ITEM(244, 250, 250, fontpage_244_250_250), // '空' -- '空' FONTDATA_ITEM(245, 239, 239, fontpage_245_239_239), // '端' -- '端' + FONTDATA_ITEM(246, 172, 172, fontpage_246_172_172), // '第' -- '第' FONTDATA_ITEM(246, 201, 201, fontpage_246_201_201), // '等' -- '等' - FONTDATA_ITEM(247, 161, 161, fontpage_247_161_161), // '管' -- '管' + FONTDATA_ITEM(247, 128, 128, fontpage_247_128_128), // '简' -- '简' + FONTDATA_ITEM(247, 177, 177, fontpage_247_177_177), // '箱' -- '箱' FONTDATA_ITEM(248, 251, 251, fontpage_248_251_251), // '类' -- '类' + FONTDATA_ITEM(250, 162, 162, fontpage_250_162_162), // '索' -- '索' FONTDATA_ITEM(250, 171, 171, fontpage_250_171_171), // '紫' -- '紫' FONTDATA_ITEM(253, 162, 162, fontpage_253_162_162), // '红' -- '红' + FONTDATA_ITEM(253, 167, 167, fontpage_253_167_167), // '级' -- '级' 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, 211, 211, fontpage_253_211_211), // '结' -- '结' + FONTDATA_ITEM(253, 217, 217, fontpage_253_217_217), // '给' -- '给' 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), // '绪' -- '绪' @@ -1238,13 +1718,17 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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, 133, 133, fontpage_256_133_133), // '者' -- '者' FONTDATA_ITEM(256, 234, 234, fontpage_256_234_234), // '聪' -- '聪' + FONTDATA_ITEM(257, 253, 253, fontpage_257_253_253), // '能' -- '能' 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(269, 199, 199, fontpage_269_199_199), // '蛇' -- '蛇' 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, 129, 129, fontpage_275_129_129), // '要' -- '要' 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), // '议' -- '议' @@ -1252,8 +1736,15 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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(279, 251, 251, fontpage_279_251_251), // '读' -- '读' FONTDATA_ITEM(280, 131, 131, fontpage_280_131_131), // '调' -- '调' FONTDATA_ITEM(282, 165, 165, fontpage_282_165_165), // '败' -- '败' + FONTDATA_ITEM(282, 170, 170, fontpage_282_170_170), // '贪' -- '贪' + FONTDATA_ITEM(282, 247, 247, fontpage_282_247_247), // '起' -- '起' + FONTDATA_ITEM(283, 133, 133, fontpage_283_133_133), // '超' -- '超' + FONTDATA_ITEM(283, 221, 221, fontpage_283_221_221), // '距' -- '距' + FONTDATA_ITEM(286, 236, 236, fontpage_286_236_236), // '转' -- '转' + FONTDATA_ITEM(286, 239, 239, fontpage_286_239_239), // '软' -- '软' 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), // '辑' -- '辑' @@ -1263,31 +1754,46 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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(287, 222, 222, fontpage_287_222_222), // '连' -- '连' + FONTDATA_ITEM(287, 247, 247, fontpage_287_247_247), // '迷' -- '迷' 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(290, 205, 205, fontpage_290_205_205), // '配' -- '配' 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, 220, 220, fontpage_298_220_220), // '镜' -- '镜' FONTDATA_ITEM(298, 255, 255, fontpage_298_255_255), // '长' -- '长' FONTDATA_ITEM(299, 237, 237, fontpage_299_237_237), // '闭' -- '闭' + FONTDATA_ITEM(299, 242, 242, fontpage_299_242_242), // '闲' -- '闲' FONTDATA_ITEM(299, 244, 244, fontpage_299_244_244), // '间' -- '间' + FONTDATA_ITEM(300, 136, 136, fontpage_300_136_136), // '阈' -- '阈' FONTDATA_ITEM(300, 205, 205, fontpage_300_205_205), // '降' -- '降' FONTDATA_ITEM(300, 228, 228, fontpage_300_228_228), // '除' -- '除' + FONTDATA_ITEM(300, 233, 233, fontpage_300_233_233), // '险' -- '险' + FONTDATA_ITEM(301, 246, 246, fontpage_301_246_246), // '零' -- '零' + FONTDATA_ITEM(302, 128, 128, fontpage_302_128_128), // '需' -- '需' FONTDATA_ITEM(302, 210, 210, fontpage_302_210_210), // '青' -- '青' FONTDATA_ITEM(302, 222, 222, fontpage_302_222_222), // '非' -- '非' + FONTDATA_ITEM(302, 224, 224, fontpage_302_224_224), // '靠' -- '靠' + FONTDATA_ITEM(302, 226, 226, fontpage_302_226_226), // '面' -- '面' + FONTDATA_ITEM(304, 245, 245, fontpage_304_245_245), // '页' -- '页' FONTDATA_ITEM(304, 249, 249, fontpage_304_249_249), // '项' -- '项' FONTDATA_ITEM(305, 132, 132, fontpage_305_132_132), // '预' -- '预' + FONTDATA_ITEM(305, 145, 145, fontpage_305_145_145), // '频' -- '频' 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, 236, 236, fontpage_308_236_236), // '马' -- '马' 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(317, 222, 222, fontpage_317_222_222), // '點' -- '點' + FONTDATA_ITEM(318, 208, 208, fontpage_318_208_208), // '齐' -- '齐' FONTDATA_ITEM(510, 154, 154, fontpage_510_154_154), // ':' -- ':' }; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_zh_TW.h b/Marlin/src/lcd/dogm/fontdata/langdata_zh_TW.h index e1bb97ea3d..20f5acda52 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_zh_TW.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_zh_TW.h @@ -5,1111 +5,1236 @@ */ #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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_141_141[45] U8G_FONT_SECTION("fontpage_156_141_141") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8d,0x8d,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xff,0xe0,0x02,0x00,0x02,0x00,0x04,0x00,0x0d, + 0x00,0x14,0x80,0x24,0x40,0x44,0x20,0x84,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_164_164[45] U8G_FONT_SECTION("fontpage_157_164_164") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa4,0xa4,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x00,0x00,0x11,0x00,0x20, + 0x80,0x51,0x40,0x11,0x00,0x0a,0x00,0x04,0x00,0x1b,0x00,0x60,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,0x0c,0x0f,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,0x0c,0x0f,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_246_246[45] U8G_FONT_SECTION("fontpage_157_246_246") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf6,0xf6,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x15,0x00,0x25,0x00,0x2f,0xc0,0x71, + 0x00,0xa1,0x00,0x2f,0xe0,0x21,0x00,0x21,0x00,0x21,0x00,0x21,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_160_245_245[45] U8G_FONT_SECTION("fontpage_160_245_245") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf5,0xf5,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x23,0xe0,0x22,0x00,0x2f,0xc0,0x68, + 0x40,0xaf,0xc0,0x28,0x40,0x2f,0xc0,0x28,0x40,0x2f,0xc0,0x38,0x60}; 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,0x0c,0x0f,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,0x0c,0x0f,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_161_190_190[45] U8G_FONT_SECTION("fontpage_161_190_190") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbe,0xbe,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x13,0xe0,0x10,0x80,0x2b,0xe0,0x2a,0x20,0x6f, + 0xe0,0xaa,0x20,0x2b,0xe0,0x2e,0x20,0x2b,0xe0,0x31,0x40,0x26,0x20}; 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,0x0c,0x0f,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,0x0c,0x0f,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, +const u8g_fntpgm_uint8_t fontpage_162_200_201[73] U8G_FONT_SECTION("fontpage_162_200_201") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc8,0xc9,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}; + 0x00,0xff,0xe0,0x12,0x00,0x12,0x00,0x12,0x20,0x22,0x20,0xc1,0xe0,0x0b,0x0b,0x16, + 0x0c,0x00,0xff,0x04,0x00,0x44,0x40,0x24,0x80,0x04,0x00,0xff,0xe0,0x12,0x00,0x12, + 0x00,0x12,0x20,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_151_151[43] U8G_FONT_SECTION("fontpage_163_151_151") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x97,0x97,0x00,0x09,0xff,0x00, + 0x00,0x0b,0x0a,0x14,0x0c,0x00,0xff,0x7f,0xe0,0x40,0x20,0x9f,0x40,0x11,0x00,0x11, + 0x00,0x11,0x00,0x11,0x00,0x21,0x20,0x41,0x20,0x80,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_166_251_251[45] U8G_FONT_SECTION("fontpage_166_251_251") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfb,0xfb,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x28,0x00,0x25,0xe0,0x53,0x20,0x99,0x20,0x25, + 0x20,0x43,0x20,0xbd,0x20,0x25,0xa0,0x25,0x40,0x3d,0x00,0x25,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,0x0c,0x0f,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_205_205[45] U8G_FONT_SECTION("fontpage_167_205_205") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcd,0xcd,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x01,0xc0,0x3e,0x00,0x20,0x00,0x20,0x00,0x3f, + 0xc0,0x28,0x80,0x25,0x00,0x22,0x00,0x45,0x00,0x48,0x80,0xb0,0x60}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_166_166[45] U8G_FONT_SECTION("fontpage_168_166_166") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa6,0xa6,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xff,0xe0,0x04,0x00,0x0d,0x80,0x34,0x40,0xc4, + 0x20,0x04,0x00,0x3f,0xc0,0x20,0x40,0x20,0x40,0x3f,0xc0,0x20,0x40}; +const u8g_fntpgm_uint8_t fontpage_168_202_202[45] U8G_FONT_SECTION("fontpage_168_202_202") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xca,0xca,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x24,0x00,0x24,0x00,0x3f,0xc0,0x44,0x00,0x04, + 0x00,0xff,0xe0,0x00,0x00,0x3f,0x80,0x20,0x80,0x20,0x80,0x3f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_232_232[45] U8G_FONT_SECTION("fontpage_172_232_232") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe8,0xe8,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7b,0xc0,0x4a,0x40,0x4a,0x40,0x7b,0xc0,0x04, + 0x80,0xff,0xe0,0x11,0x00,0xfb,0xe0,0x4a,0x40,0x4a,0x40,0x7b,0xc0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_250_250[45] U8G_FONT_SECTION("fontpage_173_250_250") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfa,0xfa,0x00,0x0a,0xff,0x00, + 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0xff,0xc0,0x88,0x40,0x88,0x40,0xff,0x40,0x88, + 0x40,0xbe,0x40,0xa2,0x40,0xa2,0x40,0xbe,0x40,0x80,0x40,0xff,0xc0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_247_247[45] U8G_FONT_SECTION("fontpage_175_247_247") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf7,0xf7,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0xf9,0x00,0x27,0xc0,0xf9,0x40,0x55, + 0x40,0xfb,0x40,0x21,0x40,0xf9,0xc0,0x22,0x40,0x24,0x20,0x28,0x20}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_160_160[45] U8G_FONT_SECTION("fontpage_178_160_160") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa0,0xa0,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x79,0xe0,0x8a,0x20,0x50,0x20,0x23, + 0xa0,0xfa,0xa0,0x2a,0xa0,0xcb,0xa0,0x28,0x20,0x11,0x20,0xe0,0xc0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_181_146_146[45] U8G_FONT_SECTION("fontpage_181_146_146") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x92,0x92,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x24,0x40,0x2f,0xe0,0x24,0x40,0xf7,0xc0,0x54, + 0x40,0x57,0xc0,0x51,0x00,0x2f,0xe0,0x33,0x80,0x4d,0x40,0x89,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_238_238[45] U8G_FONT_SECTION("fontpage_187_238_238") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x80,0x09,0x00,0xff,0xe0,0x04,0x00,0x7f, + 0xc0,0x08,0x00,0xff,0xe0,0x10,0x00,0x2f,0x80,0x42,0x00,0xbf,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_190_149_149[45] U8G_FONT_SECTION("fontpage_190_149_149") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x95,0x95,0x00,0x0a,0xff,0x00, + 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0xfc,0x40,0x04,0x40,0x04,0x40,0x7c,0x40,0x40, + 0x40,0xfc,0x40,0x04,0x40,0x04,0x40,0x04,0x40,0x28,0x40,0x10,0x40}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_165_165[45] U8G_FONT_SECTION("fontpage_199_165_165") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa5,0xa5,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x2f,0xe0,0xf4,0x40,0x22,0x80,0x2f, + 0xe0,0x31,0x00,0x6f,0xe0,0xa2,0x40,0x26,0x80,0x21,0x40,0xee,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,0x0c,0x0f,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_208_208[45] U8G_FONT_SECTION("fontpage_199_208_208") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd0,0xd0,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x27,0xc0,0x24,0x40,0xff,0xc0,0x24,0x40,0x27, + 0xc0,0x30,0x00,0x6f,0xe0,0xa5,0x00,0x25,0xe0,0x2b,0x00,0xf1,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_182_182[45] U8G_FONT_SECTION("fontpage_202_182_182") = { + 0x00,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_183_183[45] U8G_FONT_SECTION("fontpage_203_183_183") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb7,0xb7,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xaa,0x40,0xfd,0x80,0x95,0x00,0xab,0x00,0xff, + 0xe0,0xa9,0x40,0xab,0x40,0xfd,0x40,0x95,0x40,0xab,0x40,0xfe,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,0x0c,0x0f,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_135_135[45] U8G_FONT_SECTION("fontpage_204_135_135") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x87,0x87,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x3f,0xc0,0x20,0x40,0x3f,0xc0,0x20,0x40,0x3f, + 0xc0,0x79,0x00,0x11,0x00,0xff,0xe0,0x11,0x00,0x21,0x00,0xc1,0x00}; 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,0x0c,0x0f,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_175_175[45] U8G_FONT_SECTION("fontpage_204_175_175") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaf,0xaf,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x1f,0x80,0x10,0x80,0x1f,0x80,0x10,0x80,0x1f, + 0x80,0x00,0x00,0xff,0xe0,0x24,0x00,0x27,0x80,0x54,0x00,0x8f,0xe0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_209_196_196[45] U8G_FONT_SECTION("fontpage_209_196_196") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc4,0xc4,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x20,0x80,0x7f,0xc0,0x24, + 0x80,0xff,0xe0,0x24,0x80,0xff,0xe0,0x15,0x00,0x24,0x80,0xc4,0x60}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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, +const u8g_fntpgm_uint8_t fontpage_214_226_227[71] U8G_FONT_SECTION("fontpage_214_226_227") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe2,0xe3,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}; + 0x80,0x24,0x00,0x24,0x00,0x24,0x00,0x24,0x00,0x24,0x00,0xff,0xc0,0x0b,0x0a,0x14, + 0x0c,0x00,0xff,0xff,0xe0,0x04,0x00,0x04,0x00,0x24,0x00,0x27,0xc0,0x24,0x00,0x24, + 0x00,0x24,0x00,0x24,0x00,0xff,0xe0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_233_233[45] U8G_FONT_SECTION("fontpage_228_233_233") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe9,0xe9,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0xa2,0x00,0xa7,0xe0,0xfa,0xa0,0xa2, + 0xa0,0x32,0xa0,0x64,0xa0,0xa9,0x20,0x22,0x20,0x25,0x20,0x28,0xc0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_227_227[45] U8G_FONT_SECTION("fontpage_237_227_227") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe3,0xe3,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xf9,0x00,0xa1,0x00,0xf9,0xe0,0x8a,0x00,0xfa, + 0x80,0xa0,0x40,0xfc,0x00,0x00,0x00,0x7f,0xc0,0x4a,0x40,0xff,0xe0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_241_186_186[45] U8G_FONT_SECTION("fontpage_241_186_186") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xba,0xba,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x01,0x00,0xff,0xe0,0x2a,0x20,0x22,0x80,0x77, + 0xe0,0xd4,0x80,0x5f,0xe0,0x54,0x80,0x77,0xe0,0x54,0x80,0x07,0xe0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_247_177_177[45] U8G_FONT_SECTION("fontpage_247_177_177") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb1,0xb1,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x3d,0xe0,0x4a,0x80,0x94,0x40,0x7f, + 0xc0,0x12,0x40,0x3b,0xc0,0x56,0x40,0x93,0xc0,0x12,0x40,0x13,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,0x0c,0x0f,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_133_133[45] U8G_FONT_SECTION("fontpage_250_133_133") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x85,0x85,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x00,0x27,0xc0,0x41,0x00,0xf1,0x00,0x21, + 0x00,0x51,0x00,0xe9,0x00,0x01,0x00,0x51,0x00,0xa9,0x00,0xaf,0xe0}; +const u8g_fntpgm_uint8_t fontpage_250_162_162[45] U8G_FONT_SECTION("fontpage_250_162_162") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa2,0xa2,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xc0,0x04,0x00,0xff,0xe0,0x91, + 0x20,0x3e,0x00,0x08,0x80,0x7f,0xc0,0x04,0x40,0x24,0x80,0xcc,0x60}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_160_160[45] U8G_FONT_SECTION("fontpage_251_160_160") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa0,0xa0,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x23,0xc0,0x22,0x40,0x57,0x80,0xf0,0x80,0x2f, + 0xe0,0x51,0x20,0xed,0x40,0x03,0x80,0x55,0x40,0xa9,0x20,0xaf,0x20}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_267_205_205[45] U8G_FONT_SECTION("fontpage_267_205_205") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcd,0xcd,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0xff,0xe0,0x91,0x00,0xf9,0xe0,0x8a, + 0x80,0xfc,0x40,0x90,0x00,0xff,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_141_141[45] U8G_FONT_SECTION("fontpage_277_141_141") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8d,0x8d,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x47,0xe0,0xf9,0x20,0x05,0x20,0xf5,0x20,0x02, + 0xe0,0xf4,0x40,0x03,0x00,0xf2,0xa0,0x96,0x20,0xfa,0x40,0x91,0xc0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_128_128[45] U8G_FONT_SECTION("fontpage_279_128_128") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0xff,0xe0,0x01,0x00,0xff,0xe0,0x0a, + 0xa0,0xff,0xe0,0x04,0x40,0xf7,0xc0,0x94,0x40,0xf7,0xc0,0x9c,0x60}; 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,0x0c,0x0f,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,0x0c,0x0f,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_283_221_221[45] U8G_FONT_SECTION("fontpage_283_221_221") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdd,0xdd,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7b,0xe0,0x4a,0x00,0x4a,0x00,0x7b,0xe0,0x12, + 0x20,0x52,0x20,0x5a,0x20,0x53,0xe0,0x52,0x00,0x5e,0x00,0xe3,0xe0}; +const u8g_fntpgm_uint8_t fontpage_285_202_202[45] U8G_FONT_SECTION("fontpage_285_202_202") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xca,0xca,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xc0,0x04,0x00,0x3f,0x80,0x24, + 0x80,0x3f,0x80,0x24,0x80,0x3f,0x80,0x04,0x00,0xff,0xe0,0x04,0x00}; +const u8g_fntpgm_uint8_t fontpage_285_223_223[45] U8G_FONT_SECTION("fontpage_285_223_223") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdf,0xdf,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0xfa,0x00,0x23,0xe0,0xfd,0x20,0xa9, + 0x40,0xf9,0x00,0xa9,0x00,0xf9,0x80,0x22,0x80,0xfa,0x40,0x24,0x20}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_286_201_201[45] U8G_FONT_SECTION("fontpage_286_201_201") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc9,0xc9,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0xff,0xe0,0x25,0x40,0xff,0xc0,0xad, + 0x40,0xff,0xc0,0xa9,0x60,0xff,0xe0,0x24,0x40,0xfa,0x40,0x20,0xc0}; 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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_163_163[45] U8G_FONT_SECTION("fontpage_288_163_163") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa3,0xa3,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x2f,0xe0,0x25,0x40,0x07,0xc0,0xe5, + 0x40,0x27,0xc0,0x21,0x00,0x2f,0xe0,0x21,0x00,0x50,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_203_203[45] U8G_FONT_SECTION("fontpage_291_203_203") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcb,0xcb,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xff,0xe0,0x2a,0xa0,0xaf,0xe0,0x71,0x00,0xff, + 0xe0,0x22,0x80,0x77,0xe0,0x69,0x00,0xa7,0xe0,0xa1,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_142_142[45] U8G_FONT_SECTION("fontpage_301_142_142") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8e,0x8e,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xf8,0x80,0x98,0xa0,0xae,0xc0,0xc8,0xa0,0xae, + 0xe0,0x92,0x00,0x97,0xc0,0xf4,0x40,0xa7,0xc0,0x84,0x40,0x87,0xc0}; 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,0x0c,0x0f,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_226_226[45] U8G_FONT_SECTION("fontpage_301_226_226") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe2,0xe2,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x80,0xfd,0x40,0x55,0xe0,0x6f,0x40,0x55, + 0xe0,0x7d,0x40,0x21,0x40,0xfd,0xe0,0xad,0x40,0xb5,0x40,0x8d,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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,0x0c,0x0f,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_306_152_152[45] U8G_FONT_SECTION("fontpage_306_152_152") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x98,0x98,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x52,0x80,0xac,0x40,0xf8,0x20,0x8f, + 0xc0,0xf9,0x00,0x8f,0xe0,0xf9,0x00,0x95,0x40,0xb9,0x20,0xcb,0x00}; 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,0x0c,0x0f,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,0x0c,0x0f,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_212_212[45] U8G_FONT_SECTION("fontpage_309_212_212") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd4,0xd4,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x79,0x40,0x6b,0xe0,0x5a,0xa0,0xff,0xe0,0x86, + 0xa0,0x7f,0xe0,0x4a,0x40,0x7b,0xc0,0x4a,0x40,0x79,0x80,0x4f,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,0x0c,0x0f,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_195_195[45] U8G_FONT_SECTION("fontpage_317_195_195") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc3,0xc3,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0xff,0xe0,0x11,0x00,0x1f,0x00,0x00, + 0x00,0xff,0xe0,0x24,0x80,0x3f,0x80,0x24,0x80,0x3f,0x80,0xc0,0x60}; 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,0x0c,0x0f,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_318_202_202[45] U8G_FONT_SECTION("fontpage_318_202_202") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xca,0xca,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x0a,0x40,0xf5,0x80,0x55, + 0x40,0x95,0xa0,0x20,0x80,0x3f,0x80,0x20,0x80,0x3f,0x80,0xc0,0x80}; 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,0x0c,0x0f,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, 141, 141, fontpage_156_141_141), // '不' -- '不' 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, 164, 164, fontpage_157_164_164), // '交' -- '交' FONTDATA_ITEM(157, 174, 174, fontpage_157_174_174), // '亮' -- '亮' FONTDATA_ITEM(157, 228, 228, fontpage_157_228_228), // '令' -- '令' + FONTDATA_ITEM(157, 246, 246, fontpage_157_246_246), // '件' -- '件' 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), // '信' -- '信' @@ -1117,15 +1242,18 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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(160, 245, 245, fontpage_160_245_245), // '偵' -- '偵' FONTDATA_ITEM(161, 153, 153, fontpage_161_153_153), // '備' -- '備' FONTDATA_ITEM(161, 179, 179, fontpage_161_179_179), // '傳' -- '傳' + FONTDATA_ITEM(161, 190, 190, fontpage_161_190_190), // '傾' -- '傾' 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, 200, 201, fontpage_162_200_201), // '先' -- '光' 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, 151, 151, fontpage_163_151_151), // '冗' -- '冗' 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), // '出' -- '出' @@ -1137,7 +1265,6 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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), // '半' -- '半' @@ -1145,30 +1272,39 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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(166, 251, 251, fontpage_166_251_251), // '卻' -- '卻' FONTDATA_ITEM(167, 159, 159, fontpage_167_159_159), // '原' -- '原' + FONTDATA_ITEM(167, 205, 205, fontpage_167_205_205), // '反' -- '反' 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, 166, 166, fontpage_168_166_166), // '否' -- '否' + FONTDATA_ITEM(168, 202, 202, fontpage_168_202_202), // '告' -- '告' 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, 232, 232, fontpage_172_232_232), // '器' -- '器' 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, 250, 250, fontpage_173_250_250), // '固' -- '固' 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(175, 247, 247, fontpage_175_247_247), // '執' -- '執' 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, 160, 160, fontpage_178_160_160), // '夠' -- '夠' 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(181, 146, 146, fontpage_181_146_146), // '媒' -- '媒' 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), // '安' -- '安' @@ -1180,12 +1316,14 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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, 238, 238, fontpage_187_238_238), // '差' -- '差' 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(190, 149, 149, fontpage_190_149_149), // '引' -- '引' 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), // '徑' -- '徑' @@ -1204,7 +1342,6 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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), // '抽' -- '抽' @@ -1212,12 +1349,15 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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, 165, 165, fontpage_199_165_165), // '接' -- '接' FONTDATA_ITEM(199, 167, 167, fontpage_199_167_167), // '控' -- '控' + FONTDATA_ITEM(199, 208, 208, fontpage_199_208_208), // '提' -- '提' 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, 182, 182, fontpage_202_182_182), // '收' -- '收' 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), // '整' -- '整' @@ -1225,8 +1365,11 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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, 183, 183, fontpage_203_183_183), // '斷' -- '斷' FONTDATA_ITEM(203, 188, 188, fontpage_203_188_188), // '於' -- '於' + FONTDATA_ITEM(204, 135, 135, fontpage_204_135_135), // '昇' -- '昇' FONTDATA_ITEM(204, 142, 142, fontpage_204_142_142), // '明' -- '明' + FONTDATA_ITEM(204, 175, 175, fontpage_204_175_175), // '是' -- '是' 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), // '更' -- '更' @@ -1237,19 +1380,18 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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(209, 196, 196, fontpage_209_196_196), // '棄' -- '棄' 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, 226, 227, fontpage_214_226_227), // '止' -- '正' 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), // '測' -- '測' @@ -1257,30 +1399,35 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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(228, 233, 233, fontpage_228_233_233), // '物' -- '物' 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, 227, 227, fontpage_237_227_227), // '監' -- '監' 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(241, 186, 186, fontpage_241_186_186), // '確' -- '確' 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(247, 177, 177, fontpage_247_177_177), // '箱' -- '箱' FONTDATA_ITEM(249, 251, 251, fontpage_249_251_251), // '系' -- '系' + FONTDATA_ITEM(250, 133, 133, fontpage_250_133_133), // '紅' -- '紅' + FONTDATA_ITEM(250, 162, 162, fontpage_250_162_162), // '索' -- '索' 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, 160, 160, fontpage_251_160_160), // '綠' -- '綠' 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), // '線' -- '線' @@ -1290,14 +1437,11 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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(267, 205, 205, fontpage_267_205_205), // '藍' -- '藍' 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), // '被' -- '被' @@ -1310,20 +1454,27 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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, 141, 141, fontpage_277_141_141), // '認' -- '認' 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, 128, 128, fontpage_279_128_128), // '讀' -- '讀' FONTDATA_ITEM(279, 138, 138, fontpage_279_138_138), // '變' -- '變' FONTDATA_ITEM(281, 199, 199, fontpage_281_199_199), // '資' -- '資' + FONTDATA_ITEM(283, 221, 221, fontpage_283_221_221), // '距' -- '距' + FONTDATA_ITEM(285, 202, 202, fontpage_285_202_202), // '車' -- '車' + FONTDATA_ITEM(285, 223, 223, fontpage_285_223_223), // '軟' -- '軟' 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(286, 201, 201, fontpage_286_201_201), // '轉' -- '轉' 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, 163, 163, fontpage_288_163_163), // '連' -- '連' 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), // '達' -- '達' @@ -1331,7 +1482,7 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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, 203, 203, fontpage_291_203_203), // '釋' -- '釋' 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), // '針' -- '針' @@ -1345,7 +1496,9 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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, 142, 142, fontpage_301_142_142), // '階' -- '階' FONTDATA_ITEM(301, 217, 217, fontpage_301_217_217), // '雙' -- '雙' + FONTDATA_ITEM(301, 226, 226, fontpage_301_226_226), // '離' -- '離' 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), // '非' -- '非' @@ -1354,13 +1507,15 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { 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(306, 152, 152, fontpage_306_152_152), // '餘' -- '餘' FONTDATA_ITEM(307, 172, 172, fontpage_307_172_172), // '馬' -- '馬' FONTDATA_ITEM(308, 197, 197, fontpage_308_197_197), // '驅' -- '驅' + FONTDATA_ITEM(309, 212, 212, fontpage_309_212_212), // '體' -- '體' FONTDATA_ITEM(309, 216, 216, fontpage_309_216_216), // '高' -- '高' - FONTDATA_ITEM(317, 196, 196, fontpage_317_196_196), // '黄' -- '黄' + FONTDATA_ITEM(317, 195, 195, fontpage_317_195_195), // '黃' -- '黃' FONTDATA_ITEM(317, 222, 222, fontpage_317_222_222), // '點' -- '點' + FONTDATA_ITEM(318, 202, 202, fontpage_318_202_202), // '齊' -- '齊' FONTDATA_ITEM(510, 154, 154, fontpage_510_154_154), // ':' -- ':' }; diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index be414ab303..bdd9f25703 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -48,6 +48,10 @@ #include "../../feature/spindle_laser.h" #endif +#if HAS_POWER_MONITOR + #include "../../feature/power_monitor.h" +#endif + #if ENABLED(SDSUPPORT) #include "../../sd/cardreader.h" #endif @@ -56,7 +60,7 @@ #include "../../module/printcounter.h" #endif -#if DUAL_MIXING_EXTRUDER +#if HAS_DUAL_MIXING #include "../../feature/mixing.h" #endif @@ -103,7 +107,65 @@ #define STATUS_HEATERS_BOT (STATUS_HEATERS_Y + STATUS_HEATERS_HEIGHT - 1) #endif +#if HAS_POWER_MONITOR + + void display_power_monitor(const uint8_t x, const uint8_t y) { + + lcd_moveto(x, y); + + #if HAS_POWER_MONITOR_WATTS + const bool wflag = power_monitor.power_display_enabled(); + #endif + #if ENABLED(POWER_MONITOR_CURRENT) + const bool iflag = power_monitor.current_display_enabled(); + #endif + #if HAS_POWER_MONITOR_VREF + const bool vflag = power_monitor.voltage_display_enabled(); + #endif + + #if HAS_POWER_MONITOR_WATTS + // Cycle between current, voltage, and power + if (ELAPSED(millis(), power_monitor.display_item_ms)) { + power_monitor.display_item_ms = millis() + 1000UL; + ++power_monitor.display_item; + } + #elif ENABLED(POWER_MONITOR_CURRENT) + power_monitor.display_item = 0; + #elif HAS_POWER_MONITOR_VREF + power_monitor.display_item = 1; + #endif + + // ensure we have the right one selected for display + for (uint8_t i = 0; i < 3; i++) { + #if ENABLED(POWER_MONITOR_CURRENT) + if (power_monitor.display_item == 0 && !iflag) ++power_monitor.display_item; + #endif + #if HAS_POWER_MONITOR_VREF + if (power_monitor.display_item == 1 && !vflag) ++power_monitor.display_item; + #endif + #if HAS_POWER_MONITOR_WATTS + if (power_monitor.display_item == 2 && !wflag) ++power_monitor.display_item; + #endif + if (power_monitor.display_item >= 3) power_monitor.display_item = 0; + } + + switch (power_monitor.display_item) { + #if ENABLED(POWER_MONITOR_CURRENT) // Current + case 0: if (iflag) power_monitor.draw_current(); break; + #endif + #if HAS_POWER_MONITOR_VREF // Voltage + case 1: if (vflag) power_monitor.draw_voltage(); break; + #endif + #if HAS_POWER_MONITOR_WATTS // Power + case 2: if (wflag) power_monitor.draw_power(); break; + #endif + default: break; + } + } +#endif + #define PROGRESS_BAR_X 54 +#define PROGRESS_BAR_Y (EXTRAS_BASELINE + 1) #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) { @@ -142,7 +204,7 @@ FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, cons #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) + #elif BOTH(ANIM_HOTEND, STATUS_HOTEND_INVERTED) #define OFF_BMP(N) status_hotend##N##_b_bmp #define ON_BMP(N) status_hotend##N##_a_bmp #else @@ -305,12 +367,7 @@ FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, cons // 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 AxisEnum a = TERN(LCD_SHOW_E_TOTAL, axis == E_AXIS ? X_AXIS : axis, 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); @@ -332,11 +389,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const void MarlinUI::draw_status_screen() { - static char xstring[5 - #if ENABLED(LCD_SHOW_E_TOTAL) - + 7 - #endif - ], ystring[5], zstring[8]; + static char xstring[TERN(LCD_SHOW_E_TOTAL, 12, 5)], ystring[5], zstring[8]; #if ENABLED(FILAMENT_LCD_DISPLAY) static char wstring[5], mstring[4]; #endif @@ -365,11 +418,7 @@ void MarlinUI::draw_status_screen() { #endif #endif - const bool showxy = (true - #if ENABLED(LCD_SHOW_E_TOTAL) - && !printingIsActive() - #endif - ); + const bool show_e_total = TERN0(LCD_SHOW_E_TOTAL, printingIsActive() || marlin_state == MF_SD_COMPLETE); // At the first page, generate new display values if (first_page) { @@ -378,31 +427,27 @@ void MarlinUI::draw_status_screen() { #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 (TERN0(ANIM_BED, thermalManager.isHeatingBed())) SBI(new_bits, HEATBIT_BED); #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 + if (TERN0(ANIM_CUTTER, cutter.enabled())) SBI(new_bits, HEATBIT_CUTTER); 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 (show_e_total) { #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 } + else { + strcpy(xstring, ftostr4sign(lpos.x)); + strcpy(ystring, ftostr4sign(lpos.y)); + } #if ENABLED(FILAMENT_LCD_DISPLAY) strcpy(wstring, ftostr12ns(filwidth.measured_mm)); @@ -411,13 +456,7 @@ void MarlinUI::draw_status_screen() { // 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 - ; + const progress_t progress = TERN(HAS_PRINT_PROGRESS_PERMYRIAD, get_progress_permyriad, get_progress_percent)(); duration_t elapsed = print_job_timer.duration(); const uint8_t p = progress & 0xFF, ev = elapsed.value & 0xFF; if (p != lastProgress) { @@ -433,15 +472,9 @@ void MarlinUI::draw_status_screen() { estimation_x_pos = _SD_INFO_X(0); #endif } - else { - strcpy(progress_string, ( - #if ENABLED(PRINT_PROGRESS_SHOW_DECIMALS) - permyriadtostr4(progress) - #else - ui8tostr3rj(progress / (PROGRESS_SCALE)) - #endif - )); - } + else + strcpy(progress_string, TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(progress), ui8tostr3rj(progress / (PROGRESS_SCALE)))); + #if BOTH(SHOW_REMAINING_TIME, ROTATE_PROGRESS_DISPLAY) // Tri-state progress display mode progress_x_pos = _SD_INFO_X(strlen(progress_string) + 1); #endif @@ -569,21 +602,24 @@ void MarlinUI::draw_status_screen() { // 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, i16tostr3rj(cutter.powerPercent(cutter.power))); - lcd_put_wchar('%'); + if (cutter.isReady && PAGE_CONTAINS(STATUS_CUTTER_TEXT_Y - INFO_FONT_ASCENT, STATUS_CUTTER_TEXT_Y - 1)) { + #if CUTTER_UNIT_IS(PERCENT) + lcd_put_u8str(STATUS_CUTTER_TEXT_X, STATUS_CUTTER_TEXT_Y, cutter_power2str(cutter.unitPower)); + lcd_put_wchar('%'); + #elif CUTTER_UNIT_IS(RPM) + lcd_put_u8str(STATUS_CUTTER_TEXT_X - 2, STATUS_CUTTER_TEXT_Y, ftostr51rj(float(cutter.unitPower) / 1000)); + lcd_put_wchar('K'); + #else + lcd_put_u8str(STATUS_CUTTER_TEXT_X, STATUS_CUTTER_TEXT_Y, cutter_power2str(cutter.unitPower)); + #endif } #endif // Heated Bed - #if DO_DRAW_BED - _draw_bed_status(blink); - #endif + TERN_(DO_DRAW_BED, _draw_bed_status(blink)); // Heated Chamber - #if DO_DRAW_CHAMBER - _draw_chamber_status(); - #endif + TERN_(DO_DRAW_CHAMBER, _draw_chamber_status()); // Fan, if a bitmap was provided #if DO_DRAW_FAN @@ -625,15 +661,15 @@ void MarlinUI::draw_status_screen() { // Progress bar frame // - if (PAGE_CONTAINS(49, 52)) - u8g.drawFrame(PROGRESS_BAR_X, 49, PROGRESS_BAR_WIDTH, 4); + if (PAGE_CONTAINS(PROGRESS_BAR_Y, PROGRESS_BAR_Y + 3)) + u8g.drawFrame(PROGRESS_BAR_X, PROGRESS_BAR_Y, 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(PROGRESS_BAR_Y + 1, PROGRESS_BAR_Y + 2)) + u8g.drawBox(PROGRESS_BAR_X + 1, PROGRESS_BAR_Y + 1, progress_bar_solid_width, 2); if (PAGE_CONTAINS(EXTRAS_BASELINE - INFO_FONT_ASCENT, EXTRAS_BASELINE - 1)) { @@ -667,7 +703,7 @@ void MarlinUI::draw_status_screen() { #if ENABLED(DOGM_SD_PERCENT) if (progress_string[0]) { - lcd_put_u8str(55, 48, progress_string); // Percent complete + lcd_put_u8str(55, EXTRAS_BASELINE, progress_string); // Percent complete lcd_put_wchar('%'); } #endif @@ -694,7 +730,7 @@ void MarlinUI::draw_status_screen() { // XYZ Coordinates // - #if ENABLED(XYZ_HOLLOW_FRAME) + #if EITHER(XYZ_NO_FRAME, XYZ_HOLLOW_FRAME) #define XYZ_FRAME_TOP 29 #define XYZ_FRAME_HEIGHT INFO_FONT_ASCENT + 3 #else @@ -704,54 +740,56 @@ void MarlinUI::draw_status_screen() { 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 + #if DISABLED(XYZ_NO_FRAME) + #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 #endif if (PAGE_CONTAINS(XYZ_BASELINE - (INFO_FONT_ASCENT - 1), XYZ_BASELINE)) { - #if DISABLED(XYZ_HOLLOW_FRAME) + #if NONE(XYZ_NO_FRAME, XYZ_HOLLOW_FRAME) u8g.setColorIndex(0); // white on black #endif - #if DUAL_MIXING_EXTRUDER + #if HAS_DUAL_MIXING // Two-component mix / gradient instead of XY char mixer_messages[12]; - const char *mix_label; + PGM_P mix_label; #if ENABLED(GRADIENT_MIX) if (mixer.gradient.enabled) { mixer.update_mix_from_gradient(); - mix_label = "Gr"; + mix_label = PSTR("Gr"); } else #endif { mixer.update_mix_from_vtool(); - mix_label = "Mx"; + mix_label = PSTR("Mx"); } - sprintf_P(mixer_messages, PSTR("%s %d;%d%% "), mix_label, int(mixer.mix[0]), int(mixer.mix[1])); + sprintf_P(mixer_messages, PSTR(S_FMT " %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 { + if (show_e_total) { _draw_axis_value(E_AXIS, xstring, true); lcd_put_u8str_P(PSTR(" ")); } + else { + _draw_axis_value(X_AXIS, xstring, blink); + _draw_axis_value(Y_AXIS, ystring, blink); + } #endif _draw_axis_value(Z_AXIS, zstring, blink); - #if DISABLED(XYZ_HOLLOW_FRAME) + #if NONE(XYZ_NO_FRAME, XYZ_HOLLOW_FRAME) u8g.setColorIndex(1); // black on white #endif } @@ -799,26 +837,36 @@ void MarlinUI::draw_status_screen() { lcd_put_wchar(':'); lcd_put_u8str(mstring); lcd_put_wchar('%'); + return; } - else #endif - draw_status_message(blink); + + 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); + uint8_t lcd_width = LCD_WIDTH, pixel_width = LCD_PIXEL_WIDTH, + slen = utf8_strlen(status_message); + + #if HAS_POWER_MONITOR + if (power_monitor.display_enabled()) { + // make room at the end of the status line for the power monitor reading + lcd_width -= 6; + pixel_width -= (MENU_FONT_WIDTH) * 6; + } + #endif #if ENABLED(STATUS_MESSAGE_SCROLLING) static bool last_blink = false; - if (slen <= LCD_WIDTH) { + 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; } + while (slen < lcd_width) { lcd_put_wchar(' '); ++slen; } } else { // String is longer than the available space @@ -827,20 +875,21 @@ void MarlinUI::draw_status_message(const bool blink) { // and the string remaining length uint8_t rlen; const char *stat = status_and_len(rlen); - lcd_put_u8str_max(stat, LCD_PIXEL_WIDTH); + lcd_put_u8str_max(stat, pixel_width); // If the remaining string doesn't completely fill the screen - if (rlen < LCD_WIDTH) { + 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 + 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_u8str_max(status_message, pixel_width - (rlen + 2) * (MENU_FONT_WIDTH)); lcd_put_wchar(' '); } } } + if (last_blink != blink) { last_blink = blink; advance_status_scroll(); @@ -852,12 +901,16 @@ void MarlinUI::draw_status_message(const bool blink) { UNUSED(blink); // Just print the string to the LCD - lcd_put_u8str_max(status_message, LCD_PIXEL_WIDTH); + lcd_put_u8str_max(status_message, pixel_width); // Fill the rest with spaces - for (; slen < LCD_WIDTH; ++slen) lcd_put_wchar(' '); + for (; slen < lcd_width; ++slen) lcd_put_wchar(' '); #endif // !STATUS_MESSAGE_SCROLLING + + #if HAS_POWER_MONITOR + display_power_monitor(pixel_width + MENU_FONT_WIDTH, STATUS_BASELINE); + #endif } #endif // HAS_GRAPHICAL_LCD && !LIGHTWEIGHT_UI diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp index e623776b31..9338ab82e8 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp @@ -431,7 +431,7 @@ void ST7920_Lite_Status_Screen::draw_static_elements() { // Draw the static icons in GDRAM draw_gdram_icon(0, 0, nozzle_icon); - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND draw_gdram_icon(0, 1, nozzle_icon); draw_gdram_icon(0, 2, bed_icon); #else @@ -537,14 +537,9 @@ void ST7920_Lite_Status_Screen::draw_heat_icon(const bool whichIcon, const bool static struct { bool E1_show_target : 1; bool E2_show_target : 1; - #if HAS_HEATED_BED - bool bed_show_target : 1; - #endif + TERN_(HAS_HEATED_BED, bool bed_show_target : 1); } display_state = { - true, true - #if HAS_HEATED_BED - , true - #endif + true, true, TERN_(HAS_HEATED_BED, true) }; void ST7920_Lite_Status_Screen::draw_temps(uint8_t line, const int16_t temp, const int16_t target, bool showTarget, bool targetStateChange) { @@ -584,7 +579,7 @@ void ST7920_Lite_Status_Screen::draw_extruder_2_temp(const int16_t temp, const i #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); + draw_temps(TERN(HAS_MULTI_HOTEND, 2, 1), temp, target, show_target, display_state.bed_show_target != show_target || forceUpdate); display_state.bed_show_target = show_target; } #endif @@ -672,11 +667,7 @@ void ST7920_Lite_Status_Screen::draw_position(const xyze_pos_t &pos, const bool // 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 - ) { + if (TERN1(LCD_SHOW_E_TOTAL, !printingIsActive())) { write_byte(alt_label ? alt_label : 'X'); write_str(dtostrf(pos.x, -4, 0, str), 4); @@ -704,7 +695,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() { 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 + #if HAS_MULTI_HOTEND const int16_t extruder_2_target = thermalManager.degTargetHotend(1); #endif #if HAS_HEATED_BED @@ -712,13 +703,8 @@ bool ST7920_Lite_Status_Screen::indicators_changed() { #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 - ; + ^ TERN0(HAS_MULTI_HOTEND, extruder_2_target) + ^ TERN0(HAS_HEATED_BED, bed_target); if (last_checksum == checksum) return false; last_checksum = checksum; return true; @@ -731,7 +717,7 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) { 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 + #if HAS_MULTI_HOTEND const int16_t extruder_2_temp = thermalManager.degHotend(1), extruder_2_target = thermalManager.degTargetHotend(1); #endif @@ -741,12 +727,8 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) { #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 + TERN_(HAS_MULTI_HOTEND, draw_extruder_2_temp(extruder_2_temp, extruder_2_target, forceUpdate)); + TERN_(HAS_HEATED_BED, draw_bed_temp(bed_temp, bed_target, forceUpdate)); uint16_t spd = thermalManager.fan_speed[0]; @@ -761,9 +743,7 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) { // 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 + TERN_(HAS_HEATED_BED, draw_heat_icon(bed_target > 0 && blink, bed_target > 0)); } } @@ -813,9 +793,7 @@ void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) { * 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 + TERN_(STATUS_MESSAGE_SCROLLING, ui.status_scroll_offset = 0); #if STATUS_EXPIRE_SECONDS countdown = ui.status_message[0] ? STATUS_EXPIRE_SECONDS : 0; #endif @@ -823,26 +801,20 @@ void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) { blink_changed(); // Clear changed flag } #if !STATUS_EXPIRE_SECONDS - #if ENABLED(STATUS_MESSAGE_SCROLLING) - else if (blink_changed()) - draw_status_message(); - #endif + else if (TERN0(STATUS_MESSAGE_SCROLLING, blink_changed())) + draw_status_message(); #else else if (blink_changed()) { if (countdown > 1) { countdown--; - #if ENABLED(STATUS_MESSAGE_SCROLLING) - draw_status_message(); - #endif + TERN_(STATUS_MESSAGE_SCROLLING, draw_status_message()); } else if (countdown > 0) { if (position_changed()) { countdown--; forceUpdate = true; } - #if ENABLED(STATUS_MESSAGE_SCROLLING) - draw_status_message(); - #endif + TERN_(STATUS_MESSAGE_SCROLLING, draw_status_message()); } } diff --git a/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp b/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp index 1854ac1c67..70cb7c66d7 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp index 1542d9db0d..e70b3671b5 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp index 599ee2a9ef..838bee0ffc 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp index 206f61c675..fc7a22b261 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -64,7 +64,7 @@ #include -#if ENABLED(LCD_USE_DMA_FSMC) +#ifdef LCD_USE_DMA_FSMC extern void LCD_IO_WriteReg(uint16_t Reg); extern void LCD_IO_WriteData(uint16_t RegValue); extern void LCD_IO_WriteSequence(uint16_t *data, uint16_t length); @@ -79,8 +79,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 X_HI (X_LO + (FSMC_UPSCALE) * WIDTH - 1) +#define Y_HI (Y_LO + (FSMC_UPSCALE) * HEIGHT - 1) // see https://ee-programming-notepad.blogspot.com/2016/10/16-bit-color-generator-picker.html @@ -526,8 +526,29 @@ static const uint16_t ili9341_init[] = { B01111111,B11111111,B11111111,B11111110, }; + #define BUTTON_SIZE_X 32 + #define BUTTON_SIZE_Y 20 + + // 14, 90, 166, 242, 185 are the original values upscaled 2x. + #define BUTTOND_X_LO (14 / 2) * (FSMC_UPSCALE) + #define BUTTOND_X_HI (BUTTOND_X_LO + (FSMC_UPSCALE) * BUTTON_SIZE_X - 1) + + #define BUTTONA_X_LO (90 / 2) * (FSMC_UPSCALE) + #define BUTTONA_X_HI (BUTTONA_X_LO + (FSMC_UPSCALE) * BUTTON_SIZE_X - 1) + + #define BUTTONB_X_LO (166 / 2) * (FSMC_UPSCALE) + #define BUTTONB_X_HI (BUTTONB_X_LO + (FSMC_UPSCALE) * BUTTON_SIZE_X - 1) + + #define BUTTONC_X_LO (242 / 2) * (FSMC_UPSCALE) + #define BUTTONC_X_HI (BUTTONC_X_LO + (FSMC_UPSCALE) * BUTTON_SIZE_X - 1) + + #define BUTTON_Y_LO (140 / 2) * (FSMC_UPSCALE) + 44 //184 2x, 254 3x + #define BUTTON_Y_HI (BUTTON_Y_LO + (FSMC_UPSCALE) * BUTTON_SIZE_Y - 1) + 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]; + uint16_t buffer[BUTTON_SIZE_X * sq(FSMC_UPSCALE)]; + + if (length > BUTTON_SIZE_X) return; for (uint16_t i = 0; i < height; i++) { uint16_t k = 0; @@ -537,20 +558,17 @@ static const uint16_t ili9341_init[] = { v = color; else v = TFT_MARLINBG_COLOR; - buffer[k++] = v; buffer[k++] = v; + LOOP_L_N(n, FSMC_UPSCALE) 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); - } + LOOP_S_L_N(n, 1, FSMC_UPSCALE) + for (uint16_t l = 0; l < length * (FSMC_UPSCALE); l++) + buffer[l + (length * (FSMC_UPSCALE) * n)] = buffer[l]; + + LCD_IO_WriteSequence(buffer, length * sq(FSMC_UPSCALE)); #else - u8g_WriteSequence(u8g, dev, k << 1, (uint8_t *)buffer); - u8g_WriteSequence(u8g, dev, k << 1, (uint8_t *)buffer); + u8g_WriteSequence(u8g, dev, k << 1, (uint8_t*)buffer); + u8g_WriteSequence(u8g, dev, k << 1, (uint8_t*)buffer); #endif } } @@ -569,7 +587,7 @@ 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]; + static uint16_t bufferA[WIDTH * sq(FSMC_UPSCALE)], bufferB[WIDTH * sq(FSMC_UPSCALE)]; uint16_t* buffer = &bufferA[0]; bool allow_async = true; #else @@ -579,7 +597,7 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u case U8G_DEV_MSG_INIT: dev->com_fn(u8g, U8G_COM_MSG_INIT, U8G_SPI_CLK_CYCLE_NONE, &lcd_id); - switch(lcd_id & 0xFFFF) { + switch (lcd_id & 0xFFFF) { case 0x8552: // ST7789V #ifdef LCD_USE_DMA_FSMC writeEscSequence(st7789v_init); @@ -597,6 +615,7 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u setWindow = setWindow_ili9328; break; case 0x9341: // ILI9341 + case 0x8066: // Anycubic / TronXY TFTs (480x320) #ifdef LCD_USE_DMA_FSMC writeEscSequence(ili9341_init); #else @@ -633,28 +652,18 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u u8g_WriteSequence(u8g, dev, 160, (uint8_t *)buffer); #endif - // bottom line and buttons + // Bottom buttons #if ENABLED(TOUCH_BUTTONS) - - setWindow(u8g, dev, 10, 170, 309, 171); - #ifdef LCD_USE_DMA_FSMC - LCD_IO_WriteMultiple(TFT_DISABLED_COLOR, 600); - #else - memset2(buffer, TFT_DISABLED_COLOR, 150); - for (uint8_t i = 8; i--;) - u8g_WriteSequence(u8g, dev, 150, (uint8_t *)buffer); - #endif - - setWindow(u8g, dev, 14, 185, 77, 224); + setWindow(u8g, dev, BUTTOND_X_LO, BUTTON_Y_LO, BUTTOND_X_HI, BUTTON_Y_HI); drawImage(buttonD, u8g, dev, 32, 20, TFT_BTCANCEL_COLOR); - setWindow(u8g, dev, 90, 185, 153, 224); + setWindow(u8g, dev, BUTTONA_X_LO, BUTTON_Y_LO, BUTTONA_X_HI, BUTTON_Y_HI); drawImage(buttonA, u8g, dev, 32, 20, TFT_BTARROWS_COLOR); - setWindow(u8g, dev, 166, 185, 229, 224); + setWindow(u8g, dev, BUTTONB_X_LO, BUTTON_Y_LO, BUTTONB_X_HI, BUTTON_Y_HI); drawImage(buttonB, u8g, dev, 32, 20, TFT_BTARROWS_COLOR); - setWindow(u8g, dev, 242, 185, 305, 224); + setWindow(u8g, dev, BUTTONC_X_LO, BUTTON_Y_LO, BUTTONC_X_HI, BUTTON_Y_HI); drawImage(buttonC, u8g, dev, 32, 20, TFT_BTOKMENU_COLOR); #endif // TOUCH_BUTTONS @@ -678,19 +687,22 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u 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; + LOOP_L_N(n, FSMC_UPSCALE) buffer[k++] = c; } #ifdef LCD_USE_DMA_FSMC - memcpy(&buffer[256], &buffer[0], 512); + LOOP_S_L_N(n, 1, FSMC_UPSCALE) + for (uint16_t l = 0; l < WIDTH * (FSMC_UPSCALE); l++) + buffer[l + WIDTH * (FSMC_UPSCALE) * n] = buffer[l]; + 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 + LCD_IO_WriteSequence(buffer, COUNT(bufferA)); // last line of last page else - LCD_IO_WriteSequence_Async(buffer, 512); + LCD_IO_WriteSequence_Async(buffer, COUNT(bufferA)); } else - LCD_IO_WriteSequence(buffer, 512); + LCD_IO_WriteSequence(buffer, COUNT(bufferA)); #else uint8_t* bufptr = (uint8_t*) buffer; for (uint8_t i = 2; i--;) { diff --git a/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp index 94956e7410..85339e8349 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/dogm/u8g_fontutf8.cpp b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp index b976e2777c..370b177470 100644 --- a/Marlin/src/lcd/dogm/u8g_fontutf8.cpp +++ b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp @@ -140,7 +140,6 @@ static int fontgroup_cb_draw_u8g(void *userdata, const font_t *fnt_current, cons 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)) @@ -256,7 +255,6 @@ static int fontgroup_cb_draw_u8gstrlen(void *userdata, const font_t *fnt_current 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); diff --git a/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp b/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp index fc7656f1cd..22f460afe7 100644 --- a/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp +++ b/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -26,13 +26,13 @@ * 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 + * Demonstrator: https://www.reprap.org/wiki/STB_Electronics + * License: https://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 + * License: https://opensource.org/licenses/BSD-3-Clause */ #include "../../inc/MarlinConfigPre.h" @@ -65,7 +65,7 @@ /** * Include all needed font files - * (See http://marlinfw.org/docs/development/fonts.html) + * (See https://marlinfw.org/docs/development/fonts.html) */ #include "fontdata/fontdata_ISO10646_1.h" #if ENABLED(USE_SMALL_INFOFONT) @@ -123,6 +123,7 @@ bool MarlinUI::detected() { return true; } custom_start_bmp #endif ; + TERN(CUSTOM_BOOTSCREEN_ANIMATED,,UNUSED(frame)); u8g.drawBitmapP(left, top, CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH, CUSTOM_BOOTSCREEN_BMPHEIGHT, bmp); @@ -227,9 +228,7 @@ bool MarlinUI::detected() { return true; } } void MarlinUI::show_bootscreen() { - #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - show_custom_bootscreen(); - #endif + TERN_(SHOW_CUSTOM_BOOTSCREEN, show_custom_bootscreen()); show_marlin_bootscreen(); } @@ -241,19 +240,13 @@ bool MarlinUI::detected() { return true; } // Initialize or re-initialize the LCD void MarlinUI::init_lcd() { - #if DISABLED(MKS_LCD12864B) + #if DISABLED(MKS_LCD12864) #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 - )); + OUT_WRITE(LCD_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); // Illuminate after reset or right away #endif - #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306) + #if ANY(MKS_12864OLED, MKS_12864OLED_SSD1306, FYSETC_242_OLED_12864) SET_OUTPUT(LCD_PINS_DC); #ifndef LCD_RESET_PIN #define LCD_RESET_PIN LCD_PINS_RS @@ -273,28 +266,20 @@ void MarlinUI::init_lcd() { WRITE(LCD_BACKLIGHT_PIN, HIGH); #endif - #if HAS_LCD_CONTRAST - refresh_contrast(); - #endif + TERN_(HAS_LCD_CONTRAST, refresh_contrast()); - #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 + TERN_(LCD_SCREEN_ROT_90, u8g.setRot90()); + TERN_(LCD_SCREEN_ROT_180, u8g.setRot180()); + TERN_(LCD_SCREEN_ROT_270, u8g.setRot270()); - #endif // !MKS_LCD12864B + #endif // !MKS_LCD12864 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 + TERN_(LIGHTWEIGHT_UI, ST7920_Lite_Status_Screen::clear_text_buffer()); const u8g_uint_t h4 = u8g.getHeight() / 4; u8g.firstPage(); do { @@ -333,7 +318,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop #endif // ADVANCED_PAUSE_FEATURE - // Set the colors for a menu item based on whether it is selected + // Mark a menu item and set font color if selected. + // Return 'false' if the item is not on screen. 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; @@ -345,15 +331,13 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop 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.setColorIndex(1); // solid outline u8g.drawBox(0, row_y1 + 2, LCD_PIXEL_WIDTH, MENU_FONT_HEIGHT - 1); - u8g.setColorIndex(0); // white on black + u8g.setColorIndex(0); // inverted text #endif } #if DISABLED(MENU_HOLLOW_FRAME) - else { - u8g.setColorIndex(1); // unmarked text is black on white - } + else u8g.setColorIndex(1); // solid text #endif if (!PAGE_CONTAINS(row_y1, row_y2)) return false; @@ -367,13 +351,15 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop if (mark_as_selected(row, style & SS_INVERT)) { - u8g_uint_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed + pixel_len_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 ((style & SS_CENTER) && !valstr) + for (int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; pad > 0; --pad) { + lcd_put_wchar(' '); + n -= MENU_FONT_WIDTH; + } + + n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH); if (valstr) n -= lcd_put_u8str_max(valstr, n); while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); } @@ -382,7 +368,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop // 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); + pixel_len_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 1) * (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(' '); @@ -390,15 +376,17 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop } // 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) { + void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const inStr, 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); + const uint8_t vallen = (pgm ? utf8_strlen_P(inStr) : utf8_strlen((char*)inStr)), + pixelwidth = (pgm ? uxg_GetUtf8StrPixelWidthP(u8g.getU8g(), inStr) : uxg_GetUtf8StrPixelWidth(u8g.getU8g(), (char*)inStr)); + + pixel_len_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, 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); + lcd_moveto(LCD_PIXEL_WIDTH - _MAX((MENU_FONT_WIDTH) * vallen, pixelwidth + 2), row_y2); + if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str((char*)inStr); } } } @@ -435,7 +423,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop // 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 (onpage) lcd_put_u8str_ind_P(0, baseline, pstr, itemIndex, itemString); // If a value is included, print a colon, then print the value right-justified if (value != nullptr) { @@ -453,8 +441,9 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop } 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); + const u8g_uint_t len = utf8_strlen_P(pstr), + by = (y + 1) * (MENU_FONT_HEIGHT); + const pixel_len_t bw = len * (MENU_FONT_WIDTH), bx = x * (MENU_FONT_WIDTH); if (inv) { u8g.setColorIndex(1); u8g.drawBox(bx - 1, by - (MENU_FONT_ASCENT) + 1, bw + 2, MENU_FONT_HEIGHT - 1); @@ -476,8 +465,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop 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); + const pixel_len_t pixw = maxlen * (MENU_FONT_WIDTH); + pixel_len_t n = pixw - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), pixw); while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); } } diff --git a/Marlin/src/lcd/dogm/ultralcd_DOGM.h b/Marlin/src/lcd/dogm/ultralcd_DOGM.h index 536b8f0bf9..1b6dd0b9de 100644 --- a/Marlin/src/lcd/dogm/ultralcd_DOGM.h +++ b/Marlin/src/lcd/dogm/ultralcd_DOGM.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -70,7 +70,7 @@ #elif ENABLED(U8GLIB_LM6059_AF) - // Based on the Adafruit ST7565 (http://www.adafruit.com/products/250) + // Based on the Adafruit ST7565 (https://www.adafruit.com/products/250) #if ENABLED(ALTERNATIVE_LCD) #define U8G_CLASS U8GLIB_LM6059 // 8 stripes (HW-SPI) @@ -123,6 +123,18 @@ #define U8G_CLASS U8GLIB_SH1106_128X64 // 8 stripes #endif +#elif ENABLED(FYSETC_242_OLED_12864) + + // FYSETC OLED 2.42" 128 × 64 FULL GRAPHICS CONTROLLER + + #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_SH1106) // Generic SH1106 OLED I2C LCD @@ -199,10 +211,18 @@ // 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 + #ifndef LCD_FULL_PIXEL_WIDTH + #define LCD_FULL_PIXEL_WIDTH 320 + #endif + #ifndef LCD_PIXEL_OFFSET_X + #define LCD_PIXEL_OFFSET_X 32 + #endif + #ifndef LCD_FULL_PIXEL_HEIGHT + #define LCD_FULL_PIXEL_HEIGHT 240 + #endif + #ifndef LCD_PIXEL_OFFSET_Y + #define LCD_PIXEL_OFFSET_Y 32 + #endif #endif // For selective rendering within a Y range @@ -210,40 +230,8 @@ #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 +#ifndef FSMC_UPSCALE + #define FSMC_UPSCALE 2 #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/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp index 4e38e554a2..e6bd80c2c2 100644 --- a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp +++ b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -34,19 +34,30 @@ #include "ultralcd_st7920_u8glib_rrd_AVR.h" #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 CPU_ST7920_DELAY_1 + #ifdef BOARD_ST7920_DELAY_1 + #define ST7920_DELAY_1 BOARD_ST7920_DELAY_1 + #else + #define ST7920_DELAY_1 CPU_ST7920_DELAY_1 + #endif #endif #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 CPU_ST7920_DELAY_2 + #ifdef BOARD_ST7920_DELAY_2 + #define ST7920_DELAY_2 BOARD_ST7920_DELAY_2 + #else + #define ST7920_DELAY_2 CPU_ST7920_DELAY_2 + #endif #endif #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 CPU_ST7920_DELAY_3 + #ifdef BOARD_ST7920_DELAY_3 + #define ST7920_DELAY_3 BOARD_ST7920_DELAY_3 + #else + #define ST7920_DELAY_3 CPU_ST7920_DELAY_3 + #endif #endif // Optimize this code with -O3 #pragma GCC optimize (3) - #ifdef ARDUINO_ARCH_STM32F1 #define ST7920_DAT(V) !!((V) & 0x80) #else diff --git a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h index c6e0b9944b..85e76444d4 100644 --- a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h +++ b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -46,11 +46,11 @@ #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) +#elif MB(3DRAG, K8200, K8400) #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) +#elif MB(MINIRAMBO, EINSY_RAMBO, EINSY_RETRO, SILVER_GATE) #define CPU_ST7920_DELAY_1 DELAY_NS(0) #define CPU_ST7920_DELAY_2 DELAY_NS(250) #define CPU_ST7920_DELAY_3 DELAY_NS(0) diff --git a/Marlin/src/lcd/dwin/README.md b/Marlin/src/lcd/dwin/README.md new file mode 100644 index 0000000000..10b05455fd --- /dev/null +++ b/Marlin/src/lcd/dwin/README.md @@ -0,0 +1,7 @@ +# DWIN for Creality Ender 3 v2 + +Marlin's Ender 3 v2 support requires the `DWIN_SET` included with the Ender 3 V2 [example configuration](https://github.com/MarlinFirmware/Configurations/tree/bugfix-2.0.x/config/examples/Creality/Ender-3%20V2). + +## Easy Install + +Copy the `DWIN_SET` folder onto a Micro-SD card and insert the card into the slot on the DWIN screen. Cycle the machine and wait for the screen to go from blue to orange. Turn the machine off and remove the SD card. When you turn on the machine the screen will display a "Creality" loading screen. diff --git a/Marlin/src/lcd/dwin/dwin.cpp b/Marlin/src/lcd/dwin/dwin.cpp new file mode 100644 index 0000000000..f8c1819c51 --- /dev/null +++ b/Marlin/src/lcd/dwin/dwin.cpp @@ -0,0 +1,3529 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * DWIN by Creality3D + */ + +#include "../../inc/MarlinConfigPre.h" + +#if ENABLED(DWIN_CREALITY_LCD) + +#include "dwin.h" + +#include +#include +#include + +#include "../fontutils.h" +#include "../ultralcd.h" + +#include "../../sd/cardreader.h" + +#include "../../MarlinCore.h" +#include "../../core/serial.h" +#include "../../core/macros.h" +#include "../../gcode/queue.h" + +#include "../../feature/powerloss.h" +#include "../../feature/babystep.h" + +#include "../../module/configuration_store.h" +#include "../../module/temperature.h" +#include "../../module/printcounter.h" +#include "../../module/motion.h" +#include "../../module/planner.h" + +#if HAS_LEVELING + #include "../../feature/bedlevel/bedlevel.h" +#endif + +#if HAS_BED_PROBE + #include "../../module/probe.h" +#endif + +#include "../../libs/buzzer.h" + +#ifndef MACHINE_SIZE + #define MACHINE_SIZE "220x220x250" +#endif +#ifndef CORP_WEBSITE_C + #define CORP_WEBSITE_C "www.cxsw3d.com" +#endif +#ifndef CORP_WEBSITE_E + #define CORP_WEBSITE_E "www.creality.com" +#endif + +#define PAUSE_HEAT true + +#define USE_STRING_HEADINGS + +#define MENU_FONT font8x16 +#define STAT_FONT font10x20 +#define HEADER_FONT font10x20 + +#define MENU_CHAR_LIMIT 24 + +// Fan speed limit +#define FANON 255 +#define FANOFF 0 + +// Print speed limit +#define MAX_PRINT_SPEED 999 +#define MIN_PRINT_SPEED 10 + +// Temp limits +#if HAS_HOTEND + #define MAX_E_TEMP (HEATER_0_MAXTEMP - (HOTEND_OVERSHOOT)) + #define MIN_E_TEMP HEATER_0_MINTEMP +#endif + +#if HAS_HEATED_BED + #define MIN_BED_TEMP BED_MINTEMP +#endif + +// Feedspeed limit (max feedspeed = DEFAULT_MAX_FEEDRATE * 2) +#define MIN_MAXFEEDSPEED 1 +#define MIN_MAXACCELERATION 1 +#define MIN_MAXCORNER 0.1 +#define MIN_STEP 1 + +#define FEEDRATE_E (60) + +// Mininum unit (0.1) : multiple (10) +#define MINUNITMULT 10 + +#define ENCODER_WAIT 20 +#define DWIN_SCROLL_UPDATE_INTERVAL 2000 +#define DWIN_REMAIN_TIME_UPDATE_INTERVAL 20000 + +constexpr uint16_t TROWS = 6, MROWS = TROWS - 1, // Total rows, and other-than-Back + TITLE_HEIGHT = 30, // Title bar height + MLINE = 53, // Menu line height + LBLX = 60, // Menu item label X + MENU_CHR_W = 8, STAT_CHR_W = 10; + +#define MBASE(L) (49 + (L)*MLINE) + +#define BABY_Z_VAR TERN(HAS_LEVELING, probe.offset.z, zprobe_zoffset) + +/* Value Init */ +HMI_value_t HMI_ValueStruct; +HMI_Flag HMI_flag{0}; + +millis_t Encoder_ms = 0; +millis_t Wait_ms = 0; +millis_t dwin_heat_time = 0; + +int checkkey = 0, last_checkkey = 0; + +typedef struct { + uint8_t now, last; + void set(uint8_t v) { now = last = v; } + void reset() { set(0); } + bool changed() { bool c = (now != last); if (c) last = now; return c; } + bool dec() { if (now) now--; return changed(); } + bool inc(uint8_t v) { if (now < v) now++; else now = v; return changed(); } +} select_t; + +select_t select_page{0}, select_file{0}, select_print{0}, select_prepare{0} + , select_control{0}, select_axis{0}, select_temp{0}, select_motion{0}, select_tune{0} + , select_PLA{0}, select_ABS{0} + , select_speed{0} + , select_acc{0} + , select_corner{0} + , select_step{0} + // , select_leveling{0} + ; + +uint8_t index_file = MROWS, + index_prepare = MROWS, + index_control = MROWS, + index_leveling = MROWS, + index_tune = 5; + +// char filebuf[50]; + +uint8_t countbuf = 0; + +bool recovery_flag = false, abort_flag = false; + +constexpr float default_max_feedrate[] = DEFAULT_MAX_FEEDRATE; +constexpr float default_max_acceleration[] = DEFAULT_MAX_ACCELERATION; +constexpr float default_max_jerk[] = { DEFAULT_XJERK, DEFAULT_YJERK, DEFAULT_ZJERK, DEFAULT_EJERK }; +constexpr float default_axis_steps_per_unit[] = DEFAULT_AXIS_STEPS_PER_UNIT; + +uint8_t Percentrecord = 0; +uint16_t last_Printtime = 0, remain_time = 0; +float last_temp_hotend_target = 0, last_temp_bed_target = 0; +float last_temp_hotend_current = 0, last_temp_bed_current = 0; +uint8_t last_fan_speed = 0; +uint16_t last_speed = 0; +float last_E_scale = 0; +bool DWIN_lcd_sd_status = 0; +bool pause_action_flag = 0; +int temphot = 0, tempbed = 0; +float zprobe_zoffset = 0; +float last_zoffset = 0, last_probe_zoffset = 0; + +#define DWIN_LANGUAGE_EEPROM_ADDRESS 0x01 // Between 0x01 and 0x63 (EEPROM_OFFSET-1) + // BL24CXX::check() uses 0x00 + +void lcd_select_language(void) { + BL24CXX::read(DWIN_LANGUAGE_EEPROM_ADDRESS, (uint8_t*)&HMI_flag.language_flag, sizeof(HMI_flag.language_flag)); + if (HMI_flag.language_flag) + DWIN_JPG_CacheTo1(Language_Chinese); + else + DWIN_JPG_CacheTo1(Language_English); +} + +void set_english_to_eeprom(void) { + HMI_flag.language_flag = 0; + DWIN_JPG_CacheTo1(Language_English); + BL24CXX::write(DWIN_LANGUAGE_EEPROM_ADDRESS, (uint8_t*)&HMI_flag.language_flag, sizeof(HMI_flag.language_flag)); +} +void set_chinese_to_eeprom(void) { + HMI_flag.language_flag = 1; + DWIN_JPG_CacheTo1(Language_Chinese); + BL24CXX::write(DWIN_LANGUAGE_EEPROM_ADDRESS, (uint8_t*)&HMI_flag.language_flag, sizeof(HMI_flag.language_flag)); +} + +void show_plus_or_minus(uint8_t size, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, long value) { + if (value < 0) { + DWIN_Draw_String(false, true, size, White, bColor, x - 6, y, (char*)"-"); + DWIN_Draw_FloatValue(true, true, 0, size, White, bColor, iNum, fNum, x, y, -value); + } + else { + DWIN_Draw_String(false, true, size, White, bColor, x - 6, y, (char*)" "); + DWIN_Draw_FloatValue(true, true, 0, size, White, bColor, iNum, fNum, x, y, value); + } +} + +void ICON_Print() { + if (select_page.now == 0) { + DWIN_ICON_Show(ICON, ICON_Print_1, 17, 130); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 1, 447, 271 - 243, 479 - 19, 58, 201); + else + DWIN_Frame_AreaCopy(1, 1, 451, 271 - 240, 479 - 16, 72 - 15, 201); + } + else { + DWIN_ICON_Show(ICON, ICON_Print_0, 17, 130); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 1, 405, 271 - 243, 420, 58, 201); + else + DWIN_Frame_AreaCopy(1, 1, 423, 271 - 240, 423 + 12, 72 - 15, 201); + } +} + +void ICON_Prepare() { + if (select_page.now == 1) { + DWIN_ICON_Show(ICON, ICON_Prepare_1, 145, 130); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 31, 447, 271 - 213, 479 - 19, 186, 201); + else + DWIN_Frame_AreaCopy(1, 33, 451, 271 - 189, 479 - 13, 200 - 25, 201); + } + else { + DWIN_ICON_Show(ICON, ICON_Prepare_0, 145, 130); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 31, 405, 271 - 213, 420, 186, 201); + else + DWIN_Frame_AreaCopy(1, 33, 423, 271 - 189, 423 + 15, 200 - 25, 201); + } +} + +void ICON_Control() { + if (select_page.now == 2) { + DWIN_ICON_Show(ICON, ICON_Control_1, 17, 246); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 61, 447, 271 - 183, 479 - 19, 58, 318); + else + DWIN_Frame_AreaCopy(1, 85, 451, 271 - 139, 479 - 16, 72 - 24, 318); + } + else { + DWIN_ICON_Show(ICON, ICON_Control_0, 17, 246); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 61, 405, 271 - 183, 420, 58, 318); + else + DWIN_Frame_AreaCopy(1, 85, 423, 271 - 139, 479 - 45, 72 - 24, 318); + } +} + +void ICON_StartInfo(bool show) { + if (show) { + DWIN_ICON_Show(ICON, ICON_Info_1, 145, 246); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 91, 447, 271 - 153, 479 - 19, 186, 318); + else + DWIN_Frame_AreaCopy(1, 132, 451, 159, 479 - 13, 186, 318); + } + else { + DWIN_ICON_Show(ICON, ICON_Info_0, 145, 246); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 91, 405, 271 - 153, 420, 186, 318); + else + DWIN_Frame_AreaCopy(1, 132, 423, 159, 423 + 12, 186, 318); + } +} + +void ICON_Leveling(bool show) { + if (show) { + DWIN_ICON_Show(ICON, ICON_Leveling_1, 145, 246); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 211, 447, 238, 479 - 19, 186, 318); + else + DWIN_Frame_AreaCopy(1, 84, 437, 120, 449, 200 - 18, 318); + } + else { + DWIN_ICON_Show(ICON, ICON_Leveling_0, 145, 246); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 211, 405, 238, 420, 186, 318); + else + DWIN_Frame_AreaCopy(1, 84, 465, 120, 478, 200 - 18, 318); + } +} + +void ICON_Tune() { + if (select_print.now == 0) { + DWIN_ICON_Show(ICON, ICON_Setup_1, 8, 252); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 121, 447, 271 - 123, 479 - 21, 34, 325); + else + DWIN_Frame_AreaCopy(1, 1, 465, 271 - 237, 479 - 2, 48 - 17, 325); + } + else { + DWIN_ICON_Show(ICON, ICON_Setup_0, 8, 252); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 121, 405, 271 - 123, 420, 34, 325); + else + DWIN_Frame_AreaCopy(1, 1, 438, 271 - 239, 479 - 31, 48 - 17, 325); + } +} + +void ICON_Pause() { + if (select_print.now == 1) { + DWIN_ICON_Show(ICON, ICON_Pause_1, 96, 252); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 181, 447, 271 - 63, 479 - 20, 124, 325); + else + DWIN_Frame_AreaCopy(1, 177, 451, 271 - 55, 479 - 17, 136 - 20, 325); + } + else { + DWIN_ICON_Show(ICON, ICON_Pause_0, 96, 252); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 181, 405, 271 - 63, 420, 124, 325); + else + DWIN_Frame_AreaCopy(1, 177, 423, 271 - 56, 479 - 46, 136 - 20, 325); + } +} + +void ICON_Continue() { + if (select_print.now == 1) { + DWIN_ICON_Show(ICON, ICON_Continue_1, 96, 252); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 1, 447, 271 - 243, 479 - 19, 124, 325); + else + DWIN_Frame_AreaCopy(1, 1, 451, 271 - 239, 479 - 16, 136 - 15, 325); + } + else { + DWIN_ICON_Show(ICON, ICON_Continue_0, 96, 252); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 1, 405, 271 - 243, 420, 124, 325); + else + DWIN_Frame_AreaCopy(1, 1, 424, 271 - 240, 479 - 45, 136 - 15, 325); + } +} + +void ICON_Stop() { + if (select_print.now == 2) { + DWIN_ICON_Show(ICON, ICON_Stop_1, 184, 252); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 151, 447, 271 - 93, 479 - 20, 210, 325); + else + DWIN_Frame_AreaCopy(1, 218, 451, 271 - 22, 479 - 14, 224 - 15, 325); + } + else { + DWIN_ICON_Show(ICON, ICON_Stop_0, 184, 252); + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 151, 405, 271 - 93, 420, 210, 325); + else + DWIN_Frame_AreaCopy(1, 218, 423, 271 - 24, 479 - 43, 224 - 15, 325); + } +} + +inline void Clear_Title_Bar(void) { + DWIN_Draw_Rectangle(1, Background_blue, 0, 0, DWIN_WIDTH, 30); +} + +inline void Draw_Title(const char * const title) { + DWIN_Draw_String(false, false, HEADER_FONT, White, Background_blue, 14, 4, (char*)title); +} + +inline void Clear_Menu_Area(void) { + DWIN_Draw_Rectangle(1, Background_black, 0, 31, 272, 360); +} + +inline void Clear_Main_Window(void) { + Clear_Title_Bar(); + Clear_Menu_Area(); +} + +inline void Clear_Popup_Area(void) { + Clear_Title_Bar(); + DWIN_Draw_Rectangle(1, Background_black, 0, 31, 272, 480); +} + +void Draw_Popup_Bkgd_105(void) { + DWIN_Draw_Rectangle(1, Background_window, 14, 105, 271 - 13, 479 - 105); +} + +inline void Draw_More_Icon(const uint8_t line) { + DWIN_ICON_Show(ICON, ICON_More, 226, 46 + line * MLINE); +} + +inline void Draw_Menu_Cursor(const uint8_t line) { + // DWIN_ICON_Show(ICON,ICON_Rectangle, 0, 31 + line * MLINE); + DWIN_Draw_Rectangle(1, Rectangle_Color, 0, 31 + line * MLINE, 14, 31 + (line + 1) * MLINE - 2); +} + +inline void Erase_Menu_Cursor(const uint8_t line) { + DWIN_Draw_Rectangle(1, Background_black, 0, 31 + line * MLINE, 14, 31 + (line + 1) * MLINE - 2); +} + +inline void Move_Highlight(const int16_t from, const uint16_t newline) { + Erase_Menu_Cursor(newline - from); + Draw_Menu_Cursor(newline); +} + +inline void Add_Menu_Line() { + Move_Highlight(1, MROWS); + DWIN_Draw_Line(Line_Color, 16, 82 + MROWS * MLINE, 256, 83 + MROWS * MLINE); +} + +inline void Scroll_Menu(const uint8_t dir) { + DWIN_Frame_AreaMove(1, dir, MLINE, Background_black, 0, 31, 272, 349); + switch (dir) { + case DWIN_SCROLL_DOWN: Move_Highlight(-1, 0); break; + case DWIN_SCROLL_UP: Add_Menu_Line(); break; + } +} + +inline uint16_t nr_sd_menu_items() { + return card.get_num_Files() + !card.flag.workDirIsRoot; +} + +inline void Draw_Menu_Icon(const uint8_t line, const uint8_t icon) { + DWIN_ICON_Show(ICON, icon, 26, 46 + line * MLINE); +} + +inline void Erase_Menu_Text(const uint8_t line) { + DWIN_Draw_Rectangle(1, Background_black, LBLX, 31 + line * MLINE + 4, 271, 28 + (line + 1) * MLINE - 4); +} + +inline void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, const char * const label=nullptr) { + if (label) DWIN_Draw_String(false, false, font8x16, White, Background_black, LBLX, 48 + line * MLINE, (char*)label); + if (icon) Draw_Menu_Icon(line, icon); + DWIN_Draw_Line(Line_Color, 16, 29 + (line + 1) * MLINE, 256, 30 + (line + 1) * MLINE); +} + +// The "Back" label is always on the first line +inline void Draw_Back_Label(void) { + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 129, 72, 271 - 115, 479 - 395, LBLX, MBASE(0)); + else + DWIN_Frame_AreaCopy(1, 226, 179, 271 - 15, 479 - 290, LBLX, MBASE(0)); +} + +// Draw "Back" line at the top +inline void Draw_Back_First(const bool is_sel=true) { + Draw_Menu_Line(0, ICON_Back); + Draw_Back_Label(); + if (is_sel) Draw_Menu_Cursor(0); +} + +// +// Draw Menus +// + +inline void draw_move_en(const uint16_t line) { + DWIN_Frame_AreaCopy(1, 69, 61, 271 - 169, 479 - 408, LBLX, line); // "Move" +} + +inline void Prepare_Item_Move(const uint8_t row) { + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 159, 70, 271 - 71, 479 - 395, LBLX, MBASE(row)); + else + draw_move_en(MBASE(row)); // "Move >" + Draw_Menu_Line(row, ICON_Axis); + Draw_More_Icon(row); +} + +inline void Prepare_Item_Disable(const uint8_t row) { + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 204, 70, 271 - 12, 479 - 397, LBLX, MBASE(row)); + else + DWIN_Frame_AreaCopy(1, 103, 59, 271 - 71, 479 - 405, LBLX, MBASE(row)); // "Disable Stepper" + Draw_Menu_Line(row, ICON_CloseMotor); +} + +inline void Prepare_Item_Home(const uint8_t row) { + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 0, 89, 271 - 230, 479 - 378, LBLX, MBASE(row)); + else + DWIN_Frame_AreaCopy(1, 202, 61, 271 - 0, 479 - 408, LBLX, MBASE(row)); // "Auto Home" + Draw_Menu_Line(row, ICON_Homing); +} + +inline void Prepare_Item_Offset(const uint8_t row) { + if (HMI_flag.language_flag) { + #if HAS_BED_PROBE + DWIN_Frame_AreaCopy(1, 174, 164, 271 - 48, 479 - 302, LBLX, MBASE(row)); + show_plus_or_minus(font8x16, Background_black, 2, 2, 202, MBASE(row), probe.offset.z * 100); + #else + DWIN_Frame_AreaCopy(1, 43, 89, 271 - 173, 479 - 378, LBLX, MBASE(row)); + #endif + } + else { + #if HAS_BED_PROBE + DWIN_Frame_AreaCopy(1, 93, 179, 271 - 130, 479 - 290, LBLX, MBASE(row)); // "Z-Offset" + show_plus_or_minus(font8x16, Background_black, 2, 2, 202, MBASE(row), probe.offset.z * 100); + #else + DWIN_Frame_AreaCopy(1, 1, 76, 271 - 165, 479 - 393, LBLX, MBASE(row)); // "..." + #endif + } + Draw_Menu_Line(row, ICON_SetHome); +} + +inline void Prepare_Item_PLA(const uint8_t row) { + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 100, 89, 271 - 93 - 27, 479 - 378, LBLX, MBASE(row)); + } + else { + DWIN_Frame_AreaCopy(1, 107, 76, 271 - 115, 479 - 393, LBLX, MBASE(row)); // "Preheat" + DWIN_Frame_AreaCopy(1, 157, 76, 181, 479 - 393, LBLX + 49 + 3, MBASE(row)); // "PLA" + } + Draw_Menu_Line(row, ICON_PLAPreheat); +} + +inline void Prepare_Item_ABS(const uint8_t row) { + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 180, 89, 271 - 11 - 27, 479 - 379, LBLX, MBASE(row)); + } + else { + DWIN_Frame_AreaCopy(1, 107, 76, 271 - 115, 479 - 393, LBLX, MBASE(row)); // "Preheat" + DWIN_Frame_AreaCopy(1, 172, 76, 198, 479 - 393, LBLX + 49 + 3, MBASE(row)); // "ABS" + } + Draw_Menu_Line(row, ICON_ABSPreheat); +} + +inline void Prepare_Item_Cool(const uint8_t row) { + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 1, 104, 271 - 215, 479 - 362, LBLX, MBASE(row)); + else + DWIN_Frame_AreaCopy(1, 200, 76, 271 - 7, 479 - 393, LBLX, MBASE(row));// "Cooldown" + Draw_Menu_Line(row, ICON_Cool); +} + +inline void Prepare_Item_Lang(const uint8_t row) { + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 239, 134, 271 - 5, 479 - 333, LBLX, MBASE(row)); + DWIN_Draw_String(false, false, font8x16, White, Background_black, 226, MBASE(row), (char*)"CN"); + } + else { + DWIN_Frame_AreaCopy(1, 0, 194, 271 - 150, 479 - 272, LBLX, MBASE(row)); // "Language selection" + DWIN_Draw_String(false, false, font8x16, White, Background_black, 226, MBASE(row), (char*)"EN"); + } + Draw_Menu_Icon(row, ICON_Language); +} + +inline void Draw_Prepare_Menu() { + Clear_Main_Window(); + + const int16_t scroll = MROWS - index_prepare; // Scrolled-up lines + #define PSCROL(L) (scroll + (L)) + #define PVISI(L) WITHIN(PSCROL(L), 0, MROWS) + + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 133, 1, 271 - 111, 479 - 465 - 1, 14, 8); // "Prepare" + } + else { + #ifdef USE_STRING_HEADINGS + Draw_Title("Prepare"); // TODO: GET_TEXT_F + #else + DWIN_Frame_AreaCopy(1, 178, 2, 271 - 42, 479 - 464 - 1, 14, 8); // "Prepare" + #endif + } + + if (PVISI(0)) Draw_Back_First(select_prepare.now == 0); // < Back + if (PVISI(1)) Prepare_Item_Move(PSCROL(1)); // Move > + if (PVISI(2)) Prepare_Item_Disable(PSCROL(2)); // Disable Stepper + if (PVISI(3)) Prepare_Item_Home(PSCROL(3)); // Auto Home + if (PVISI(4)) Prepare_Item_Offset(PSCROL(4)); // Z-Offset + if (PVISI(5)) Prepare_Item_PLA(PSCROL(5)); // Preheat PLA + if (PVISI(6)) Prepare_Item_ABS(PSCROL(6)); // Preheat ABS + if (PVISI(7)) Prepare_Item_Cool(PSCROL(7)); // Cooldown + if (PVISI(8)) Prepare_Item_Lang(PSCROL(8)); // Language CN/EN + + if (select_prepare.now) Draw_Menu_Cursor(PSCROL(select_prepare.now)); +} + +inline void Draw_Control_Menu() { + Clear_Main_Window(); + + const int16_t scroll = TERN(HAS_LEVELING, MROWS - index_control, 0); // Scrolled-up lines + + #define CSCROL(L) (scroll + (L)) + #define CLINE(L) MBASE(CSCROL(L)) + #define CVISI(L) WITHIN(CSCROL(L), 0, MROWS) + + if (CVISI(0)) Draw_Back_First(select_control.now == 0); // < Back + + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 103, 1, 271 - 141, 479 - 465, 14, 8); + DWIN_Frame_AreaCopy(1, 57, 104, 271 - 187, 479 - 363, LBLX, CLINE(1)); // Temperature > + DWIN_Frame_AreaCopy(1, 87, 104, 271 - 157, 479 - 363, LBLX, CLINE(2)); // Motion > + DWIN_Frame_AreaCopy(1, 117, 104, 271 - 99, 479 - 363, LBLX, CLINE(3)); // Store Config + DWIN_Frame_AreaCopy(1, 174, 103, 271 - 42, 479 - 363, LBLX, CLINE(4)); // Read Config + DWIN_Frame_AreaCopy(1, 1, 118, 271 - 215, 479 - 348, LBLX, CLINE(5)); // Reset Config + + if (CVISI(6)) + DWIN_Frame_AreaCopy(1, 231, 104, 271 - 13, 479 - 363, LBLX, CLINE(6)); // Info > + } + else { + #ifdef USE_STRING_HEADINGS + Draw_Title("Control"); // TODO: GET_TEXT_F + #else + DWIN_Frame_AreaCopy(1, 128, 2, 271 - 95, 479 - 467, 14, 8); + #endif + + DWIN_Frame_AreaCopy(1, 1, 89, 271 - 188, 479 - 377 - 1, LBLX, CLINE(1));// Temperature > + DWIN_Frame_AreaCopy(1, 84, 89, 271 - 143, 479 - 380, LBLX, CLINE(2));// Motion > + DWIN_Frame_AreaCopy(1, 131 + 17, 89, 271 - 3, 479 - 377 - 1, LBLX, CLINE(3));// "Store Configuration" + + DWIN_Frame_AreaCopy(1, 26, 104, 271 - 214, 479 - 365, LBLX, CLINE(4)); // "Read" + DWIN_Frame_AreaCopy(1, 131 + 51, 89, 271 - 3, 479 - 377 - 1, LBLX + 31 + 3, CLINE(4)); // "Configuration" + + DWIN_Frame_AreaCopy(1, 59, 104, 271 - 178, 479 - 365, LBLX, CLINE(5)); // "Reset" + DWIN_Frame_AreaCopy(1, 131 + 51, 89, 271 - 3, 479 - 377 - 1, LBLX + 34 + 3, CLINE(5)); // "Configuration" + + if (CVISI(6)) + DWIN_Frame_AreaCopy(1, 0, 104, 25, 115, LBLX, CLINE(6)); // Info > + } + + if (select_control.now && CVISI(select_control.now)) + Draw_Menu_Cursor(CSCROL(select_control.now)); + + // Draw icons and lines + LOOP_L_N(i, 6) + if (CVISI(i + 1)) Draw_Menu_Line(CSCROL(i + 1), ICON_Temperature + i); + + Draw_More_Icon(CSCROL(1)); + Draw_More_Icon(CSCROL(2)); + if (CVISI(6)) Draw_More_Icon(CSCROL(6)); +} + +inline void Draw_Tune_Menu() { + Clear_Main_Window(); + + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 73, 2, 271 - 171, 479 - 466, 14, 9); + + DWIN_Frame_AreaCopy(1, 116, 164, 271 - 100, 479 - 303, LBLX, MBASE(1)); + DWIN_Frame_AreaCopy(1, 1, 134, 271 - 215, 479 - 333, LBLX, MBASE(2)); + DWIN_Frame_AreaCopy(1, 58, 134, 271 - 158, 479 - 333, LBLX, MBASE(3)); + DWIN_Frame_AreaCopy(1, 115, 134, 271 - 101, 479 - 333, LBLX, MBASE(4)); + DWIN_Frame_AreaCopy(1, 174, 164, 271 - 48, 479 - 302, LBLX, MBASE(5)); + } + else { + #ifdef USE_STRING_HEADINGS + Draw_Title("Tune"); // TODO: GET_TEXT + #else + DWIN_Frame_AreaCopy(1, 94, 2, 271 - 145, 479 - 467, 14, 9); + #endif + DWIN_Frame_AreaCopy(1, 1, 179, 271 - 179, 479 - 287 - 2, LBLX, MBASE(1)); // print speed + DWIN_Frame_AreaCopy(1, 197, 104, 271 - 33, 479 - 365, LBLX, MBASE(2)); // Hotend... + DWIN_Frame_AreaCopy(1, 1, 89, 271 - 188, 479 - 377 - 1, LBLX + 41 + 3, MBASE(2)); // ...Temperature + DWIN_Frame_AreaCopy(1, 240, 104, 271 - 7, 479 - 365, LBLX, MBASE(3)); // Bed... + DWIN_Frame_AreaCopy(1, 1, 89, 271 - 188, 479 - 377 - 1, LBLX + 24 + 3, MBASE(3)); // ...Temperature + DWIN_Frame_AreaCopy(1, 0, 119, 271 - 207, 479 - 347, LBLX, MBASE(4)); // fan speed + DWIN_Frame_AreaCopy(1, 93, 179, 271 - 130, 479 - 290, LBLX, MBASE(5)); // Z-offset + } + + Draw_Back_First(select_tune.now == 0); + if (select_tune.now) Draw_Menu_Cursor(select_tune.now); + + Draw_Menu_Line(1, ICON_Speed); + Draw_Menu_Line(2, ICON_HotendTemp); + Draw_Menu_Line(3, ICON_BedTemp); + Draw_Menu_Line(4, ICON_FanSpeed); + Draw_Menu_Line(5, ICON_Zoffset); + + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(1), feedrate_percentage); + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(2), thermalManager.temp_hotend[0].target); + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(3), thermalManager.temp_bed.target); + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(4), thermalManager.fan_speed[0]); + show_plus_or_minus(font8x16, Background_black, 2, 2, 202, MBASE(5), BABY_Z_VAR * 100); +} + +inline void draw_max_en(const uint16_t line) { + DWIN_Frame_AreaCopy(1, 245, 119, 271 - 2, 479 - 350, LBLX, line); // "Max" +} +inline void draw_max_accel_en(const uint16_t line) { + draw_max_en(line); + DWIN_Frame_AreaCopy(1, 1, 135, 271 - 192, 479 - 334, LBLX + 24 + 3, line); // "Acceleration" +} +inline void draw_speed_en(const uint16_t inset, const uint16_t line) { + DWIN_Frame_AreaCopy(1, 184, 119, 224, 479 - 347, LBLX + inset, line); // "Speed" +} +inline void draw_corner_en(const uint16_t line) { + DWIN_Frame_AreaCopy(1, 64, 119, 271 - 165, 479 - 350, LBLX + 24 + 3, line); // "Corner" +} +inline void draw_steps_per_mm(const uint16_t line) { + DWIN_Frame_AreaCopy(1, 1, 151, 271 - 170, 479 - 318, LBLX, line); // "Steps-per-mm" +} +inline void say_x(const uint16_t inset, const uint16_t line) { + DWIN_Frame_AreaCopy(1, 95, 104, 271 - 169, 479 - 365, LBLX + inset, line); // "X" +} +inline void say_y(const uint16_t inset, const uint16_t line) { + DWIN_Frame_AreaCopy(1, 104, 104, 271 - 161, 479 - 365, LBLX + inset, line); // "Y" +} +inline void say_z(const uint16_t inset, const uint16_t line) { + DWIN_Frame_AreaCopy(1, 112, 104, 271 - 151, 479 - 365, LBLX + inset, line); // "Z" +} +inline void say_e(const uint16_t inset, const uint16_t line) { + DWIN_Frame_AreaCopy(1, 237, 119, 271 - 27, 479 - 350, LBLX + inset, line); // "E" +} + +inline void Draw_Motion_Menu() { + Clear_Main_Window(); + + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 1, 16, 271 - 243, 479 - 451, 14, 8); + + DWIN_Frame_AreaCopy(1, 173, 133, 228, 479 - 332, LBLX, MBASE(1)); // max speed + DWIN_Frame_AreaCopy(1, 173, 133, 200, 479 - 332, LBLX, MBASE(2)); // max... + DWIN_Frame_AreaCopy(1, 28, 149, 271 - 202, 479 - 318, LBLX + 27, MBASE(2) + 1); // ...acceleration + DWIN_Frame_AreaCopy(1, 173, 133, 200, 479 - 332, LBLX, MBASE(3)); // max... + DWIN_Frame_AreaCopy(1, 1, 180, 271 - 243, 479 - 287, LBLX + 27, MBASE(3) + 1); // ... + DWIN_Frame_AreaCopy(1, 202, 133, 228, 479 - 332, LBLX + 54, MBASE(3)); // ...jerk + DWIN_Frame_AreaCopy(1, 153, 148, 271 - 77, 479 - 318, LBLX, MBASE(4)); // flow ratio + } + else { + #ifdef USE_STRING_HEADINGS + Draw_Title("Motion"); // TODO: GET_TEXT_F + #else + DWIN_Frame_AreaCopy(1, 144, 16, 271 - 82, 479 - 453, 14, 8); + #endif + draw_max_en(MBASE(1)); draw_speed_en(24 + 3, MBASE(1)); // "Max Speed" + draw_max_accel_en(MBASE(2)); // "Max Acceleration" + draw_max_en(MBASE(3)); draw_corner_en(MBASE(3)); // "Max Corner" + draw_steps_per_mm(MBASE(4)); // "Steps-per-mm" + } + + Draw_Back_First(select_motion.now == 0); + if (select_motion.now) Draw_Menu_Cursor(select_motion.now); + + LOOP_L_N(i, 4) Draw_Menu_Line(i + 1, ICON_MaxSpeed + i); + + Draw_More_Icon(1); + Draw_More_Icon(2); + Draw_More_Icon(3); + Draw_More_Icon(4); +} + +// +// Draw Popup Windows +// + +void Popup_Window_Temperature(const bool toohigh) { + Clear_Popup_Area(); + Draw_Popup_Bkgd_105(); + if (toohigh) { + DWIN_ICON_Show(ICON, ICON_TempTooHigh, 102, 165); + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 103, 371, 237, 479 - 93, 52, 285); + DWIN_Frame_AreaCopy(1, 151, 389, 185, 402, 187, 285); + DWIN_Frame_AreaCopy(1, 189, 389, 271 - 0, 402, 95, 310); + } + else { + DWIN_Draw_String(false, true, font8x16, Font_window, Background_window, 36, 300, (char*)"Nozzle or Bed temperature"); + DWIN_Draw_String(false, true, font8x16, Font_window, Background_window, 92, 300, (char*)"is too high"); + } + } + else { + DWIN_ICON_Show(ICON, ICON_TempTooLow, 102, 165); + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 103, 371, 271 - 1, 479 - 93, 52, 285); + DWIN_Frame_AreaCopy(1, 189, 389, 271 - 0, 402, 95, 310); + } + else { + DWIN_Draw_String(false, true, font8x16, Font_window, Background_window, 36, 300, (char*)"Nozzle or Bed temperature"); + DWIN_Draw_String(false, true, font8x16, Font_window, Background_window, 92, 300, (char*)"is too low"); + } + } +} + +inline void Draw_Popup_Bkgd_60() { + DWIN_Draw_Rectangle(1, Background_window, 14, 60, 271 - 13, 330); +} + +#if HAS_HOTEND + + void Popup_Window_ETempTooLow(void) { + Clear_Main_Window(); + Draw_Popup_Bkgd_60(); + DWIN_ICON_Show(ICON, ICON_TempTooLow, 102, 105); + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 103, 371, 136, 479 - 93, 69, 240); + DWIN_Frame_AreaCopy(1, 170, 371, 271 - 1, 479 - 93, 69 + 33, 240); + DWIN_ICON_Show(ICON, ICON_Confirm_C, 86, 280); + } + else { + DWIN_Draw_String(false, true, font8x16, Font_window, Background_window, 20, 235, (char*)"Nozzle is too cold"); + DWIN_ICON_Show(ICON, ICON_Confirm_E, 86, 280); + } + } + +#endif + +void Popup_Window_Resume(void) { + Clear_Popup_Area(); + Draw_Popup_Bkgd_105(); + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 160, 338, 271 - 36, 479 - 125, 98, 135); + DWIN_Frame_AreaCopy(1, 103, 321, 271 - 0, 479 - 144, 52, 192); + DWIN_ICON_Show(ICON, ICON_Continue_C, 26, 307); + DWIN_ICON_Show(ICON, ICON_Cancel_C, 146, 307); + } + else { + DWIN_Draw_String(false, true, font8x16, Font_window, Background_window, 120, 115, (char*)"Tips"); + DWIN_Draw_String(false, true, font8x16, Font_window, Background_window, 24, 192, (char*)"I see the file stopped"); + DWIN_Draw_String(false, true, font8x16, Font_window, Background_window, 68, 212, (char*)"unexpectedly last time"); + DWIN_ICON_Show(ICON, ICON_Continue_E, 26, 307); + DWIN_ICON_Show(ICON, ICON_Cancel_E, 146, 307); + } +} + +void Popup_Window_Home(void) { + Clear_Main_Window(); + Draw_Popup_Bkgd_60(); + DWIN_ICON_Show(ICON, ICON_BLTouch, 101, 105); + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 0, 371, 33, 386, 85, 240); + DWIN_Frame_AreaCopy(1, 203, 286, 271, 302, 118, 240); + DWIN_Frame_AreaCopy(1, 0, 389, 150, 402, 61, 280); + } + else { + DWIN_Draw_String(false, true, font8x16, Font_window, Background_window, 80, 230, (char*)"Auto homing..."); + DWIN_Draw_String(false, true, font8x16, Font_window, Background_window, 24, 260, (char*)"Please wait until completed"); + } +} + +void Popup_Window_Leveling(void) { + Clear_Main_Window(); + Draw_Popup_Bkgd_60(); + DWIN_ICON_Show(ICON, ICON_AutoLeveling, 101, 105); + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 0, 371, 100, 386, 84, 240); + DWIN_Frame_AreaCopy(1, 0, 389, 150, 402, 61, 280); + } + else { + DWIN_Draw_String(false, true, font8x16, Font_window, Background_window, 76, 230, (char*)"Auto leveling..."); + DWIN_Draw_String(false, true, font8x16, Font_window, Background_window, 24, 260, (char*)"Please wait until completed"); + } +} + +void Draw_Select_Highlight(const bool sel) { + HMI_flag.select_flag = sel; + const uint16_t c1 = sel ? Select_Color : Background_window, + c2 = sel ? Background_window : Select_Color; + DWIN_Draw_Rectangle(0, c1, 25, 279, 126, 318); + DWIN_Draw_Rectangle(0, c1, 24, 278, 127, 319); + DWIN_Draw_Rectangle(0, c2, 145, 279, 246, 318); + DWIN_Draw_Rectangle(0, c2, 144, 278, 247, 319); +} + +void Popup_window_PauseOrStop(void) { + Clear_Main_Window(); + Draw_Popup_Bkgd_60(); + if (HMI_flag.language_flag) { + if (select_print.now == 1) DWIN_Frame_AreaCopy(1, 237, 338, 269, 356, 98, 150); + else if (select_print.now == 2) DWIN_Frame_AreaCopy(1, 221, 320, 253, 336, 98, 150); + DWIN_Frame_AreaCopy(1, 220, 304, 264, 319, 130, 150); + DWIN_ICON_Show(ICON, ICON_Confirm_C, 26, 280); + DWIN_ICON_Show(ICON, ICON_Cancel_C, 146, 280); + } + else { + if (select_print.now == 1) DWIN_Draw_String(false, true, font8x16, Font_window, Background_window, 88, 150, (char*)"Pause print?"); + else if (select_print.now == 2) DWIN_Draw_String(false, true, font8x16, Font_window, Background_window, 92, 150, (char*)"Stop print?"); + DWIN_ICON_Show(ICON, ICON_Confirm_E, 26, 280); + DWIN_ICON_Show(ICON, ICON_Cancel_E, 146, 280); + } + Draw_Select_Highlight(true); +} + +void Draw_Printing_Screen(void) { + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 30, 1, 271 - 200, 479 - 465, 14, 9);// Tune + DWIN_Frame_AreaCopy(1, 0, 72, 271 - 208, 479 - 393, 41, 188);// Pause + DWIN_Frame_AreaCopy(1, 65, 72, 271 - 143, 479 - 393, 176, 188); // Stop + } + else { + DWIN_Frame_AreaCopy(1, 40, 2, 271 - 179, 479 - 464 - 1, 14, 9);// Tune + DWIN_Frame_AreaCopy(1, 0, 44, 271 - 175, 479 - 420 - 1, 41, 188);// Pause + DWIN_Frame_AreaCopy(1, 98, 44, 271 - 119, 479 - 420 - 1, 176, 188); // Stop + } +} + +void Draw_Print_ProgressBar() { + DWIN_ICON_Show(ICON, ICON_Bar, 15, 93); + DWIN_Draw_Rectangle(1, BarFill_Color, 16 + Percentrecord * 240 / 100, 93, 256, 113); + DWIN_Draw_IntValue(true, true, 0, font8x16, Percent_Color, Background_black, 2, 117, 133, Percentrecord); + DWIN_Draw_String(false, false, font8x16, Percent_Color, Background_black, 117 + 16, 133, (char*)"%"); +} + +void Draw_Print_ProgressElapsed() { + duration_t elapsed = print_job_timer.duration(); // print timer + DWIN_Draw_IntValue(true, true, 1, font8x16, White, Background_black, 2, 42, 212, elapsed.value / 3600); + DWIN_Draw_String(false, false, font8x16, White, Background_black, 42 + 16, 212, (char*)":"); + DWIN_Draw_IntValue(true, true, 1, font8x16, White, Background_black, 2, 42 + 24, 212, (elapsed.value % 3600) / 60); +} + +void Draw_Print_ProgressRemain() { + DWIN_Draw_IntValue(true, true, 1, font8x16, White, Background_black, 2, 176, 212, remain_time / 3600); + DWIN_Draw_String(false, false, font8x16, White, Background_black, 176 + 16, 212, (char*)":"); + DWIN_Draw_IntValue(true, true, 1, font8x16, White, Background_black, 2, 176 + 24, 212, (remain_time % 3600) / 60); +} + +void Goto_PrintProcess(void) { + checkkey = PrintProcess; + + Clear_Main_Window(); + Draw_Printing_Screen(); + + ICON_Tune(); + if (printingIsPaused()) ICON_Continue(); else ICON_Pause(); + ICON_Stop(); + + // Copy into filebuf string before entry + char * const name = card.longest_filename(); + DWIN_Draw_String(false, false, font8x16, White, Background_black, (DWIN_WIDTH - strlen(name) * MENU_CHR_W) / 2, 60, name); + + DWIN_ICON_Show(ICON, ICON_PrintTime, 17, 193); + DWIN_ICON_Show(ICON, ICON_RemainTime, 150, 191); + + Draw_Print_ProgressBar(); + Draw_Print_ProgressElapsed(); + Draw_Print_ProgressRemain(); +} + +void Goto_MainMenu(void) { + checkkey = MainMenu; + + Clear_Main_Window(); + + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 2, 2, 271 - 244, 479 - 465, 14, 9); // "Home" + } + else { + #ifdef USE_STRING_HEADINGS + Draw_Title("Home"); // TODO: GET_TEXT + #else + DWIN_Frame_AreaCopy(1, 0, 2, 271 - 232, 479 - 467, 14, 9); + #endif + } + + DWIN_ICON_Show(ICON, ICON_LOGO, 71, 52); + + ICON_Print(); + ICON_Prepare(); + ICON_Control(); + TERN(HAS_LEVELING, ICON_Leveling, ICON_StartInfo)(select_page.now == 3); +} + +inline ENCODER_DiffState get_encoder_state() { + const millis_t ms = millis(); + if (PENDING(ms, Encoder_ms)) return ENCODER_DIFF_NO; + const ENCODER_DiffState state = Encoder_ReceiveAnalyze(); + if (state != ENCODER_DIFF_NO) Encoder_ms = ms + ENCODER_WAIT; + return state; +} + +void HMI_Move_X(void) { + ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); + if (encoder_diffState != ENCODER_DIFF_NO) { + if (encoder_diffState == ENCODER_DIFF_CW) { + HMI_ValueStruct.Move_X_scale += EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + HMI_ValueStruct.Move_X_scale -= EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + checkkey = AxisMove; + EncoderRate.encoderRateEnabled = 0; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 216, MBASE(1), HMI_ValueStruct.Move_X_scale); + if (!planner.is_full()) { + // Wait for planner moves to finish! + planner.synchronize(); + planner.buffer_line(current_position, MMM_TO_MMS(HOMING_FEEDRATE_XY), active_extruder); + } + DWIN_UpdateLCD(); + return; + } + NOLESS(HMI_ValueStruct.Move_X_scale, (X_MIN_POS) * MINUNITMULT); + NOMORE(HMI_ValueStruct.Move_X_scale, (X_MAX_POS) * MINUNITMULT); + current_position[X_AXIS] = HMI_ValueStruct.Move_X_scale / 10; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(1), HMI_ValueStruct.Move_X_scale); + DWIN_UpdateLCD(); + } +} + +void HMI_Move_Y(void) { + ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); + if (encoder_diffState != ENCODER_DIFF_NO) { + if (encoder_diffState == ENCODER_DIFF_CW) { + HMI_ValueStruct.Move_Y_scale += EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + HMI_ValueStruct.Move_Y_scale -= EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + checkkey = AxisMove; + EncoderRate.encoderRateEnabled = 0; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 216, MBASE(2), HMI_ValueStruct.Move_Y_scale); + if (!planner.is_full()) { + // Wait for planner moves to finish! + planner.synchronize(); + planner.buffer_line(current_position, MMM_TO_MMS(HOMING_FEEDRATE_XY), active_extruder); + } + DWIN_UpdateLCD(); + return; + } + NOLESS(HMI_ValueStruct.Move_Y_scale, (Y_MIN_POS) * MINUNITMULT); + NOMORE(HMI_ValueStruct.Move_Y_scale, (Y_MAX_POS) * MINUNITMULT); + current_position[Y_AXIS] = HMI_ValueStruct.Move_Y_scale / 10; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(2), HMI_ValueStruct.Move_Y_scale); + DWIN_UpdateLCD(); + } +} + +void HMI_Move_Z(void) { + ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); + if (encoder_diffState != ENCODER_DIFF_NO) { + if (encoder_diffState == ENCODER_DIFF_CW) { + HMI_ValueStruct.Move_Z_scale += EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + HMI_ValueStruct.Move_Z_scale -= EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + checkkey = AxisMove; + EncoderRate.encoderRateEnabled = 0; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 216, MBASE(3), HMI_ValueStruct.Move_Z_scale); + if (!planner.is_full()) { + // Wait for planner moves to finish! + planner.synchronize(); + planner.buffer_line(current_position, MMM_TO_MMS(HOMING_FEEDRATE_Z), active_extruder); + } + DWIN_UpdateLCD(); + return; + } + NOLESS(HMI_ValueStruct.Move_Z_scale, Z_MIN_POS * MINUNITMULT); + NOMORE(HMI_ValueStruct.Move_Z_scale, Z_MAX_POS * MINUNITMULT); + current_position[Z_AXIS] = HMI_ValueStruct.Move_Z_scale / 10; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(3), HMI_ValueStruct.Move_Z_scale); + DWIN_UpdateLCD(); + } +} + +void HMI_Move_E(void) { + ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); + if (encoder_diffState != ENCODER_DIFF_NO) { + if (encoder_diffState == ENCODER_DIFF_CW) { + HMI_ValueStruct.Move_E_scale += EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + HMI_ValueStruct.Move_E_scale -= EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + checkkey = AxisMove; + EncoderRate.encoderRateEnabled = 0; + last_E_scale = HMI_ValueStruct.Move_E_scale; + show_plus_or_minus(font8x16, Background_black, 3, 1, 216, MBASE(4), HMI_ValueStruct.Move_E_scale); + if (!planner.is_full()) { + planner.synchronize(); // Wait for planner moves to finish! + planner.buffer_line(current_position, MMM_TO_MMS(FEEDRATE_E), active_extruder); + } + DWIN_UpdateLCD(); + return; + } + if ((HMI_ValueStruct.Move_E_scale - last_E_scale) > (EXTRUDE_MAXLENGTH) * MINUNITMULT) + HMI_ValueStruct.Move_E_scale = last_E_scale + (EXTRUDE_MAXLENGTH) * MINUNITMULT; + else if ((last_E_scale - HMI_ValueStruct.Move_E_scale) > (EXTRUDE_MAXLENGTH) * MINUNITMULT) + HMI_ValueStruct.Move_E_scale = last_E_scale - (EXTRUDE_MAXLENGTH) * MINUNITMULT; + current_position.e = HMI_ValueStruct.Move_E_scale / 10; + show_plus_or_minus(font8x16, Select_Color, 3, 1, 216, MBASE(4), HMI_ValueStruct.Move_E_scale); + DWIN_UpdateLCD(); + } +} + +void HMI_Zoffset(void) { + ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); + if (encoder_diffState != ENCODER_DIFF_NO) { + last_zoffset = zprobe_zoffset; + if (encoder_diffState == ENCODER_DIFF_CW) { + HMI_ValueStruct.offset_value += EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + HMI_ValueStruct.offset_value -= EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + EncoderRate.encoderRateEnabled = 0; + zprobe_zoffset = HMI_ValueStruct.offset_value / 100; + #if HAS_BED_PROBE + if (WITHIN(zprobe_zoffset - last_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) + probe.offset.z = zprobe_zoffset; + settings.save(); + #elif ENABLED(BABYSTEPPING) + babystep.add_mm(Z_AXIS, (zprobe_zoffset - last_zoffset)); + #else + UNUSED(zprobe_zoffset - last_zoffset); + #endif + + if (HMI_ValueStruct.show_mode == -4) { + checkkey = Prepare; + show_plus_or_minus(font8x16, Background_black, 2, 2, 202, MBASE(4 + MROWS - index_prepare), TERN(HAS_LEVELING, probe.offset.z * 100, HMI_ValueStruct.offset_value)); + } + else { + checkkey = Tune; + show_plus_or_minus(font8x16, Background_black, 2, 2, 202, MBASE(5 + MROWS - index_tune), TERN(HAS_LEVELING, probe.offset.z * 100, HMI_ValueStruct.offset_value)); + } + DWIN_UpdateLCD(); + return; + } + NOLESS(HMI_ValueStruct.offset_value, (Z_PROBE_OFFSET_RANGE_MIN) * 100); + NOMORE(HMI_ValueStruct.offset_value, (Z_PROBE_OFFSET_RANGE_MAX) * 100); + if (HMI_ValueStruct.show_mode == -4) + show_plus_or_minus(font8x16, Select_Color, 2, 2, 202, MBASE(4 + MROWS - index_prepare), HMI_ValueStruct.offset_value); + else + show_plus_or_minus(font8x16, Select_Color, 2, 2, 202, MBASE(5 + MROWS - index_tune), HMI_ValueStruct.offset_value); + DWIN_UpdateLCD(); + } +} + +#if HAS_HOTEND + + void HMI_ETemp(void) { + ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); + if (encoder_diffState != ENCODER_DIFF_NO) { + if (encoder_diffState == ENCODER_DIFF_CW) { + HMI_ValueStruct.E_Temp += EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + HMI_ValueStruct.E_Temp -= EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return + EncoderRate.encoderRateEnabled = 0; + if (HMI_ValueStruct.show_mode == -1) { // temperature + checkkey = TemperatureID; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(1), HMI_ValueStruct.E_Temp); + } + else if (HMI_ValueStruct.show_mode == -2) { + checkkey = PLAPreheat; + ui.material_preset[0].hotend_temp = HMI_ValueStruct.E_Temp; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(1), ui.material_preset[0].hotend_temp); + return; + } + else if (HMI_ValueStruct.show_mode == -3) { + checkkey = ABSPreheat; + ui.material_preset[1].hotend_temp = HMI_ValueStruct.E_Temp; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(1), ui.material_preset[1].hotend_temp); + return; + } + else { // tune + checkkey = Tune; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(2 + MROWS - index_tune), HMI_ValueStruct.E_Temp); + } + thermalManager.setTargetHotend(HMI_ValueStruct.E_Temp, 0); + return; + } + // E_Temp limit + NOMORE(HMI_ValueStruct.E_Temp, MAX_E_TEMP); + NOLESS(HMI_ValueStruct.E_Temp, MIN_E_TEMP); + // E_Temp value + if (HMI_ValueStruct.show_mode >= 0) // tune + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(2 + MROWS - index_tune), HMI_ValueStruct.E_Temp); + else // other page + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(1), HMI_ValueStruct.E_Temp); + } + } + +#endif // if HAS_HOTEND + +#if HAS_HEATED_BED + + void HMI_BedTemp(void) { + ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); + if (encoder_diffState != ENCODER_DIFF_NO) { + if (encoder_diffState == ENCODER_DIFF_CW) { + HMI_ValueStruct.Bed_Temp += EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + HMI_ValueStruct.Bed_Temp -= EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return + EncoderRate.encoderRateEnabled = 0; + if (HMI_ValueStruct.show_mode == -1) { + checkkey = TemperatureID; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(2), HMI_ValueStruct.Bed_Temp); + } + else if (HMI_ValueStruct.show_mode == -2) { + checkkey = PLAPreheat; + ui.material_preset[0].bed_temp = HMI_ValueStruct.Bed_Temp; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(2), ui.material_preset[0].bed_temp); + return; + } + else if (HMI_ValueStruct.show_mode == -3) { + checkkey = ABSPreheat; + ui.material_preset[1].bed_temp = HMI_ValueStruct.Bed_Temp; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(2), ui.material_preset[1].bed_temp); + return; + } + else { + checkkey = Tune; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(3 + MROWS - index_tune), HMI_ValueStruct.Bed_Temp); + } + thermalManager.setTargetBed(HMI_ValueStruct.Bed_Temp); + return; + } + // Bed_Temp limit + NOMORE(HMI_ValueStruct.Bed_Temp, BED_MAX_TARGET); + NOLESS(HMI_ValueStruct.Bed_Temp, MIN_BED_TEMP); + // Bed_Temp value + if (HMI_ValueStruct.show_mode >= 0) // tune page + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(3 + MROWS - index_tune), HMI_ValueStruct.Bed_Temp); + else // other page + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(2), HMI_ValueStruct.Bed_Temp); + } + } + +#endif // if HAS_HEATED_BED + +#if HAS_FAN + + void HMI_FanSpeed(void) { + ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); + if (encoder_diffState != ENCODER_DIFF_NO) { + if (encoder_diffState == ENCODER_DIFF_CW) { + HMI_ValueStruct.Fan_speed += EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + HMI_ValueStruct.Fan_speed -= EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return + EncoderRate.encoderRateEnabled = 0; + if (HMI_ValueStruct.show_mode == -1) { + checkkey = TemperatureID; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(3), HMI_ValueStruct.Fan_speed); + } + else if (HMI_ValueStruct.show_mode == -2) { + checkkey = PLAPreheat; + ui.material_preset[0].fan_speed = HMI_ValueStruct.Fan_speed; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(3), ui.material_preset[0].fan_speed); + return; + } + else if (HMI_ValueStruct.show_mode == -3) { + checkkey = ABSPreheat; + ui.material_preset[1].fan_speed = HMI_ValueStruct.Fan_speed; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(3), ui.material_preset[1].fan_speed); + return; + } + else { + checkkey = Tune; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(4 + MROWS - index_tune), HMI_ValueStruct.Fan_speed); + } + thermalManager.set_fan_speed(0, HMI_ValueStruct.Fan_speed); + return; + } + // Fan_speed limit + NOMORE(HMI_ValueStruct.Fan_speed, FANON); + NOLESS(HMI_ValueStruct.Fan_speed, FANOFF); + // Fan_speed value + if (HMI_ValueStruct.show_mode >= 0) // tune page + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(4 + MROWS - index_tune), HMI_ValueStruct.Fan_speed); + else // other page + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(3), HMI_ValueStruct.Fan_speed); + } + } + +#endif // if HAS_FAN + +void HMI_PrintSpeed(void) { + ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); + if (encoder_diffState != ENCODER_DIFF_NO) { + if (encoder_diffState == ENCODER_DIFF_CW) { + HMI_ValueStruct.print_speed += EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + HMI_ValueStruct.print_speed -= EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return + checkkey = Tune; + EncoderRate.encoderRateEnabled = 0; + feedrate_percentage = HMI_ValueStruct.print_speed; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(1 + MROWS - index_tune), HMI_ValueStruct.print_speed); + return; + } + // print_speed limit + NOMORE(HMI_ValueStruct.print_speed, MAX_PRINT_SPEED); + NOLESS(HMI_ValueStruct.print_speed, MIN_PRINT_SPEED); + // print_speed value + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(1 + MROWS - index_tune), HMI_ValueStruct.print_speed); + } +} + +void HMI_MaxFeedspeedXYZE(void) { + ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); + if (encoder_diffState != ENCODER_DIFF_NO) { + if (encoder_diffState == ENCODER_DIFF_CW) { + HMI_ValueStruct.Max_Feedspeed += EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + HMI_ValueStruct.Max_Feedspeed -= EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return + checkkey = MaxSpeed; + EncoderRate.encoderRateEnabled = 0; + if (HMI_flag.feedspeed_flag == X_AXIS) planner.set_max_feedrate(X_AXIS, HMI_ValueStruct.Max_Feedspeed); + else if (HMI_flag.feedspeed_flag == Y_AXIS) planner.set_max_feedrate(Y_AXIS, HMI_ValueStruct.Max_Feedspeed); + else if (HMI_flag.feedspeed_flag == Z_AXIS) planner.set_max_feedrate(Z_AXIS, HMI_ValueStruct.Max_Feedspeed); + #if HAS_HOTEND + else if (HMI_flag.feedspeed_flag == E_AXIS) planner.set_max_feedrate(E_AXIS, HMI_ValueStruct.Max_Feedspeed); + #endif + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 4, 210, MBASE(select_speed.now), HMI_ValueStruct.Max_Feedspeed); + return; + } + // MaxFeedspeed limit + if (HMI_flag.feedspeed_flag == X_AXIS) {if (HMI_ValueStruct.Max_Feedspeed > default_max_feedrate[X_AXIS] * 2) HMI_ValueStruct.Max_Feedspeed = default_max_feedrate[X_AXIS] * 2; } + else if (HMI_flag.feedspeed_flag == Y_AXIS) {if (HMI_ValueStruct.Max_Feedspeed > default_max_feedrate[Y_AXIS] * 2) HMI_ValueStruct.Max_Feedspeed = default_max_feedrate[Y_AXIS] * 2; } + else if (HMI_flag.feedspeed_flag == Z_AXIS) {if (HMI_ValueStruct.Max_Feedspeed > default_max_feedrate[Z_AXIS] * 2) HMI_ValueStruct.Max_Feedspeed = default_max_feedrate[Z_AXIS] * 2; } + #if HAS_HOTEND + else if (HMI_flag.feedspeed_flag == E_AXIS) {if (HMI_ValueStruct.Max_Feedspeed > default_max_feedrate[E_AXIS] * 2) HMI_ValueStruct.Max_Feedspeed = default_max_feedrate[E_AXIS] * 2; } + #endif + if (HMI_ValueStruct.Max_Feedspeed < MIN_MAXFEEDSPEED) HMI_ValueStruct.Max_Feedspeed = MIN_MAXFEEDSPEED; + // MaxFeedspeed value + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 4, 210, MBASE(select_speed.now), HMI_ValueStruct.Max_Feedspeed); + } +} + +void HMI_MaxAccelerationXYZE(void) { + ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); + if (encoder_diffState != ENCODER_DIFF_NO) { + if (encoder_diffState == ENCODER_DIFF_CW) { HMI_ValueStruct.Max_Acceleration += EncoderRate.encoderMoveValue;} + else if (encoder_diffState == ENCODER_DIFF_CCW) { HMI_ValueStruct.Max_Acceleration -= EncoderRate.encoderMoveValue;} + else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return + checkkey = MaxAcceleration; + EncoderRate.encoderRateEnabled = 0; + if (HMI_flag.acc_flag == X_AXIS) planner.set_max_acceleration(X_AXIS, HMI_ValueStruct.Max_Acceleration); + else if (HMI_flag.acc_flag == Y_AXIS) planner.set_max_acceleration(Y_AXIS, HMI_ValueStruct.Max_Acceleration); + else if (HMI_flag.acc_flag == Z_AXIS) planner.set_max_acceleration(Z_AXIS, HMI_ValueStruct.Max_Acceleration); + #if HAS_HOTEND + else if (HMI_flag.acc_flag == E_AXIS) planner.set_max_acceleration(E_AXIS, HMI_ValueStruct.Max_Acceleration); + #endif + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 4, 210, MBASE(select_acc.now), HMI_ValueStruct.Max_Acceleration); + return; + } + // MaxAcceleration limit + if (HMI_flag.acc_flag == X_AXIS) {if (HMI_ValueStruct.Max_Acceleration > default_max_acceleration[X_AXIS] * 2) HMI_ValueStruct.Max_Acceleration = default_max_acceleration[X_AXIS] * 2; } + else if (HMI_flag.acc_flag == Y_AXIS) {if (HMI_ValueStruct.Max_Acceleration > default_max_acceleration[Y_AXIS] * 2) HMI_ValueStruct.Max_Acceleration = default_max_acceleration[Y_AXIS] * 2; } + else if (HMI_flag.acc_flag == Z_AXIS) {if (HMI_ValueStruct.Max_Acceleration > default_max_acceleration[Z_AXIS] * 2) HMI_ValueStruct.Max_Acceleration = default_max_acceleration[Z_AXIS] * 2; } + #if HAS_HOTEND + else if (HMI_flag.acc_flag == E_AXIS) {if (HMI_ValueStruct.Max_Acceleration > default_max_acceleration[E_AXIS] * 2) HMI_ValueStruct.Max_Acceleration = default_max_acceleration[E_AXIS] * 2; } + #endif + if (HMI_ValueStruct.Max_Acceleration < MIN_MAXACCELERATION) HMI_ValueStruct.Max_Acceleration = MIN_MAXACCELERATION; + // MaxAcceleration value + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 4, 210, MBASE(select_acc.now), HMI_ValueStruct.Max_Acceleration); + } +} + +void HMI_MaxCornerXYZE(void) { + ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); + if (encoder_diffState != ENCODER_DIFF_NO) { + if (encoder_diffState == ENCODER_DIFF_CW) { + HMI_ValueStruct.Max_Corner += EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + HMI_ValueStruct.Max_Corner -= EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return + checkkey = MaxCorner; + EncoderRate.encoderRateEnabled = 0; + if (HMI_flag.corner_flag == X_AXIS) planner.set_max_jerk(X_AXIS, HMI_ValueStruct.Max_Corner / 10); + else if (HMI_flag.corner_flag == Y_AXIS) planner.set_max_jerk(Y_AXIS, HMI_ValueStruct.Max_Corner / 10); + else if (HMI_flag.corner_flag == Z_AXIS) planner.set_max_jerk(Z_AXIS, HMI_ValueStruct.Max_Corner / 10); + else if (HMI_flag.corner_flag == E_AXIS) planner.set_max_jerk(E_AXIS, HMI_ValueStruct.Max_Corner / 10); + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(select_corner.now), HMI_ValueStruct.Max_Corner); + return; + } + // MaxCorner limit + if (HMI_flag.corner_flag == X_AXIS) + NOMORE(HMI_ValueStruct.Max_Corner, default_max_jerk[X_AXIS] * 2 * MINUNITMULT); + else if (HMI_flag.corner_flag == Y_AXIS) + NOMORE(HMI_ValueStruct.Max_Corner, default_max_jerk[Y_AXIS] * 2 * MINUNITMULT); + else if (HMI_flag.corner_flag == Z_AXIS) + NOMORE(HMI_ValueStruct.Max_Corner, default_max_jerk[Z_AXIS] * 2 * MINUNITMULT); + else if (HMI_flag.corner_flag == E_AXIS) + NOMORE(HMI_ValueStruct.Max_Corner, default_max_jerk[E_AXIS] * 2 * MINUNITMULT); + NOLESS(HMI_ValueStruct.Max_Corner, (MIN_MAXCORNER) * MINUNITMULT); + // MaxCorner value + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_corner.now), HMI_ValueStruct.Max_Corner); + } +} + +void HMI_StepXYZE(void) { + ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); + if (encoder_diffState != ENCODER_DIFF_NO) { + if (encoder_diffState == ENCODER_DIFF_CW) { + HMI_ValueStruct.Max_Step += EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + HMI_ValueStruct.Max_Step -= EncoderRate.encoderMoveValue; + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { // return + checkkey = Step; + EncoderRate.encoderRateEnabled = 0; + if (HMI_flag.step_flag == X_AXIS) planner.settings.axis_steps_per_mm[X_AXIS] = HMI_ValueStruct.Max_Step / 10; + else if (HMI_flag.step_flag == Y_AXIS) planner.settings.axis_steps_per_mm[Y_AXIS] = HMI_ValueStruct.Max_Step / 10; + else if (HMI_flag.step_flag == Z_AXIS) planner.settings.axis_steps_per_mm[Z_AXIS] = HMI_ValueStruct.Max_Step / 10; + else if (HMI_flag.step_flag == E_AXIS) planner.settings.axis_steps_per_mm[E_AXIS] = HMI_ValueStruct.Max_Step / 10; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(select_step.now), HMI_ValueStruct.Max_Step); + return; + } + // Step limit + if (HMI_flag.step_flag == X_AXIS) + NOMORE(HMI_ValueStruct.Max_Step, default_axis_steps_per_unit[X_AXIS] * 2 * MINUNITMULT); + else if (HMI_flag.step_flag == Y_AXIS) + NOMORE(HMI_ValueStruct.Max_Step, default_axis_steps_per_unit[Y_AXIS] * 2 * MINUNITMULT); + else if (HMI_flag.step_flag == Z_AXIS) + NOMORE(HMI_ValueStruct.Max_Step, default_axis_steps_per_unit[Z_AXIS] * 2 * MINUNITMULT); + else if (HMI_flag.step_flag == E_AXIS) + NOMORE(HMI_ValueStruct.Max_Step, default_axis_steps_per_unit[E_AXIS] * 2 * MINUNITMULT); + NOLESS(HMI_ValueStruct.Max_Step, MIN_STEP); + // Step value + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_step.now), HMI_ValueStruct.Max_Step); + } +} + +void update_variable(void) { + /* Tune page temperature update */ + if (checkkey == Tune) { + if (last_temp_hotend_target != thermalManager.temp_hotend[0].target) + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(2 + MROWS - index_tune), thermalManager.temp_hotend[0].target); + if (last_temp_bed_target != thermalManager.temp_bed.target) + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(3 + MROWS - index_tune), thermalManager.temp_bed.target); + if (last_fan_speed != thermalManager.fan_speed[0]) { + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(4 + MROWS - index_tune), thermalManager.fan_speed[0]); + last_fan_speed = thermalManager.fan_speed[0]; + } + } + + /* Temperature page temperature update */ + if (checkkey == TemperatureID) { + if (last_temp_hotend_target != thermalManager.temp_hotend[0].target) + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(1), thermalManager.temp_hotend[0].target); + if (last_temp_bed_target != thermalManager.temp_bed.target) + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(2), thermalManager.temp_bed.target); + if (last_fan_speed != thermalManager.fan_speed[0]) { + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(3), thermalManager.fan_speed[0]); + last_fan_speed = thermalManager.fan_speed[0]; + } + } + + /* Bottom temperature update */ + if (last_temp_hotend_current != thermalManager.temp_hotend[0].celsius) { + DWIN_Draw_IntValue(true, true, 0, STAT_FONT, White, Background_black, 3, 33, 382, thermalManager.temp_hotend[0].celsius); + last_temp_hotend_current = thermalManager.temp_hotend[0].celsius; + } + if (last_temp_hotend_target != thermalManager.temp_hotend[0].target) { + DWIN_Draw_IntValue(true, true, 0, STAT_FONT, White, Background_black, 3, 33 + 4 * STAT_CHR_W + 6, 382, thermalManager.temp_hotend[0].target); + last_temp_hotend_target = thermalManager.temp_hotend[0].target; + } + if (last_temp_bed_current != thermalManager.temp_bed.celsius) { + DWIN_Draw_IntValue(true, true, 0, STAT_FONT, White, Background_black, 3, 178, 382, thermalManager.temp_bed.celsius); + last_temp_bed_current = thermalManager.temp_bed.celsius; + } + if (last_temp_bed_target != thermalManager.temp_bed.target) { + DWIN_Draw_IntValue(true, true, 0, STAT_FONT, White, Background_black, 3, 178 + 4 * STAT_CHR_W + 6, 382, thermalManager.temp_bed.target); + last_temp_bed_target = thermalManager.temp_bed.target; + } + if (last_speed != feedrate_percentage) { + DWIN_Draw_IntValue(true, true, 0, STAT_FONT, White, Background_black, 3, 33 + 2 * STAT_CHR_W, 429, feedrate_percentage); + last_speed = feedrate_percentage; + } + #if HAS_LEVELING + if (last_probe_zoffset != probe.offset.z) { + show_plus_or_minus(STAT_FONT, Background_black, 2, 2, 178 + STAT_CHR_W, 429, probe.offset.z * 100); + last_probe_zoffset = probe.offset.z; + } + #else + if (last_zoffset != zprobe_zoffset) { + show_plus_or_minus(STAT_FONT, Background_black, 2, 2, 178 + STAT_CHR_W, 429, zprobe_zoffset * 100); + last_zoffset = zprobe_zoffset; + } + #endif +} + +/** +* Read and cache the working directory. +* +* TODO: New code can follow the pattern of menu_media.cpp +* and rely on Marlin caching for performance. No need to +* cache files here. +* +*/ + +#ifndef strcasecmp_P + #define strcasecmp_P(a, b) strcasecmp((a), (b)) +#endif + +inline void make_name_without_ext(char *dst, char *src, int maxlen=MENU_CHAR_LIMIT) { + char * const name = card.longest_filename(); + size_t pos = strlen(name); // index of ending nul + + // For files, remove the extension + // which may be .gcode, .gco, or .g + if (!card.flag.filenameIsDir) + while (pos && src[pos] != '.') pos--; // find last '.' (stop at 0) + + int len = pos; // nul or '.' + if (len > maxlen) { // Keep the name short + pos = len = maxlen; // move nul down + dst[--pos] = '.'; // insert dots + dst[--pos] = '.'; + dst[--pos] = '.'; + } + + dst[len] = '\0'; // end it + + // Copy down to 0 + while (pos--) dst[pos] = src[pos]; +} + +inline void HMI_SDCardInit(void) { card.cdroot(); } + +void MarlinUI::refresh() { + // The card was mounted or unmounted + // or some other status change occurred + // DWIN_lcd_sd_status = false; // On next DWIN_Update + // HMI_SDCardUpdate(); +} + +#define ICON_Folder ICON_More + +char shift_name[LONG_FILENAME_LENGTH + 1]; +int8_t shift_amt; // = 0 +millis_t shift_ms; // = 0 + +// Init the shift name based on the highlighted item +inline void Init_Shift_Name() { + const bool is_subdir = !card.flag.workDirIsRoot; + const int8_t filenum = select_file.now - 1 - is_subdir; // Skip "Back" and ".." + const uint16_t fileCnt = card.get_num_Files(); + if (WITHIN(filenum, 0, fileCnt - 1)) { + card.getfilename_sorted(SD_ORDER(filenum, fileCnt)); + char * const name = card.longest_filename(); + make_name_without_ext(shift_name, name, 100); + } +} + +inline void Init_SDItem_Shift() { + shift_amt = 0; + shift_ms = select_file.now > 0 && strlen(shift_name) > MENU_CHAR_LIMIT + ? millis() + 750UL : 0; +} + +/** + * Display an SD item, adding a CDUP for subfolders. + */ +inline void Draw_SDItem(const uint16_t item, int16_t row=-1) { + if (row < 0) row = item + 1 + MROWS - index_file; + const bool is_subdir = !card.flag.workDirIsRoot; + if (is_subdir && item == 0) { + Draw_Menu_Line(row, ICON_Folder, (char*)".."); + return; + } + + card.getfilename_sorted(item - is_subdir); + char * const name = card.longest_filename(); + + // Init the current selected name + // This is used during scroll drawing + if (item == select_file.now - 1) { + make_name_without_ext(shift_name, name, 100); + Init_SDItem_Shift(); + } + + char str[strlen(name) + 1]; + + make_name_without_ext(str, name); + + Draw_Menu_Line(row, card.flag.filenameIsDir ? ICON_Folder : ICON_File, str); +} + +inline void Draw_SDItem_Shifted(int8_t &shift) { + // Limit to the number of chars past the cutoff + const size_t len = strlen(shift_name); + NOMORE(shift, _MAX((signed)len - MENU_CHAR_LIMIT, 0)); + + // Shorten to the available space + const size_t lastchar = _MIN((signed)len, shift + MENU_CHAR_LIMIT); + + const char c = shift_name[lastchar]; + shift_name[lastchar] = '\0'; + + const uint8_t row = select_file.now + MROWS - index_file; // skip "Back" and scroll + Erase_Menu_Text(row); + Draw_Menu_Line(row, 0, &shift_name[shift]); + + shift_name[lastchar] = c; +} + +// Redraw the first set of SD Files +inline void Redraw_SD_List() { + select_file.reset(); + index_file = MROWS; + + Clear_Menu_Area(); // Leave title bar unchanged + + Draw_Back_First(); + + // As many files as will fit + LOOP_L_N(i, _MIN(nr_sd_menu_items(), MROWS)) + Draw_SDItem(i, i + 1); + + Init_SDItem_Shift(); +} + +inline void SDCard_Up(void) { + card.cdup(); + Redraw_SD_List(); + DWIN_lcd_sd_status = false; // On next DWIN_Update +} + +inline void SDCard_Folder(char * const dirname) { + card.cd(dirname); + Redraw_SD_List(); + DWIN_lcd_sd_status = false; // On next DWIN_Update +} + +// +// Watch for media mount / unmount +// +void HMI_SDCardUpdate(void) { + if (HMI_flag.home_flag) return; + if (DWIN_lcd_sd_status != card.isMounted()) { + DWIN_lcd_sd_status = card.isMounted(); + // SERIAL_ECHOLNPAIR("HMI_SDCardUpdate: ", int(DWIN_lcd_sd_status)); + if (card.isMounted()) { + if (checkkey == SelectFile) + Redraw_SD_List(); + } + else { + // clean file icon + if (checkkey == SelectFile) { + Redraw_SD_List(); + } + else if (checkkey == PrintProcess || checkkey == Tune || printingIsActive()) { + // TODO: Move card removed abort handling + // to CardReader::manage_media. + card.flag.abort_sd_printing = true; + wait_for_heatup = false; + abort_flag = true; + } + } + DWIN_UpdateLCD(); + } +} + +/* Start */ +void HMI_StartFrame(const bool with_update) { + Goto_MainMenu(); + + DWIN_Draw_Rectangle(1, Background_black, 0, 360, 272, 479); + + DWIN_ICON_Show(ICON, ICON_HotendTemp, 13, 381); + #if HOTENDS > 1 + // DWIN_ICON_Show(ICON,ICON_HotendTemp, 13, 381); + #endif + DWIN_ICON_Show(ICON, ICON_BedTemp, 158, 381); + DWIN_ICON_Show(ICON, ICON_Speed, 13, 429); + DWIN_ICON_Show(ICON, ICON_Zoffset, 158, 428); + + // Draw initial Status Area + DWIN_Draw_IntValue(true, true, 0, STAT_FONT, White, Background_black, 3, 33, 382, thermalManager.temp_hotend[0].celsius); + DWIN_Draw_IntValue(true, true, 0, STAT_FONT, White, Background_black, 3, 33 + 4 * STAT_CHR_W + 6, 382, thermalManager.temp_hotend[0].target); + DWIN_Draw_IntValue(true, true, 0, STAT_FONT, White, Background_black, 3, 178, 382, thermalManager.temp_bed.celsius); + DWIN_Draw_IntValue(true, true, 0, STAT_FONT, White, Background_black, 3, 178 + 4 * STAT_CHR_W + 6, 382, thermalManager.temp_bed.target); + + DWIN_Draw_IntValue(true, true, 0, STAT_FONT, White, Background_black, 3, 33 + 2 * STAT_CHR_W, 429, feedrate_percentage); + DWIN_Draw_String(false, false, STAT_FONT, White, Background_black, 33 + (2 + 3) * STAT_CHR_W + 2, 429, (char*)"%"); + + show_plus_or_minus(STAT_FONT, Background_black, 2, 2, 178, 429, BABY_Z_VAR * 100); + DWIN_Draw_String(false, false, STAT_FONT, White, Background_black, 33 + 3 * STAT_CHR_W + 5, 383, (char*)"/"); + DWIN_Draw_String(false, false, STAT_FONT, White, Background_black, 178 + 3 * STAT_CHR_W + 5, 383, (char*)"/"); + + if (with_update) { + DWIN_UpdateLCD(); + delay(5); + } +} + +inline void Draw_Info_Menu() { + Clear_Main_Window(); + + DWIN_Draw_String(false, false, font8x16, White, Background_black, (DWIN_WIDTH - strlen(MACHINE_SIZE) * MENU_CHR_W) / 2, 122, (char*)MACHINE_SIZE); + DWIN_Draw_String(false, false, font8x16, White, Background_black, (DWIN_WIDTH - strlen(SHORT_BUILD_VERSION) * MENU_CHR_W) / 2, 195, (char*)SHORT_BUILD_VERSION); + + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 30, 17, 271 - 214, 479 - 450, 14, 8); + + DWIN_Frame_AreaCopy(1, 197, 149, 271 - 19, 479 - 318, 108, 102); + DWIN_Frame_AreaCopy(1, 1, 164, 271 - 215, 479 - 303, 108, 175); + DWIN_Frame_AreaCopy(1, 58, 164, 271 - 158, 479 - 303, 105, 248); + DWIN_Draw_String(false, false, font8x16, White, Background_black, (DWIN_WIDTH - strlen(CORP_WEBSITE_C) * MENU_CHR_W) / 2, 268, (char*)CORP_WEBSITE_C); + } + else { + #ifdef USE_STRING_HEADINGS + Draw_Title("Info"); // TODO: GET_TEXT_F + #else + DWIN_Frame_AreaCopy(1, 190, 16, 271 - 56, 479 - 453, 14, 8); + #endif + + DWIN_Frame_AreaCopy(1, 120, 150, 146, 479 - 318, 124, 102); + DWIN_Frame_AreaCopy(1, 146, 151, 271 - 17, 479 - 318, 82, 175); + DWIN_Frame_AreaCopy(1, 0, 165, 271 - 177, 479 - 304, 89, 248); + DWIN_Draw_String(false, false, font8x16, White, Background_black, (DWIN_WIDTH - strlen(CORP_WEBSITE_E) * MENU_CHR_W) / 2, 268, (char*)CORP_WEBSITE_E); + } + + Draw_Back_First(); + LOOP_L_N(i, 3) { + DWIN_ICON_Show(ICON, ICON_PrintSize + i, 26, 99 + i * 73); + DWIN_Draw_Line(Line_Color, 16, MBASE(2) + i * 73, 256, 156 + i * 73); + } +} + +inline void Draw_Print_File_Menu() { + Clear_Title_Bar(); + + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 0, 31, 271 - 216, 479 - 435, 14, 8); + } + else { + #ifdef USE_STRING_HEADINGS + Draw_Title("Print file"); // TODO: GET_TEXT_F + #else + DWIN_Frame_AreaCopy(1, 52, 31, 271 - 134, 479 - 438, 14, 8); // "Print file" + #endif + } + + Redraw_SD_List(); +} + +/* Main Process */ +void HMI_MainMenu(void) { + ENCODER_DiffState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + + if (encoder_diffState == ENCODER_DIFF_CW) { + if (select_page.inc(3)) { + switch (select_page.now) { + case 0: ICON_Print(); break; + case 1: ICON_Print(); ICON_Prepare(); break; + case 2: ICON_Prepare(); ICON_Control(); break; + case 3: ICON_Control(); TERN(HAS_LEVELING, ICON_Leveling, ICON_StartInfo)(1); break; + } + } + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + if (select_page.dec()) { + switch (select_page.now) { + case 0: ICON_Print(); ICON_Prepare(); break; + case 1: ICON_Prepare(); ICON_Control(); break; + case 2: ICON_Control(); TERN(HAS_LEVELING, ICON_Leveling, ICON_StartInfo)(0); break; + case 3: TERN(HAS_LEVELING, ICON_Leveling, ICON_StartInfo)(1); break; + } + } + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + switch (select_page.now) { + /* Print File */ + case 0: + checkkey = SelectFile; + Draw_Print_File_Menu(); + break; + + /* Prepare */ + case 1: + checkkey = Prepare; + select_prepare.reset(); + index_prepare = MROWS; + Draw_Prepare_Menu(); + break; + + /* Control */ + case 2: + checkkey = Control; + select_control.reset(); + index_control = MROWS; + Draw_Control_Menu(); + break; + + /* Leveling */ + case 3: + #if HAS_LEVELING + checkkey = Leveling; + HMI_Leveling(); + #else + checkkey = Info; + Draw_Info_Menu(); + #endif + break; + } + } + DWIN_UpdateLCD(); +} + +/* Select (and Print) File */ +void HMI_SelectFile(void) { + ENCODER_DiffState encoder_diffState = get_encoder_state(); + + const uint16_t hasUpDir = !card.flag.workDirIsRoot; + + if (encoder_diffState == ENCODER_DIFF_NO) { + if (shift_ms && select_file.now >= 1 + hasUpDir) { + // Scroll selected filename every second + const millis_t ms = millis(); + if (ELAPSED(ms, shift_ms)) { + const bool was_reset = shift_amt < 0; + shift_ms = ms + 375UL + was_reset * 250UL; // ms per character + int8_t shift_new = shift_amt + 1; // Try to shift by... + Draw_SDItem_Shifted(shift_new); // Draw the item + if (!was_reset && shift_new == 0) // Was it limited to 0? + shift_ms = 0; // No scrolling needed + else if (shift_new == shift_amt) // Scroll reached the end + shift_new = -1; // Reset + shift_amt = shift_new; // Set new scroll + } + } + return; + } + + // First pause is long. Easy. + // On reset, long pause must be after 0. + + const uint16_t fullCnt = nr_sd_menu_items(); + + if (encoder_diffState == ENCODER_DIFF_CW && fullCnt) { + if (select_file.inc(fullCnt)) { + const uint8_t itemnum = select_file.now - 1; // -1 for "Back" + if (shift_ms) { // If line was shifted + Erase_Menu_Text(select_file.now - 1 + MROWS - index_file); // Erase and + Draw_SDItem(itemnum - 1); // redraw + } + if (select_file.now > MROWS && select_file.now > index_file) { // Cursor past the bottom + index_file = select_file.now; // New bottom line + Scroll_Menu(DWIN_SCROLL_UP); + Draw_SDItem(itemnum, MROWS); // Draw and init the shift name + } + else { + Move_Highlight(1, select_file.now + MROWS - index_file); // Just move highlight + Init_Shift_Name(); // ...and init the shift name + } + Init_SDItem_Shift(); + } + } + else if (encoder_diffState == ENCODER_DIFF_CCW && fullCnt) { + if (select_file.dec()) { + const uint8_t itemnum = select_file.now - 1; // -1 for "Back" + if (shift_ms) { // If line was shifted + Erase_Menu_Text(select_file.now + 1 + MROWS - index_file); // Erase and + Draw_SDItem(itemnum + 1); // redraw + } + if (select_file.now < index_file - MROWS) { // Cursor past the top + index_file--; // New bottom line + Scroll_Menu(DWIN_SCROLL_DOWN); + if (index_file == MROWS) { + Draw_Back_First(); + shift_ms = 0; + } + else { + Draw_SDItem(itemnum, 0); // Draw the item (and init shift name) + } + } + else { + Move_Highlight(-1, select_file.now + MROWS - index_file); // Just move highlight + Init_Shift_Name(); // ...and init the shift name + } + Init_SDItem_Shift(); // Reset left. Init timer. + } + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + if (select_file.now == 0) { + /* back */ + select_page.set(0); + Goto_MainMenu(); + } + else if (hasUpDir && select_file.now == 1) { + /* CDUP */ + SDCard_Up(); + goto HMI_SelectFileExit; + } + else { + const uint16_t filenum = select_file.now - 1 - hasUpDir; + card.getfilename_sorted(SD_ORDER(filenum, card.get_num_Files())); + + // Enter that folder! + if (card.flag.filenameIsDir) { + SDCard_Folder(card.filename); + goto HMI_SelectFileExit; + } + + // Reset highlight for next entry + select_print.reset(); + select_file.reset(); + + // Start choice and print SD file + HMI_flag.heat_flag = 1; + HMI_flag.print_finish = 0; + HMI_ValueStruct.show_mode = 0; + + card.openAndPrintFile(card.filename); + + #if FAN_COUNT > 0 + // All fans on for Ender 3 v2 ? + // The slicer should manage this for us. + // for (uint8_t i = 0; i < FAN_COUNT; i++) + // thermalManager.fan_speed[i] = FANON; + #endif + + Goto_PrintProcess(); + } + } +HMI_SelectFileExit: + DWIN_UpdateLCD(); +} + +/* Printing */ +void HMI_Printing(void) { + ENCODER_DiffState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + + if (HMI_flag.confirm_flag) { + if (encoder_diffState == ENCODER_DIFF_ENTER) { + HMI_flag.confirm_flag = 0; + abort_flag = 1; + } + return; + } + + // Avoid flicker by updating only the previous menu + if (encoder_diffState == ENCODER_DIFF_CW) { + if (select_print.inc(2)) { + switch (select_print.now) { + case 0: ICON_Tune(); break; + case 1: + ICON_Tune(); + if (printingIsPaused()) ICON_Continue(); else ICON_Pause(); + break; + case 2: + if (printingIsPaused()) ICON_Continue(); else ICON_Pause(); + ICON_Stop(); + break; + } + } + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + if (select_print.dec()) { + switch (select_print.now) { + case 0: + ICON_Tune(); + if (printingIsPaused()) ICON_Continue(); else ICON_Pause(); + break; + case 1: + if (printingIsPaused()) ICON_Continue(); else ICON_Pause(); + ICON_Stop(); + break; + case 2: ICON_Stop(); break; + } + } + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + switch (select_print.now) { + case 0: // setting + checkkey = Tune; + HMI_ValueStruct.show_mode = 0; + select_tune.reset(); + index_tune = 5; + Draw_Tune_Menu(); + break; + case 1: // pause + /* pause */ + if (HMI_flag.pause_flag) { + ICON_Pause(); + + char cmd[40]; + cmd[0] = '\0'; + + #if ENABLED(PAUSE_HEAT) + if (tempbed) sprintf_P(cmd, PSTR("M190 S%i\n"), tempbed); + if (temphot) sprintf_P(&cmd[strlen(cmd)], PSTR("M109 S%i\n"), temphot); + #endif + + strcat_P(cmd, PSTR("M24")); + queue.inject(cmd); + } + else { + HMI_flag.select_flag = 1; + checkkey = Print_window; + Popup_window_PauseOrStop(); + } + break; + + case 2: // stop + /* stop */ + HMI_flag.select_flag = 1; + checkkey = Print_window; + Popup_window_PauseOrStop(); + break; + + default: + break; + } + } + DWIN_UpdateLCD(); +} + +/* pause and stop window */ +void HMI_PauseOrStop(void) { + ENCODER_DiffState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + + if (encoder_diffState == ENCODER_DIFF_CW) { + Draw_Select_Highlight(false); + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + Draw_Select_Highlight(true); + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + if (select_print.now == 1) { // pause window + if (HMI_flag.select_flag) { + pause_action_flag = 1; + ICON_Continue(); + #if ENABLED(POWER_LOSS_RECOVERY) + if (recovery.enabled) recovery.save(true); + #endif + queue.inject_P(PSTR("M25")); + } + else { + // cancel pause + } + Goto_PrintProcess(); + } + else if (select_print.now == 2) { // stop window + if (HMI_flag.select_flag) { + wait_for_heatup = false; // Stop waiting for heater + + #if 0 + // TODO: In ExtUI or MarlinUI add a common stop event + // card.flag.abort_sd_printing = true; + #else + checkkey = Back_Main; + // Wait for planner moves to finish! + if (HMI_flag.home_flag) planner.synchronize(); + card.endFilePrint(); + #ifdef ACTION_ON_CANCEL + host_action_cancel(); + #endif + #ifdef EVENT_GCODE_SD_STOP + Popup_Window_Home(); + queue.inject_P(PSTR(EVENT_GCODE_SD_STOP)); // For Ender 3 "G28 X Y" + #endif + abort_flag = true; + #endif + } + else { + Goto_PrintProcess(); // cancel stop + } + } + } + DWIN_UpdateLCD(); +} + +inline void Draw_Move_Menu() { + Clear_Main_Window(); + + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 192, 1, 271 - 38, 479 - 465, 14, 8); + DWIN_Frame_AreaCopy(1, 58, 118, 271 - 165, 479 - 347, LBLX, MBASE(1)); + DWIN_Frame_AreaCopy(1, 109, 118, 271 - 114, 479 - 347, LBLX, MBASE(2)); + DWIN_Frame_AreaCopy(1, 160, 118, 271 - 62, 479 - 347, LBLX, MBASE(3)); + DWIN_Frame_AreaCopy(1, 212, 118, 271 - 18, 479 - 348, LBLX, MBASE(4)); + } + else { + #ifdef USE_STRING_HEADINGS + Draw_Title("Move"); // TODO: GET_TEXT_F + #else + DWIN_Frame_AreaCopy(1, 231, 2, 271 - 6, 479 - 467, 14, 8); + #endif + draw_move_en(MBASE(1)); say_x(33 + 3, MBASE(1)); // "Move X" + draw_move_en(MBASE(2)); say_y(33 + 3, MBASE(2)); // "Move Y" + draw_move_en(MBASE(3)); say_z(33 + 3, MBASE(3)); // "Move Z" + DWIN_Frame_AreaCopy(1, 123, 192, 271 - 95, 479 - 277, LBLX, MBASE(4)); // "Extruder" + } + + Draw_Back_First(select_axis.now == 0); + if (select_axis.now) Draw_Menu_Cursor(select_axis.now); + + LOOP_L_N(i, MROWS) Draw_Menu_Line(i + 1, ICON_MoveX + i); +} + +/* Prepare */ +void HMI_Prepare(void) { + ENCODER_DiffState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + + // Avoid flicker by updating only the previous menu + if (encoder_diffState == ENCODER_DIFF_CW) { + if (select_prepare.inc(8)) { + if (select_prepare.now > MROWS && select_prepare.now > index_prepare) { + index_prepare = select_prepare.now; + + // Scroll up and draw a blank bottom line + Scroll_Menu(DWIN_SCROLL_UP); + Draw_Menu_Icon(MROWS, ICON_Axis + select_prepare.now - 1); + + // Draw "More" icon for sub-menus + if (index_prepare < 7) Draw_More_Icon(MROWS - index_prepare + 1); + + if (index_prepare == 6) Prepare_Item_ABS(MROWS); + else if (index_prepare == 7) Prepare_Item_Cool(MROWS); + else if (index_prepare == 8) Prepare_Item_Lang(MROWS); + } + else { + Move_Highlight(1, select_prepare.now + MROWS - index_prepare); + } + } + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + if (select_prepare.dec()) { + if (select_prepare.now < index_prepare - MROWS) { + index_prepare--; + Scroll_Menu(DWIN_SCROLL_DOWN); + + if (index_prepare == MROWS) + Draw_Back_First(); + else + Draw_Menu_Line(0, ICON_Axis + select_prepare.now - 1); + + if (index_prepare < 7) Draw_More_Icon(MROWS - index_prepare + 1); + + if (index_prepare == 6) Prepare_Item_Move(0); + else if (index_prepare == 7) Prepare_Item_Disable(0); + else if (index_prepare == 8) Prepare_Item_Home(0); + } + else { + Move_Highlight(-1, select_prepare.now + MROWS - index_prepare); + } + } + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + switch (select_prepare.now) { + case 0: // back + select_page.set(1); + Goto_MainMenu(); + break; + case 1: // axis move + checkkey = AxisMove; + select_axis.reset(); + Draw_Move_Menu(); + + queue.inject_P(PSTR("G92 E0")); + current_position.e = HMI_ValueStruct.Move_E_scale = 0; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 216, MBASE(1), current_position[X_AXIS] * MINUNITMULT); + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 216, MBASE(2), current_position[Y_AXIS] * MINUNITMULT); + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 216, MBASE(3), current_position[Z_AXIS] * MINUNITMULT); + show_plus_or_minus(font8x16, Background_black, 3, 1, 216, MBASE(4), current_position.e * MINUNITMULT); + break; + case 2: // close motion + queue.inject_P(PSTR("M84")); + break; + case 3: // homing + checkkey = Last_Prepare; + index_prepare = MROWS; + queue.inject_P(PSTR("G28")); // G28 will set home_flag + Popup_Window_Home(); + break; + case 4: // Z-offset + #if HAS_LEVELING + checkkey = Homeoffset; + HMI_ValueStruct.show_mode = -4; + HMI_ValueStruct.offset_value = probe.offset.z * 100; + show_plus_or_minus(font8x16, Select_Color, 2, 2, 202, MBASE(4 + MROWS - index_prepare), HMI_ValueStruct.offset_value); + EncoderRate.encoderRateEnabled = 1; + #else + // Apply workspace offset, making the current position 0,0,0 + queue.inject_P(PSTR("G92 X0 Y0 Z0")); + buzzer.tone(100, 659); + buzzer.tone(100, 698); + #endif + break; + case 5: // PLA preheat + thermalManager.setTargetHotend(ui.material_preset[0].hotend_temp, 0); + thermalManager.setTargetBed(ui.material_preset[0].bed_temp); + thermalManager.set_fan_speed(0, ui.material_preset[0].fan_speed); + break; + case 6: // ABS preheat + thermalManager.setTargetHotend(ui.material_preset[1].hotend_temp, 0); + thermalManager.setTargetBed(ui.material_preset[1].bed_temp); + thermalManager.set_fan_speed(0, ui.material_preset[1].fan_speed); + break; + case 7: // cool + thermalManager.zero_fan_speeds(); + thermalManager.disable_all_heaters(); + break; + case 8: // language + /* select language */ + HMI_flag.language_flag = !HMI_flag.language_flag; + if (HMI_flag.language_flag) { + set_chinese_to_eeprom(); + DWIN_JPG_CacheTo1(Language_Chinese); + } + else { + set_english_to_eeprom(); + DWIN_JPG_CacheTo1(Language_English); + } + Draw_Prepare_Menu(); + break; + default: + break; + } + } + DWIN_UpdateLCD(); +} + +void Draw_Temperature_Menu() { + Clear_Main_Window(); + + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 236, 2, 271 - 8, 479 - 466, 14, 8); + + DWIN_Frame_AreaCopy(1, 1, 134, 271 - 215, 479 - 333, LBLX, MBASE(1)); + DWIN_Frame_AreaCopy(1, 58, 134, 271 - 158, 479 - 333, LBLX, MBASE(2)); + DWIN_Frame_AreaCopy(1, 115, 134, 271 - 101, 479 - 333, LBLX, MBASE(3)); + DWIN_Frame_AreaCopy(1, 100, 89, 271 - 93, 479 - 378, LBLX, MBASE(4)); + DWIN_Frame_AreaCopy(1, 180, 89, 271 - 11, 479 - 379, LBLX, MBASE(5)); + } + else { + #ifdef USE_STRING_HEADINGS + Draw_Title("Temperature"); // TODO: GET_TEXT_F + #else + DWIN_Frame_AreaCopy(1, 56, 16, 271 - 130, 479 - 450 - 1, 14, 8); + #endif + + DWIN_Frame_AreaCopy(1, 197, 104, 271 - 33, 479 - 365, LBLX, MBASE(1)); // Nozzle... + DWIN_Frame_AreaCopy(1, 1, 89, 271 - 188, 479 - 377 - 1, LBLX + 41 + 3, MBASE(1)); // ...Temperature + DWIN_Frame_AreaCopy(1, 240, 104, 271 - 7, 479 - 365, LBLX, MBASE(2)); // Bed... + DWIN_Frame_AreaCopy(1, 1, 89, 271 - 188, 479 - 377 - 1, LBLX + 24 + 3, MBASE(2)); // ...Temperature + DWIN_Frame_AreaCopy(1, 0, 119, 271 - 207, 479 - 347, LBLX, MBASE(3)); // Fan speed + DWIN_Frame_AreaCopy(1, 107, 76, 271 - 115, 479 - 393, LBLX, MBASE(4)); // Preheat... + DWIN_Frame_AreaCopy(1, 157, 76, 181, 479 - 393, LBLX + 49 + 3, MBASE(4)); // ...PLA + DWIN_Frame_AreaCopy(1, 131, 119, 271 - 89, 479 - 347, LBLX + 49 + 24 + 6, MBASE(4)); // PLA setting + DWIN_Frame_AreaCopy(1, 107, 76, 271 - 115, 479 - 393, LBLX, MBASE(5)); // Preheat... + DWIN_Frame_AreaCopy(1, 172, 76, 198, 479 - 393, LBLX + 49 + 3, MBASE(5)); // ...ABS + DWIN_Frame_AreaCopy(1, 131, 119, 271 - 89, 479 - 347, LBLX + 49 + 3 + 26 + 3, MBASE(5)); // ABS setting + } + + Draw_Back_First(select_temp.now == 0); + if (select_temp.now) Draw_Menu_Cursor(select_temp.now); + + LOOP_L_N(i, 5) Draw_Menu_Line(i + 1, ICON_SetEndTemp + i); + + Draw_More_Icon(4); + Draw_More_Icon(5); + + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(1), thermalManager.temp_hotend[0].target); + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(2), thermalManager.temp_bed.target); + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(3), thermalManager.fan_speed[0]); +} + +/* Control */ +void HMI_Control(void) { + ENCODER_DiffState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + + // Avoid flicker by updating only the previous menu + if (encoder_diffState == ENCODER_DIFF_CW) { + #define CONTROL_ITEMS (5 + ENABLED(HAS_LEVELING)) + if (select_control.inc(CONTROL_ITEMS)) { + if (select_control.now > MROWS && select_control.now > index_control) { + index_control = select_control.now; + Scroll_Menu(DWIN_SCROLL_UP); + Draw_Menu_Icon(MROWS, ICON_Temperature + select_control.now - 1); + Draw_More_Icon(1 + MROWS - index_control); // Temperature > + Draw_More_Icon(2 + MROWS - index_control); // Motion > + if (index_control > MROWS) { + Draw_More_Icon(6 + MROWS - index_control); // Info > + if (HMI_flag.language_flag) + DWIN_Frame_AreaCopy(1, 231, 104, 271 - 13, 479 - 363, LBLX, MBASE(5)); + else + DWIN_Frame_AreaCopy(1, 0, 104, 271 - 247, 479 - 365, LBLX, MBASE(5)); + } + } + else { + Move_Highlight(1, select_control.now + MROWS - index_control); + } + } + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + if (select_control.dec()) { + if (select_control.now < index_control - MROWS) { + index_control--; + Scroll_Menu(DWIN_SCROLL_DOWN); + if (index_control == MROWS) + Draw_Back_First(); + else + Draw_Menu_Line(0, ICON_Temperature + select_control.now - 1); + Draw_More_Icon(0 + MROWS - index_control + 1); // Temperature > + Draw_More_Icon(1 + MROWS - index_control + 1); // Motion > + } + else { + Move_Highlight(-1, select_control.now + MROWS - index_control); + } + } + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + switch (select_control.now) { + case 0: // back + select_page.set(2); + Goto_MainMenu(); + break; + case 1: // temperature + checkkey = TemperatureID; + HMI_ValueStruct.show_mode = -1; + select_temp.reset(); + Draw_Temperature_Menu(); + break; + case 2: // motion + checkkey = Motion; + select_motion.reset(); + Draw_Motion_Menu(); + break; + case 3: // write EEPROM + if (settings.save()) { + buzzer.tone(100, 659); + buzzer.tone(100, 698); + } + else + buzzer.tone(20, 440); + break; + case 4: // read EEPROM + if (settings.load()) { + buzzer.tone(100, 659); + buzzer.tone(100, 698); + } + else {buzzer.tone(20, 440);} + break; + case 5: // resume EEPROM + settings.reset(); + #if HAS_BUZZER + buzzer.tone(100, 659); + buzzer.tone(100, 698); + #endif + break; + case 6: // info + checkkey = Info; + Draw_Info_Menu(); + break; + default: + break; + } + } + DWIN_UpdateLCD(); +} + +/* Leveling */ +void HMI_Leveling(void) { + Popup_Window_Leveling(); + DWIN_UpdateLCD(); + queue.inject_P(PSTR("G28O\nG29")); +} + +/* Axis Move */ +void HMI_AxisMove(void) { + ENCODER_DiffState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + + #if HAS_HOTEND + // popup window resume + if (HMI_flag.ETempTooLow_flag) { + if (encoder_diffState == ENCODER_DIFF_ENTER) { + HMI_flag.ETempTooLow_flag = 0; + Draw_Move_Menu(); + current_position.e = HMI_ValueStruct.Move_E_scale = 0; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 216, MBASE(1), HMI_ValueStruct.Move_X_scale); + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 216, MBASE(2), HMI_ValueStruct.Move_Y_scale); + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 216, MBASE(3), HMI_ValueStruct.Move_Z_scale); + show_plus_or_minus(font8x16, Background_black, 3, 1, 216, MBASE(4), HMI_ValueStruct.Move_E_scale); + DWIN_UpdateLCD(); + } + return; + } + #endif + + // Avoid flicker by updating only the previous menu + if (encoder_diffState == ENCODER_DIFF_CW) { + if (select_axis.inc(4)) Move_Highlight(1, select_axis.now); + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + if (select_axis.dec()) Move_Highlight(-1, select_axis.now); + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + switch (select_axis.now) { + case 0: // back + checkkey = Prepare; + select_prepare.set(1); + index_prepare = MROWS; + Draw_Prepare_Menu(); + break; + case 1: // X axis move + checkkey = Move_X; + HMI_ValueStruct.Move_X_scale = current_position[X_AXIS] * MINUNITMULT; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(1), HMI_ValueStruct.Move_X_scale); + EncoderRate.encoderRateEnabled = 1; + break; + case 2: // Y axis move + checkkey = Move_Y; + HMI_ValueStruct.Move_Y_scale = current_position[Y_AXIS] * MINUNITMULT; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(2), HMI_ValueStruct.Move_Y_scale); + EncoderRate.encoderRateEnabled = 1; + break; + case 3: // Z axis move + checkkey = Move_Z; + HMI_ValueStruct.Move_Z_scale = current_position[Z_AXIS] * MINUNITMULT; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 216, MBASE(3), HMI_ValueStruct.Move_Z_scale); + EncoderRate.encoderRateEnabled = 1; + break; + #if HAS_HOTEND + case 4: // Extruder + // window tips + #ifdef PREVENT_COLD_EXTRUSION + if (thermalManager.temp_hotend[0].celsius < EXTRUDE_MINTEMP) { + HMI_flag.ETempTooLow_flag = 1; + Popup_Window_ETempTooLow(); + DWIN_UpdateLCD(); + return; + } + #endif + checkkey = Extruder; + HMI_ValueStruct.Move_E_scale = current_position.e * MINUNITMULT; + show_plus_or_minus(font8x16, Select_Color, 3, 1, 216, MBASE(4), HMI_ValueStruct.Move_E_scale); + EncoderRate.encoderRateEnabled = 1; + break; + #endif + } + } + DWIN_UpdateLCD(); +} + +/* TemperatureID */ +void HMI_Temperature(void) { + ENCODER_DiffState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + + // Avoid flicker by updating only the previous menu + if (encoder_diffState == ENCODER_DIFF_CW) { + if (select_temp.inc(5)) Move_Highlight(1, select_temp.now); + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + if (select_temp.dec()) Move_Highlight(-1, select_temp.now); + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + switch (select_temp.now) { + case 0: // back + checkkey = Control; + select_control.set(1); + index_control = MROWS; + Draw_Control_Menu(); + break; + #if HAS_HOTEND + case 1: // nozzle temperature + checkkey = ETemp; + HMI_ValueStruct.E_Temp = thermalManager.temp_hotend[0].target; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(1), thermalManager.temp_hotend[0].target); + EncoderRate.encoderRateEnabled = 1; + break; + #endif + #if HAS_HEATED_BED + case 2: // bed temperature + checkkey = BedTemp; + HMI_ValueStruct.Bed_Temp = thermalManager.temp_bed.target; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(2), thermalManager.temp_bed.target); + EncoderRate.encoderRateEnabled = 1; + break; + #endif + #if HAS_FAN + case 3: // fan speed + checkkey = FanSpeed; + HMI_ValueStruct.Fan_speed = thermalManager.fan_speed[0]; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(3), thermalManager.fan_speed[0]); + EncoderRate.encoderRateEnabled = 1; + break; + #endif + #if HAS_HOTEND + case 4: // PLA preheat setting + checkkey = PLAPreheat; + select_PLA.reset(); + HMI_ValueStruct.show_mode = -2; + + Clear_Main_Window(); + + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 59, 16, 271 - 132, 479 - 450, 14, 8); + + DWIN_Frame_AreaCopy(1, 100, 89, 124, 479 - 378, LBLX, MBASE(1)); + DWIN_Frame_AreaCopy(1, 1, 134, 271 - 215, 479 - 333, LBLX + 24, MBASE(1)); // PLA nozzle temp + DWIN_Frame_AreaCopy(1, 100, 89, 124, 479 - 378, LBLX, MBASE(2)); + DWIN_Frame_AreaCopy(1, 58, 134, 271 - 158, 479 - 333, LBLX + 24, MBASE(2)); // PLA bed temp + DWIN_Frame_AreaCopy(1, 100, 89, 124, 479 - 378, LBLX, MBASE(3)); + DWIN_Frame_AreaCopy(1, 115, 134, 271 - 101, 479 - 333, LBLX + 24, MBASE(3)); // PLA fan speed + DWIN_Frame_AreaCopy(1, 72, 148, 271 - 120, 479 - 317, LBLX, MBASE(4)); // save PLA configuration + } + else { + #ifdef USE_STRING_HEADINGS + Draw_Title("PLA Settings"); // TODO: GET_TEXT_F + #else + DWIN_Frame_AreaCopy(1, 56, 16, 271 - 130, 479 - 450 - 1, 14, 8); + #endif + + DWIN_Frame_AreaCopy(1, 157, 76, 181, 479 - 393, LBLX, MBASE(1)); + DWIN_Frame_AreaCopy(1, 197, 104, 271 - 33, 479 - 365, LBLX + 24 + 3, MBASE(1)); + DWIN_Frame_AreaCopy(1, 1, 89, 271 - 188, 479 - 377 - 1, LBLX + 24 + 41 + 6, MBASE(1)); // PLA nozzle temp + DWIN_Frame_AreaCopy(1, 157, 76, 181, 479 - 393, LBLX, MBASE(2) + 3); + DWIN_Frame_AreaCopy(1, 240, 104, 271 - 7, 479 - 365, LBLX + 24 + 3, MBASE(2) + 3); + DWIN_Frame_AreaCopy(1, 1, 89, 271 - 188, 479 - 377 - 1, LBLX + 24 + 24 + 6, MBASE(2) + 3); // PLA bed temp + DWIN_Frame_AreaCopy(1, 157, 76, 181, 479 - 393, LBLX, MBASE(3)); + DWIN_Frame_AreaCopy(1, 0, 119, 271 - 207, 479 - 347, LBLX + 24 + 3, MBASE(3)); // PLA fan speed + DWIN_Frame_AreaCopy(1, 97, 165, 271 - 42, 479 - 301 - 1, LBLX, MBASE(4)); // save PLA configuration + } + + Draw_Back_First(); + + Draw_Menu_Line(1, ICON_SetEndTemp); + Draw_Menu_Line(2, ICON_SetBedTemp); + Draw_Menu_Line(3, ICON_FanSpeed); + Draw_Menu_Line(4, ICON_WriteEEPROM); + + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(1), ui.material_preset[0].hotend_temp); + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(2), ui.material_preset[0].bed_temp); + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(3), ui.material_preset[0].fan_speed); + + break; + + case 5: // ABS preheat setting + checkkey = ABSPreheat; + select_ABS.reset(); + HMI_ValueStruct.show_mode = -3; + + Clear_Main_Window(); + + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 142, 16, 271 - 48, 479 - 450, 14, 8); + + DWIN_Frame_AreaCopy(1, 180, 89, 204, 479 - 379, LBLX, MBASE(1)); + DWIN_Frame_AreaCopy(1, 1, 134, 271 - 215, 479 - 333, LBLX + 24, MBASE(1)); // ABS nozzle temp + DWIN_Frame_AreaCopy(1, 180, 89, 204, 479 - 379, LBLX, MBASE(2)); + DWIN_Frame_AreaCopy(1, 58, 134, 271 - 158, 479 - 333, LBLX + 24, MBASE(2)); // ABS bed temp + DWIN_Frame_AreaCopy(1, 180, 89, 204, 479 - 379, LBLX, MBASE(3)); + DWIN_Frame_AreaCopy(1, 115, 134, 271 - 101, 479 - 333, LBLX + 24, MBASE(3)); // ABS fan speed + DWIN_Frame_AreaCopy(1, 72, 148, 271 - 120, 479 - 317, LBLX, MBASE(4)); + DWIN_Frame_AreaCopy(1, 180, 89, 204, 479 - 379, LBLX + 28, MBASE(4) + 2); // save ABS configuration + } + else { + #ifdef USE_STRING_HEADINGS + Draw_Title("ABS Settings"); // TODO: GET_TEXT_F + #else + DWIN_Frame_AreaCopy(1, 56, 16, 271 - 130, 479 - 450 - 1, 14, 8); + #endif + + DWIN_Frame_AreaCopy(1, 172, 76, 198, 479 - 393, LBLX, MBASE(1)); + DWIN_Frame_AreaCopy(1, 197, 104, 271 - 33, 479 - 365, LBLX + 24 + 3, MBASE(1)); + DWIN_Frame_AreaCopy(1, 1, 89, 271 - 188, 479 - 377 - 1, LBLX + 24 + 41 + 6, MBASE(1)); // ABS nozzle temp + DWIN_Frame_AreaCopy(1, 172, 76, 198, 479 - 393, LBLX, MBASE(2) + 3); + DWIN_Frame_AreaCopy(1, 240, 104, 271 - 7, 479 - 365, LBLX + 24 + 3, MBASE(2) + 3); + DWIN_Frame_AreaCopy(1, 1, 89, 271 - 188, 479 - 377 - 1, LBLX + 24 + 24 + 6, MBASE(2) + 3); // ABS bed temp + DWIN_Frame_AreaCopy(1, 172, 76, 198, 479 - 393, LBLX, MBASE(3)); + DWIN_Frame_AreaCopy(1, 0, 119, 271 - 207, 479 - 347, LBLX + 24 + 3, MBASE(3)); // ABS fan speed + DWIN_Frame_AreaCopy(1, 97, 165, 271 - 42, 479 - 301 - 1, LBLX, MBASE(4)); + DWIN_Frame_AreaCopy(1, 172, 76, 198, 479 - 393, LBLX + 33, MBASE(4)); // save ABS configuration + } + + Draw_Back_First(); + + Draw_Menu_Line(1, ICON_SetEndTemp); + Draw_Menu_Line(2, ICON_SetBedTemp); + Draw_Menu_Line(3, ICON_FanSpeed); + Draw_Menu_Line(4, ICON_WriteEEPROM); + + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(1), ui.material_preset[1].hotend_temp); + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(2), ui.material_preset[1].bed_temp); + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 3, 216, MBASE(3), ui.material_preset[1].fan_speed); + + break; + #endif // if HAS_HOTEND + } + } + DWIN_UpdateLCD(); +} + +inline void Draw_Max_Speed_Menu() { + Clear_Main_Window(); + + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 1, 16, 271 - 243, 479 - 451, 14, 8); + + auto say_max_speed = [](const uint16_t row) { + DWIN_Frame_AreaCopy(1, 173, 133, 228, 479 - 332, LBLX, row); // "Max speed" + }; + + say_max_speed(MBASE(1)); // "Max speed" + DWIN_Frame_AreaCopy(1, 229, 133, 236, 479 - 332, LBLX + 55 + 3, MBASE(1)); // X + say_max_speed(MBASE(2)); // "Max speed" + DWIN_Frame_AreaCopy(1, 1, 150, 271 - 264, 479 - 319, LBLX + 55 + 3, MBASE(2) + 3); // Y + say_max_speed(MBASE(3)); // "Max speed" + DWIN_Frame_AreaCopy(1, 9, 150, 271 - 255, 479 - 319, LBLX + 55 + 3, MBASE(3) + 3); // Z + say_max_speed(MBASE(4)); // "Max speed" + DWIN_Frame_AreaCopy(1, 18, 150, 271 - 246, 479 - 319, LBLX + 55 + 3, MBASE(4) + 3); // E + } + else { + #ifdef USE_STRING_HEADINGS + Draw_Title("Max Speed (mm/s)"); // TODO: GET_TEXT_F + #else + DWIN_Frame_AreaCopy(1, 144, 16, 271 - 82, 479 - 453, 14, 8); + #endif + + draw_max_en(MBASE(1)); // "Max" + DWIN_Frame_AreaCopy(1, 184, 119, 271 - 37, 479 - 347, LBLX + 24 + 3, MBASE(1)); // "Speed X" + + draw_max_en(MBASE(2)); // "Max" + draw_speed_en(24 + 3, MBASE(2)); // "Speed" + say_y(24 + 40 + 6, MBASE(2)); // "Y" + + draw_max_en(MBASE(3)); // "Max" + draw_speed_en(24 + 3, MBASE(3)); // "Speed" + say_z(24 + 40 + 6, MBASE(3)); // "Z" + + draw_max_en(MBASE(4)); // "Max" + draw_speed_en(24 + 3, MBASE(4)); // "Speed" + say_e(24 + 40 + 6, MBASE(4)); // "E" + } + + Draw_Back_First(); + LOOP_L_N(i, 4) Draw_Menu_Line(i + 1, ICON_MaxSpeedX + i); + + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 4, 210, MBASE(1), planner.settings.max_feedrate_mm_s[X_AXIS]); + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 4, 210, MBASE(2), planner.settings.max_feedrate_mm_s[Y_AXIS]); + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 4, 210, MBASE(3), planner.settings.max_feedrate_mm_s[Z_AXIS]); + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 4, 210, MBASE(4), planner.settings.max_feedrate_mm_s[E_AXIS]); +} + +inline void Draw_Max_Accel_Menu() { + Clear_Main_Window(); + + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 1, 16, 271 - 243, 479 - 451, 14, 8); + + DWIN_Frame_AreaCopy(1, 173, 133, 200, 479 - 332, LBLX, MBASE(1)); + DWIN_Frame_AreaCopy(1, 28, 149, 271 - 202, 479 - 318, LBLX + 27, MBASE(1) + 1); + DWIN_Frame_AreaCopy(1, 229, 133, 236, 479 - 332, LBLX + 27 + 41 + 3, MBASE(1)); // max acceleration X + DWIN_Frame_AreaCopy(1, 173, 133, 200, 479 - 332, LBLX, MBASE(2)); + DWIN_Frame_AreaCopy(1, 28, 149, 271 - 202, 479 - 318, LBLX + 27, MBASE(2) + 1); + DWIN_Frame_AreaCopy(1, 1, 150, 271 - 264, 479 - 319, LBLX + 27 + 41 + 3, MBASE(2) + 2); // max acceleration Y + DWIN_Frame_AreaCopy(1, 173, 133, 200, 479 - 332, LBLX, MBASE(3)); + DWIN_Frame_AreaCopy(1, 28, 149, 271 - 202, 479 - 318, LBLX + 27, MBASE(3) + 1); + DWIN_Frame_AreaCopy(1, 9, 150, 271 - 255, 479 - 319, LBLX + 27 + 41 + 3, MBASE(3) + 2); // max acceleration Z + DWIN_Frame_AreaCopy(1, 173, 133, 200, 479 - 332, LBLX, MBASE(4)); + DWIN_Frame_AreaCopy(1, 28, 149, 271 - 202, 479 - 318, LBLX + 27, MBASE(4) + 1); + DWIN_Frame_AreaCopy(1, 18, 150, 271 - 246, 479 - 319, LBLX + 27 + 41 + 3, MBASE(4) + 2); // max acceleration E + } + else { + #ifdef USE_STRING_HEADINGS + Draw_Title("Max Accel (mm/s/s)"); // TODO: GET_TEXT_F + #else + DWIN_Frame_AreaCopy(1, 144, 16, 271 - 82, 479 - 453, 14, 8); + #endif + draw_max_accel_en(MBASE(1)); say_x(24 + 78 + 6, MBASE(1)); // "Max Acceleration X" + draw_max_accel_en(MBASE(2)); say_y(24 + 78 + 6, MBASE(2)); // "Max Acceleration Y" + draw_max_accel_en(MBASE(3)); say_z(24 + 78 + 6, MBASE(3)); // "Max Acceleration Z" + draw_max_accel_en(MBASE(4)); say_e(24 + 78 + 6, MBASE(4)); // "Max Acceleration E" + } + + Draw_Back_First(); + LOOP_L_N(i, 4) Draw_Menu_Line(i + 1, ICON_MaxAccX + i); + + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 4, 210, MBASE(1), planner.settings.max_acceleration_mm_per_s2[X_AXIS]); + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 4, 210, MBASE(2), planner.settings.max_acceleration_mm_per_s2[Y_AXIS]); + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 4, 210, MBASE(3), planner.settings.max_acceleration_mm_per_s2[Z_AXIS]); + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Background_black, 4, 210, MBASE(4), planner.settings.max_acceleration_mm_per_s2[E_AXIS]); +} + +inline void Draw_Max_Jerk_Menu() { + Clear_Main_Window(); + + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 1, 16, 271 - 243, 479 - 451, 14, 8); + + DWIN_Frame_AreaCopy(1, 173, 133, 200, 479 - 332, LBLX, MBASE(1)); + DWIN_Frame_AreaCopy(1, 1, 180, 271 - 243, 479 - 287, LBLX + 27, MBASE(1) + 1); + DWIN_Frame_AreaCopy(1, 202, 133, 228, 479 - 332, LBLX + 53, MBASE(1)); + DWIN_Frame_AreaCopy(1, 229, 133, 236, 479 - 332, LBLX + 80 + 3, MBASE(1)); // max corner speed X + DWIN_Frame_AreaCopy(1, 173, 133, 200, 479 - 332, LBLX, MBASE(2)); + DWIN_Frame_AreaCopy(1, 1, 180, 271 - 243, 479 - 287, LBLX + 27, MBASE(2) + 1); + DWIN_Frame_AreaCopy(1, 202, 133, 228, 479 - 332, LBLX + 53, MBASE(2)); + DWIN_Frame_AreaCopy(1, 1, 150, 271 - 264, 479 - 319, LBLX + 80 + 3, MBASE(2) + 3); // max corner speed Y + DWIN_Frame_AreaCopy(1, 173, 133, 200, 479 - 332, LBLX, MBASE(3)); + DWIN_Frame_AreaCopy(1, 1, 180, 271 - 243, 479 - 287, LBLX + 27, MBASE(3) + 1); + DWIN_Frame_AreaCopy(1, 202, 133, 228, 479 - 332, LBLX + 53, MBASE(3)); + DWIN_Frame_AreaCopy(1, 9, 150, 271 - 255, 479 - 319, LBLX + 80 + 3, MBASE(3) + 3); // max corner speed Z + DWIN_Frame_AreaCopy(1, 173, 133, 200, 479 - 332, LBLX, MBASE(4)); + DWIN_Frame_AreaCopy(1, 1, 180, 271 - 243, 479 - 287, LBLX + 27, MBASE(4) + 1); + DWIN_Frame_AreaCopy(1, 202, 133, 228, 479 - 332, LBLX + 53, MBASE(4)); + DWIN_Frame_AreaCopy(1, 18, 150, 271 - 246, 479 - 319, LBLX + 80 + 3, MBASE(4) + 3); // max corner speed E + } + else { + #ifdef USE_STRING_HEADINGS + Draw_Title("Max Corner"); // TODO: GET_TEXT_F + #else + DWIN_Frame_AreaCopy(1, 144, 16, 271 - 82, 479 - 453, 14, 8); + #endif + + draw_max_en(MBASE(1)); // "Max" + draw_corner_en(MBASE(1)); // "Corner" + draw_speed_en(66 + 6, MBASE(1)); // "Speed" + say_x(106 + 9, MBASE(1)); // "X" + + draw_max_en(MBASE(2)); // "Max" + draw_corner_en(MBASE(2)); // "Corner" + draw_speed_en(66 + 6, MBASE(2)); // "Speed" + say_y(106 + 9, MBASE(2)); // "Y" + + draw_max_en(MBASE(3)); // "Max" + draw_corner_en(MBASE(3)); // "Corner" + draw_speed_en(66 + 6, MBASE(3)); // "Speed" + say_z(106 + 9, MBASE(3)); // "Z" + + draw_max_en(MBASE(4)); // "Max" + draw_corner_en(MBASE(4)); // "Corner" + draw_speed_en(66 + 6, MBASE(4)); // "Speed" + say_e(106 + 9, MBASE(4)); // "E" + } + + Draw_Back_First(); + LOOP_L_N(i, 4) Draw_Menu_Line(i + 1, ICON_MaxSpeedCornerX + i); + + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(1), planner.max_jerk[X_AXIS] * MINUNITMULT); + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(2), planner.max_jerk[Y_AXIS] * MINUNITMULT); + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(3), planner.max_jerk[Z_AXIS] * MINUNITMULT); + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(4), planner.max_jerk[E_AXIS] * MINUNITMULT); +} + +inline void Draw_Steps_Menu() { + Clear_Main_Window(); + + if (HMI_flag.language_flag) { + DWIN_Frame_AreaCopy(1, 1, 16, 271 - 243, 479 - 451, 14, 8); + + DWIN_Frame_AreaCopy(1, 153, 148, 271 - 77, 479 - 318, LBLX, MBASE(1)); + DWIN_Frame_AreaCopy(1, 229, 133, 236, 479 - 332, LBLX + 41 + 3, MBASE(1)); // Transmission Ratio X + DWIN_Frame_AreaCopy(1, 153, 148, 271 - 77, 479 - 318, LBLX, MBASE(2)); + DWIN_Frame_AreaCopy(1, 1, 150, 271 - 264, 479 - 319, LBLX + 41 + 3, MBASE(2) + 3); // Transmission Ratio Y + DWIN_Frame_AreaCopy(1, 153, 148, 271 - 77, 479 - 318, LBLX, MBASE(3)); + DWIN_Frame_AreaCopy(1, 9, 150, 271 - 255, 479 - 319, LBLX + 41 + 3, MBASE(3) + 3); // Transmission Ratio Z + DWIN_Frame_AreaCopy(1, 153, 148, 271 - 77, 479 - 318, LBLX, MBASE(4)); + DWIN_Frame_AreaCopy(1, 18, 150, 271 - 246, 479 - 319, LBLX + 41 + 3, MBASE(4) + 3); // Transmission Ratio E + } + else { + #ifdef USE_STRING_HEADINGS + Draw_Title("Steps-per-mm"); // TODO: GET_TEXT_F + #else + DWIN_Frame_AreaCopy(1, 144, 16, 271 - 82, 479 - 453, 14, 8); + #endif + draw_steps_per_mm(MBASE(1)); say_x(100 + 3, MBASE(1)); // "Steps-per-mm X" + draw_steps_per_mm(MBASE(2)); say_y(100 + 3, MBASE(2)); // "Y" + draw_steps_per_mm(MBASE(3)); say_z(100 + 3, MBASE(3)); // "Z" + draw_steps_per_mm(MBASE(4)); say_e(100 + 3, MBASE(4)); // "E" + } + + Draw_Back_First(); + LOOP_L_N(i, 4) Draw_Menu_Line(i + 1, ICON_StepX + i); + + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(1), planner.settings.axis_steps_per_mm[X_AXIS] * MINUNITMULT); + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(2), planner.settings.axis_steps_per_mm[Y_AXIS] * MINUNITMULT); + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(3), planner.settings.axis_steps_per_mm[Z_AXIS] * MINUNITMULT); + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Background_black, 3, 1, 210, MBASE(4), planner.settings.axis_steps_per_mm[E_AXIS] * MINUNITMULT); +} + +/* Motion */ +void HMI_Motion(void) { + ENCODER_DiffState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + + // Avoid flicker by updating only the previous menu + if (encoder_diffState == ENCODER_DIFF_CW) { + if (select_motion.inc(4)) Move_Highlight(1, select_motion.now); + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + if (select_motion.dec()) Move_Highlight(-1, select_motion.now); + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + switch (select_motion.now) { + case 0: // back + checkkey = Control; + select_control.set(2); + index_control = MROWS; + Draw_Control_Menu(); + break; + case 1: // max speed + checkkey = MaxSpeed; + select_speed.reset(); + Draw_Max_Speed_Menu(); + break; + case 2: // max acceleration + checkkey = MaxAcceleration; + select_acc.reset(); + Draw_Max_Accel_Menu(); + break; + case 3: // max corner speed + checkkey = MaxCorner; + select_corner.reset(); + Draw_Max_Jerk_Menu(); + break; + case 4: // transmission ratio + checkkey = Step; + select_step.reset(); + Draw_Steps_Menu(); + break; + default: + break; + } + } + DWIN_UpdateLCD(); +} + +/* Info */ +void HMI_Info(void) { + ENCODER_DiffState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + if (encoder_diffState == ENCODER_DIFF_ENTER) { + #if HAS_LEVELING + checkkey = Control; + select_control.set(CONTROL_ITEMS); + Draw_Control_Menu(); + #else + select_page.set(3); + Goto_MainMenu(); + #endif + } + DWIN_UpdateLCD(); +} + +/* Tune */ +void HMI_Tune(void) { + ENCODER_DiffState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + + // Avoid flicker by updating only the previous menu + if (encoder_diffState == ENCODER_DIFF_CW) { + if (select_tune.inc(6)) { + if (select_tune.now > MROWS && select_tune.now > index_tune) { + index_tune = select_tune.now; + Scroll_Menu(DWIN_SCROLL_UP); + Prepare_Item_Lang(5); + } + else { + Move_Highlight(1, select_tune.now + MROWS - index_tune); + } + } + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + if (select_tune.dec()) { + if (select_tune.now < index_tune - MROWS) { + index_tune--; + Scroll_Menu(DWIN_SCROLL_DOWN); + if (index_tune == MROWS) Draw_Back_First(); + } + else { + Move_Highlight(-1, select_tune.now + MROWS - index_tune); + } + } + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + switch (select_tune.now) { + case 0: { // Back + select_print.set(0); + Goto_PrintProcess(); + } + break; + case 1: // Print speed + checkkey = PrintSpeed; + HMI_ValueStruct.print_speed = feedrate_percentage; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(1 + MROWS - index_tune), feedrate_percentage); + EncoderRate.encoderRateEnabled = 1; + break; + #if HAS_HOTEND + case 2: // Nozzle temp + checkkey = ETemp; + HMI_ValueStruct.E_Temp = thermalManager.temp_hotend[0].target; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(2 + MROWS - index_tune), thermalManager.temp_hotend[0].target); + EncoderRate.encoderRateEnabled = 1; + break; + #endif + #if HAS_HEATED_BED + case 3: // Bed temp + checkkey = BedTemp; + HMI_ValueStruct.Bed_Temp = thermalManager.temp_bed.target; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(3 + MROWS - index_tune), thermalManager.temp_bed.target); + EncoderRate.encoderRateEnabled = 1; + break; + #endif + #if HAS_FAN + case 4: // Fan speed + checkkey = FanSpeed; + HMI_ValueStruct.Fan_speed = thermalManager.fan_speed[0]; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(4 + MROWS - index_tune), thermalManager.fan_speed[0]); + EncoderRate.encoderRateEnabled = 1; + break; + #endif + case 5: // Z-offset + checkkey = Homeoffset; + HMI_ValueStruct.offset_value = BABY_Z_VAR * 100; + show_plus_or_minus(font8x16, Select_Color, 2, 2, 202, MBASE(5 + MROWS - index_tune), HMI_ValueStruct.offset_value); + EncoderRate.encoderRateEnabled = 1; + break; + case 6: // Language + // Select language + HMI_flag.language_flag = !HMI_flag.language_flag; + + Clear_Main_Window(); + + if (HMI_flag.language_flag) { + set_chinese_to_eeprom(); + DWIN_JPG_CacheTo1(Language_Chinese); + } + else { + set_english_to_eeprom(); + DWIN_JPG_CacheTo1(Language_English); + } + + Draw_Tune_Menu(); + break; + + default: break; + } + } + DWIN_UpdateLCD(); +} + +/* PLA Preheat */ +void HMI_PLAPreheatSetting(void) { + ENCODER_DiffState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + + // Avoid flicker by updating only the previous menu + if (encoder_diffState == ENCODER_DIFF_CW) { + if (select_PLA.inc(4)) Move_Highlight(1, select_PLA.now); + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + if (select_PLA.dec()) Move_Highlight(-1, select_PLA.now); + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + switch (select_PLA.now) { + case 0: // back + checkkey = TemperatureID; + select_temp.now = 4; + HMI_ValueStruct.show_mode = -1; + Draw_Temperature_Menu(); + break; + #if HAS_HOTEND + case 1: // set nozzle temperature + checkkey = ETemp; + HMI_ValueStruct.E_Temp = ui.material_preset[0].hotend_temp; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(1), ui.material_preset[0].hotend_temp); + EncoderRate.encoderRateEnabled = 1; + break; + #endif + #if HAS_HEATED_BED + case 2: // set bed temperature + checkkey = BedTemp; + HMI_ValueStruct.Bed_Temp = ui.material_preset[0].bed_temp; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(2), ui.material_preset[0].bed_temp); + EncoderRate.encoderRateEnabled = 1; + break; + #endif + #if HAS_FAN + case 3: // set fan speed + checkkey = FanSpeed; + HMI_ValueStruct.Fan_speed = ui.material_preset[0].fan_speed; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(3), ui.material_preset[0].fan_speed); + EncoderRate.encoderRateEnabled = 1; + break; + #endif + case 4: // save PLA configuration + if (settings.save()) { + buzzer.tone(100, 659); + buzzer.tone(100, 698); + } + else + buzzer.tone(20, 440); + break; + default: break; + } + } + DWIN_UpdateLCD(); +} + +/* ABS Preheat */ +void HMI_ABSPreheatSetting(void) { + ENCODER_DiffState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + + // Avoid flicker by updating only the previous menu + if (encoder_diffState == ENCODER_DIFF_CW) { + if (select_ABS.inc(4)) Move_Highlight(1, select_ABS.now); + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + if (select_ABS.dec()) Move_Highlight(-1, select_ABS.now); + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + switch (select_ABS.now) { + case 0: // back + checkkey = TemperatureID; + select_temp.now = 5; + HMI_ValueStruct.show_mode = -1; + Draw_Temperature_Menu(); + break; + #if HAS_HOTEND + case 1: // set nozzle temperature + checkkey = ETemp; + HMI_ValueStruct.E_Temp = ui.material_preset[1].hotend_temp; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(1), ui.material_preset[1].hotend_temp); + EncoderRate.encoderRateEnabled = 1; + break; + #endif + #if HAS_HEATED_BED + case 2: // set bed temperature + checkkey = BedTemp; + HMI_ValueStruct.Bed_Temp = ui.material_preset[1].bed_temp; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(2), ui.material_preset[1].bed_temp); + EncoderRate.encoderRateEnabled = 1; + break; + #endif + #if HAS_FAN + case 3: // set fan speed + checkkey = FanSpeed; + HMI_ValueStruct.Fan_speed = ui.material_preset[1].fan_speed; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 3, 216, MBASE(3), ui.material_preset[1].fan_speed); + EncoderRate.encoderRateEnabled = 1; + break; + #endif + case 4: // save PLA configuration + if (settings.save()) { + buzzer.tone(100, 659); + buzzer.tone(100, 698); + } + else + buzzer.tone(20, 440); + break; + default: + break; + } + } + DWIN_UpdateLCD(); +} + +/* Max Speed */ +void HMI_MaxSpeed(void) { + ENCODER_DiffState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + + // Avoid flicker by updating only the previous menu + if (encoder_diffState == ENCODER_DIFF_CW) { + if (select_speed.inc(4)) Move_Highlight(1, select_speed.now); + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + if (select_speed.dec()) Move_Highlight(-1, select_speed.now); + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + switch (select_speed.now) { + case 0: // back + checkkey = Motion; + select_motion.now = 1; + Draw_Motion_Menu(); + break; + case 1: // max Speed X + checkkey = MaxSpeed_value; + HMI_flag.feedspeed_flag = X_AXIS; + HMI_ValueStruct.Max_Feedspeed = planner.settings.max_feedrate_mm_s[X_AXIS]; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 4, 210, MBASE(select_speed.now), HMI_ValueStruct.Max_Feedspeed); + EncoderRate.encoderRateEnabled = 1; + break; + case 2: // max Speed Y + checkkey = MaxSpeed_value; + HMI_flag.feedspeed_flag = Y_AXIS; + HMI_ValueStruct.Max_Feedspeed = planner.settings.max_feedrate_mm_s[Y_AXIS]; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 4, 210, MBASE(select_speed.now), HMI_ValueStruct.Max_Feedspeed); + EncoderRate.encoderRateEnabled = 1; + break; + case 3: // max Speed Z + checkkey = MaxSpeed_value; + HMI_flag.feedspeed_flag = Z_AXIS; + HMI_ValueStruct.Max_Feedspeed = planner.settings.max_feedrate_mm_s[Z_AXIS]; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 4, 210, MBASE(select_speed.now), HMI_ValueStruct.Max_Feedspeed); + EncoderRate.encoderRateEnabled = 1; + break; + case 4: // max Speed E + checkkey = MaxSpeed_value; + HMI_flag.feedspeed_flag = E_AXIS; + HMI_ValueStruct.Max_Feedspeed = planner.settings.max_feedrate_mm_s[E_AXIS]; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 4, 210, MBASE(select_speed.now), HMI_ValueStruct.Max_Feedspeed); + EncoderRate.encoderRateEnabled = 1; + break; + default: + break; + } + } + DWIN_UpdateLCD(); +} + +/* Max Acceleration */ +void HMI_MaxAcceleration(void) { + ENCODER_DiffState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + + // Avoid flicker by updating only the previous menu + if (encoder_diffState == ENCODER_DIFF_CW) { + if (select_acc.inc(4)) Move_Highlight(1, select_acc.now); + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + if (select_acc.dec()) Move_Highlight(-1, select_acc.now); + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + switch (select_acc.now) { + case 0: // back + checkkey = Motion; + select_motion.now = 2; + Draw_Motion_Menu(); + break; + case 1: // max acceleration X + checkkey = MaxAcceleration_value; + HMI_flag.acc_flag = X_AXIS; + HMI_ValueStruct.Max_Acceleration = planner.settings.max_acceleration_mm_per_s2[X_AXIS]; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 4, 210, MBASE(select_acc.now), HMI_ValueStruct.Max_Acceleration); + EncoderRate.encoderRateEnabled = 1; + break; + case 2: // max acceleration Y + checkkey = MaxAcceleration_value; + HMI_flag.acc_flag = Y_AXIS; + HMI_ValueStruct.Max_Acceleration = planner.settings.max_acceleration_mm_per_s2[Y_AXIS]; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 4, 210, MBASE(select_acc.now), HMI_ValueStruct.Max_Acceleration); + EncoderRate.encoderRateEnabled = 1; + break; + case 3: // max acceleration Z + checkkey = MaxAcceleration_value; + HMI_flag.acc_flag = Z_AXIS; + HMI_ValueStruct.Max_Acceleration = planner.settings.max_acceleration_mm_per_s2[Z_AXIS]; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 4, 210, MBASE(select_acc.now), HMI_ValueStruct.Max_Acceleration); + EncoderRate.encoderRateEnabled = 1; + break; + case 4: // max acceleration E + checkkey = MaxAcceleration_value; + HMI_flag.acc_flag = E_AXIS; + HMI_ValueStruct.Max_Acceleration = planner.settings.max_acceleration_mm_per_s2[E_AXIS]; + DWIN_Draw_IntValue(true, true, 0, font8x16, White, Select_Color, 4, 210, MBASE(select_acc.now), HMI_ValueStruct.Max_Acceleration); + EncoderRate.encoderRateEnabled = 1; + break; + default: + break; + } + } + DWIN_UpdateLCD(); +} + +/* Max Corner */ +void HMI_MaxCorner(void) { + ENCODER_DiffState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + + // Avoid flicker by updating only the previous menu + if (encoder_diffState == ENCODER_DIFF_CW) { + if (select_corner.inc(4)) Move_Highlight(1, select_corner.now); + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + if (select_corner.dec()) Move_Highlight(-1, select_corner.now); + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + switch (select_corner.now) { + case 0: // back + checkkey = Motion; + select_motion.now = 3; + Draw_Motion_Menu(); + break; + case 1: // max corner X + checkkey = MaxCorner_value; + HMI_flag.corner_flag = X_AXIS; + HMI_ValueStruct.Max_Corner = planner.max_jerk[X_AXIS] * MINUNITMULT; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_corner.now), HMI_ValueStruct.Max_Corner); + EncoderRate.encoderRateEnabled = 1; + break; + case 2: // max corner Y + checkkey = MaxCorner_value; + HMI_flag.corner_flag = Y_AXIS; + HMI_ValueStruct.Max_Corner = planner.max_jerk[Y_AXIS] * MINUNITMULT; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_corner.now), HMI_ValueStruct.Max_Corner); + EncoderRate.encoderRateEnabled = 1; + break; + case 3: // max corner Z + checkkey = MaxCorner_value; + HMI_flag.corner_flag = Z_AXIS; + HMI_ValueStruct.Max_Corner = planner.max_jerk[Z_AXIS] * MINUNITMULT; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_corner.now), HMI_ValueStruct.Max_Corner); + EncoderRate.encoderRateEnabled = 1; + break; + case 4: // max corner E + checkkey = MaxCorner_value; + HMI_flag.corner_flag = E_AXIS; + HMI_ValueStruct.Max_Corner = planner.max_jerk[E_AXIS] * MINUNITMULT; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_corner.now), HMI_ValueStruct.Max_Corner); + EncoderRate.encoderRateEnabled = 1; + break; + default: + break; + } + } + DWIN_UpdateLCD(); +} + +/* Step */ +void HMI_Step(void) { + ENCODER_DiffState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + + // Avoid flicker by updating only the previous menu + if (encoder_diffState == ENCODER_DIFF_CW) { + if (select_step.inc(4)) Move_Highlight(1, select_step.now); + } + else if (encoder_diffState == ENCODER_DIFF_CCW) { + if (select_step.dec()) Move_Highlight(-1, select_step.now); + } + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + switch (select_step.now) { + case 0: // back + checkkey = Motion; + select_motion.now = 4; + Draw_Motion_Menu(); + break; + case 1: // max step X + checkkey = Step_value; + HMI_flag.step_flag = X_AXIS; + HMI_ValueStruct.Max_Step = planner.settings.axis_steps_per_mm[X_AXIS] * MINUNITMULT; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_step.now), HMI_ValueStruct.Max_Step); + EncoderRate.encoderRateEnabled = 1; + break; + case 2: // max step Y + checkkey = Step_value; + HMI_flag.step_flag = Y_AXIS; + HMI_ValueStruct.Max_Step = planner.settings.axis_steps_per_mm[Y_AXIS] * MINUNITMULT; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_step.now), HMI_ValueStruct.Max_Step); + EncoderRate.encoderRateEnabled = 1; + break; + case 3: // max step Z + checkkey = Step_value; + HMI_flag.step_flag = Z_AXIS; + HMI_ValueStruct.Max_Step = planner.settings.axis_steps_per_mm[Z_AXIS] * MINUNITMULT; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_step.now), HMI_ValueStruct.Max_Step); + EncoderRate.encoderRateEnabled = 1; + break; + case 4: // max step E + checkkey = Step_value; + HMI_flag.step_flag = E_AXIS; + HMI_ValueStruct.Max_Step = planner.settings.axis_steps_per_mm[E_AXIS] * MINUNITMULT; + DWIN_Draw_FloatValue(true, true, 0, font8x16, White, Select_Color, 3, 1, 210, MBASE(select_step.now), HMI_ValueStruct.Max_Step); + EncoderRate.encoderRateEnabled = 1; + break; + default: + break; + } + } + DWIN_UpdateLCD(); +} + +void HMI_Init(void) { + HMI_SDCardInit(); + + for (uint16_t t = 0; t <= 100; t += 2) { + DWIN_ICON_Show(ICON, ICON_Bar, 15, 260); + DWIN_Draw_Rectangle(1, Background_black, 15 + t * 242 / 100, 260, 257, 280); + DWIN_UpdateLCD(); + delay(20); + } + + lcd_select_language(); + + #if ENABLED(FIX_MOUNTED_PROBE) // For "CREALITY_TOUCH" probe too? + SET_OUTPUT(COM_PIN); + WRITE(COM_PIN, 1); + #endif + + delay(200); +} + +void DWIN_Update(void) { + EachMomentUpdate(); // Status update + HMI_SDCardUpdate(); // SD card update + DWIN_HandleScreen(); // Rotary encoder update +} + +void EachMomentUpdate(void) { + static millis_t next_rts_update_ms = 0; + const millis_t ms = millis(); + if (PENDING(ms, next_rts_update_ms)) return; + next_rts_update_ms = ms + DWIN_SCROLL_UPDATE_INTERVAL; + + // variable update + update_variable(); + + if (checkkey == PrintProcess) { + // if print done + if (HMI_flag.print_finish && !HMI_flag.confirm_flag) { + HMI_flag.print_finish = 0; + HMI_flag.confirm_flag = 1; + + TERN_(POWER_LOSS_RECOVERY, recovery.cancel()); + + planner.finish_and_disable(); + + // show percent bar and value + Percentrecord = 0; + Draw_Print_ProgressBar(); + + // show print done confirm + DWIN_Draw_Rectangle(1, Background_black, 0, 250, 271, 360); + DWIN_ICON_Show(ICON, HMI_flag.language_flag ? ICON_Confirm_C : ICON_Confirm_E, 86, 302 - 19); + } + else if (HMI_flag.pause_flag != printingIsPaused()) { + // print status update + HMI_flag.pause_flag = printingIsPaused(); + if (HMI_flag.pause_flag) ICON_Continue(); else ICON_Pause(); + } + } + + // pause after homing + if (pause_action_flag && printingIsPaused() && !planner.has_blocks_queued()) { + pause_action_flag = 0; + #if ENABLED(PAUSE_HEAT) + tempbed = thermalManager.temp_bed.target; + temphot = thermalManager.temp_hotend[0].target; + thermalManager.disable_all_heaters(); + #endif + queue.inject_P(PSTR("G1 F1200 X0 Y0")); + } + + if (card.isPrinting() && checkkey == PrintProcess) { // print process + const uint8_t card_pct = card.percentDone(); + static uint8_t last_cardpercentValue = 101; + if (last_cardpercentValue != card_pct) { // print percent + last_cardpercentValue = card_pct; + if (card_pct) { + Percentrecord = card_pct; + Draw_Print_ProgressBar(); + } + } + + duration_t elapsed = print_job_timer.duration(); // print timer + /* already print time */ + const uint16_t min = (elapsed.value % 3600) / 60; + if (last_Printtime != min) { // 1 minute update + last_Printtime = min; + Draw_Print_ProgressElapsed(); + } + /* remain print time */ + static millis_t next_remain_time_update = 0; + if (elapsed.minute() > 5 && ELAPSED(ms, next_remain_time_update) && HMI_flag.heat_flag == 0) { // show after 5 min and 20s update + remain_time = ((elapsed.value - dwin_heat_time) * ((float)card.getFileSize() / (float)card.getIndex())) - (elapsed.value - dwin_heat_time); + next_remain_time_update += 20 * 1000UL; + Draw_Print_ProgressRemain(); + } + } + else if (abort_flag && !HMI_flag.home_flag) { // Print Stop + abort_flag = 0; + HMI_ValueStruct.print_speed = feedrate_percentage = 100; + zprobe_zoffset = TERN(HAS_LEVELING, probe.offset.z, 0); + + planner.finish_and_disable(); + + #if DISABLED(SD_ABORT_NO_COOLDOWN) + thermalManager.disable_all_heaters(); + #endif + + select_page.set(0); + Goto_MainMenu(); + } + else if (DWIN_lcd_sd_status && recovery.dwin_flag) { // resume print before power off + recovery.dwin_flag = false; + + recovery.load(); + if (!recovery.valid()) return recovery.purge(); + + auto draw_first_option = [](const bool sel) { + const uint16_t c1 = sel ? Background_window : Select_Color; + DWIN_Draw_Rectangle(0, c1, 25, 306, 126, 345); + DWIN_Draw_Rectangle(0, c1, 24, 305, 127, 346); + }; + + auto update_selection = [&](const bool sel) { + HMI_flag.select_flag = sel; + draw_first_option(sel); + const uint16_t c2 = sel ? Select_Color : Background_window; + DWIN_Draw_Rectangle(0, c2, 145, 306, 246, 345); + DWIN_Draw_Rectangle(0, c2, 144, 305, 247, 346); + }; + + const uint16_t fileCnt = card.get_num_Files(); + for (uint16_t i = 0; i < fileCnt; i++) { + // TODO: Resume print via M1000 then update the UI + // with the active filename which can come from CardReader. + card.getfilename_sorted(SD_ORDER(i, fileCnt)); + if (!strcmp(card.filename, &recovery.info.sd_filename[1])) { // Resume print before power failure while have the same file + recovery_flag = 1; + HMI_flag.select_flag = 1; + Popup_Window_Resume(); + draw_first_option(false); + char * const name = card.longest_filename(); + DWIN_Draw_String(false, true, font8x16, Font_window, Background_window, (DWIN_WIDTH - strlen(name) * MENU_CHR_W) / 2, 252, name); + DWIN_UpdateLCD(); + break; + } + } + + // if hasn't resumable G-code file + if (!recovery_flag) return; + + while (recovery_flag) { + ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); + if (encoder_diffState != ENCODER_DIFF_NO) { + if (encoder_diffState == ENCODER_DIFF_ENTER) { + recovery_flag = 0; + if (HMI_flag.select_flag) break; + TERN_(POWER_LOSS_RECOVERY, recovery.cancel()); + HMI_StartFrame(true); + return; + } + else + update_selection(encoder_diffState == ENCODER_DIFF_CCW); + + DWIN_UpdateLCD(); + } + } + + select_print.set(0); + HMI_ValueStruct.show_mode = 0; + HMI_StartFrame(false); + recovery.resume(); + return; + } + DWIN_UpdateLCD(); +} + +void DWIN_HandleScreen(void) { + switch (checkkey) { + case MainMenu: HMI_MainMenu(); break; + case SelectFile: HMI_SelectFile(); break; + case Prepare: HMI_Prepare(); break; + case Control: HMI_Control(); break; + case Leveling: break; + case PrintProcess: HMI_Printing(); break; + case Print_window: HMI_PauseOrStop(); break; + case AxisMove: HMI_AxisMove(); break; + case TemperatureID: HMI_Temperature(); break; + case Motion: HMI_Motion(); break; + case Info: HMI_Info(); break; + case Tune: HMI_Tune(); break; + case PLAPreheat: HMI_PLAPreheatSetting(); break; + case ABSPreheat: HMI_ABSPreheatSetting(); break; + case MaxSpeed: HMI_MaxSpeed(); break; + case MaxAcceleration: HMI_MaxAcceleration(); break; + case MaxCorner: HMI_MaxCorner(); break; + case Step: HMI_Step(); break; + case Move_X: HMI_Move_X(); break; + case Move_Y: HMI_Move_Y(); break; + case Move_Z: HMI_Move_Z(); break; + case Extruder: HMI_Move_E(); break; + case Homeoffset: HMI_Zoffset(); break; + #if HAS_HOTEND + case ETemp: HMI_ETemp(); break; + #endif + #if HAS_HEATED_BED + case BedTemp: HMI_BedTemp(); break; + #endif + #if HAS_FAN + case FanSpeed: HMI_FanSpeed(); break; + #endif + case PrintSpeed: HMI_PrintSpeed(); break; + case MaxSpeed_value: HMI_MaxFeedspeedXYZE(); break; + case MaxAcceleration_value: HMI_MaxAccelerationXYZE(); break; + case MaxCorner_value: HMI_MaxCornerXYZE(); break; + case Step_value: HMI_StepXYZE(); break; + default: break; + } +} + +void DWIN_CompletedHoming(void) { + HMI_flag.home_flag = false; + if (checkkey == Last_Prepare) { + checkkey = Prepare; + select_prepare.now = 3; + index_prepare = MROWS; + Draw_Prepare_Menu(); + } + else if (checkkey == Back_Main) { + HMI_ValueStruct.print_speed = feedrate_percentage = 100; + zprobe_zoffset = TERN0(BLTOUCH, probe.offset.z); + planner.finish_and_disable(); + Goto_MainMenu(); + } +} + +void DWIN_CompletedLeveling(void) { + if (checkkey == Leveling) Goto_MainMenu(); +} + +#endif // DWIN_CREALITY_LCD diff --git a/Marlin/src/lcd/dwin/dwin.h b/Marlin/src/lcd/dwin/dwin.h new file mode 100644 index 0000000000..2d24d2504e --- /dev/null +++ b/Marlin/src/lcd/dwin/dwin.h @@ -0,0 +1,364 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * DWIN by Creality3D + */ + +#include "dwin_lcd.h" +#include "rotary_encoder.h" +#include "../../libs/BL24CXX.h" + +#include + +enum processID { + // Process ID + MainMenu, + SelectFile, + Prepare, + Control, + Leveling, + PrintProcess, + AxisMove, + TemperatureID, + Motion, + Info, + Tune, + #if HAS_HOTEND + PLAPreheat, + ABSPreheat, + #endif + MaxSpeed, + MaxSpeed_value, + MaxAcceleration, + MaxAcceleration_value, + MaxCorner, + MaxCorner_value, + Step, + Step_value, + + // Last Process ID + Last_Prepare, + + // Back Process ID + Back_Main, + Back_Print, + + // Date variable ID + Move_X, + Move_Y, + Move_Z, + Extruder, + Homeoffset, + #if HAS_HOTEND + ETemp, + #endif + #if HAS_HEATED_BED + BedTemp, + #endif + #if HAS_FAN + FanSpeed, + #endif + PrintSpeed, + + // Window ID + Print_window, + Popup_Window +}; + +// Picture ID +#define Start_Process 0 +#define Language_English 1 +#define Language_Chinese 2 + +// ICON ID +#define ICON 0x09 +#define ICON_LOGO 0 +#define ICON_Print_0 1 +#define ICON_Print_1 2 +#define ICON_Prepare_0 3 +#define ICON_Prepare_1 4 +#define ICON_Control_0 5 +#define ICON_Control_1 6 +#define ICON_Leveling_0 7 +#define ICON_Leveling_1 8 +#define ICON_HotendTemp 9 +#define ICON_BedTemp 10 +#define ICON_Speed 11 +#define ICON_Zoffset 12 +#define ICON_Back 13 +#define ICON_File 14 +#define ICON_PrintTime 15 +#define ICON_RemainTime 16 +#define ICON_Setup_0 17 +#define ICON_Setup_1 18 +#define ICON_Pause_0 19 +#define ICON_Pause_1 20 +#define ICON_Continue_0 21 +#define ICON_Continue_1 22 +#define ICON_Stop_0 23 +#define ICON_Stop_1 24 +#define ICON_Bar 25 +#define ICON_More 26 + +#define ICON_Axis 27 +#define ICON_CloseMotor 28 +#define ICON_Homing 29 +#define ICON_SetHome 30 +#define ICON_PLAPreheat 31 +#define ICON_ABSPreheat 32 +#define ICON_Cool 33 +#define ICON_Language 34 + +#define ICON_MoveX 35 +#define ICON_MoveY 36 +#define ICON_MoveZ 37 +#define ICON_Extruder 38 + +#define ICON_Temperature 40 +#define ICON_Motion 41 +#define ICON_WriteEEPROM 42 +#define ICON_ReadEEPROM 43 +#define ICON_ResumeEEPROM 44 +#define ICON_Info 45 + +#define ICON_SetEndTemp 46 +#define ICON_SetBedTemp 47 +#define ICON_FanSpeed 48 +#define ICON_SetPLAPreheat 49 +#define ICON_SetABSPreheat 50 + +#define ICON_MaxSpeed 51 +#define ICON_MaxAccelerated 52 +#define ICON_MaxCorner 53 +#define ICON_Step 54 +#define ICON_PrintSize 55 +#define ICON_Version 56 +#define ICON_Contact 57 +#define ICON_StockConfiguraton 58 +#define ICON_MaxSpeedX 59 +#define ICON_MaxSpeedY 60 +#define ICON_MaxSpeedZ 61 +#define ICON_MaxSpeedE 62 +#define ICON_MaxAccX 63 +#define ICON_MaxAccY 64 +#define ICON_MaxAccZ 65 +#define ICON_MaxAccE 66 +#define ICON_MaxSpeedCornerX 67 +#define ICON_MaxSpeedCornerY 68 +#define ICON_MaxSpeedCornerZ 69 +#define ICON_MaxSpeedCornerE 70 +#define ICON_StepX 71 +#define ICON_StepY 72 +#define ICON_StepZ 73 +#define ICON_StepE 74 +#define ICON_Setspeed 75 +#define ICON_SetZOffset 76 +#define ICON_Rectangle 77 +#define ICON_BLTouch 78 +#define ICON_TempTooLow 79 +#define ICON_AutoLeveling 80 +#define ICON_TempTooHigh 81 +#define ICON_NoTips_C 82 +#define ICON_NoTips_E 83 +#define ICON_Continue_C 84 +#define ICON_Continue_E 85 +#define ICON_Cancel_C 86 +#define ICON_Cancel_E 87 +#define ICON_Confirm_C 88 +#define ICON_Confirm_E 89 +#define ICON_Info_0 90 +#define ICON_Info_1 91 + +/** + * 3-.0:The font size, 0x00-0x09, corresponds to the font size below: + * 0x00=6*12 0x01=8*16 0x02=10*20 0x03=12*24 0x04=14*28 + * 0x05=16*32 0x06=20*40 0x07=24*48 0x08=28*56 0x09=32*64 + */ +#define font6x12 0x00 +#define font8x16 0x01 +#define font10x20 0x02 +#define font12x24 0x03 +#define font14x28 0x04 +#define font16x32 0x05 +#define font20x40 0x06 +#define font24x48 0x07 +#define font28x56 0x08 +#define font32x64 0x09 + +// Color +#define White 0xFFFF +#define Background_window 0x31E8 // Popup background color +#define Background_blue 0x1125 // Dark blue background color +#define Background_black 0x0841 // black background color +#define Font_window 0xD6BA // Popup font background color +#define Line_Color 0x3A6A // Split line color +#define Rectangle_Color 0xEE2F // blue square cursor color +#define Percent_Color 0xFE29 // percentage color +#define BarFill_Color 0x10E4 // fill color of progress bar +#define Select_Color 0x33BB // selected color + +extern int checkkey, last_checkkey; +extern float zprobe_zoffset; +extern char print_filename[16]; + +extern millis_t dwin_heat_time; + +typedef struct { + TERN_(HAS_HOTEND, int16_t E_Temp = 0); + TERN_(HAS_HEATED_BED, int16_t Bed_Temp = 0); + TERN_(HAS_FAN, int16_t Fan_speed = 0); + int16_t print_speed = 100; + float Max_Feedspeed = 0; + float Max_Acceleration = 0; + float Max_Corner = 0; + float Max_Step = 0; + float Move_X_scale = 0; + float Move_Y_scale = 0; + float Move_Z_scale = 0; + #if EXTRUDERS + float Move_E_scale = 0; + #endif + float offset_value = 0; + char show_mode = 0; // -1: Temperature control 0: Printing temperature +} HMI_value_t; + +typedef struct { + bool language_flag; // 0: EN, 1: CN + bool pause_flag:1; + bool print_finish:1; + bool confirm_flag:1; + bool select_flag:1; + bool home_flag:1; + bool heat_flag:1; // 0: heating done 1: during heating + #if HAS_HOTEND + bool ETempTooLow_flag:1; + #endif + #if HAS_LEVELING + bool leveling_offset_flag:1; + #endif + #if HAS_FAN + char feedspeed_flag; + #endif + char acc_flag; + char corner_flag; + char step_flag; +} HMI_Flag; + +extern HMI_value_t HMI_ValueStruct; +extern HMI_Flag HMI_flag; + +// Language +void lcd_select_language(void); +void set_english_to_eeprom(void); +void set_chinese_to_eeprom(void); + +// Show ICO +void ICON_Print(bool show); +void ICON_Prepare(bool show); +void ICON_Control(bool show); +void ICON_Leveling(bool show); +void ICON_StartInfo(bool show); + +void ICON_Setting(bool show); +void ICON_Pause(bool show); +void ICON_Continue(bool show); +void ICON_Stop(bool show); + +// Popup window tips +#if HAS_HOTEND + void Popup_Window_Temperature(const bool toohigh); + void Popup_Window_ETempTooLow(void); +#endif + +void Popup_Window_Resume(void); +void Popup_Window_Home(void); +void Popup_Window_Leveling(void); + +void Goto_PrintProcess(void); +void Goto_MainMenu(void); + +// Variable control +void HMI_Move_X(void); +void HMI_Move_Y(void); +void HMI_Move_Z(void); +void HMI_Move_E(void); + +void HMI_Zoffset(void); + +TERN_(HAS_HOTEND, void HMI_ETemp(void)); +TERN_(HAS_HEATED_BED, void HMI_BedTemp(void)); +TERN_(HAS_FAN, void HMI_FanSpeed(void)); + +void HMI_PrintSpeed(void); + +void HMI_MaxFeedspeedXYZE(void); +void HMI_MaxAccelerationXYZE(void); +void HMI_MaxCornerXYZE(void); +void HMI_StepXYZE(void); + +void update_variable(void); +void show_plus_or_minus(uint8_t size, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, long value); + +// SD Card +void HMI_SDCardInit(void); +void HMI_SDCardUpdate(void); + +// Main Process +void Icon_print(bool value); +void Icon_control(bool value); +void Icon_temperature(bool value); +void Icon_leveling(bool value); + +// Other +bool Pause_HeatStatus(); +void HMI_StartFrame(const bool with_update); // startup screen +void HMI_MainMenu(void); // main process screen +void HMI_SelectFile(void); // file page +void HMI_Printing(void); // print page +void HMI_Prepare(void); // prepare page +void HMI_Control(void); // control page +void HMI_Leveling(void); // Level the page +void HMI_AxisMove(void); // Axis movement menu +void HMI_Temperature(void); // Temperature menu +void HMI_Motion(void); // Sports menu +void HMI_Info(void); // Information menu +void HMI_Tune(void); // Adjust the menu + +#if HAS_HOTEND + void HMI_PLAPreheatSetting(void); // PLA warm-up setting + void HMI_ABSPreheatSetting(void); // ABS warm-up setting +#endif + +void HMI_MaxSpeed(void); // Maximum speed submenu +void HMI_MaxAcceleration(void); // Maximum acceleration submenu +void HMI_MaxCorner(void); // Maximum corner speed submenu +void HMI_Step(void); // transmission ratio + +void HMI_Init(void); +void DWIN_Update(void); +void EachMomentUpdate(void); +void DWIN_HandleScreen(void); + +void DWIN_CompletedHoming(void); +void DWIN_CompletedLeveling(void); diff --git a/Marlin/src/lcd/dwin/dwin_lcd.cpp b/Marlin/src/lcd/dwin/dwin_lcd.cpp new file mode 100644 index 0000000000..3c14a95936 --- /dev/null +++ b/Marlin/src/lcd/dwin/dwin_lcd.cpp @@ -0,0 +1,302 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 dwin_lcd.c + * @author LEO / Creality3D + * @date 2019/07/18 + * @version 2.0.1 + * @brief 迪文屏控制操作函数 + ********************************************************************************/ + +#include "../../inc/MarlinConfigPre.h" + +#if ENABLED(DWIN_CREALITY_LCD) + +#include "../../inc/MarlinConfig.h" + +#include "dwin_lcd.h" +#include // for memset + +// Make sure DWIN_SendBuf is large enough to hold the largest +// printed string plus the draw command and tail. +uint8_t DWIN_SendBuf[11 + 24] = { 0xAA }; +uint8_t DWIN_BufTail[4] = { 0xCC, 0x33, 0xC3, 0x3C }; +uint8_t databuf[26] = { 0 }; +uint8_t receivedType; + +int recnum = 0; + +inline void DWIN_Byte(size_t &i, const uint16_t bval) { + DWIN_SendBuf[++i] = bval; +} + +inline void DWIN_Word(size_t &i, const uint16_t wval) { + DWIN_SendBuf[++i] = wval >> 8; + DWIN_SendBuf[++i] = wval & 0xFF; +} + +inline void DWIN_Long(size_t &i, const uint32_t lval) { + DWIN_SendBuf[++i] = (lval >> 24) & 0xFF; + DWIN_SendBuf[++i] = (lval >> 16) & 0xFF; + DWIN_SendBuf[++i] = (lval >> 8) & 0xFF; + DWIN_SendBuf[++i] = lval & 0xFF; +} + +inline void DWIN_String(size_t &i, char * const string) { + const size_t len = strlen(string); + memcpy(&DWIN_SendBuf[i+1], string, len); + i += len; +} + +/*发送当前BUF中的数据以及包尾数据 len:整包数据长度*/ +inline void DWIN_Send(size_t &i) { + ++i; + LOOP_L_N(n, i) { MYSERIAL1.write(DWIN_SendBuf[n]); + delayMicroseconds(1); } + LOOP_L_N(n, 4) { MYSERIAL1.write(DWIN_BufTail[n]); + delayMicroseconds(1); } +} + +/*----------------------------------------------系统变量函数----------------------------------------------*/ +/*握手 1: 握手成功 2: 握手失败*/ +bool DWIN_Handshake(void) { + size_t i = 0; + DWIN_Byte(i, 0x00); + DWIN_Send(i); + + while (MYSERIAL1.available() > 0 && recnum < (signed)sizeof(databuf)) { + databuf[recnum] = MYSERIAL1.read(); + // ignore the invalid data + if (databuf[0] != FHONE) { // prevent the program from running. + if (recnum > 0) { + recnum = 0; + ZERO(databuf); + } + continue; + } + delay(10); + recnum++; + } + + return ( recnum >= 3 + && databuf[0] == FHONE + && databuf[1] == '\0' + && databuf[2] == 'O' + && databuf[3] == 'K' ); +} + +/*设定背光亮度 luminance:亮度(0x00~0xFF)*/ +void DWIN_Backlight_SetLuminance(const uint8_t luminance) { + size_t i = 0; + DWIN_Byte(i, 0x30); + DWIN_Byte(i, _MAX(luminance, 0x1F)); + DWIN_Send(i); +} + +/*设定画面显示方向 dir:0,0°; 1,90°; 2,180°; 3,270°*/ +void DWIN_Frame_SetDir(uint8_t dir) { + size_t i = 0; + DWIN_Byte(i, 0x34); + DWIN_Byte(i, 0x5A); + DWIN_Byte(i, 0xA5); + DWIN_Byte(i, dir); + DWIN_Send(i); +} + +/*更新显示*/ +void DWIN_UpdateLCD(void) { + size_t i = 0; + DWIN_Byte(i, 0x3D); + DWIN_Send(i); +} + +/*----------------------------------------------绘图相关函数----------------------------------------------*/ +/*画面清屏 color:清屏颜色*/ +void DWIN_Frame_Clear(const uint16_t color) { + size_t i = 0; + DWIN_Byte(i, 0x01); + DWIN_Word(i, color); + DWIN_Send(i); +} + +/*画面画线 color:线段颜色 xStart:X起始坐标 yStart:Y起始坐标 xEnd:X终止坐标 yEnd:Y终止坐标*/ +void DWIN_Draw_Line(uint16_t color, uint16_t xStart, uint16_t yStart, uint16_t xEnd, uint16_t yEnd) { + size_t i = 0; + DWIN_Byte(i, 0x03); + DWIN_Word(i, color); + DWIN_Word(i, xStart); + DWIN_Word(i, yStart); + DWIN_Word(i, xEnd); + DWIN_Word(i, yEnd); + DWIN_Send(i); +} + +/*画面画矩形 mode:0,外框;1,填充;2,异或填充 color:颜色 xStart/yStart:矩形左上坐标 xEnd/yEnd:矩形右下坐标*/ +void DWIN_Draw_Rectangle(uint8_t mode, uint16_t color, + uint16_t xStart, uint16_t yStart, uint16_t xEnd, uint16_t yEnd) { + size_t i = 0; + DWIN_Byte(i, 0x05); + DWIN_Byte(i, mode); + DWIN_Word(i, color); + DWIN_Word(i, xStart); + DWIN_Word(i, yStart); + DWIN_Word(i, xEnd); + DWIN_Word(i, yEnd); + DWIN_Send(i); +} + +/*画面区域移动 mode:0,环移;1,平移 dir:0,向左移动;1,向右移动;2,向上移动;3,向下移动 dis:移动距离 + color:填充颜色 xStart/yStart:选定区域左上坐标 xEnd/yEnd:选定区域右下坐标*/ +void DWIN_Frame_AreaMove(uint8_t mode, uint8_t dir, uint16_t dis, + uint16_t color, uint16_t xStart, uint16_t yStart, uint16_t xEnd, uint16_t yEnd) { + size_t i = 0; + DWIN_Byte(i, 0x09); + DWIN_Byte(i, (mode << 7) | dir); + DWIN_Word(i, dis); + DWIN_Word(i, color); + DWIN_Word(i, xStart); + DWIN_Word(i, yStart); + DWIN_Word(i, xEnd); + DWIN_Word(i, yEnd); + DWIN_Send(i); +} + +/*----------------------------------------------文本相关函数----------------------------------------------*/ +/*画面显示字符串 widthAdjust:true,自调整字符宽度;false,不调整字符宽度 bShow:true,显示背景色;false,不显示背景色 size:字号大小 + color:字符颜色 bColor:背景颜色 x/y:字符串左上坐标 *string:字符串*/ +void DWIN_Draw_String(bool widthAdjust, bool bShow, uint8_t size, + uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, char *string) { + size_t i = 0; + DWIN_Byte(i, 0x11); + DWIN_Byte(i, (widthAdjust? 0x80:0x00) | (bShow? 0x40:0x00) | size); + DWIN_Word(i, color); + DWIN_Word(i, bColor); + DWIN_Word(i, x); + DWIN_Word(i, y); + DWIN_String(i, string); + DWIN_Send(i); +} + +/*画面显示正整数 bShow:true,显示背景色;false,不显示背景色 zeroFill:true,补零;false,不补零 zeroMode:1,无效0显示为0; 0,无效0显示为空格 size:字号大小 + color:字符颜色 bColor:背景颜色 iNum:位数 x/y:变量左上坐标 value:整型变量*/ +void DWIN_Draw_IntValue(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, + uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, uint16_t value) { + size_t i = 0; + DWIN_Byte(i, 0x14); + DWIN_Byte(i, (bShow? 0x80:0x00) | (zeroFill? 0x20:0x00) | (zeroMode? 0x10:0x00) | size); + DWIN_Word(i, color); + DWIN_Word(i, bColor); + DWIN_Byte(i, iNum); + DWIN_Byte(i, 0); // fNum + DWIN_Word(i, x); + DWIN_Word(i, y); + #if 0 + for (char count = 0; count < 8; count++) { + DWIN_Byte(i, value); + value >>= 8; + if ((value&0xFF) == 0x00) break; + } + #else + // Write a big-endian 64 bit integer + const size_t p = i + 1; + for (char count = 8; count--;) { // 7..0 + ++i; + DWIN_SendBuf[p + count] = value; + value >>= 8; + } + #endif + + DWIN_Send(i); +} + +/*画面显示浮点数 bShow:true,显示背景色;false,不显示背景色 zeroFill:true,补零;false,不补零 zeroMode:1,无效0显示为0; 0,无效0显示为空格 size:字号大小 + color:字符颜色 bColor:背景颜色 iNum:整数位数 fNum:小数位数 x/y:变量左上坐标 value:浮点数变量*/ +void DWIN_Draw_FloatValue(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, + uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, long value) { + //uint8_t *fvalue = (uint8_t*)&value; + size_t i = 0; + DWIN_Byte(i, 0x14); + DWIN_Byte(i, (bShow? 0x80:0x00) | (zeroFill? 0x20:0x00) | (zeroMode? 0x10:0x00) | size); + DWIN_Word(i, color); + DWIN_Word(i, bColor); + DWIN_Byte(i, iNum); + DWIN_Byte(i, fNum); + DWIN_Word(i, x); + DWIN_Word(i, y); + DWIN_Long(i, value); + /* + DWIN_Byte(i, fvalue[3]); + DWIN_Byte(i, fvalue[2]); + DWIN_Byte(i, fvalue[1]); + DWIN_Byte(i, fvalue[0]); + */ + DWIN_Send(i); +} + +/*----------------------------------------------图片相关函数----------------------------------------------*/ +/*jpg图片显示并缓存在#0虚拟显示区 id:图片ID*/ +void DWIN_JPG_ShowAndCache(const uint8_t id) { + size_t i = 0; + DWIN_Word(i, 0x2200); + DWIN_Byte(i, id); + DWIN_Send(i); //AA 23 00 00 00 00 08 00 01 02 03 CC 33 C3 3C +} + +/*图标显示 libID:图标库ID picID:图标ID x/y:图标左上坐标*/ +void DWIN_ICON_Show(uint8_t libID, uint8_t picID, uint16_t x, uint16_t y) { + NOMORE(x, DWIN_WIDTH - 1); + NOMORE(y, DWIN_HEIGHT - 1); // -- ozy -- srl + size_t i = 0; + DWIN_Byte(i, 0x23); + DWIN_Word(i, x); + DWIN_Word(i, y); + DWIN_Byte(i, 0x80 | libID); + DWIN_Byte(i, picID); + DWIN_Send(i); +} + +/*jpg图片解压到#1虚拟显示区 id:图片ID*/ +void DWIN_JPG_CacheToN(uint8_t n, uint8_t id) { + size_t i = 0; + DWIN_Byte(i, 0x25); + DWIN_Byte(i, n); + DWIN_Byte(i, id); + DWIN_Send(i); +} + +/*从虚拟显示区复制区域至当前画面 cacheID:虚拟区号 xStart/yStart:虚拟区左上坐标 xEnd/yEnd:虚拟区右下坐标 x/y:当前画面粘贴坐标*/ +void DWIN_Frame_AreaCopy(uint8_t cacheID, uint16_t xStart, uint16_t yStart, + uint16_t xEnd, uint16_t yEnd, uint16_t x, uint16_t y) { + size_t i = 0; + DWIN_Byte(i, 0x27); + DWIN_Byte(i, 0x80 | cacheID); + DWIN_Word(i, xStart); + DWIN_Word(i, yStart); + DWIN_Word(i, xEnd); + DWIN_Word(i, yEnd); + DWIN_Word(i, x); + DWIN_Word(i, y); + DWIN_Send(i); +} + +#endif // DWIN_CREALITY_LCD diff --git a/Marlin/src/lcd/dwin/dwin_lcd.h b/Marlin/src/lcd/dwin/dwin_lcd.h new file mode 100644 index 0000000000..3fae1ccfc9 --- /dev/null +++ b/Marlin/src/lcd/dwin/dwin_lcd.h @@ -0,0 +1,111 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 dwin_lcd.h + * @author LEO / Creality3D + * @date 2019/07/18 + * @version 2.0.1 + * @brief 迪文屏控制操作函数 + ********************************************************************************/ + +#include + +#define RECEIVED_NO_DATA 0x00 +#define RECEIVED_SHAKE_HAND_ACK 0x01 + +#define FHONE 0xAA + +#define DWIN_SCROLL_UP 2 +#define DWIN_SCROLL_DOWN 3 + +#define DWIN_WIDTH 272 +#define DWIN_HEIGHT 480 + +/*接收数据解析 返回值:true,接收到数据;false,未接收到数据*/ +bool DWIN_ReceiveAnalyze(void); + +/*发送当前BUF中的数据以及包尾数据 len:整包数据长度*/ +void DWIN_Send_BufTail(const uint8_t len); + +/*----------------------------------------------系统变量函数----------------------------------------------*/ +/*握手 1: 握手成功 2: 握手失败*/ +bool DWIN_Handshake(void); + +/*设定背光亮度 luminance:亮度(0x00~0xFF)*/ +void DWIN_Backlight_SetLuminance(const uint8_t luminance); + +/*设定画面显示方向 dir:0,0°; 1,90°; 2,180°; 3,270°*/ +void DWIN_Frame_SetDir(uint8_t dir); + +/*更新显示*/ +void DWIN_UpdateLCD(void); + +/*----------------------------------------------绘图相关函数----------------------------------------------*/ +/*画面清屏 color:清屏颜色*/ +void DWIN_Frame_Clear(const uint16_t color); + +/*画面画线 color:线段颜色 xStart:X起始坐标 yStart:Y起始坐标 xEnd:X终止坐标 yEnd:Y终止坐标*/ +void DWIN_Draw_Line(uint16_t color, uint16_t xStart, uint16_t yStart, uint16_t xEnd, uint16_t yEnd); + +/*画面画矩形 mode:0,外框;1,填充;2,异或填充 color:颜色 xStart/yStart:矩形左上坐标 xEnd/yEnd:矩形右下坐标*/ +void DWIN_Draw_Rectangle(uint8_t mode, uint16_t color, + uint16_t xStart, uint16_t yStart, uint16_t xEnd, uint16_t yEnd); + +/*画面区域移动 mode:0,环移;1,平移 dir:0,向左移动;1,向右移动;2,向上移动;3,向下移动 dis:移动距离 + color:填充颜色 xStart/yStart:选定区域左上坐标 xEnd/yEnd:选定区域右下坐标*/ +void DWIN_Frame_AreaMove(uint8_t mode, uint8_t dir, uint16_t dis, + uint16_t color, uint16_t xStart, uint16_t yStart, uint16_t xEnd, uint16_t yEnd); + +/*----------------------------------------------文本相关函数----------------------------------------------*/ +/*画面显示字符串 widthAdjust:true,自调整字符宽度;false,不调整字符宽度 bShow:true,显示背景色;false,不显示背景色 size:字号大小 + color:字符颜色 bColor:背景颜色 x/y:字符串左上坐标 *string:字符串*/ +void DWIN_Draw_String(bool widthAdjust, bool bShow, uint8_t size, + uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, char *string); + +/*画面显示正整数 bShow:true,显示背景色;false,不显示背景色 zeroFill:true,补零;false,不补零 zeroMode:1,无效0显示为0; 0,无效0显示为空格 size:字号大小 + color:字符颜色 bColor:背景颜色 iNum:位数 x/y:变量左上坐标 value:整型变量*/ +void DWIN_Draw_IntValue(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, + uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, uint16_t value); + +/*画面显示浮点数 bShow:true,显示背景色;false,不显示背景色 zeroFill:true,补零;false,不补零 zeroMode:1,无效0显示为0; 0,无效0显示为空格 size:字号大小 + color:字符颜色 bColor:背景颜色 iNum:整数位数 fNum:小数位数 x/y:变量左上坐标 value:浮点数变量*/ +void DWIN_Draw_FloatValue(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, + uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, long value); + +/*----------------------------------------------图片相关函数----------------------------------------------*/ +/*jpg图片显示并缓存在#0虚拟显示区 id:图片ID*/ +void DWIN_JPG_ShowAndCache(const uint8_t id); + +/*图标显示 libID:图标库ID picID:图标ID x/y:图标左上坐标*/ +void DWIN_ICON_Show(uint8_t libID, uint8_t picID, uint16_t x, uint16_t y); + +/*jpg图片解压到#1虚拟显示区 id:图片ID*/ +void DWIN_JPG_CacheToN(uint8_t n, uint8_t id); + +/*jpg图片解压到#1虚拟显示区 id:图片ID*/ +inline void DWIN_JPG_CacheTo1(uint8_t id) { DWIN_JPG_CacheToN(1, id); } + +/*从虚拟显示区复制区域至当前画面 cacheID:虚拟区号 xStart/yStart:虚拟区左上坐标 xEnd/yEnd:虚拟区右下坐标 x/y:当前画面粘贴坐标*/ +void DWIN_Frame_AreaCopy(uint8_t cacheID, uint16_t xStart, uint16_t yStart, + uint16_t xEnd, uint16_t yEnd, uint16_t x, uint16_t y); diff --git a/Marlin/src/lcd/dwin/rotary_encoder.cpp b/Marlin/src/lcd/dwin/rotary_encoder.cpp new file mode 100644 index 0000000000..62e2cda351 --- /dev/null +++ b/Marlin/src/lcd/dwin/rotary_encoder.cpp @@ -0,0 +1,251 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 rotary_encoder.cpp + * @author LEO / Creality3D + * @date 2019/07/06 + * @version 2.0.1 + * @brief 旋转编码器操作函数 + ****************************************************************************** +**/ + +#include "../../inc/MarlinConfigPre.h" + +#if ENABLED(DWIN_CREALITY_LCD) + +#include "rotary_encoder.h" + +#include "../../MarlinCore.h" +#include "../../HAL/shared/Delay.h" + +#if HAS_BUZZER + #include "../../libs/buzzer.h" +#endif + +#include + +ENCODER_Rate EncoderRate; + +/*蜂鸣器响*/ +void Encoder_tick(void) { + WRITE(BEEPER_PIN, 1); + delay(10); + WRITE(BEEPER_PIN, 0); +} + +/*编码器初始化 PB12:Encoder_A PB13:Encoder_B PB14:Encoder_C*/ +void Encoder_Configuration(void) { + #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 + #ifdef BEEPER_PIN + SET_OUTPUT(BEEPER_PIN); + #endif +} + +millis_t next_click_update_ms; +/*接收数据解析 返回值:ENCODER_DIFF_NO,无状态; ENCODER_DIFF_CW,顺时针旋转; ENCODER_DIFF_CCW,逆时针旋转; ENCODER_DIFF_ENTER,按下*/ +ENCODER_DiffState Encoder_ReceiveAnalyze(void) { + const millis_t now = millis(); + static unsigned char lastEncoderBits; + unsigned char newbutton = 0; + static signed char temp_diff = 0; + + ENCODER_DiffState temp_diffState = ENCODER_DIFF_NO; + if (BUTTON_PRESSED(EN1)) newbutton |= 0x01; + if (BUTTON_PRESSED(EN2)) newbutton |= 0x02; + if (BUTTON_PRESSED(ENC)) { + if (ELAPSED(now, next_click_update_ms)) { + next_click_update_ms = millis() + 300; + Encoder_tick(); + #if PIN_EXISTS(LCD_LED) + //LED_Action(); + #endif + const bool was_waiting = wait_for_user; + wait_for_user = false; + return was_waiting ? ENCODER_DIFF_NO : ENCODER_DIFF_ENTER; + } + else return ENCODER_DIFF_NO; + } + if (newbutton != lastEncoderBits) { + switch (newbutton) { + case ENCODER_PHASE_0: { + if (lastEncoderBits == ENCODER_PHASE_3) temp_diff++; + else if (lastEncoderBits == ENCODER_PHASE_1) temp_diff--; + }break; + case ENCODER_PHASE_1: { + if (lastEncoderBits == ENCODER_PHASE_0) temp_diff++; + else if (lastEncoderBits == ENCODER_PHASE_2) temp_diff--; + }break; + case ENCODER_PHASE_2: { + if (lastEncoderBits == ENCODER_PHASE_1) temp_diff++; + else if (lastEncoderBits == ENCODER_PHASE_3) temp_diff--; + }break; + case ENCODER_PHASE_3: { + if (lastEncoderBits == ENCODER_PHASE_2) temp_diff++; + else if (lastEncoderBits == ENCODER_PHASE_0) temp_diff--; + }break; + } + lastEncoderBits = newbutton; + } + + if (abs(temp_diff) >= ENCODER_PULSES_PER_STEP) { + if (temp_diff > 0) temp_diffState = ENCODER_DIFF_CW; + else temp_diffState = ENCODER_DIFF_CCW; + + #if ENABLED(ENCODER_RATE_MULTIPLIER) + + millis_t ms = millis(); + int32_t encoderMultiplier = 1; + + // if must encoder rati multiplier + if (EncoderRate.encoderRateEnabled) { + const float abs_diff = ABS(temp_diff); + const float encoderMovementSteps = abs_diff / (ENCODER_PULSES_PER_STEP); + if (EncoderRate.lastEncoderTime) { + // Note that the rate is always calculated between two passes through the + // loop and that the abs of the temp_diff value is tracked. + const float encoderStepRate = encoderMovementSteps / float(ms - EncoderRate.lastEncoderTime) * 1000; + if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100; + else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10; + else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5; + } + EncoderRate.lastEncoderTime = ms; + } + #else + constexpr int32_t encoderMultiplier = 1; + #endif // ENCODER_RATE_MULTIPLIER + + // EncoderRate.encoderMoveValue += (temp_diff * encoderMultiplier) / (ENCODER_PULSES_PER_STEP); + EncoderRate.encoderMoveValue = (temp_diff * encoderMultiplier) / (ENCODER_PULSES_PER_STEP); + if (EncoderRate.encoderMoveValue < 0) EncoderRate.encoderMoveValue = -EncoderRate.encoderMoveValue; + + temp_diff = 0; + } + return temp_diffState; +} + +#if PIN_EXISTS(LCD_LED) + + /*取低24位有效 24Bit: G7 G6 G5 G4 G3 G2 G1 G0 R7 R6 R5 R4 R3 R2 R1 R0 B7 B6 B5 B4 B3 B2 B1 B0*/ + unsigned int LED_DataArray[LED_NUM]; + + /*LED灯操作*/ + void LED_Action(void) { + LED_Control(RGB_SCALE_WARM_WHITE,0x0F); + delay(30); + LED_Control(RGB_SCALE_WARM_WHITE,0x00); + } + + /*LED初始化*/ + void LED_Configuration(void) { + SET_OUTPUT(LCD_LED_PIN); + } + + /*LED写数据*/ + void LED_WriteData(void) { + unsigned char tempCounter_LED, tempCounter_Bit; + for (tempCounter_LED = 0; tempCounter_LED < LED_NUM; tempCounter_LED++) { + for (tempCounter_Bit = 0; tempCounter_Bit < 24; tempCounter_Bit++) { + if (LED_DataArray[tempCounter_LED] & (0x800000 >> tempCounter_Bit)) { + LED_DATA_HIGH; + DELAY_NS(300); + LED_DATA_LOW; + DELAY_NS(200); + } + else { + LED_DATA_HIGH; + LED_DATA_LOW; + DELAY_NS(200); + } + } + } + } + + /*LED控制 RGB_Scale:RGB色彩配比 luminance:亮度(0~0xFF)*/ + void LED_Control(unsigned char RGB_Scale, unsigned char luminance) { + unsigned char temp_Counter; + for (temp_Counter = 0; temp_Counter < LED_NUM; temp_Counter++) { + LED_DataArray[temp_Counter] = 0; + switch(RGB_Scale) { + case RGB_SCALE_R10_G7_B5: LED_DataArray[temp_Counter] = (luminance*10/10) << 8 | (luminance*7/10) << 16 | luminance*5/10; break; + case RGB_SCALE_R10_G7_B4: LED_DataArray[temp_Counter] = (luminance*10/10) << 8 | (luminance*7/10) << 16 | luminance*4/10; break; + case RGB_SCALE_R10_G8_B7: LED_DataArray[temp_Counter] = (luminance*10/10) << 8 | (luminance*8/10) << 16 | luminance*7/10; break; + } + } + LED_WriteData(); + } + + /*LED渐变控制 RGB_Scale:RGB色彩配比 luminance:亮度(0~0xFF) change_Time:渐变时间(ms)*/ + void LED_GraduallyControl(unsigned char RGB_Scale, unsigned char luminance, unsigned int change_Interval) { + unsigned char temp_Counter; + unsigned char LED_R_Data[LED_NUM], LED_G_Data[LED_NUM], LED_B_Data[LED_NUM]; + bool LED_R_Flag = 0, LED_G_Flag = 0, LED_B_Flag = 0; + + for (temp_Counter = 0; temp_Counter < LED_NUM; temp_Counter++) { + switch(RGB_Scale) { + case RGB_SCALE_R10_G7_B5: { + LED_R_Data[temp_Counter] = luminance*10/10; + LED_G_Data[temp_Counter] = luminance*7/10; + LED_B_Data[temp_Counter] = luminance*5/10; + }break; + case RGB_SCALE_R10_G7_B4: { + LED_R_Data[temp_Counter] = luminance*10/10; + LED_G_Data[temp_Counter] = luminance*7/10; + LED_B_Data[temp_Counter] = luminance*4/10; + }break; + case RGB_SCALE_R10_G8_B7: { + LED_R_Data[temp_Counter] = luminance*10/10; + LED_G_Data[temp_Counter] = luminance*8/10; + LED_B_Data[temp_Counter] = luminance*7/10; + }break; + } + } + for (temp_Counter = 0; temp_Counter < LED_NUM; temp_Counter++) { + if ((unsigned char)(LED_DataArray[temp_Counter] >> 8) > LED_R_Data[temp_Counter]) LED_DataArray[temp_Counter] -= 0x000100; + else if ((unsigned char)(LED_DataArray[temp_Counter] >> 8) < LED_R_Data[temp_Counter]) LED_DataArray[temp_Counter] += 0x000100; + while (1) { + else LED_R_Flag = 1; + if ((unsigned char)(LED_DataArray[temp_Counter]>>16) > LED_G_Data[temp_Counter]) LED_DataArray[temp_Counter] -= 0x010000; + else if ((unsigned char)(LED_DataArray[temp_Counter]>>16) < LED_G_Data[temp_Counter]) LED_DataArray[temp_Counter] += 0x010000; + else LED_G_Flag = 1; + if ((unsigned char)LED_DataArray[temp_Counter] > LED_B_Data[temp_Counter]) LED_DataArray[temp_Counter] -= 0x000001; + else if ((unsigned char)LED_DataArray[temp_Counter] < LED_B_Data[temp_Counter]) LED_DataArray[temp_Counter] += 0x000001; + else LED_B_Flag = 1; + } + LED_WriteData(); + if (LED_R_Flag && LED_G_Flag && LED_B_Flag) break; + else delay(change_Interval); + } + } + +#endif + +#endif // DWIN_CREALITY_LCD diff --git a/Marlin/src/lcd/dwin/rotary_encoder.h b/Marlin/src/lcd/dwin/rotary_encoder.h new file mode 100644 index 0000000000..5c5a8f86a2 --- /dev/null +++ b/Marlin/src/lcd/dwin/rotary_encoder.h @@ -0,0 +1,105 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 rotary_encoder.h + * @author LEO / Creality3D + * @date 2019/07/06 + * @version 2.0.1 + * @brief 旋转编码器操作函数 + ****************************************************************************** +**/ + +#include "../../inc/MarlinConfig.h" +#include "../../MarlinCore.h" + +/*********************** Encoder Set ***********************/ + +#define ENCODER_PHASE_0 0 +#define ENCODER_PHASE_1 2 +#define ENCODER_PHASE_2 3 +#define ENCODER_PHASE_3 1 + +#define ENCODER_PULSES_PER_STEP 4 + +#define BUTTON_PRESSED(BN) !READ(BTN_## BN) + +typedef struct { + bool encoderRateEnabled = 0; + int encoderMoveValue = 0; + millis_t lastEncoderTime = 0; +} ENCODER_Rate; + +extern ENCODER_Rate EncoderRate; + +typedef enum { + ENCODER_DIFF_NO = 0, + ENCODER_DIFF_CW = 1, + ENCODER_DIFF_CCW = 2, + ENCODER_DIFF_ENTER = 3 +} ENCODER_DiffState; + +/*编码器初始化 PB12:Encoder_A PB13:Encoder_B PB14:Encoder_C*/ +void Encoder_Configuration(void); + +/*接收数据解析 返回值:ENCODER_DIFF_NO,无状态; ENCODER_DIFF_CW,顺时针旋转; ENCODER_DIFF_CCW,逆时针旋转; ENCODER_DIFF_ENTER,按下*/ +ENCODER_DiffState Encoder_ReceiveAnalyze(void); + + +/*********************** Encoder LED ***********************/ + +#if PIN_EXISTS(LCD_LED) + + #define LED_NUM 4 + #define LED_DATA_HIGH WRITE(LCD_LED_PIN, 1) + #define LED_DATA_LOW WRITE(LCD_LED_PIN, 0) + + #define RGB_SCALE_R10_G7_B5 1 + #define RGB_SCALE_R10_G7_B4 2 + #define RGB_SCALE_R10_G8_B7 3 + #define RGB_SCALE_NEUTRAL_WHITE RGB_SCALE_R10_G7_B5 //正白 + #define RGB_SCALE_WARM_WHITE RGB_SCALE_R10_G7_B4 //暖白 + #define RGB_SCALE_COOL_WHITE RGB_SCALE_R10_G8_B7 //冷白 + + extern unsigned int LED_DataArray[LED_NUM]; + + /*状态LED初始化*/ + void STATE_LED_Configuration(void); + + /*LED灯操作*/ + void LED_Action(void); + + /*LED初始化*/ + void LED_Configuration(void); + + /*LED写数据*/ + void LED_WriteData(void); + + /*LED控制 RGB_Scale:RGB色彩配比 luminance:亮度(0~0xFF)*/ + void LED_Control(unsigned char RGB_Scale, unsigned char luminance); + + /*LED渐变控制 RGB_Scale:RGB色彩配比 luminance:亮度(0~0xFF) change_Time:渐变时间(ms)*/ + void LED_GraduallyControl(unsigned char RGB_Scale, unsigned char luminance, unsigned int change_Interval); + +#endif diff --git a/Marlin/src/lcd/extui/lib/anycubic/anycubic_serial.cpp b/Marlin/src/lcd/extui/lib/anycubic/anycubic_serial.cpp new file mode 100644 index 0000000000..fd5f2691bd --- /dev/null +++ b/Marlin/src/lcd/extui/lib/anycubic/anycubic_serial.cpp @@ -0,0 +1,290 @@ +/* + anycubic_serial.cpp --- Support for Anycubic i3 Mega TFT serial connection + Created by Christian Hopp on 09.12.17. + + Original file: + HardwareSerial.cpp - Hardware serial library for Wiring + Copyright (c) 2006 Nicholas Zambetti. 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 + + Modified 23 November 2006 by David A. Mellis + Modified 28 September 2010 by Mark Sproul + Modified 14 August 2012 by Alarus +*/ + +#include "../../../../inc/MarlinConfig.h" + +#if ENABLED(ANYCUBIC_TFT_MODEL) + +#include + +// This next line disables the entire anycubic_serial.cpp, +// to support AtTiny series and other chips without a UART +#ifdef UBRR3H + +#include "anycubic_serial.h" + +#include +#include +#include +#include +#include "wiring_private.h" + +// Define constants and variables for buffering incoming serial data. We're +// using a ring buffer (I think), in which head is the index of the location +// to which to write the next incoming character and tail is the index of the +// location from which to read. +#if (RAMEND < 1000) + #define SERIAL_BUFFER_SIZE 64 +#else + #define SERIAL_BUFFER_SIZE 128 +#endif + +struct ring_buffer { + unsigned char buffer[SERIAL_BUFFER_SIZE]; + volatile unsigned int head; + volatile unsigned int tail; +}; + +ring_buffer rx_buffer_ajg = { { 0 }, 0, 0 }; +ring_buffer tx_buffer_ajg = { { 0 }, 0, 0 }; + +inline void store_char(unsigned char c, ring_buffer *buffer) { + int i = (unsigned int)(buffer->head + 1) % SERIAL_BUFFER_SIZE; + + // if we should be storing the received character into the location + // just before the tail (meaning that the head would advance to the + // current location of the tail), we're about to overflow the buffer + // and so we don't write the character or advance the head. + if (i != buffer->tail) { + buffer->buffer[buffer->head] = c; + buffer->head = i; + } +} + +#if defined(USART3_RX_vect) && defined(UDR3) + void serialEvent3() __attribute__((weak)); + void serialEvent3() {} + #define serialEvent3_implemented + ISR(USART3_RX_vect) { + if (bit_is_clear(UCSR3A, UPE3)) { + unsigned char c = UDR3; + store_char(c, &rx_buffer_ajg); + } + else { + unsigned char c = UDR3; + } + } +#endif + +#ifdef USART3_UDRE_vect + + ISR(USART3_UDRE_vect) { + if (tx_buffer_ajg.head == tx_buffer_ajg.tail) { + // Buffer empty, so disable interrupts + cbi(UCSR3B, UDRIE3); + } + else { + // There is more data in the output buffer. Send the next byte + unsigned char c = tx_buffer_ajg.buffer[tx_buffer_ajg.tail]; + tx_buffer_ajg.tail = (tx_buffer_ajg.tail + 1) % SERIAL_BUFFER_SIZE; + + UDR3 = c; + } + } + +#endif + +// Constructors //////////////////////////////////////////////////////////////// + +AnycubicSerialClass::AnycubicSerialClass(ring_buffer *rx_buffer, ring_buffer *tx_buffer, + volatile uint8_t *ubrrh, volatile uint8_t *ubrrl, + volatile uint8_t *ucsra, volatile uint8_t *ucsrb, + volatile uint8_t *ucsrc, volatile uint8_t *udr, + uint8_t rxen, uint8_t txen, uint8_t rxcie, uint8_t udrie, uint8_t u2x +) { + _rx_buffer = rx_buffer; + _tx_buffer = tx_buffer; + _ubrrh = ubrrh; + _ubrrl = ubrrl; + _ucsra = ucsra; + _ucsrb = ucsrb; + _ucsrc = ucsrc; + _udr = udr; + _rxen = rxen; + _txen = txen; + _rxcie = rxcie; + _udrie = udrie; + _u2x = u2x; +} + +// Public Methods ////////////////////////////////////////////////////////////// + +void AnycubicSerialClass::begin(unsigned long baud) { + uint16_t baud_setting; + bool use_u2x = true; + + #if F_CPU == 16000000UL + // hardcoded 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) use_u2x = false; + #endif + +try_again: + + if (use_u2x) { + *_ucsra = 1 << _u2x; + baud_setting = (F_CPU / 4 / baud - 1) / 2; + } else { + *_ucsra = 0; + baud_setting = (F_CPU / 8 / baud - 1) / 2; + } + + if ((baud_setting > 4095) && use_u2x) { + use_u2x = false; + goto try_again; + } + + // assign the baud_setting, a.k.a. ubbr (USART Baud Rate Register) + *_ubrrh = baud_setting >> 8; + *_ubrrl = baud_setting; + + transmitting = false; + + sbi(*_ucsrb, _rxen); + sbi(*_ucsrb, _txen); + sbi(*_ucsrb, _rxcie); + cbi(*_ucsrb, _udrie); +} + +void AnycubicSerialClass::begin(unsigned long baud, byte config) { + uint16_t baud_setting; + uint8_t current_config; + bool use_u2x = true; + + #if F_CPU == 16000000UL + // hardcoded 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) use_u2x = false; + #endif + +try_again: + + if (use_u2x) { + *_ucsra = 1 << _u2x; + baud_setting = (F_CPU / 4 / baud - 1) / 2; + } + else { + *_ucsra = 0; + baud_setting = (F_CPU / 8 / baud - 1) / 2; + } + + if ((baud_setting > 4095) && use_u2x) { + use_u2x = false; + goto try_again; + } + + // assign the baud_setting, a.k.a. ubbr (USART Baud Rate Register) + *_ubrrh = baud_setting >> 8; + *_ubrrl = baud_setting; + + //set the data bits, parity, and stop bits + #ifdef __AVR_ATmega8__ + config |= 0x80; // select UCSRC register (shared with UBRRH) + #endif + *_ucsrc = config; + + sbi(*_ucsrb, _rxen); + sbi(*_ucsrb, _txen); + sbi(*_ucsrb, _rxcie); + cbi(*_ucsrb, _udrie); +} + +void AnycubicSerialClass::end() { + // wait for transmission of outgoing data + while (_tx_buffer->head != _tx_buffer->tail) + ; + + cbi(*_ucsrb, _rxen); + cbi(*_ucsrb, _txen); + cbi(*_ucsrb, _rxcie); + cbi(*_ucsrb, _udrie); + + // clear any received data + _rx_buffer->head = _rx_buffer->tail; +} + +int AnycubicSerialClass::available(void) { + return (int)(SERIAL_BUFFER_SIZE + _rx_buffer->head - _rx_buffer->tail) % SERIAL_BUFFER_SIZE; +} + +int AnycubicSerialClass::peek(void) { + if (_rx_buffer->head == _rx_buffer->tail) { + return -1; + } else { + return _rx_buffer->buffer[_rx_buffer->tail]; + } +} + +int AnycubicSerialClass::read(void) { + // if the head isn't ahead of the tail, we don't have any characters + if (_rx_buffer->head == _rx_buffer->tail) { + return -1; + } else { + unsigned char c = _rx_buffer->buffer[_rx_buffer->tail]; + _rx_buffer->tail = (unsigned int)(_rx_buffer->tail + 1) % SERIAL_BUFFER_SIZE; + return c; + } +} + +void AnycubicSerialClass::flush() { + // UDR is kept full while the buffer is not empty, so TXC triggers when EMPTY && SENT + while (transmitting && ! (*_ucsra & _BV(TXC0))); + transmitting = false; +} + +size_t AnycubicSerialClass::write(uint8_t c) { + int i = (_tx_buffer->head + 1) % SERIAL_BUFFER_SIZE; + + // If the output buffer is full, there's nothing for it other than to + // wait for the interrupt handler to empty it a bit + // ???: return 0 here instead? + while (i == _tx_buffer->tail) + ; + + _tx_buffer->buffer[_tx_buffer->head] = c; + _tx_buffer->head = i; + + sbi(*_ucsrb, _udrie); + // clear the TXC bit -- "can be cleared by writing a one to its bit location" + transmitting = true; + sbi(*_ucsra, TXC0); + + return 1; +} + +AnycubicSerialClass::operator bool() { + return true; +} + +// Preinstantiate Objects ////////////////////////////////////////////////////// + +AnycubicSerialClass AnycubicSerial(&rx_buffer_ajg, &tx_buffer_ajg, &UBRR3H, &UBRR3L, &UCSR3A, &UCSR3B, &UCSR3C, &UDR3, RXEN3, TXEN3, RXCIE3, UDRIE3, U2X3); + +#endif // UBRR3H +#endif // ANYCUBIC_TFT_MODEL diff --git a/Marlin/src/lcd/extui/lib/anycubic/anycubic_serial.h b/Marlin/src/lcd/extui/lib/anycubic/anycubic_serial.h new file mode 100644 index 0000000000..ed4c19b63e --- /dev/null +++ b/Marlin/src/lcd/extui/lib/anycubic/anycubic_serial.h @@ -0,0 +1,145 @@ +/* + anycubic_serial.h --- Support for Anycubic i3 Mega TFT serial connection + Created by Christian Hopp on 09.12.17. + + Original file: + + HardwareSerial.h - Hardware serial library for Wiring + Copyright (c) 2006 Nicholas Zambetti. 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 + + Modified 28 September 2010 by Mark Sproul + Modified 14 August 2012 by Alarus +*/ +#pragma once + +#include +#include + +#include "Stream.h" + +#define FORCE_INLINE __attribute__((always_inline)) inline + +struct ring_buffer; + +class AnycubicSerialClass : public Stream { + private: + ring_buffer *_rx_buffer; + ring_buffer *_tx_buffer; + volatile uint8_t *_ubrrh; + volatile uint8_t *_ubrrl; + volatile uint8_t *_ucsra; + volatile uint8_t *_ucsrb; + volatile uint8_t *_ucsrc; + volatile uint8_t *_udr; + uint8_t _rxen; + uint8_t _txen; + uint8_t _rxcie; + uint8_t _udrie; + uint8_t _u2x; + bool transmitting; + public: + AnycubicSerialClass(ring_buffer *rx_buffer, ring_buffer *tx_buffer, + volatile uint8_t *ubrrh, volatile uint8_t *ubrrl, + volatile uint8_t *ucsra, volatile uint8_t *ucsrb, + volatile uint8_t *ucsrc, volatile uint8_t *udr, + uint8_t rxen, uint8_t txen, uint8_t rxcie, uint8_t udrie, uint8_t u2x + ); + void begin(unsigned long); + void begin(unsigned long, uint8_t); + void end(); + virtual int available(void); + virtual int peek(void); + virtual int read(void); + virtual void flush(void); + virtual size_t write(uint8_t); + inline size_t write(unsigned long n) { return write((uint8_t)n); } + inline size_t write(long n) { return write((uint8_t)n); } + inline size_t write(unsigned int n) { return write((uint8_t)n); } + inline size_t write(int n) { return write((uint8_t)n); } + using Print::write; // pull in write(str) and write(buf, size) from Print + operator bool(); +}; + +// Define config for Serial.begin(baud, config); +#define SERIAL_5N1 0x00 +#define SERIAL_6N1 0x02 +#define SERIAL_7N1 0x04 +#define SERIAL_8N1 0x06 +#define SERIAL_5N2 0x08 +#define SERIAL_6N2 0x0A +#define SERIAL_7N2 0x0C +#define SERIAL_8N2 0x0E +#define SERIAL_5E1 0x20 +#define SERIAL_6E1 0x22 +#define SERIAL_7E1 0x24 +#define SERIAL_8E1 0x26 +#define SERIAL_5E2 0x28 +#define SERIAL_6E2 0x2A +#define SERIAL_7E2 0x2C +#define SERIAL_8E2 0x2E +#define SERIAL_5O1 0x30 +#define SERIAL_6O1 0x32 +#define SERIAL_7O1 0x34 +#define SERIAL_8O1 0x36 +#define SERIAL_5O2 0x38 +#define SERIAL_6O2 0x3A +#define SERIAL_7O2 0x3C +#define SERIAL_8O2 0x3E + +extern void serialEventRun(void) __attribute__((weak)); + +#define ANYCUBIC_SERIAL_PROTOCOL(x) (AnycubicSerial.print(x)) +#define ANYCUBIC_SERIAL_PROTOCOL_F(x,y) (AnycubicSerial.print(x, y)) +#define ANYCUBIC_SERIAL_PROTOCOLPGM(x) (AnycubicSerialprintPGM(PSTR(x))) +#define ANYCUBIC_SERIAL_(x) (AnycubicSerial.print(x), AnycubicSerial.write('\n')) +#define ANYCUBIC_SERIAL_PROTOCOLLN(x) (AnycubicSerial.print(x), AnycubicSerial.write('\r'), AnycubicSerial.write('\n')) +#define ANYCUBIC_SERIAL_PROTOCOLLNPGM(x) (AnycubicSerialprintPGM(PSTR(x)), AnycubicSerial.write('\r'), AnycubicSerial.write('\n')) + +#define ANYCUBIC_SERIAL_START() (AnycubicSerial.write('\r'), AnycubicSerial.write('\n')) +#define ANYCUBIC_SERIAL_CMD_SEND(x) (AnycubicSerialprintPGM(PSTR(x)), AnycubicSerial.write('\r'), AnycubicSerial.write('\n')) +#define ANYCUBIC_SERIAL_ENTER() (AnycubicSerial.write('\r'), AnycubicSerial.write('\n')) +#define ANYCUBIC_SERIAL_SPACE() (AnycubicSerial.write(' ')) + +const char newErr[] PROGMEM = "ERR "; +const char newSucc[] PROGMEM = "OK"; + +#define ANYCUBIC_SERIAL_ERROR_START (AnycubicSerialprintPGM(newErr)) +#define ANYCUBIC_SERIAL_ERROR(x) ANYCUBIC_SERIAL_PROTOCOL(x) +#define ANYCUBIC_SERIAL_ERRORPGM(x) ANYCUBIC_SERIAL_PROTOCOLPGM(x) +#define ANYCUBIC_SERIAL_ERRORLN(x) ANYCUBIC_SERIAL_PROTOCOLLN(x) +#define ANYCUBIC_SERIAL_ERRORLNPGM(x) ANYCUBIC_SERIAL_PROTOCOLLNPGM(x) + +//##define ANYCUBIC_SERIAL_ECHO_START (AnycubicSerialprintPGM(newSucc)) +#define ANYCUBIC_SERIAL_ECHOLN(x) ANYCUBIC_SERIAL_PROTOCOLLN(x) +#define ANYCUBIC_SERIAL_SUCC_START (AnycubicSerialprintPGM(newSucc)) +#define ANYCUBIC_SERIAL_ECHOPAIR(name,value) (serial_echopair_P(PSTR(name),(value))) +#define ANYCUBIC_SERIAL_ECHOPGM(x) ANYCUBIC_SERIAL_PROTOCOLPGM(x) +#define ANYCUBIC_SERIAL_ECHO(x) ANYCUBIC_SERIAL_PROTOCOL(x) + +#ifdef UBRR3H + + extern AnycubicSerialClass AnycubicSerial; + + FORCE_INLINE void AnycubicSerialprintPGM(const char *str) { + char ch = pgm_read_byte(str); + while (ch) { + AnycubicSerial.write(ch); + ch = pgm_read_byte(++str); + } + } + +#endif diff --git a/Marlin/src/lcd/extui/lib/anycubic/anycubic_tft.cpp b/Marlin/src/lcd/extui/lib/anycubic/anycubic_tft.cpp new file mode 100644 index 0000000000..718b47fee9 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/anycubic/anycubic_tft.cpp @@ -0,0 +1,1066 @@ +/** + * anycubic_tft.cpp --- Support for Anycubic i3 Mega TFT + * Created by Christian Hopp on 09.12.17. + * Improved by David Ramiro + * Converted to ext_iu by John BouAntoun 21 June 2020 + * + * 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/MarlinConfigPre.h" + +#if ENABLED(ANYCUBIC_TFT_MODEL) + +#include "anycubic_tft.h" +#include "anycubic_serial.h" + +#include "../../../../inc/MarlinConfig.h" +#include "../../ui_api.h" +#include "../../../../MarlinCore.h" // for quickstop_stepper and disable_steppers + +AnycubicTFTClass AnycubicTFT; + +char _conv[8]; + +char *itostr2(const uint8_t &x) { + // sprintf(conv,"%5.1f",x); + int xx = x; + _conv[0] = (xx / 10) % 10 + '0'; + _conv[1] = (xx) % 10 + '0'; + _conv[2] = 0; + return _conv; +} + +#ifndef ULTRA_LCD + #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, '-')) + + char* itostr3(const int 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 signed float to fixed-length string with 023.45 / -23.45 format + char *ftostr32(const float &x) { + long xx = x * 100; + _conv[1] = MINUSOR(xx, DIGIMOD(xx, 10000)); + _conv[2] = DIGIMOD(xx, 1000); + _conv[3] = DIGIMOD(xx, 100); + _conv[4] = '.'; + _conv[5] = DIGIMOD(xx, 10); + _conv[6] = DIGIMOD(xx, 1); + return &_conv[1]; + } + +#endif + +AnycubicTFTClass::AnycubicTFTClass() {} + +void AnycubicTFTClass::OnSetup() { + AnycubicSerial.begin(115200); + ANYCUBIC_SENDCOMMAND_DBG_PGM("J17", "TFT Serial Debug: Main board reset... J17"); // J17 Main board reset + ExtUI::delay_ms(10); + + // initialise the state of the key pins running on the tft + #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) + pinMode(SD_DETECT_PIN, INPUT); + WRITE(SD_DETECT_PIN, HIGH); + #endif + #if ENABLED(FILAMENT_RUNOUT_SENSOR) + pinMode(FIL_RUNOUT_PIN, INPUT); + WRITE(FIL_RUNOUT_PIN, HIGH); + #endif + + mediaPrintingState = AMPRINTSTATE_NOT_PRINTING; + mediaPauseState = AMPAUSESTATE_NOT_PAUSED; + + // DoSDCardStateCheck(); + ANYCUBIC_SENDCOMMAND_DBG_PGM("J12", "TFT Serial Debug: Ready... J12"); // J12 Ready + ExtUI::delay_ms(10); + + DoFilamentRunoutCheck(); + SelectedFile[0] = 0; + + #if ENABLED(STARTUP_CHIME) + ExtUI::injectCommands_P(PSTR("M300 P250 S554\nM300 P250 S554\nM300 P250 S740\nM300 P250 S554\nM300 P250 S740\nM300 P250 S554\nM300 P500 S831")); + #endif + #if ENABLED(ANYCUBIC_TFT_DEBUG) + SERIAL_ECHOLNPGM("TFT Serial Debug: Finished startup"); + #endif +} + +void AnycubicTFTClass::OnCommandScan() { + static millis_t nextStopCheck = 0; // used to slow the stopped print check down to reasonable times + const millis_t ms = millis(); + if (ELAPSED(ms, nextStopCheck)) { + nextStopCheck = ms + 1000UL; + if (mediaPrintingState == AMPRINTSTATE_STOP_REQUESTED && IsNozzleHomed()) { + #if ENABLED(ANYCUBIC_TFT_DEBUG) + SERIAL_ECHOLNPGM("TFT Serial Debug: Finished stopping print, releasing motors ..."); + #endif + mediaPrintingState = AMPRINTSTATE_NOT_PRINTING; + mediaPauseState = AMPAUSESTATE_NOT_PAUSED; + ExtUI::injectCommands_P(PSTR("M84\nM27")); // disable stepper motors and force report of SD status + ExtUI::delay_ms(200); + // tell printer to release resources of print to indicate it is done + ANYCUBIC_SENDCOMMAND_DBG_PGM("J14", "TFT Serial Debug: SD Print Stopped... J14"); + } + } + + if (TFTbuflen < (TFTBUFSIZE - 1)) + GetCommandFromTFT(); + + if (TFTbuflen) { + TFTbuflen = (TFTbuflen - 1); + TFTbufindr = (TFTbufindr + 1) % TFTBUFSIZE; + } +} + +void AnycubicTFTClass::OnKillTFT() { + ANYCUBIC_SENDCOMMAND_DBG_PGM("J11", "TFT Serial Debug: Kill command... J11"); +} + +void AnycubicTFTClass::OnSDCardStateChange(bool isInserted) { + #if ENABLED(ANYCUBIC_TFT_DEBUG) + SERIAL_ECHOPGM("TFT Serial Debug: OnSDCardStateChange event triggered..."); + SERIAL_ECHO(itostr2(isInserted)); + SERIAL_EOL(); + #endif + DoSDCardStateCheck(); +} + +void AnycubicTFTClass::OnSDCardError() { + #if ENABLED(ANYCUBIC_TFT_DEBUG) + SERIAL_ECHOLNPGM("TFT Serial Debug: OnSDCardError event triggered..."); + #endif + ANYCUBIC_SENDCOMMAND_DBG_PGM("J21", "TFT Serial Debug: On SD Card Error ... J21"); +} + +void AnycubicTFTClass::OnFilamentRunout() { + #if ENABLED(ANYCUBIC_TFT_DEBUG) + SERIAL_ECHOLNPGM("TFT Serial Debug: FilamentRunout triggered..."); + #endif + DoFilamentRunoutCheck(); +} + +void AnycubicTFTClass::OnUserConfirmRequired(const char * const msg) { + #if ENABLED(ANYCUBIC_TFT_DEBUG) + SERIAL_ECHOPGM("TFT Serial Debug: OnUserConfirmRequired triggered... "); + SERIAL_ECHOLN(msg); + #endif + + #if ENABLED(SDSUPPORT) + /** + * Need to handle the process of following states + * "Nozzle Parked" + * "Load Filament" + * "Filament Purging..." + * "HeaterTimeout" + * "Reheat finished." + * + * NOTE: The only way to handle these states is strcmp_P with the msg unfortunately (very expensive) + */ + if (strcmp_P(msg, PSTR("Nozzle Parked")) == 0) { + mediaPrintingState = AMPRINTSTATE_PAUSED; + mediaPauseState = AMPAUSESTATE_PARKED; + // enable continue button + ANYCUBIC_SENDCOMMAND_DBG_PGM("J18", "TFT Serial Debug: UserConfirm SD print paused done... J18"); + } + else if (strcmp_P(msg, PSTR("Load Filament")) == 0) { + mediaPrintingState = AMPRINTSTATE_PAUSED; + mediaPauseState = AMPAUSESTATE_FILAMENT_OUT; + // enable continue button + ANYCUBIC_SENDCOMMAND_DBG_PGM("J18", "TFT Serial Debug: UserConfirm Filament is out... J18"); + ANYCUBIC_SENDCOMMAND_DBG_PGM("J23", "TFT Serial Debug: UserConfirm Blocking filament prompt... J23"); + } + else if (strcmp_P(msg, PSTR("Filament Purging...")) == 0) { + mediaPrintingState = AMPRINTSTATE_PAUSED; + mediaPauseState = AMPAUSESTATE_PARKING; + // TODO: JBA I don't think J05 just disables the continue button, i think it injects a rogue M25. So taking this out + // disable continue button + // ANYCUBIC_SENDCOMMAND_DBG_PGM("J05", "TFT Serial Debug: UserConfirm SD Filament Purging... J05"); // J05 printing pause + + // enable continue button + ANYCUBIC_SENDCOMMAND_DBG_PGM("J18", "TFT Serial Debug: UserConfirm Filament is purging... J18"); + } + else if (strcmp_P(msg, PSTR("HeaterTimeout")) == 0) { + mediaPrintingState = AMPRINTSTATE_PAUSED; + mediaPauseState = AMPAUSESTATE_HEATER_TIMEOUT; + // enable continue button + ANYCUBIC_SENDCOMMAND_DBG_PGM("J18", "TFT Serial Debug: UserConfirm SD Heater timeout... J18"); + } + else if (strcmp_P(msg, PSTR("Reheat finished.")) == 0) { + mediaPrintingState = AMPRINTSTATE_PAUSED; + mediaPauseState = AMPAUSESTATE_REHEAT_FINISHED; + // enable continue button + ANYCUBIC_SENDCOMMAND_DBG_PGM("J18", "TFT Serial Debug: UserConfirm SD Reheat done... J18"); + } + #endif +} + +float AnycubicTFTClass::CodeValue() { + return (strtod(&TFTcmdbuffer[TFTbufindr][TFTstrchr_pointer - TFTcmdbuffer[TFTbufindr] + 1], NULL)); +} + +bool AnycubicTFTClass::CodeSeen(char code) { + TFTstrchr_pointer = strchr(TFTcmdbuffer[TFTbufindr], code); + return (TFTstrchr_pointer != NULL); // Return True if a character was found +} + +bool AnycubicTFTClass::IsNozzleHomed() { + const float xPosition = ExtUI::getAxisPosition_mm((ExtUI::axis_t) ExtUI::X); + const float yPosition = ExtUI::getAxisPosition_mm((ExtUI::axis_t) ExtUI::Y); + return WITHIN(xPosition, X_MIN_POS - 0.1, X_MIN_POS + 0.1) && + WITHIN(yPosition, Y_MIN_POS - 0.1, Y_MIN_POS + 0.1); +} + +void AnycubicTFTClass::HandleSpecialMenu() { + /** + * NOTE: that the file selection command actual lowercases the entire selected file/foldername, so charracter comparisons need to be lowercase. + */ + if (SelectedDirectory[0] == '<') { + switch (SelectedDirectory[1]) { + case 'e': // "" + SpecialMenu = false; + return; + break; + + #if ENABLED(PROBE_MANUALLY) + case '0': + switch (SelectedDirectory[2]) { + case '1': // "<01ZUp0.1>" + SERIAL_ECHOLNPGM("Special Menu: Z Up 0.1"); + ExtUI::injectCommands_P(PSTR("G91\nG1 Z+0.1\nG90")); + break; + + case '2': // "<02ZUp0.02>" + SERIAL_ECHOLNPGM("Special Menu: Z Up 0.02"); + ExtUI::injectCommands_P(PSTR("G91\nG1 Z+0.02\nG90")); + break; + + case '3': // "<03ZDn0.02>" + SERIAL_ECHOLNPGM("Special Menu: Z Down 0.02"); + ExtUI::injectCommands_P(PSTR("G91\nG1 Z-0.02\nG90")); + break; + + case '4': // "<04ZDn0.1>" + SERIAL_ECHOLNPGM("Special Menu: Z Down 0.1"); + ExtUI::injectCommands_P(PSTR("G91\nG1 Z-0.1\nG90")); + break; + + case '5': // "<05PrehtBed>" + SERIAL_ECHOLNPGM("Special Menu: Preheat Bed"); + ExtUI::injectCommands_P(PSTR("M140 S65")); + break; + + case '6': // "<06SMeshLvl>" + SERIAL_ECHOLNPGM("Special Menu: Start Mesh Leveling"); + ExtUI::injectCommands_P(PSTR("G29 S1")); + break; + + case '7': // "<07MeshNPnt>" + SERIAL_ECHOLNPGM("Special Menu: Next Mesh Point"); + ExtUI::injectCommands_P(PSTR("G29 S2")); + break; + + case '8': // "<08HtEndPID>" + SERIAL_ECHOLNPGM("Special Menu: Auto Tune Hotend PID"); + // need to dwell for half a second to give the fan a chance to start before the pid tuning starts + ExtUI::injectCommands_P(PSTR("M106 S204\nG4 P500\nM303 E0 S215 C15 U1")); + break; + + case '9': // "<09HtBedPID>" + SERIAL_ECHOLNPGM("Special Menu: Auto Tune Hotbed Pid"); + ExtUI::injectCommands_P(PSTR("M303 E-1 S65 C6 U1")); + break; + + default: + break; + } + break; + + case '1': + switch (SelectedDirectory[2]) { + case '0': // "<10FWDeflts>" + SERIAL_ECHOLNPGM("Special Menu: Load FW Defaults"); + ExtUI::injectCommands_P(PSTR("M502\nM300 P105 S1661\nM300 P210 S1108")); + break; + + case '1': // "<11SvEEPROM>" + SERIAL_ECHOLNPGM("Special Menu: Save EEPROM"); + ExtUI::injectCommands_P(PSTR("M500\nM300 P105 S1108\nM300 P210 S1661")); + break; + + default: + break; + } + break; + #else // if ENABLED(PROBE_MANUALLY) + case '0': + switch (SelectedDirectory[2]) { + case '1': // "<01PrehtBed>" + SERIAL_ECHOLNPGM("Special Menu: Preheat Bed"); + ExtUI::injectCommands_P(PSTR("M140 S65")); + break; + + case '2': // "<02ABL>" + SERIAL_ECHOLNPGM("Special Menu: Auto Bed Leveling"); + ExtUI::injectCommands_P(PSTR("G28\nG29")); + break; + + case '3': // "<03HtendPID>" + SERIAL_ECHOLNPGM("Special Menu: Auto Tune Hotend PID"); + // need to dwell for half a second to give the fan a chance to start before the pid tuning starts + ExtUI::injectCommands_P(PSTR("M106 S204\nG4 P500\nM303 E0 S215 C15 U1")); + break; + + case '4': // "<04HtbedPID>" + SERIAL_ECHOLNPGM("Special Menu: Auto Tune Hotbed Pid"); + ExtUI::injectCommands_P(PSTR("M303 E-1 S65 C6 U1")); + break; + + case '5': // "<05FWDeflts>" + SERIAL_ECHOLNPGM("Special Menu: Load FW Defaults"); + ExtUI::injectCommands_P(PSTR("M502\nM300 P105 S1661\nM300 P210 S1108")); + break; + + case '6': // "<06SvEEPROM>" + SERIAL_ECHOLNPGM("Special Menu: Save EEPROM"); + ExtUI::injectCommands_P(PSTR("M500\nM300 P105 S1108\nM300 P210 S1661")); + break; + + case '7': // <07SendM108> + SERIAL_ECHOLNPGM("Special Menu: Send User Confirmation"); + ExtUI::injectCommands_P(PSTR("M108")); + break; + + default: + break; + } + break; + #endif // PROBE_MANUALLY + + default: + break; + } + #if ENABLED(ANYCUBIC_TFT_DEBUG) + } + else { + SERIAL_ECHOPGM("TFT Serial Debug: Attempted to HandleSpecialMenu on non-special menu... "); + SERIAL_ECHOLN(SelectedDirectory); + #endif + } +} + +void AnycubicTFTClass::RenderCurrentFileList() { + #if ENABLED(SDSUPPORT) + uint16_t selectedNumber = 0; + SelectedDirectory[0] = 0; + SelectedFile[0] = 0; + + ANYCUBIC_SERIAL_PROTOCOLPGM("FN "); // Filelist start + ANYCUBIC_SERIAL_ENTER(); + + if (!ExtUI::isMediaInserted() && !SpecialMenu) { + ANYCUBIC_SENDCOMMAND_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to render Current File List... J02"); + + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + } + else { + if (CodeSeen('S')) + selectedNumber = CodeValue(); + + if (SpecialMenu) + RenderSpecialMenu(selectedNumber); + else + RenderCurrentFolder(selectedNumber); + } + ANYCUBIC_SERIAL_PROTOCOLPGM("END"); // Filelist stop + ANYCUBIC_SERIAL_ENTER(); + #endif // SDSUPPORT +} + +void AnycubicTFTClass::RenderSpecialMenu(uint16_t selectedNumber) { + switch (selectedNumber) { + #if ENABLED(PROBE_MANUALLY) + case 0: // First Page + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<01ZUp0.1>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<02ZUp0.02>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<03ZDn0.02>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<04ZDn0.1>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + break; + + case 4: // Second Page + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<05PrehtBed>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<06SMeshLvl>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<07MeshNPnt>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<08HtEndPID>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + break; + + case 8: // Third Page + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<09HtBedPID>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<10FWDeflts>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<11SvEEPROM>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + break; + #else + case 0: // First Page + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<01PrehtBed>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<02ABL>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<03HtEndPID>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<04HtBedPID>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + break; + + case 4: // Second Page + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<05FWDeflts>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<06SvEEPROM>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM("<07SendM108>"); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + break; + + #endif // PROBE_MANUALLY + + default: + break; + } +} + +void AnycubicTFTClass::RenderCurrentFolder(uint16_t selectedNumber) { + ExtUI::FileList currentFileList; + uint16_t cnt = selectedNumber; + uint16_t max_files; + uint16_t dir_files = currentFileList.count(); + + if ((dir_files - selectedNumber) < 4) + max_files = dir_files; + else + max_files = selectedNumber + 3; + + for (cnt = selectedNumber; cnt <= max_files; cnt++) { + if (cnt == 0) { // Special Entry + if (currentFileList.isAtRootDir()) { + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + ANYCUBIC_SERIAL_PROTOCOLLNPGM(""); + } + else { + ANYCUBIC_SERIAL_PROTOCOLLNPGM("/.."); + ANYCUBIC_SERIAL_PROTOCOLLNPGM("/.."); + } + } + else { + currentFileList.seek(cnt - 1, false); + + #if ENABLED(ANYCUBIC_TFT_DEBUG) + SERIAL_ECHOLN(currentFileList.filename()); + #endif + if (currentFileList.isDir()) { + ANYCUBIC_SERIAL_PROTOCOLPGM("/"); + ANYCUBIC_SERIAL_PROTOCOLLN(currentFileList.shortFilename()); + ANYCUBIC_SERIAL_PROTOCOLPGM("/"); + ANYCUBIC_SERIAL_PROTOCOLLN(currentFileList.longFilename()); + + } + else { + ANYCUBIC_SERIAL_PROTOCOLLN(currentFileList.shortFilename()); + ANYCUBIC_SERIAL_PROTOCOLLN(currentFileList.longFilename()); + } + } + } +} + +void AnycubicTFTClass::OnPrintTimerStarted() { + #if ENABLED(SDSUPPORT) + if (mediaPrintingState == AMPRINTSTATE_PRINTING) + ANYCUBIC_SENDCOMMAND_DBG_PGM("J04", "TFT Serial Debug: Starting SD Print... J04"); // J04 Starting Print + + #endif +} + +void AnycubicTFTClass::OnPrintTimerPaused() { + #if ENABLED(SDSUPPORT) + if (ExtUI::isPrintingFromMedia()) { + mediaPrintingState = AMPRINTSTATE_PAUSED; + mediaPauseState = AMPAUSESTATE_PARKING; + } + #endif +} + +void AnycubicTFTClass::OnPrintTimerStopped() { + #if ENABLED(SDSUPPORT) + if (mediaPrintingState == AMPRINTSTATE_PRINTING) { + mediaPrintingState = AMPRINTSTATE_NOT_PRINTING; + mediaPauseState = AMPAUSESTATE_NOT_PAUSED; + ANYCUBIC_SENDCOMMAND_DBG_PGM("J14", "TFT Serial Debug: SD Print Completed... J14"); + } + // otherwise it was stopped by the printer so don't send print completed signal to TFT + #endif +} + +void AnycubicTFTClass::GetCommandFromTFT() { + char *starpos = NULL; + while (AnycubicSerial.available() > 0 && TFTbuflen < TFTBUFSIZE) { + serial3_char = AnycubicSerial.read(); + if (serial3_char == '\n' || + serial3_char == '\r' || + serial3_char == ':' || + serial3_count >= (TFT_MAX_CMD_SIZE - 1) + ) { + + if (!serial3_count) return; // if empty line + + TFTcmdbuffer[TFTbufindw][serial3_count] = 0; // terminate string + + if ((strchr(TFTcmdbuffer[TFTbufindw], 'A') != NULL)) { + int16_t a_command; + TFTstrchr_pointer = strchr(TFTcmdbuffer[TFTbufindw], 'A'); + a_command = ((int)((strtod(&TFTcmdbuffer[TFTbufindw][TFTstrchr_pointer - TFTcmdbuffer[TFTbufindw] + 1], NULL)))); + + #if ENABLED(ANYCUBIC_TFT_DEBUG) + if ((a_command > 7) && (a_command != 20)) { // No debugging of status polls, please! + SERIAL_ECHOPGM("TFT Serial Command: "); + SERIAL_ECHOLN(TFTcmdbuffer[TFTbufindw]); + } + #endif + + switch (a_command) { + case 0: { // A0 GET HOTEND TEMP + float hotendActualTemp = ExtUI::getActualTemp_celsius((ExtUI::extruder_t) (ExtUI::extruder_t) ExtUI::E0); + ANYCUBIC_SENDCOMMANDPGM_VAL("A0V ", int(hotendActualTemp + 0.5)); + } + break; + + case 1: { // A1 GET HOTEND TARGET TEMP + float hotendTargetTemp = ExtUI::getTargetTemp_celsius((ExtUI::extruder_t) (ExtUI::extruder_t) ExtUI::E0); + ANYCUBIC_SENDCOMMANDPGM_VAL("A1V ", int(hotendTargetTemp + 0.5)); + } + break; + + case 2: { // A2 GET HOTBED TEMP + float heatedBedActualTemp = ExtUI::getActualTemp_celsius((ExtUI::heater_t) ExtUI::BED); + ANYCUBIC_SENDCOMMANDPGM_VAL("A2V ", int(heatedBedActualTemp + 0.5)); + } + break; + + case 3: { // A3 GET HOTBED TARGET TEMP + float heatedBedTargetTemp = ExtUI::getTargetTemp_celsius((ExtUI::heater_t) ExtUI::BED); + ANYCUBIC_SENDCOMMANDPGM_VAL("A3V ", int(heatedBedTargetTemp + 0.5)); + } + break; + + case 4: // A4 GET FAN SPEED + { + float fanPercent = ExtUI::getActualFan_percent(ExtUI::FAN0); + fanPercent = constrain(fanPercent, 0, 100); + ANYCUBIC_SENDCOMMANDPGM_VAL("A4V ", int(fanPercent)); + } + break; + + case 5: // A5 GET CURRENT COORDINATE + { + float xPostition = ExtUI::getAxisPosition_mm(ExtUI::X); + float yPostition = ExtUI::getAxisPosition_mm(ExtUI::Y); + float zPostition = ExtUI::getAxisPosition_mm(ExtUI::Z); + ANYCUBIC_SERIAL_PROTOCOLPGM("A5V"); + ANYCUBIC_SERIAL_SPACE(); + ANYCUBIC_SERIAL_PROTOCOLPGM("X: "); + ANYCUBIC_SERIAL_PROTOCOL(xPostition); + ANYCUBIC_SERIAL_SPACE(); + ANYCUBIC_SERIAL_PROTOCOLPGM("Y: "); + ANYCUBIC_SERIAL_PROTOCOL(yPostition); + ANYCUBIC_SERIAL_SPACE(); + ANYCUBIC_SERIAL_PROTOCOLPGM("Z: "); + ANYCUBIC_SERIAL_PROTOCOL(zPostition); + ANYCUBIC_SERIAL_SPACE(); + ANYCUBIC_SERIAL_ENTER(); + } + break; + + case 6: // A6 GET SD CARD PRINTING STATUS + #if ENABLED(SDSUPPORT) + if (ExtUI::isPrintingFromMedia()) { + ANYCUBIC_SERIAL_PROTOCOLPGM("A6V "); + if (ExtUI::isMediaInserted()) { + ANYCUBIC_SERIAL_PROTOCOL(itostr3(int(ExtUI::getProgress_percent()))); + ANYCUBIC_SERIAL_ENTER(); + } + else { + ANYCUBIC_SENDCOMMAND_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to return printing status... J02"); + } + } + else { + ANYCUBIC_SERIAL_PROTOCOLPGM("A6V ---"); + ANYCUBIC_SERIAL_ENTER(); + } + #endif + break; + + case 7: { // A7 GET PRINTING TIME + uint32_t elapsedSeconds = ExtUI::getProgress_seconds_elapsed(); + ANYCUBIC_SERIAL_PROTOCOLPGM("A7V "); + if (elapsedSeconds != 0) { // print time + uint32_t elapsedMinutes = elapsedSeconds / 60; + ANYCUBIC_SERIAL_PROTOCOL(itostr2(elapsedMinutes / 60)); + ANYCUBIC_SERIAL_SPACE(); + ANYCUBIC_SERIAL_PROTOCOLPGM("H"); + ANYCUBIC_SERIAL_SPACE(); + ANYCUBIC_SERIAL_PROTOCOL(itostr2(elapsedMinutes % 60)); + ANYCUBIC_SERIAL_SPACE(); + ANYCUBIC_SERIAL_PROTOCOLPGM("M"); + } + else { + ANYCUBIC_SERIAL_SPACE(); + ANYCUBIC_SERIAL_PROTOCOLPGM("999:999"); + } + ANYCUBIC_SERIAL_ENTER(); + } + break; + + case 8: // A8 GET SD LIST + #if ENABLED(SDSUPPORT) + SelectedFile[0] = 0; + RenderCurrentFileList(); + #endif + break; + + case 9: // A9 pause sd print + #if ENABLED(SDSUPPORT) + if (ExtUI::isPrintingFromMedia()) + PausePrint(); + + #endif + break; + + case 10: // A10 resume sd print + #if ENABLED(SDSUPPORT) + if (ExtUI::isPrintingFromMediaPaused()) + ResumePrint(); + + #endif + break; + + case 11: // A11 STOP SD PRINT + #if ENABLED(SDSUPPORT) + StopPrint(); + #endif + break; + + case 12: // A12 kill + kill(PSTR(STR_ERR_KILLED)); + break; + + case 13: // A13 SELECTION FILE + #if ENABLED(SDSUPPORT) + if (ExtUI::isMediaInserted()) { + starpos = (strchr(TFTstrchr_pointer + 4, '*')); + if (TFTstrchr_pointer[4] == '/') { + strcpy(SelectedDirectory, TFTstrchr_pointer + 5); + SelectedFile[0] = 0; + ANYCUBIC_SENDCOMMAND_DBG_PGM("J21", "TFT Serial Debug: Clear file selection... J21 "); // J21 Not File Selected + ANYCUBIC_SERIAL_ENTER(); + } + else if (TFTstrchr_pointer[4] == '<') { + strcpy(SelectedDirectory, TFTstrchr_pointer + 4); + SpecialMenu = true; + SelectedFile[0] = 0; + ANYCUBIC_SENDCOMMAND_DBG_PGM("J21", "TFT Serial Debug: Clear file selection... J21 "); // J21 Not File Selected + ANYCUBIC_SERIAL_ENTER(); + } + else { + SelectedDirectory[0] = 0; + + if (starpos != NULL) + *(starpos - 1) = '\0'; + + strcpy(SelectedFile, TFTstrchr_pointer + 4); + ANYCUBIC_SENDCOMMAND_DBG_PGM_VAL("J20", "TFT Serial Debug: File Selected... J20 ", SelectedFile); // J20 File Selected + } + } + #endif + break; + + case 14: // A14 START PRINTING + #if ENABLED(SDSUPPORT) + if (!ExtUI::isPrinting() && strlen(SelectedFile) > 0) + StartPrint(); + + #endif + break; + + case 15: // A15 RESUMING FROM OUTAGE + // TODO: JBA implement resume form outage + break; + + case 16: { // A16 set hotend temp + unsigned int tempvalue; + if (CodeSeen('S')) { + tempvalue = constrain(CodeValue(), 0, 275); + ExtUI::setTargetTemp_celsius(tempvalue, (ExtUI::extruder_t) ExtUI::E0); + } + else if (CodeSeen('C') && !ExtUI::isPrinting()) { + if (ExtUI::getAxisPosition_mm(ExtUI::Z) < 10) + ExtUI::injectCommands_P(PSTR("G1 Z10")); // RASE Z AXIS + tempvalue = constrain(CodeValue(), 0, 275); + ExtUI::setTargetTemp_celsius(tempvalue, (ExtUI::extruder_t) ExtUI::E0); + } + } + break; + + case 17:// A17 set heated bed temp + { + unsigned int tempbed; + if (CodeSeen('S')) { + tempbed = constrain(CodeValue(), 0, 100); + ExtUI::setTargetTemp_celsius(tempbed, (ExtUI::heater_t)ExtUI::BED); + } + } + break; + + case 18:// A18 set fan speed + { + float fanPercent; + if (CodeSeen('S')) { + fanPercent = CodeValue(); + fanPercent = constrain(fanPercent, 0, 100); + ExtUI::setTargetFan_percent(fanPercent, ExtUI::FAN0); + } + else { + fanPercent = 100; + } + ExtUI::setTargetFan_percent(fanPercent, ExtUI::FAN0); + + ANYCUBIC_SERIAL_ENTER(); + } + break; + + case 19: // A19 stop stepper drivers - sent on stop extrude command and on turn motors off command + if (!ExtUI::isPrinting()) { + quickstop_stepper(); + disable_all_steppers(); + } + + ANYCUBIC_SERIAL_ENTER(); + break; + + case 20: { // A20 read printing speed + int16_t feedrate_percentage = 100; + + if (CodeSeen('S')) + feedrate_percentage = constrain(CodeValue(), 40, 999); + else + ANYCUBIC_SENDCOMMANDPGM_VAL("A20V ", feedrate_percentage); + } + break; + + case 21: // A21 all home + if (!ExtUI::isPrinting() && !ExtUI::isPrintingFromMediaPaused()) { + if (CodeSeen('X') || CodeSeen('Y') || CodeSeen('Z')) { + if (CodeSeen('X')) + ExtUI::injectCommands_P(PSTR("G28 X")); + if (CodeSeen('Y')) + ExtUI::injectCommands_P(PSTR("G28 Y")); + if (CodeSeen('Z')) + ExtUI::injectCommands_P(PSTR("G28 Z")); + } + else if (CodeSeen('C')) { + ExtUI::injectCommands_P(PSTR("G28")); + } + } + break; + + case 22: // A22 move X/Y/Z or extrude + if (!ExtUI::isPrinting()) { + float coorvalue; + unsigned int movespeed = 0; + char commandStr[30]; + char fullCommandStr[38]; + + commandStr[0] = 0; // empty string + if (CodeSeen('F')) // Set feedrate + movespeed = CodeValue(); + + if (CodeSeen('X')) { // Move in X direction + coorvalue = CodeValue(); + if ((coorvalue <= 0.2) && coorvalue > 0) + sprintf_P(commandStr, PSTR("G1 X0.1F%i"), movespeed); + else if ((coorvalue <= -0.1) && coorvalue > -1) + sprintf_P(commandStr, PSTR("G1 X-0.1F%i"), movespeed); + else + sprintf_P(commandStr, PSTR("G1 X%iF%i"), int(coorvalue), movespeed); + } + else if (CodeSeen('Y')) { // Move in Y direction + coorvalue = CodeValue(); + if ((coorvalue <= 0.2) && coorvalue > 0) + sprintf_P(commandStr, PSTR("G1 Y0.1F%i"), movespeed); + else if ((coorvalue <= -0.1) && coorvalue > -1) + sprintf_P(commandStr, PSTR("G1 Y-0.1F%i"), movespeed); + else + sprintf_P(commandStr, PSTR("G1 Y%iF%i"), int(coorvalue), movespeed); + } + else if (CodeSeen('Z')) { // Move in Z direction + coorvalue = CodeValue(); + if ((coorvalue <= 0.2) && coorvalue > 0) + sprintf_P(commandStr, PSTR("G1 Z0.1F%i"), movespeed); + else if ((coorvalue <= -0.1) && coorvalue > -1) + sprintf_P(commandStr, PSTR("G1 Z-0.1F%i"), movespeed); + else + sprintf_P(commandStr, PSTR("G1 Z%iF%i"), int(coorvalue), movespeed); + } + else if (CodeSeen('E')) { // Extrude + coorvalue = CodeValue(); + if ((coorvalue <= 0.2) && coorvalue > 0) + sprintf_P(commandStr, PSTR("G1 E0.1F%i"), movespeed); + else if ((coorvalue <= -0.1) && coorvalue > -1) + sprintf_P(commandStr, PSTR("G1 E-0.1F%i"), movespeed); + else + sprintf_P(commandStr, PSTR("G1 E%iF500"), int(coorvalue)); + } + + if (strlen(commandStr) > 0) { + sprintf_P(fullCommandStr, PSTR("G91\n%s\nG90"), commandStr); + #if ENABLED(ANYCUBIC_TFT_DEBUG) + SERIAL_ECHOPGM("TFT Serial Debug: A22 Move final request with gcode... "); + SERIAL_ECHOLN(fullCommandStr); + #endif + ExtUI::injectCommands(fullCommandStr); + } + } + ANYCUBIC_SERIAL_ENTER(); + break; + + case 23: // A23 preheat pla + if (!ExtUI::isPrinting()) { + if (ExtUI::getAxisPosition_mm(ExtUI::Z) < 10) + ExtUI::injectCommands_P(PSTR("G1 Z10")); // RASE Z AXIS + + ExtUI::setTargetTemp_celsius(PREHEAT_1_TEMP_BED, (ExtUI::heater_t) ExtUI::BED); + ExtUI::setTargetTemp_celsius(PREHEAT_1_TEMP_HOTEND, (ExtUI::extruder_t) ExtUI::E0); + ANYCUBIC_SERIAL_SUCC_START; + ANYCUBIC_SERIAL_ENTER(); + } + break; + + case 24:// A24 preheat abs + if (!ExtUI::isPrinting()) { + if (ExtUI::getAxisPosition_mm(ExtUI::Z) < 10) + ExtUI::injectCommands_P(PSTR("G1 Z10")); // RASE Z AXIS + + ExtUI::setTargetTemp_celsius(PREHEAT_2_TEMP_BED, (ExtUI::heater_t) ExtUI::BED); + ExtUI::setTargetTemp_celsius(PREHEAT_2_TEMP_HOTEND, (ExtUI::extruder_t) ExtUI::E0); + ANYCUBIC_SERIAL_SUCC_START; + ANYCUBIC_SERIAL_ENTER(); + } + break; + + case 25: // A25 cool down + if (!ExtUI::isPrinting()) { + ExtUI::setTargetTemp_celsius(0, (ExtUI::heater_t) ExtUI::BED); + ExtUI::setTargetTemp_celsius(0, (ExtUI::extruder_t) ExtUI::E0); + + ANYCUBIC_SENDCOMMAND_DBG_PGM("J12", "TFT Serial Debug: Cooling down... J12"); // J12 cool down + } + break; + + case 26: // A26 refresh SD + #if ENABLED(SDSUPPORT) + if (ExtUI::isMediaInserted()) { + if (strlen(SelectedDirectory) > 0) { + ExtUI::FileList currentFileList; + if ((SelectedDirectory[0] == '.') && (SelectedDirectory[1] == '.')) { + currentFileList.upDir(); + } + else { + if (SelectedDirectory[0] == '<') + HandleSpecialMenu(); + else + currentFileList.changeDir(SelectedDirectory); + } + } + } + else { + ANYCUBIC_SENDCOMMAND_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to refresh SD A26... J02"); + } + + SelectedDirectory[0] = 0; + #endif + break; + + #if ENABLED(SERVO_ENDSTOPS) + case 27: break; // A27 servos angles adjust + #endif + + case 28: // A28 filament test + if (CodeSeen('O')) + NOOP; + else if (CodeSeen('C')) + NOOP; + ANYCUBIC_SERIAL_ENTER(); + break; + + case 33: // A33 get version info + ANYCUBIC_SERIAL_PROTOCOLPGM("J33 "); + ANYCUBIC_SERIAL_PROTOCOLPGM(DETAILED_BUILD_VERSION); + ANYCUBIC_SERIAL_ENTER(); + break; + + default: + break; + } + } + + TFTbufindw = (TFTbufindw + 1) % TFTBUFSIZE; + TFTbuflen += 1; + serial3_count = 0; // clear buffer + } + else { + TFTcmdbuffer[TFTbufindw][serial3_count++] = serial3_char; + } + } +} + +void AnycubicTFTClass::DoSDCardStateCheck() { + #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) + bool isInserted = ExtUI::isMediaInserted(); + if (isInserted) + ANYCUBIC_SENDCOMMAND_DBG_PGM("J00", "TFT Serial Debug: SD card state changed... isInserted"); + else + ANYCUBIC_SENDCOMMAND_DBG_PGM("J01", "TFT Serial Debug: SD card state changed... !isInserted"); + + #endif +} + +void AnycubicTFTClass::DoFilamentRunoutCheck() { + #if ENABLED(FILAMENT_RUNOUT_SENSOR) + // NOTE: ExtUI::getFilamentRunoutState() only returns the runout state if the job is printing + // we want to actually check the status of the pin here, regardless of printstate + if (READ(FIL_RUNOUT_PIN)) { + if (mediaPrintingState == AMPRINTSTATE_PRINTING || mediaPrintingState == AMPRINTSTATE_PAUSED || mediaPrintingState == AMPRINTSTATE_PAUSE_REQUESTED) { + // play tone to indicate filament is out + ExtUI::injectCommands_P(PSTR("\nM300 P200 S1567\nM300 P200 S1174\nM300 P200 S1567\nM300 P200 S1174\nM300 P2000 S1567")); + + // tell the user that the filament has run out and wait + ANYCUBIC_SENDCOMMAND_DBG_PGM("J23", "TFT Serial Debug: Blocking filament prompt... J23"); + } + else { + ANYCUBIC_SENDCOMMAND_DBG_PGM("J15", "TFT Serial Debug: Non blocking filament runout... J15"); + } + } + #endif // FILAMENT_RUNOUT_SENSOR +} + +void AnycubicTFTClass::StartPrint() { + #if ENABLED(SDSUPPORT) + if (!ExtUI::isPrinting() && strlen(SelectedFile) > 0) { + #if ENABLED(ANYCUBIC_TFT_DEBUG) + SERIAL_ECHOPGM("TFT Serial Debug: About to print file ... "); + SERIAL_ECHO(ExtUI::isPrinting()); + SERIAL_ECHOPGM(" "); + SERIAL_ECHOLN(SelectedFile); + #endif + mediaPrintingState = AMPRINTSTATE_PRINTING; + mediaPauseState = AMPAUSESTATE_NOT_PAUSED; + ExtUI::printFile(SelectedFile); + } + #endif // SDUPPORT +} + +void AnycubicTFTClass::PausePrint() { + #if ENABLED(SDSUPPORT) + if (ExtUI::isPrintingFromMedia() && mediaPrintingState != AMPRINTSTATE_STOP_REQUESTED && mediaPauseState == AMPAUSESTATE_NOT_PAUSED) { + mediaPrintingState = AMPRINTSTATE_PAUSE_REQUESTED; + mediaPauseState = AMPAUSESTATE_NOT_PAUSED; // need the userconfirm method to update pause state + ANYCUBIC_SENDCOMMAND_DBG_PGM("J05", "TFT Serial Debug: SD print pause started... J05"); // J05 printing pause + + // for some reason pausing the print doesn't retract the extruder so force a manual one here + ExtUI::injectCommands_P(PSTR("G91\nG1 E-2 F1800\nG90")); + ExtUI::pausePrint(); + } + #endif +} + +void AnycubicTFTClass::ResumePrint() { + #if ENABLED(SDSUPPORT) + #if ENABLED(FILAMENT_RUNOUT_SENSOR) + if (READ(FIL_RUNOUT_PIN)) { + #if ENABLED(ANYCUBIC_TFT_DEBUG) + SERIAL_ECHOLNPGM("TFT Serial Debug: Resume Print with filament sensor still tripped... "); + #endif + + // trigger the user message box + DoFilamentRunoutCheck(); + + // re-enable the continue button + ANYCUBIC_SENDCOMMAND_DBG_PGM("J18", "TFT Serial Debug: Resume Print with filament sensor still tripped... J18"); + return; + } + #endif + + if (mediaPauseState == AMPAUSESTATE_HEATER_TIMEOUT) { + mediaPauseState = AMPAUSESTATE_REHEATING; + // TODO: JBA I don't think J05 just disables the continue button, i think it injects a rogue M25. So taking this out + // // disable the continue button + // ANYCUBIC_SENDCOMMAND_DBG_PGM("J05", "TFT Serial Debug: Resume called with heater timeout... J05"); // J05 printing pause + + // reheat the nozzle + ExtUI::setUserConfirmed(); + } + else { + mediaPrintingState = AMPRINTSTATE_PRINTING; + mediaPauseState = AMPAUSESTATE_NOT_PAUSED; + + ANYCUBIC_SENDCOMMAND_DBG_PGM("J04", "TFT Serial Debug: SD print resumed... J04"); // J04 printing form sd card now + ExtUI::resumePrint(); + } + #endif +} + +void AnycubicTFTClass::StopPrint() { + #if ENABLED(SDSUPPORT) + mediaPrintingState = AMPRINTSTATE_STOP_REQUESTED; + mediaPauseState = AMPAUSESTATE_NOT_PAUSED; + ANYCUBIC_SENDCOMMAND_DBG_PGM("J16", "TFT Serial Debug: SD print stop called... J16"); + + // for some reason stopping the print doesn't retract the extruder so force a manual one here + ExtUI::injectCommands_P(PSTR("G91\nG1 E-2 F1800\nG90")); + ExtUI::stopPrint(); + #endif +} + +#endif // ANYCUBIC_TFT_MODEL diff --git a/Marlin/src/lcd/extui/lib/anycubic/anycubic_tft.h b/Marlin/src/lcd/extui/lib/anycubic/anycubic_tft.h new file mode 100644 index 0000000000..324dfd213f --- /dev/null +++ b/Marlin/src/lcd/extui/lib/anycubic/anycubic_tft.h @@ -0,0 +1,114 @@ +/** + * anycubic_tft.h --- Support for Anycubic i3 Mega TFT + * Created by Christian Hopp on 09.12.17. + * Improved by David Ramiro + * Converted to ext_iu by John BouAntoun 21 June 2020 + * + * 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 + +#include "../../../../inc/MarlinConfigPre.h" +#include "../../../../sd/SdFatConfig.h" // for the FILENAME_LENGTH macro + +// command sending macro's with debugging capability +#define ANYCUBIC_SENDCOMMANDPGM(x) ANYCUBIC_SERIAL_PROTOCOLLNPGM(x) +#define ANYCUBIC_SENDCOMMANDPGM_VAL(x,y) (ANYCUBIC_SERIAL_PROTOCOLPGM(x), ANYCUBIC_SERIAL_PROTOCOLLN(itostr3(y))) +#define ANYCUBIC_SENDCOMMAND(x) ANYCUBIC_SERIAL_PROTOCOLLN(x) +#if ENABLED(ANYCUBIC_TFT_DEBUG) + #define ANYCUBIC_SENDCOMMAND_DBG_PGM(x,y) (ANYCUBIC_SERIAL_PROTOCOLLNPGM(x), SERIAL_ECHOLNPGM(y)) + #define ANYCUBIC_SENDCOMMAND_DBG_PGM_VAL(x,y,z) (ANYCUBIC_SERIAL_PROTOCOLLNPGM(x), SERIAL_ECHOPGM(y), SERIAL_ECHOLN(z)) +#else + #define ANYCUBIC_SENDCOMMAND_DBG_PGM(x,y) (ANYCUBIC_SERIAL_PROTOCOLLNPGM(x)) + #define ANYCUBIC_SENDCOMMAND_DBG_PGM_VAL(x,y,z) (ANYCUBIC_SERIAL_PROTOCOLLNPGM(x)) +#endif + +char *itostr2(const uint8_t &x); +#ifndef ULTRA_LCD + char *itostr3(const int); + char *ftostr32(const float &); +#endif + +#define TFTBUFSIZE 4 +#define TFT_MAX_CMD_SIZE 96 + +enum AnycubicMediaPrintState { + AMPRINTSTATE_NOT_PRINTING, + AMPRINTSTATE_PRINTING, + AMPRINTSTATE_PAUSE_REQUESTED, + AMPRINTSTATE_PAUSED, + AMPRINTSTATE_STOP_REQUESTED +}; + +enum AnycubicMediaPauseState { + AMPAUSESTATE_NOT_PAUSED, + AMPAUSESTATE_PARKING, + AMPAUSESTATE_PARKED, + AMPAUSESTATE_FILAMENT_OUT, + AMPAUSESTATE_FIAMENT_PRUGING, + AMPAUSESTATE_HEATER_TIMEOUT, + AMPAUSESTATE_REHEATING, + AMPAUSESTATE_REHEAT_FINISHED +}; + +class AnycubicTFTClass { +public: + AnycubicTFTClass(); + void OnSetup(); + void OnCommandScan(); + void OnKillTFT(); + void OnSDCardStateChange(bool); + void OnSDCardError(); + void OnFilamentRunout(); + void OnUserConfirmRequired(const char *); + void OnPrintTimerStarted(); + void OnPrintTimerPaused(); + void OnPrintTimerStopped(); + +private: + char TFTcmdbuffer[TFTBUFSIZE][TFT_MAX_CMD_SIZE]; + int TFTbuflen=0; + int TFTbufindr = 0; + int TFTbufindw = 0; + char serial3_char; + int serial3_count = 0; + char *TFTstrchr_pointer; + uint8_t SpecialMenu = false; + AnycubicMediaPrintState mediaPrintingState = AMPRINTSTATE_NOT_PRINTING; + AnycubicMediaPauseState mediaPauseState = AMPAUSESTATE_NOT_PAUSED; + + float CodeValue(); + bool CodeSeen(char); + bool IsNozzleHomed(); + void RenderCurrentFileList(); + void RenderSpecialMenu(uint16_t); + void RenderCurrentFolder(uint16_t); + void GetCommandFromTFT(); + void CheckSDCardChange(); + void CheckPauseState(); + void CheckPrintCompletion(); + void HandleSpecialMenu(); + void DoSDCardStateCheck(); + void DoFilamentRunoutCheck(); + void StartPrint(); + void PausePrint(); + void ResumePrint(); + void StopPrint(); + + char SelectedDirectory[30]; + char SelectedFile[FILENAME_LENGTH]; +}; + +extern AnycubicTFTClass AnycubicTFT; diff --git a/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp b/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp index 6ac84c2bb0..b788587c94 100644 --- a/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -59,1107 +59,8 @@ constexpr uint8_t DGUS_CMD_READVAR = 0x83; bool dguslcd_local_debug; // = false; #endif -#if ENABLED(DGUS_FILAMENT_LOADUNLOAD) - typedef struct { - ExtUI::extruder_t extruder; // which extruder to operate - uint8_t action; // load or unload - bool heated; // heating done ? - float purge_length; // the length to extrude before unload, prevent filament jam - } filament_data_t; - static filament_data_t filament_data; -#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; - #define dgusserial DGUS_SERIAL -// 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 progress to the display. -void DGUSScreenVariableHandler::DGUSLCD_SendPrintProgressToDisplay(DGUS_VP_Variable &var) { - //DEBUG_ECHOPAIR(" DGUSLCD_SendPrintProgressToDisplay ", var.VP); - uint16_t tmp = ExtUI::getProgress_percent(); - //DEBUG_ECHOLNPAIR(" data ", tmp); - 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(); - char buf[32]; - elapsed.toString(buf); - 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 HAS_PID_HEATING - void DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID(DGUS_VP_Variable &var) { - float value = *(float *)var.memadr; - float valuesend = 0; - switch (var.VP) { - default: return; - #if HOTENDS >= 1 - case VP_E0_PID_P: valuesend = value; break; - case VP_E0_PID_I: valuesend = unscalePID_i(value); break; - case VP_E0_PID_D: valuesend = unscalePID_d(value); break; - #endif - #if HOTENDS >= 2 - case VP_E1_PID_P: valuesend = value; break; - case VP_E1_PID_I: valuesend = unscalePID_i(value); break; - case VP_E1_PID_D: valuesend = unscalePID_d(value); break; - #endif - #if HAS_HEATED_BED - case VP_BED_PID_P: valuesend = value; break; - case VP_BED_PID_I: valuesend = unscalePID_i(value); break; - case VP_BED_PID_D: valuesend = unscalePID_d(value); break; - #endif - } - - valuesend *= cpow(10, 1); - union { int16_t i; char lb[2]; } endian; - - char tmp[2]; - endian.i = valuesend; - tmp[0] = endian.lb[1]; - tmp[1] = endian.lb[0]; - dgusdisplay.WriteVariable(var.VP, tmp, 2); - } -#endif - -#if ENABLED(PRINTCOUNTER) - - // Send the accumulate 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_SendPrintAccTimeToDisplay(DGUS_VP_Variable &var) { - printStatistics state = print_job_timer.getStats(); - char buf[21]; - duration_t elapsed = state.printTime; - elapsed.toString(buf); - dgusdisplay.WriteVariable(VP_PrintAccTime, buf, var.size, true); - } - - void DGUSScreenVariableHandler::DGUSLCD_SendPrintsTotalToDisplay(DGUS_VP_Variable &var) { - printStatistics state = print_job_timer.getStats(); - char buf[21]; - sprintf_P(buf, PSTR("%u"), state.totalPrints); - dgusdisplay.WriteVariable(VP_PrintsTotal, buf, var.size, true); - } - -#endif - -// Send fan status value to the display. -#if FAN_COUNT > 0 - void DGUSScreenVariableHandler::DGUSLCD_SendFanStatusToDisplay(DGUS_VP_Variable &var) { - if (var.memadr) { - DEBUG_ECHOPAIR(" DGUSLCD_SendFanStatusToDisplay ", var.VP); - DEBUG_ECHOLNPAIR(" data ", *(uint8_t *)var.memadr); - uint16_t data_to_send = 0; - if (*(uint8_t *) var.memadr) data_to_send = 1; - data_to_send = swap16(data_to_send); - dgusdisplay.WriteVariable(var.VP, data_to_send); - } - } -#endif - -// Send heater status value to the display. -void DGUSScreenVariableHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var) { - if (var.memadr) { - DEBUG_ECHOPAIR(" DGUSLCD_SendHeaterStatusToDisplay ", var.VP); - DEBUG_ECHOLNPAIR(" data ", *(int16_t *)var.memadr); - uint16_t data_to_send = 0; - if (*(int16_t *) var.memadr) data_to_send = 1; - data_to_send = swap16(data_to_send); - dgusdisplay.WriteVariable(var.VP, data_to_send); - } -} - -#if ENABLED(DGUS_UI_WAITING) - void DGUSScreenVariableHandler::DGUSLCD_SendWaitingStatusToDisplay(DGUS_VP_Variable &var) { - // In FYSETC UI design there are 10 statuses to loop - static uint16_t period = 0; - static uint16_t index = 0; - //DEBUG_ECHOPAIR(" DGUSLCD_SendWaitingStatusToDisplay ", var.VP); - //DEBUG_ECHOLNPAIR(" data ", swap16(index)); - if (period++ > DGUS_UI_WAITING_STATUS_PERIOD) { - dgusdisplay.WriteVariable(var.VP, swap16(index)); - //DEBUG_ECHOLNPAIR(" data ", swap16(index)); - if (++index >= DGUS_UI_WAITING_STATUS) index = 0; - period = 0; - } - } -#endif - -#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; - const int16_t scroll = (int16_t)swap16(*(uint16_t*)val_ptr); - if (scroll) { - 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); - } - else if (!filelist.isAtRootDir()) { - filelist.upDir(); - top_file = 0; - ForceCompleteUpdate(); - } - - 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; - } - - #if ENABLED(DGUS_PRINT_FILENAME) - // Send print filename - dgusdisplay.WriteVariable(VP_SD_Print_Filename, filelist.filename(), VP_SD_FileName_LEN, true); - #endif - - // 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.shortFilename()); - ScreenHandler.GotoScreen( - #if ENABLED(DGUS_LCD_UI_ORIGIN) - DGUSLCD_SCREEN_STATUS - #else - DGUSLCD_SCREEN_SDPRINTMANIPULATION - #endif - ); - } - - 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_PrintTune(DGUS_VP_Variable &var, void *val_ptr) { - if (!ExtUI::isPrintingFromMedia()) return; // avoid race condition when user stays in this menu and printer finishes. - GotoScreen(DGUSLCD_SCREEN_SDPRINTTUNE); - } - - 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_ptr(&(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 ", target); - #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("HandleManualExtrude"); - - 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; -} - -#if ENABLED(DGUS_UI_MOVE_DIS_OPTION) - void DGUSScreenVariableHandler::HandleManualMoveOption(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleManualMoveOption"); - *(uint16_t*)var.memadr = swap16(*(uint16_t*)val_ptr); - } -#endif - -void DGUSScreenVariableHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleManualMove"); - - int16_t movevalue = swap16(*(uint16_t*)val_ptr); - #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) - const uint16_t choice = *(uint16_t*)var.memadr; - movevalue = movevalue > 0 ? choice : -choice; - #endif - char axiscode; - unsigned int speed = 1500; //FIXME: get default feedrate for manual moves, dont hardcode. - - switch (var.VP) { - default: return; - - 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; - } - - if (!movevalue) { - // homing - DEBUG_ECHOPAIR(" homing ", axiscode); - char buf[6] = "G28 X"; - buf[4] = axiscode; - //DEBUG_ECHOPAIR(" ", buf); - queue.enqueue_one_now(buf); - //DEBUG_ECHOLNPGM(" ✓"); - ScreenHandler.ForceCompleteUpdate(); - return; - } - else { - //movement - DEBUG_ECHOPAIR(" move ", axiscode); - bool old_relative_mode = relative_mode; - if (!relative_mode) { - //DEBUG_ECHOPGM(" G91"); - queue.enqueue_now_P(PSTR("G91")); - //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); - queue.enqueue_one_now(buf); - //DEBUG_ECHOLNPGM(" ✓ "); - if (backup_speed != speed) { - snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed); - queue.enqueue_one_now(buf); - //DEBUG_ECHOPAIR(" ", buf); - } - //while (!enqueue_and_echo_command(buf)) idle(); - //DEBUG_ECHOLNPGM(" ✓ "); - if (!old_relative_mode) { - //DEBUG_ECHOPGM("G90"); - queue.enqueue_now_P(PSTR("G90")); - //DEBUG_ECHOPGM(" ✓ "); - } - } - - ScreenHandler.ForceCompleteUpdate(); - DEBUG_ECHOLNPGM("manmv done."); - return; - - cannotmove: - DEBUG_ECHOLNPAIR(" cannot move ", axiscode); - return; -} - -void DGUSScreenVariableHandler::HandleMotorLockUnlock(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleMotorLockUnlock"); - - char buf[4]; - const int16_t lock = swap16(*(uint16_t*)val_ptr); - strcpy_P(buf, lock ? PSTR("M18") : PSTR("M17")); - - //DEBUG_ECHOPAIR(" ", buf); - queue.enqueue_one_now(buf); -} - -#if ENABLED(POWER_LOSS_RECOVERY) - - void DGUSScreenVariableHandler::HandlePowerLossRecovery(DGUS_VP_Variable &var, void *val_ptr) { - uint16_t value = swap16(*(uint16_t*)val_ptr); - if (value) { - queue.inject_P(PSTR("M1000")); - ScreenHandler.GotoScreen(DGUSLCD_SCREEN_SDPRINTMANIPULATION); - } - else { - recovery.cancel(); - ScreenHandler.GotoScreen(DGUSLCD_SCREEN_STATUS); - } - } - -#endif - -void DGUSScreenVariableHandler::HandleSettings(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleSettings"); - uint16_t value = swap16(*(uint16_t*)val_ptr); - switch (value) { - default: break; - case 1: - #if ENABLED(PRINTCOUNTER) - print_job_timer.initStats(); - #endif - queue.enqueue_now_P(PSTR("M502\nM500")); - break; - case 2: queue.enqueue_now_P(PSTR("M501")); break; - case 3: queue.enqueue_now_P(PSTR("M500")); break; - } -} - -void DGUSScreenVariableHandler::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleStepPerMMChanged"); - - uint16_t value_raw = swap16(*(uint16_t*)val_ptr); - DEBUG_ECHOLNPAIR("value_raw:", value_raw); - float value = (float)value_raw/10; - ExtUI::axis_t axis; - switch (var.VP) { - case VP_X_STEP_PER_MM: axis = ExtUI::axis_t::X; break; - case VP_Y_STEP_PER_MM: axis = ExtUI::axis_t::Y; break; - case VP_Z_STEP_PER_MM: axis = ExtUI::axis_t::Z; break; - default: return; - } - DEBUG_ECHOLNPAIR_F("value:", value); - ExtUI::setAxisSteps_per_mm(value, axis); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisSteps_per_mm(axis)); - ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel - return; -} - -void DGUSScreenVariableHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleStepPerMMExtruderChanged"); - - uint16_t value_raw = swap16(*(uint16_t*)val_ptr); - DEBUG_ECHOLNPAIR("value_raw:", value_raw); - float value = (float)value_raw/10; - ExtUI::extruder_t extruder; - switch (var.VP) { - default: return; - #if HOTENDS >= 1 - case VP_E0_STEP_PER_MM: extruder = ExtUI::extruder_t::E0; break; - #endif - #if HOTENDS >= 2 - case VP_E1_STEP_PER_MM: extruder = ExtUI::extruder_t::E1; break; - #endif - } - DEBUG_ECHOLNPAIR_F("value:", value); - ExtUI::setAxisSteps_per_mm(value,extruder); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisSteps_per_mm(extruder)); - ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel - return; -} - -#if HAS_PID_HEATING - void DGUSScreenVariableHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) { - uint16_t rawvalue = swap16(*(uint16_t*)val_ptr); - DEBUG_ECHOLNPAIR("V1:", rawvalue); - float value = (float)rawvalue / 10; - DEBUG_ECHOLNPAIR("V2:", value); - float newvalue = 0; - - switch (var.VP) { - default: return; - #if HOTENDS >= 1 - case VP_E0_PID_P: newvalue = value; break; - case VP_E0_PID_I: newvalue = scalePID_i(value); break; - case VP_E0_PID_D: newvalue = scalePID_d(value); break; - #endif - #if HOTENDS >= 2 - case VP_E1_PID_P: newvalue = value; break; - case VP_E1_PID_I: newvalue = scalePID_i(value); break; - case VP_E1_PID_D: newvalue = scalePID_d(value); break; - #endif - #if HAS_HEATED_BED - case VP_BED_PID_P: newvalue = value; break; - case VP_BED_PID_I: newvalue = scalePID_i(value); break; - case VP_BED_PID_D: newvalue = scalePID_d(value); break; - #endif - } - - DEBUG_ECHOLNPAIR_F("V3:", newvalue); - *(float *)var.memadr = newvalue; - ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel - } - - void DGUSScreenVariableHandler::HandlePIDAutotune(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandlePIDAutotune"); - - char buf[32] = {0}; - - switch (var.VP) { - default: break; - #if ENABLED(PIDTEMP) - #if HOTENDS >= 1 - case VP_PID_AUTOTUNE_E0: // Autotune Extruder 0 - sprintf(buf, "M303 E%d C5 S210 U1", ExtUI::extruder_t::E0); - break; - #endif - #if HOTENDS >= 2 - case VP_PID_AUTOTUNE_E1: - sprintf(buf, "M303 E%d C5 S210 U1", ExtUI::extruder_t::E1); - break; - #endif - #endif - #if ENABLED(PIDTEMPBED) - case VP_PID_AUTOTUNE_BED: - sprintf(buf, "M303 E-1 C5 S70 U1"); - break; - #endif - } - - if (buf[0]) queue.enqueue_one_now(buf); - - #if ENABLED(DGUS_UI_WAITING) - sendinfoscreen(PSTR("PID is autotuning"), PSTR("please wait"), NUL_STR, NUL_STR, true, true, true, true); - GotoScreen(DGUSLCD_SCREEN_WAITING); - #endif - } -#endif - -void DGUSScreenVariableHandler::HandleProbeOffsetZChanged(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleProbeOffsetZChanged"); - - const float offset = float(int16_t(swap16(*(uint16_t*)val_ptr))) / 100.0f; - ExtUI::setZOffset_mm(offset); - ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel - return; -} - -#if ENABLED(BABYSTEPPING) - void DGUSScreenVariableHandler::HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleLiveAdjustZ"); - - int16_t flag = swap16(*(uint16_t*)val_ptr); - int16_t steps = flag ? -20 : 20; - ExtUI::smartAdjustAxis_steps(steps, ExtUI::axis_t::Z, true); - ScreenHandler.ForceCompleteUpdate(); - return; - } -#endif - -#if FAN_COUNT - void DGUSScreenVariableHandler::HandleFanControl(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleFanControl"); - *(uint8_t*)var.memadr = *(uint8_t*)var.memadr > 0 ? 0 : 255; - } -#endif - -void DGUSScreenVariableHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleHeaterControl"); - - uint8_t preheat_temp = 0; - switch (var.VP) { - #if HOTENDS >= 1 - case VP_E0_CONTROL: - #endif - #if HOTENDS >= 2 - case VP_E1_CONTROL: - #endif - #if HOTENDS >= 3 - case VP_E2_CONTROL: - #endif - preheat_temp = PREHEAT_1_TEMP_HOTEND; - break; - - case VP_BED_CONTROL: - preheat_temp = PREHEAT_1_TEMP_BED; - break; - } - - *(int16_t*)var.memadr = *(int16_t*)var.memadr > 0 ? 0 : preheat_temp; -} - -#if ENABLED(DGUS_PREHEAT_UI) - void DGUSScreenVariableHandler::HandlePreheat(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandlePreheat"); - - uint8_t e_temp = 0; - uint8_t bed_temp = 0; - const uint16_t preheat_option = swap16(*(uint16_t*)val_ptr); - switch (preheat_option) { - case 0: // Preheat PLA - #if defined(PREHEAT_1_TEMP_HOTEND) && defined(PREHEAT_1_TEMP_BED) - e_temp = PREHEAT_1_TEMP_HOTEND; - bed_temp = PREHEAT_1_TEMP_BED; - #endif - break; - case 1: // Preheat ABS - #if defined(PREHEAT_2_TEMP_HOTEND) && defined(PREHEAT_2_TEMP_BED) - e_temp = PREHEAT_2_TEMP_HOTEND; - bed_temp = PREHEAT_2_TEMP_BED; - #endif - break; - case 2: // Preheat PET - #if defined(PREHEAT_3_TEMP_HOTEND) && defined(PREHEAT_3_TEMP_BED) - e_temp = PREHEAT_3_TEMP_HOTEND; - bed_temp = PREHEAT_3_TEMP_BED; - #endif - break; - case 3: // Preheat FLEX - #if defined(PREHEAT_4_TEMP_HOTEND) && defined(PREHEAT_4_TEMP_BED) - e_temp = PREHEAT_4_TEMP_HOTEND; - bed_temp = PREHEAT_4_TEMP_BED; - #endif - break; - case 7: // Custom preheat - break; - case 9: // Cool down - e_temp = 0; - bed_temp = 0; - break; - default: - #if defined(PREHEAT_1_TEMP_HOTEND) && defined(PREHEAT_1_TEMP_BED) - e_temp = PREHEAT_1_TEMP_HOTEND; - bed_temp = PREHEAT_1_TEMP_BED; - #endif - break; - } - - switch (var.VP) { - default: return; - #if HOTENDS >= 1 - case VP_E0_BED_PREHEAT: - thermalManager.setTargetHotend(e_temp, 0); - #if HAS_HEATED_BED - thermalManager.setTargetBed(bed_temp); - #endif - break; - #endif - #if HOTENDS >= 2 - case VP_E1_BED_PREHEAT: - thermalManager.setTargetHotend(e_temp, 1); - #if HAS_HEATED_BED - thermalManager.setTargetBed(bed_temp); - #endif - break; - #endif - } - - // Go to the preheat screen to show the heating progress - GotoScreen(DGUSLCD_SCREEN_PREHEAT); - } -#endif - -#if ENABLED(DGUS_FILAMENT_LOADUNLOAD) - void DGUSScreenVariableHandler::HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleFilamentOption"); - - uint8_t e_temp = 0; - filament_data.heated = false; - uint16_t preheat_option = swap16(*(uint16_t*)val_ptr); - if (preheat_option <= 8) // Load filament type - filament_data.action = 1; - else if (preheat_option >= 10) { // Unload filament type - preheat_option -= 10; - filament_data.action = 2; - filament_data.purge_length = DGUS_FILAMENT_PURGE_LENGTH; - } - else // Cancel filament operation - filament_data.action = 0; - - switch (preheat_option) { - case 0: // Load PLA - #ifdef PREHEAT_1_TEMP_HOTEND - e_temp = PREHEAT_1_TEMP_HOTEND; - #endif - break; - case 1: // Load ABS - #if ENABLED(PREHEAT_2_TEMP_HOTEND) - e_temp = PREHEAT_2_TEMP_HOTEND; - #endif - break; - case 2: // Load PET - #ifdef PREHEAT_3_TEMP_HOTEND - e_temp = PREHEAT_3_TEMP_HOTEND; - #endif - break; - case 3: // Load FLEX - #ifdef PREHEAT_4_TEMP_HOTEND - e_temp = PREHEAT_4_TEMP_HOTEND; - #endif - break; - case 9: // Cool down - default: - e_temp = 0; - break; - } - - if (filament_data.action == 0) { // Go back to utility screen - #if HOTENDS >= 1 - thermalManager.setTargetHotend(e_temp, ExtUI::extruder_t::E0); - #endif - #if HOTENDS >= 2 - thermalManager.setTargetHotend(e_temp, ExtUI::extruder_t::E1); - #endif - GotoScreen(DGUSLCD_SCREEN_UTILITY); - } - else { // Go to the preheat screen to show the heating progress - switch (var.VP) { - default: return; - #if HOTENDS >= 1 - case VP_E0_FILAMENT_LOAD_UNLOAD: - filament_data.extruder = ExtUI::extruder_t::E0; - thermalManager.setTargetHotend(e_temp, filament_data.extruder); - break; - #endif - #if HOTENDS >= 2 - case VP_E1_FILAMENT_LOAD_UNLOAD: - filament_data.extruder = ExtUI::extruder_t::E1; - thermalManager.setTargetHotend(e_temp, filament_data.extruder); - break; - #endif - } - GotoScreen(DGUSLCD_SCREEN_FILAMENT_HEATING); - } - } - - void DGUSScreenVariableHandler::HandleFilamentLoadUnload(DGUS_VP_Variable &var) { - DEBUG_ECHOLNPGM("HandleFilamentLoadUnload"); - if (filament_data.action <= 0) return; - - // If we close to the target temperature, we can start load or unload the filament - if (thermalManager.hotEnoughToExtrude(filament_data.extruder) && \ - thermalManager.targetHotEnoughToExtrude(filament_data.extruder)) { - float movevalue = DGUS_FILAMENT_LOAD_LENGTH_PER_TIME; - - if (filament_data.action == 1) { // load filament - if (!filament_data.heated) { - GotoScreen(DGUSLCD_SCREEN_FILAMENT_LOADING); - filament_data.heated = true; - } - movevalue = ExtUI::getAxisPosition_mm(filament_data.extruder)+movevalue; - } - else { // unload filament - if (!filament_data.heated) { - GotoScreen(DGUSLCD_SCREEN_FILAMENT_UNLOADING); - filament_data.heated = true; - } - // Before unloading extrude to prevent jamming - if (filament_data.purge_length >= 0) { - movevalue = ExtUI::getAxisPosition_mm(filament_data.extruder) + movevalue; - filament_data.purge_length -= movevalue; - } - else - movevalue = ExtUI::getAxisPosition_mm(filament_data.extruder) - movevalue; - } - ExtUI::setAxisPosition_mm(movevalue, filament_data.extruder); - } - } -#endif - -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-robin 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 overrunning 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() { - // protect against recursion… ProcessRx() may indirectly call idle() when injecting gcode commands. - if (!no_reentrance) { - no_reentrance = true; - ProcessRx(); - no_reentrance = false; - } -} - void DGUSDisplay::InitDisplay() { dgusserial.begin(DGUS_BAUDRATE); @@ -1192,6 +93,35 @@ void DGUSDisplay::WriteVariable(uint16_t adr, const void* values, uint8_t values } } +void DGUSDisplay::WriteVariable(uint16_t adr, uint16_t value) { + value = (value & 0xffU) << 8U | (value >> 8U); + WriteVariable(adr, static_cast(&value), sizeof(uint16_t)); +} + +void DGUSDisplay::WriteVariable(uint16_t adr, int16_t value) { + value = (value & 0xffU) << 8U | (value >> 8U); + WriteVariable(adr, static_cast(&value), sizeof(uint16_t)); +} + +void DGUSDisplay::WriteVariable(uint16_t adr, uint8_t value) { + WriteVariable(adr, static_cast(&value), sizeof(uint8_t)); +} + +void DGUSDisplay::WriteVariable(uint16_t adr, int8_t value) { + WriteVariable(adr, static_cast(&value), sizeof(int8_t)); +} + +void DGUSDisplay::WriteVariable(uint16_t adr, long value) { + union { long l; char lb[4]; } endian; + char tmp[4]; + endian.l = value; + tmp[0] = endian.lb[3]; + tmp[1] = endian.lb[2]; + tmp[2] = endian.lb[1]; + tmp[3] = endian.lb[0]; + WriteVariable(adr, static_cast(&tmp), sizeof(long)); +} + void DGUSDisplay::WriteVariablePGM(uint16_t adr, const void* values, uint8_t valueslen, bool isstr) { const char* myvalues = static_cast(values); bool strend = !myvalues; @@ -1207,41 +137,6 @@ void DGUSDisplay::WriteVariablePGM(uint16_t adr, const void* values, uint8_t val } } -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 ENABLED(POWER_LOSS_RECOVERY) - if (!booted && recovery.valid()) booted = true; - #endif - 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 ENABLED(DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS) @@ -1312,7 +207,7 @@ void DGUSDisplay::ProcessRx() { | 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) + //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)) { @@ -1349,7 +244,30 @@ void DGUSDisplay::WritePGM(const char str[], uint8_t len) { while (len--) dgusserial.write(pgm_read_byte(str++)); } +void DGUSDisplay::loop() { + // protect against recursion… ProcessRx() may indirectly call idle() when injecting gcode commands. + if (!no_reentrance) { + no_reentrance = true; + ProcessRx(); + no_reentrance = false; + } +} + +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; + // A SW memory barrier, to ensure GCC does not overoptimize loops #define sw_barrier() asm volatile("": : :"memory"); +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; +} + #endif // HAS_DGUS_LCD diff --git a/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.h b/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.h index 00e626adc9..ee536ea219 100644 --- a/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -54,9 +54,22 @@ public: // 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)); + static void WriteVariable(uint16_t adr, int16_t value); + static void WriteVariable(uint16_t adr, uint16_t value); + static void WriteVariable(uint16_t adr, uint8_t value); + static void WriteVariable(uint16_t adr, int8_t value); + static void WriteVariable(uint16_t adr, long value); + + // Utility functions for bridging ui_api and dbus + template + static void SetVariable(DGUS_VP_Variable &var) { + WriteVariable(var.VP, (WireType)Getter(selector)); + } + + template + static void GetVariable(DGUS_VP_Variable &var, void *val_ptr) { + uint16_t newvalue = swap16(*(uint16_t*)val_ptr); + Setter(newvalue, selector); } // Until now I did not need to actively read from the display. That's why there is no ReadVariable @@ -83,233 +96,20 @@ private: static void WritePGM(const char str[], uint8_t len); static void ProcessRx(); + static inline uint16_t swap16(const uint16_t value) { return (value & 0xffU) << 8U | (value >> 8U); } static rx_datagram_state_t rx_datagram_state; static uint8_t rx_datagram_len; static bool Initialized, no_reentrance; }; +#define GET_VARIABLE(f, t, V...) (&DGUSDisplay::GetVariable) +#define SET_VARIABLE(f, t, V...) (&DGUSDisplay::SetVariable) + 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); - #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) - // Hook for manual move option - static void HandleManualMoveOption(DGUS_VP_Variable &var, void *val_ptr); - #endif - // 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); - // Hook for motor lock and unlook - static void HandleMotorLockUnlock(DGUS_VP_Variable &var, void *val_ptr); - #if ENABLED(POWER_LOSS_RECOVERY) - // Hook for power loss recovery. - static void HandlePowerLossRecovery(DGUS_VP_Variable &var, void *val_ptr); - #endif - // Hook for settings - static void HandleSettings(DGUS_VP_Variable &var, void *val_ptr); - static void HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr); - static void HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr); - #if HAS_PID_HEATING - // Hook for "Change this temperature PID para" - static void HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr); - // Hook for PID autotune - static void HandlePIDAutotune(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if HAS_BED_PROBE - // Hook for "Change probe offset z" - static void HandleProbeOffsetZChanged(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if ENABLED(BABYSTEPPING) - // Hook for live z adjust action - static void HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if FAN_COUNT > 0 - // Hook for fan control - static void HandleFanControl(DGUS_VP_Variable &var, void *val_ptr); - #endif - // Hook for heater control - static void HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr); - #if ENABLED(DGUS_PREHEAT_UI) - // Hook for preheat - static void HandlePreheat(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) - // Hook for filament load and unload filament option - static void HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr); - // Hook for filament load and unload - static void HandleFilamentLoadUnload(DGUS_VP_Variable &var); - #endif - - #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); - /// User hit the tune button - static void DGUSLCD_SD_PrintTune(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_SendTemperaturePID(DGUS_VP_Variable &var); - static void DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendPrintProgressToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var); - #if ENABLED(PRINTCOUNTER) - static void DGUSLCD_SendPrintAccTimeToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendPrintsTotalToDisplay(DGUS_VP_Variable &var); - #endif - #if FAN_COUNT > 0 - static void DGUSLCD_SendFanStatusToDisplay(DGUS_VP_Variable &var); - #endif - static void DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var); - #if ENABLED(DGUS_UI_WAITING) - static void DGUSLCD_SendWaitingStatusToDisplay(DGUS_VP_Variable &var); - #endif - - /// 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; - LOOP_L_N(i, sizeof(T)) 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); - } - } - - /// Send a float value to the display. - /// Display will get a 2-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_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { - if (var.memadr) { - float f = *(float *)var.memadr; - DEBUG_ECHOLNPAIR_F(" >> ", f, 6); - f *= cpow(10, decimals); - union { int16_t i; char lb[2]; } endian; - - char tmp[2]; - endian.i = f; - tmp[0] = endian.lb[1]; - tmp[1] = endian.lb[0]; - dgusdisplay.WriteVariable(var.VP, tmp, 2); - } - } - - /// 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); diff --git a/Marlin/src/lcd/extui/lib/dgus/DGUSDisplayDef.h b/Marlin/src/lcd/extui/lib/dgus/DGUSDisplayDef.h index 7af1ffefa7..b34a04875d 100644 --- a/Marlin/src/lcd/extui/lib/dgus/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/lib/dgus/DGUSDisplayDef.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,6 +25,8 @@ #include "DGUSVPVariable.h" +#include + // This file defines the interaction between Marlin and the display firmware. // information on which screen which VP is displayed @@ -41,6 +43,8 @@ extern const struct VPMapping VPMap[]; // List of VPs handled by Marlin / The Display. extern const struct DGUS_VP_Variable ListOfVP[]; +#include "../../../../inc/MarlinConfig.h" + #if ENABLED(DGUS_LCD_UI_ORIGIN) #include "origin/DGUSDisplayDef.h" #elif ENABLED(DGUS_LCD_UI_FYSETC) diff --git a/Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.cpp new file mode 100644 index 0000000000..7988985c2e --- /dev/null +++ b/Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.cpp @@ -0,0 +1,1140 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_DGUS_LCD + +#include "DGUSScreenHandler.h" +#include "DGUSDisplay.h" +#include "DGUSVPVariable.h" +#include "DGUSDisplayDef.h" + +#include "../../ui_api.h" +#include "../../../../MarlinCore.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" + +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../../../feature/powerloss.h" +#endif + +uint16_t DGUSScreenHandler::ConfirmVP; + +#if ENABLED(SDSUPPORT) + int16_t DGUSScreenHandler::top_file = 0; + int16_t DGUSScreenHandler::file_to_print = 0; + static ExtUI::FileList filelist; +#endif + +void (*DGUSScreenHandler::confirm_action_cb)() = nullptr; + +//DGUSScreenHandler ScreenHandler; + +DGUSLCD_Screens DGUSScreenHandler::current_screen; +DGUSLCD_Screens DGUSScreenHandler::past_screens[NUM_PAST_SCREENS]; +uint8_t DGUSScreenHandler::update_ptr; +uint16_t DGUSScreenHandler::skipVP; +bool DGUSScreenHandler::ScreenComplete; + +//DGUSDisplay dgusdisplay; + +// endianness swap +uint16_t swap16(const uint16_t value) { return (value & 0xffU) << 8U | (value >> 8U); } + +void DGUSScreenHandler::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 ? DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(ramcopy) : DGUSScreenHandler::DGUSLCD_SendStringToDisplay(ramcopy); + } + if (populate_VPVar(VP_MSGSTR2, &ramcopy)) { + ramcopy.memadr = (void*) line2; + l2inflash ? DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(ramcopy) : DGUSScreenHandler::DGUSLCD_SendStringToDisplay(ramcopy); + } + if (populate_VPVar(VP_MSGSTR3, &ramcopy)) { + ramcopy.memadr = (void*) line3; + l3inflash ? DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(ramcopy) : DGUSScreenHandler::DGUSLCD_SendStringToDisplay(ramcopy); + } + if (populate_VPVar(VP_MSGSTR4, &ramcopy)) { + ramcopy.memadr = (void*) line4; + l4inflash ? DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(ramcopy) : DGUSScreenHandler::DGUSLCD_SendStringToDisplay(ramcopy); + } +} + +void DGUSScreenHandler::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 DGUSScreenHandler::setstatusmessage(const char *msg) { + DGUS_VP_Variable ramcopy; + if (populate_VPVar(VP_M117, &ramcopy)) { + ramcopy.memadr = (void*) msg; + DGUSLCD_SendStringToDisplay(ramcopy); + } +} + +void DGUSScreenHandler::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 DGUSScreenHandler::DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var) { + if (var.memadr) { + //DEBUG_ECHOPAIR(" DGUS_LCD_SendWordValueToDisplay ", var.VP); + //DEBUG_ECHOLNPAIR(" data ", *(uint16_t *)var.memadr); + if (var.size > 1) + dgusdisplay.WriteVariable(var.VP, *(int16_t*)var.memadr); + else + dgusdisplay.WriteVariable(var.VP, *(int8_t*)var.memadr); + } +} + +// Send an uint8_t between 0 and 255 to the display, but scale to a percentage (0..100) +void DGUSScreenHandler::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); + dgusdisplay.WriteVariable(var.VP, tmp); + } +} + +// Send the current print progress to the display. +void DGUSScreenHandler::DGUSLCD_SendPrintProgressToDisplay(DGUS_VP_Variable &var) { + //DEBUG_ECHOPAIR(" DGUSLCD_SendPrintProgressToDisplay ", var.VP); + uint16_t tmp = ExtUI::getProgress_percent(); + //DEBUG_ECHOLNPAIR(" data ", tmp); + dgusdisplay.WriteVariable(var.VP, tmp); +} + +// 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 DGUSScreenHandler::DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var) { + duration_t elapsed = print_job_timer.duration(); + char buf[32]; + elapsed.toString(buf); + dgusdisplay.WriteVariable(VP_PrintTime, buf, var.size, true); +} + +// Send an uint8_t between 0 and 100 to a variable scale to 0..255 +void DGUSScreenHandler::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 DGUSScreenHandler::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 DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var) { + char *tmp = (char*) var.memadr; + dgusdisplay.WriteVariablePGM(var.VP, tmp, var.size, true); +} + +#if HAS_PID_HEATING + void DGUSScreenHandler::DGUSLCD_SendTemperaturePID(DGUS_VP_Variable &var) { + float value = *(float *)var.memadr; + float valuesend = 0; + switch (var.VP) { + default: return; + #if HOTENDS >= 1 + case VP_E0_PID_P: valuesend = value; break; + case VP_E0_PID_I: valuesend = unscalePID_i(value); break; + case VP_E0_PID_D: valuesend = unscalePID_d(value); break; + #endif + #if HOTENDS >= 2 + case VP_E1_PID_P: valuesend = value; break; + case VP_E1_PID_I: valuesend = unscalePID_i(value); break; + case VP_E1_PID_D: valuesend = unscalePID_d(value); break; + #endif + #if HAS_HEATED_BED + case VP_BED_PID_P: valuesend = value; break; + case VP_BED_PID_I: valuesend = unscalePID_i(value); break; + case VP_BED_PID_D: valuesend = unscalePID_d(value); break; + #endif + } + + valuesend *= cpow(10, 1); + union { int16_t i; char lb[2]; } endian; + + char tmp[2]; + endian.i = valuesend; + tmp[0] = endian.lb[1]; + tmp[1] = endian.lb[0]; + dgusdisplay.WriteVariable(var.VP, tmp, 2); + } +#endif + +#if ENABLED(PRINTCOUNTER) + + // Send the accumulate print time to the display. + // It is using a hex display for that: It expects BSD coded data in the format xxyyzz + void DGUSScreenHandler::DGUSLCD_SendPrintAccTimeToDisplay(DGUS_VP_Variable &var) { + printStatistics state = print_job_timer.getStats(); + char buf[21]; + duration_t elapsed = state.printTime; + elapsed.toString(buf); + dgusdisplay.WriteVariable(VP_PrintAccTime, buf, var.size, true); + } + + void DGUSScreenHandler::DGUSLCD_SendPrintsTotalToDisplay(DGUS_VP_Variable &var) { + printStatistics state = print_job_timer.getStats(); + char buf[21]; + sprintf_P(buf, PSTR("%u"), state.totalPrints); + dgusdisplay.WriteVariable(VP_PrintsTotal, buf, var.size, true); + } + +#endif + +// Send fan status value to the display. +#if HAS_FAN + void DGUSScreenHandler::DGUSLCD_SendFanStatusToDisplay(DGUS_VP_Variable &var) { + if (var.memadr) { + DEBUG_ECHOPAIR(" DGUSLCD_SendFanStatusToDisplay ", var.VP); + DEBUG_ECHOLNPAIR(" data ", *(uint8_t *)var.memadr); + uint16_t data_to_send = 0; + if (*(uint8_t *) var.memadr) data_to_send = 1; + dgusdisplay.WriteVariable(var.VP, data_to_send); + } + } +#endif + +// Send heater status value to the display. +void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var) { + if (var.memadr) { + DEBUG_ECHOPAIR(" DGUSLCD_SendHeaterStatusToDisplay ", var.VP); + DEBUG_ECHOLNPAIR(" data ", *(int16_t *)var.memadr); + uint16_t data_to_send = 0; + if (*(int16_t *) var.memadr) data_to_send = 1; + dgusdisplay.WriteVariable(var.VP, data_to_send); + } +} + +#if ENABLED(DGUS_UI_WAITING) + void DGUSScreenHandler::DGUSLCD_SendWaitingStatusToDisplay(DGUS_VP_Variable &var) { + // In FYSETC UI design there are 10 statuses to loop + static uint16_t period = 0; + static uint16_t index = 0; + //DEBUG_ECHOPAIR(" DGUSLCD_SendWaitingStatusToDisplay ", var.VP); + //DEBUG_ECHOLNPAIR(" data ", swap16(index)); + if (period++ > DGUS_UI_WAITING_STATUS_PERIOD) { + dgusdisplay.WriteVariable(var.VP, index); + //DEBUG_ECHOLNPAIR(" data ", swap16(index)); + if (++index >= DGUS_UI_WAITING_STATUS) index = 0; + period = 0; + } + } +#endif + +#if ENABLED(SDSUPPORT) + + void DGUSScreenHandler::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 DGUSScreenHandler::DGUSLCD_SD_ScrollFilelist(DGUS_VP_Variable& var, void *val_ptr) { + auto old_top = top_file; + const int16_t scroll = (int16_t)swap16(*(uint16_t*)val_ptr); + if (scroll) { + 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); + } + else if (!filelist.isAtRootDir()) { + filelist.upDir(); + top_file = 0; + ForceCompleteUpdate(); + } + + if (old_top != top_file) ForceCompleteUpdate(); + } + + void DGUSScreenHandler::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; + } + + #if ENABLED(DGUS_PRINT_FILENAME) + // Send print filename + dgusdisplay.WriteVariable(VP_SD_Print_Filename, filelist.filename(), VP_SD_FileName_LEN, true); + #endif + + // 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 DGUSScreenHandler::DGUSLCD_SD_StartPrint(DGUS_VP_Variable &var, void *val_ptr) { + if (!filelist.seek(file_to_print)) return; + ExtUI::printFile(filelist.shortFilename()); + ScreenHandler.GotoScreen( + #if ENABLED(DGUS_LCD_UI_ORIGIN) + DGUSLCD_SCREEN_STATUS + #else + DGUSLCD_SCREEN_SDPRINTMANIPULATION + #endif + ); + } + + void DGUSScreenHandler::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 DGUSScreenHandler::DGUSLCD_SD_ReallyAbort(DGUS_VP_Variable &var, void *val_ptr) { + ExtUI::stopPrint(); + GotoScreen(DGUSLCD_SCREEN_MAIN); + } + + void DGUSScreenHandler::DGUSLCD_SD_PrintTune(DGUS_VP_Variable &var, void *val_ptr) { + if (!ExtUI::isPrintingFromMedia()) return; // avoid race condition when user stays in this menu and printer finishes. + GotoScreen(DGUSLCD_SCREEN_SDPRINTTUNE); + } + + void DGUSScreenHandler::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 DGUSScreenHandler::SDCardInserted() { + top_file = 0; + filelist.refresh(); + auto cs = ScreenHandler.getCurrentScreen(); + if (cs == DGUSLCD_SCREEN_MAIN || cs == DGUSLCD_SCREEN_STATUS) + ScreenHandler.GotoScreen(DGUSLCD_SCREEN_SDFILELIST); + } + + void DGUSScreenHandler::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 DGUSScreenHandler::SDCardError() { + DGUSScreenHandler::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 DGUSScreenHandler::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_ptr(&(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 DGUSScreenHandler::ScreenChangeHookIfIdle(DGUS_VP_Variable &var, void *val_ptr) { + if (!ExtUI::isPrinting()) { + ScreenChangeHook(var, val_ptr); + dgusdisplay.RequestScreen(current_screen); + } +} + +void DGUSScreenHandler::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 ", target); + #endif +} + +void DGUSScreenHandler::HandleAllHeatersOff(DGUS_VP_Variable &var, void *val_ptr) { + thermalManager.disable_all_heaters(); + ScreenHandler.ForceCompleteUpdate(); // hint to send all data. +} + +void DGUSScreenHandler::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 DGUSScreenHandler::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.set_flow(target_extruder, newvalue); + 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 DGUSScreenHandler::HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleManualExtrude"); + + 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; +} + +#if ENABLED(DGUS_UI_MOVE_DIS_OPTION) + void DGUSScreenHandler::HandleManualMoveOption(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleManualMoveOption"); + *(uint16_t*)var.memadr = swap16(*(uint16_t*)val_ptr); + } +#endif + +void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleManualMove"); + + int16_t movevalue = swap16(*(uint16_t*)val_ptr); + #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) + if (movevalue) { + const uint16_t choice = *(uint16_t*)var.memadr; + movevalue = movevalue < 0 ? -choice : choice; + } + #endif + char axiscode; + unsigned int speed = 1500; //FIXME: get default feedrate for manual moves, dont hardcode. + + switch (var.VP) { + default: return; + + 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; + } + + if (!movevalue) { + // homing + DEBUG_ECHOPAIR(" homing ", axiscode); + char buf[6] = "G28 X"; + buf[4] = axiscode; + //DEBUG_ECHOPAIR(" ", buf); + queue.enqueue_one_now(buf); + //DEBUG_ECHOLNPGM(" ✓"); + ScreenHandler.ForceCompleteUpdate(); + return; + } + else { + //movement + DEBUG_ECHOPAIR(" move ", axiscode); + bool old_relative_mode = relative_mode; + if (!relative_mode) { + //DEBUG_ECHOPGM(" G91"); + queue.enqueue_now_P(PSTR("G91")); + //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); + queue.enqueue_one_now(buf); + //DEBUG_ECHOLNPGM(" ✓ "); + if (backup_speed != speed) { + snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed); + queue.enqueue_one_now(buf); + //DEBUG_ECHOPAIR(" ", buf); + } + //while (!enqueue_and_echo_command(buf)) idle(); + //DEBUG_ECHOLNPGM(" ✓ "); + if (!old_relative_mode) { + //DEBUG_ECHOPGM("G90"); + queue.enqueue_now_P(PSTR("G90")); + //DEBUG_ECHOPGM(" ✓ "); + } + } + + ScreenHandler.ForceCompleteUpdate(); + DEBUG_ECHOLNPGM("manmv done."); + return; + + cannotmove: + DEBUG_ECHOLNPAIR(" cannot move ", axiscode); + return; +} + +void DGUSScreenHandler::HandleMotorLockUnlock(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleMotorLockUnlock"); + + char buf[4]; + const int16_t lock = swap16(*(uint16_t*)val_ptr); + strcpy_P(buf, lock ? PSTR("M18") : PSTR("M17")); + + //DEBUG_ECHOPAIR(" ", buf); + queue.enqueue_one_now(buf); +} + +#if ENABLED(POWER_LOSS_RECOVERY) + + void DGUSScreenHandler::HandlePowerLossRecovery(DGUS_VP_Variable &var, void *val_ptr) { + uint16_t value = swap16(*(uint16_t*)val_ptr); + if (value) { + queue.inject_P(PSTR("M1000")); + ScreenHandler.GotoScreen(DGUSLCD_SCREEN_SDPRINTMANIPULATION); + } + else { + recovery.cancel(); + ScreenHandler.GotoScreen(DGUSLCD_SCREEN_STATUS); + } + } + +#endif + +void DGUSScreenHandler::HandleSettings(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleSettings"); + uint16_t value = swap16(*(uint16_t*)val_ptr); + switch (value) { + default: break; + case 1: + TERN_(PRINTCOUNTER, print_job_timer.initStats()); + queue.inject_P(PSTR("M502\nM500")); + break; + case 2: queue.inject_P(PSTR("M501")); break; + case 3: queue.inject_P(PSTR("M500")); break; + } +} + +void DGUSScreenHandler::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleStepPerMMChanged"); + + uint16_t value_raw = swap16(*(uint16_t*)val_ptr); + DEBUG_ECHOLNPAIR("value_raw:", value_raw); + float value = (float)value_raw/10; + ExtUI::axis_t axis; + switch (var.VP) { + case VP_X_STEP_PER_MM: axis = ExtUI::axis_t::X; break; + case VP_Y_STEP_PER_MM: axis = ExtUI::axis_t::Y; break; + case VP_Z_STEP_PER_MM: axis = ExtUI::axis_t::Z; break; + default: return; + } + DEBUG_ECHOLNPAIR_F("value:", value); + ExtUI::setAxisSteps_per_mm(value, axis); + DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisSteps_per_mm(axis)); + ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel + return; +} + +void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleStepPerMMExtruderChanged"); + + uint16_t value_raw = swap16(*(uint16_t*)val_ptr); + DEBUG_ECHOLNPAIR("value_raw:", value_raw); + float value = (float)value_raw/10; + ExtUI::extruder_t extruder; + switch (var.VP) { + default: return; + #if HOTENDS >= 1 + case VP_E0_STEP_PER_MM: extruder = ExtUI::extruder_t::E0; break; + #endif + #if HOTENDS >= 2 + case VP_E1_STEP_PER_MM: extruder = ExtUI::extruder_t::E1; break; + #endif + } + DEBUG_ECHOLNPAIR_F("value:", value); + ExtUI::setAxisSteps_per_mm(value,extruder); + DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisSteps_per_mm(extruder)); + ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel + return; +} + +#if HAS_PID_HEATING + void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) { + uint16_t rawvalue = swap16(*(uint16_t*)val_ptr); + DEBUG_ECHOLNPAIR("V1:", rawvalue); + float value = (float)rawvalue / 10; + DEBUG_ECHOLNPAIR("V2:", value); + float newvalue = 0; + + switch (var.VP) { + default: return; + #if HOTENDS >= 1 + case VP_E0_PID_P: newvalue = value; break; + case VP_E0_PID_I: newvalue = scalePID_i(value); break; + case VP_E0_PID_D: newvalue = scalePID_d(value); break; + #endif + #if HOTENDS >= 2 + case VP_E1_PID_P: newvalue = value; break; + case VP_E1_PID_I: newvalue = scalePID_i(value); break; + case VP_E1_PID_D: newvalue = scalePID_d(value); break; + #endif + #if HAS_HEATED_BED + case VP_BED_PID_P: newvalue = value; break; + case VP_BED_PID_I: newvalue = scalePID_i(value); break; + case VP_BED_PID_D: newvalue = scalePID_d(value); break; + #endif + } + + DEBUG_ECHOLNPAIR_F("V3:", newvalue); + *(float *)var.memadr = newvalue; + ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel + } + + void DGUSScreenHandler::HandlePIDAutotune(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandlePIDAutotune"); + + char buf[32] = {0}; + + switch (var.VP) { + default: break; + #if ENABLED(PIDTEMP) + #if HOTENDS >= 1 + case VP_PID_AUTOTUNE_E0: // Autotune Extruder 0 + sprintf(buf, "M303 E%d C5 S210 U1", ExtUI::extruder_t::E0); + break; + #endif + #if HOTENDS >= 2 + case VP_PID_AUTOTUNE_E1: + sprintf(buf, "M303 E%d C5 S210 U1", ExtUI::extruder_t::E1); + break; + #endif + #endif + #if ENABLED(PIDTEMPBED) + case VP_PID_AUTOTUNE_BED: + sprintf(buf, "M303 E-1 C5 S70 U1"); + break; + #endif + } + + if (buf[0]) queue.enqueue_one_now(buf); + + #if ENABLED(DGUS_UI_WAITING) + sendinfoscreen(PSTR("PID is autotuning"), PSTR("please wait"), NUL_STR, NUL_STR, true, true, true, true); + GotoScreen(DGUSLCD_SCREEN_WAITING); + #endif + } +#endif + +#if HAS_BED_PROBE + void DGUSScreenHandler::HandleProbeOffsetZChanged(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleProbeOffsetZChanged"); + + const float offset = float(int16_t(swap16(*(uint16_t*)val_ptr))) / 100.0f; + ExtUI::setZOffset_mm(offset); + ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel + return; + } +#endif + +#if ENABLED(BABYSTEPPING) + void DGUSScreenHandler::HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleLiveAdjustZ"); + + int16_t flag = swap16(*(uint16_t*)val_ptr); + int16_t steps = flag ? -20 : 20; + ExtUI::smartAdjustAxis_steps(steps, ExtUI::axis_t::Z, true); + ScreenHandler.ForceCompleteUpdate(); + return; + } +#endif + +#if HAS_FAN + void DGUSScreenHandler::HandleFanControl(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleFanControl"); + *(uint8_t*)var.memadr = *(uint8_t*)var.memadr > 0 ? 0 : 255; + } +#endif + +void DGUSScreenHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleHeaterControl"); + + uint8_t preheat_temp = 0; + switch (var.VP) { + #if HOTENDS >= 1 + case VP_E0_CONTROL: + #endif + #if HOTENDS >= 2 + case VP_E1_CONTROL: + #endif + #if HOTENDS >= 3 + case VP_E2_CONTROL: + #endif + preheat_temp = PREHEAT_1_TEMP_HOTEND; + break; + + case VP_BED_CONTROL: + preheat_temp = PREHEAT_1_TEMP_BED; + break; + } + + *(int16_t*)var.memadr = *(int16_t*)var.memadr > 0 ? 0 : preheat_temp; +} + +#if ENABLED(DGUS_PREHEAT_UI) + + void DGUSScreenHandler::HandlePreheat(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandlePreheat"); + + uint8_t e_temp = 0; + TERN_(HAS_HEATED_BED, uint8_t bed_temp = 0); + const uint16_t preheat_option = swap16(*(uint16_t*)val_ptr); + switch (preheat_option) { + default: + case 0: // Preheat PLA + #if defined(PREHEAT_1_TEMP_HOTEND) && defined(PREHEAT_1_TEMP_BED) + e_temp = PREHEAT_1_TEMP_HOTEND; + TERN_(HAS_HEATED_BED, bed_temp = PREHEAT_1_TEMP_BED); + #endif + break; + case 1: // Preheat ABS + #if defined(PREHEAT_2_TEMP_HOTEND) && defined(PREHEAT_2_TEMP_BED) + e_temp = PREHEAT_2_TEMP_HOTEND; + TERN_(HAS_HEATED_BED, bed_temp = PREHEAT_2_TEMP_BED); + #endif + break; + case 2: // Preheat PET + #if defined(PREHEAT_3_TEMP_HOTEND) && defined(PREHEAT_3_TEMP_BED) + e_temp = PREHEAT_3_TEMP_HOTEND; + TERN_(HAS_HEATED_BED, bed_temp = PREHEAT_3_TEMP_BED); + #endif + break; + case 3: // Preheat FLEX + #if defined(PREHEAT_4_TEMP_HOTEND) && defined(PREHEAT_4_TEMP_BED) + e_temp = PREHEAT_4_TEMP_HOTEND; + TERN_(HAS_HEATED_BED, bed_temp = PREHEAT_4_TEMP_BED); + #endif + break; + case 7: break; // Custom preheat + case 9: break; // Cool down + } + + switch (var.VP) { + default: return; + #if HOTENDS >= 1 + case VP_E0_BED_PREHEAT: + thermalManager.setTargetHotend(e_temp, 0); + TERN_(HAS_HEATED_BED, thermalManager.setTargetBed(bed_temp)); + break; + #endif + #if HOTENDS >= 2 + case VP_E1_BED_PREHEAT: + thermalManager.setTargetHotend(e_temp, 1); + TERN_(HAS_HEATED_BED, thermalManager.setTargetBed(bed_temp)); + break; + #endif + } + + // Go to the preheat screen to show the heating progress + GotoScreen(DGUSLCD_SCREEN_PREHEAT); + } + +#endif + +#if ENABLED(DGUS_FILAMENT_LOADUNLOAD) + + typedef struct { + ExtUI::extruder_t extruder; // which extruder to operate + uint8_t action; // load or unload + bool heated; // heating done ? + float purge_length; // the length to extrude before unload, prevent filament jam + } filament_data_t; + + static filament_data_t filament_data; + + void DGUSScreenHandler::HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleFilamentOption"); + + uint8_t e_temp = 0; + filament_data.heated = false; + uint16_t preheat_option = swap16(*(uint16_t*)val_ptr); + if (preheat_option <= 8) // Load filament type + filament_data.action = 1; + else if (preheat_option >= 10) { // Unload filament type + preheat_option -= 10; + filament_data.action = 2; + filament_data.purge_length = DGUS_FILAMENT_PURGE_LENGTH; + } + else // Cancel filament operation + filament_data.action = 0; + + switch (preheat_option) { + case 0: // Load PLA + #ifdef PREHEAT_1_TEMP_HOTEND + e_temp = PREHEAT_1_TEMP_HOTEND; + #endif + break; + case 1: // Load ABS + TERN_(PREHEAT_2_TEMP_HOTEND, e_temp = PREHEAT_2_TEMP_HOTEND); + break; + case 2: // Load PET + #ifdef PREHEAT_3_TEMP_HOTEND + e_temp = PREHEAT_3_TEMP_HOTEND; + #endif + break; + case 3: // Load FLEX + #ifdef PREHEAT_4_TEMP_HOTEND + e_temp = PREHEAT_4_TEMP_HOTEND; + #endif + break; + case 9: // Cool down + default: + e_temp = 0; + break; + } + + if (filament_data.action == 0) { // Go back to utility screen + #if HOTENDS >= 1 + thermalManager.setTargetHotend(e_temp, ExtUI::extruder_t::E0); + #endif + #if HOTENDS >= 2 + thermalManager.setTargetHotend(e_temp, ExtUI::extruder_t::E1); + #endif + GotoScreen(DGUSLCD_SCREEN_UTILITY); + } + else { // Go to the preheat screen to show the heating progress + switch (var.VP) { + default: return; + #if HOTENDS >= 1 + case VP_E0_FILAMENT_LOAD_UNLOAD: + filament_data.extruder = ExtUI::extruder_t::E0; + thermalManager.setTargetHotend(e_temp, filament_data.extruder); + break; + #endif + #if HOTENDS >= 2 + case VP_E1_FILAMENT_LOAD_UNLOAD: + filament_data.extruder = ExtUI::extruder_t::E1; + thermalManager.setTargetHotend(e_temp, filament_data.extruder); + break; + #endif + } + GotoScreen(DGUSLCD_SCREEN_FILAMENT_HEATING); + } + } + + void DGUSScreenHandler::HandleFilamentLoadUnload(DGUS_VP_Variable &var) { + DEBUG_ECHOLNPGM("HandleFilamentLoadUnload"); + if (filament_data.action <= 0) return; + + // If we close to the target temperature, we can start load or unload the filament + if (thermalManager.hotEnoughToExtrude(filament_data.extruder) && \ + thermalManager.targetHotEnoughToExtrude(filament_data.extruder)) { + float movevalue = DGUS_FILAMENT_LOAD_LENGTH_PER_TIME; + + if (filament_data.action == 1) { // load filament + if (!filament_data.heated) { + GotoScreen(DGUSLCD_SCREEN_FILAMENT_LOADING); + filament_data.heated = true; + } + movevalue = ExtUI::getAxisPosition_mm(filament_data.extruder)+movevalue; + } + else { // unload filament + if (!filament_data.heated) { + GotoScreen(DGUSLCD_SCREEN_FILAMENT_UNLOADING); + filament_data.heated = true; + } + // Before unloading extrude to prevent jamming + if (filament_data.purge_length >= 0) { + movevalue = ExtUI::getAxisPosition_mm(filament_data.extruder) + movevalue; + filament_data.purge_length -= movevalue; + } + else + movevalue = ExtUI::getAxisPosition_mm(filament_data.extruder) - movevalue; + } + ExtUI::setAxisPosition_mm(movevalue, filament_data.extruder); + } + } +#endif + +void DGUSScreenHandler::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 DGUSScreenHandler::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 DGUSScreenHandler::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-robin 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 overrunning 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 DGUSScreenHandler::GotoScreen(DGUSLCD_Screens screen, bool ispopup) { + dgusdisplay.RequestScreen(screen); + UpdateNewScreen(screen, ispopup); +} + +bool DGUSScreenHandler::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 && TERN0(POWER_LOSS_RECOVERY, recovery.valid())) + booted = true; + 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)); +} + +#endif // HAS_DGUS_LCD diff --git a/Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.h b/Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.h new file mode 100644 index 0000000000..df738dbfd1 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.h @@ -0,0 +1,232 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 "DGUSDisplay.h" +#include "DGUSVPVariable.h" + +#include "../../../../inc/MarlinConfig.h" + +enum DGUSLCD_Screens : uint8_t; + +class DGUSScreenHandler { +public: + DGUSScreenHandler() = 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); + #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) + // Hook for manual move option + static void HandleManualMoveOption(DGUS_VP_Variable &var, void *val_ptr); + #endif + // 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); + // Hook for motor lock and unlook + static void HandleMotorLockUnlock(DGUS_VP_Variable &var, void *val_ptr); + #if ENABLED(POWER_LOSS_RECOVERY) + // Hook for power loss recovery. + static void HandlePowerLossRecovery(DGUS_VP_Variable &var, void *val_ptr); + #endif + // Hook for settings + static void HandleSettings(DGUS_VP_Variable &var, void *val_ptr); + static void HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr); + static void HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr); + #if HAS_PID_HEATING + // Hook for "Change this temperature PID para" + static void HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr); + // Hook for PID autotune + static void HandlePIDAutotune(DGUS_VP_Variable &var, void *val_ptr); + #endif + #if HAS_BED_PROBE + // Hook for "Change probe offset z" + static void HandleProbeOffsetZChanged(DGUS_VP_Variable &var, void *val_ptr); + #endif + #if ENABLED(BABYSTEPPING) + // Hook for live z adjust action + static void HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr); + #endif + #if HAS_FAN + // Hook for fan control + static void HandleFanControl(DGUS_VP_Variable &var, void *val_ptr); + #endif + // Hook for heater control + static void HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr); + #if ENABLED(DGUS_PREHEAT_UI) + // Hook for preheat + static void HandlePreheat(DGUS_VP_Variable &var, void *val_ptr); + #endif + #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) + // Hook for filament load and unload filament option + static void HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr); + // Hook for filament load and unload + static void HandleFilamentLoadUnload(DGUS_VP_Variable &var); + #endif + + #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); + /// User hit the tune button + static void DGUSLCD_SD_PrintTune(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_SendTemperaturePID(DGUS_VP_Variable &var); + static void DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var); + static void DGUSLCD_SendPrintProgressToDisplay(DGUS_VP_Variable &var); + static void DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var); + #if ENABLED(PRINTCOUNTER) + static void DGUSLCD_SendPrintAccTimeToDisplay(DGUS_VP_Variable &var); + static void DGUSLCD_SendPrintsTotalToDisplay(DGUS_VP_Variable &var); + #endif + #if HAS_FAN + static void DGUSLCD_SendFanStatusToDisplay(DGUS_VP_Variable &var); + #endif + static void DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var); + #if ENABLED(DGUS_UI_WAITING) + static void DGUSLCD_SendWaitingStatusToDisplay(DGUS_VP_Variable &var); + #endif + + /// 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; + LOOP_L_N(i, sizeof(T)) 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); + dgusdisplay.WriteVariable(var.VP, (long)f); + } + } + + /// Send a float value to the display. + /// Display will get a 2-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_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { + if (var.memadr) { + float f = *(float *)var.memadr; + DEBUG_ECHOLNPAIR_F(" >> ", f, 6); + f *= cpow(10, decimals); + dgusdisplay.WriteVariable(var.VP, (int16_t)f); + } + } + + /// 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 DGUSScreenHandler ScreenHandler; diff --git a/Marlin/src/lcd/extui/lib/dgus/DGUSVPVariable.h b/Marlin/src/lcd/extui/lib/dgus/DGUSVPVariable.h index 30555bbb9f..8c193c7c1e 100644 --- a/Marlin/src/lcd/extui/lib/dgus/DGUSVPVariable.h +++ b/Marlin/src/lcd/extui/lib/dgus/DGUSVPVariable.h @@ -16,11 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once +#include + /** * DGUSVPVariable.h * diff --git a/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp index 49d89948ba..3beed892e3 100644 --- a/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -28,6 +28,7 @@ #include "../DGUSDisplayDef.h" #include "../DGUSDisplay.h" +#include "../DGUSScreenHandler.h" #include "../../../../../module/temperature.h" #include "../../../../../module/motion.h" @@ -37,7 +38,7 @@ #include "../../../../ultralcd.h" #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) - uint16_t distanceToMove = 0.1; + uint16_t distanceToMove = 10; #endif const uint16_t VPList_Boot[] PROGMEM = { @@ -56,7 +57,7 @@ const uint16_t VPList_Main[] PROGMEM = { #if HAS_HEATED_BED VP_T_Bed_Is, VP_T_Bed_Set, VP_BED_STATUS, #endif - #if FAN_COUNT > 0 + #if HAS_FAN VP_Fan0_Percentage, VP_FAN0_STATUS, #endif VP_XPos, VP_YPos, VP_ZPos, @@ -92,7 +93,7 @@ const uint16_t VPList_Status[] PROGMEM = { #if HAS_HEATED_BED VP_T_Bed_Is, VP_T_Bed_Set, #endif - #if FAN_COUNT > 0 + #if HAS_FAN VP_Fan0_Percentage, #endif VP_XPos, VP_YPos, VP_ZPos, @@ -192,7 +193,7 @@ const uint16_t VPList_SD_PrintManipulation[] PROGMEM = { #if HAS_HEATED_BED VP_T_Bed_Is, VP_T_Bed_Set, #endif - #if FAN_COUNT > 0 + #if HAS_FAN VP_Fan0_Percentage, #if FAN_COUNT > 1 VP_Fan1_Percentage, @@ -325,157 +326,159 @@ const char MarlinVersion[] PROGMEM = SHORT_BUILD_VERSION; 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_SCREENCHANGE, nullptr, ScreenHandler.ScreenChangeHook, nullptr), + VPHELPER(VP_SCREENCHANGE_ASK, nullptr, ScreenHandler.ScreenChangeHookIfIdle, nullptr), + #if ENABLED(SDSUPPORT) + VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, ScreenHandler.ScreenChangeHookIfSD, nullptr), + #endif + VPHELPER(VP_CONFIRMED, nullptr, ScreenHandler.ScreenConfirmedOK, nullptr), - VPHELPER(VP_TEMP_ALL_OFF, nullptr, &DGUSScreenVariableHandler::HandleAllHeatersOff, nullptr), + VPHELPER(VP_TEMP_ALL_OFF, nullptr, &ScreenHandler.HandleAllHeatersOff, nullptr), #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) - VPHELPER(VP_MOVE_OPTION, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMoveOption, nullptr), + VPHELPER(VP_MOVE_OPTION, &distanceToMove, &ScreenHandler.HandleManualMoveOption, nullptr), #endif #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) - VPHELPER(VP_MOVE_X, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMove, nullptr), - VPHELPER(VP_MOVE_Y, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMove, nullptr), - VPHELPER(VP_MOVE_Z, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMove, nullptr), - VPHELPER(VP_HOME_ALL, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMove, nullptr), + VPHELPER(VP_MOVE_X, &distanceToMove, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_MOVE_Y, &distanceToMove, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_MOVE_Z, &distanceToMove, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_HOME_ALL, &distanceToMove, &ScreenHandler.HandleManualMove, nullptr), #else - 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), + VPHELPER(VP_MOVE_X, nullptr, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_MOVE_Y, nullptr, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_MOVE_Z, nullptr, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_HOME_ALL, nullptr, &ScreenHandler.HandleManualMove, nullptr), #endif - VPHELPER(VP_MOTOR_LOCK_UNLOK, nullptr, &DGUSScreenVariableHandler::HandleMotorLockUnlock, nullptr), + VPHELPER(VP_MOTOR_LOCK_UNLOK, nullptr, &ScreenHandler.HandleMotorLockUnlock, nullptr), #if ENABLED(POWER_LOSS_RECOVERY) - VPHELPER(VP_POWER_LOSS_RECOVERY, nullptr, &DGUSScreenVariableHandler::HandlePowerLossRecovery, nullptr), + VPHELPER(VP_POWER_LOSS_RECOVERY, nullptr, &ScreenHandler.HandlePowerLossRecovery, nullptr), #endif - VPHELPER(VP_SETTINGS, nullptr, &DGUSScreenVariableHandler::HandleSettings, nullptr), + VPHELPER(VP_SETTINGS, nullptr, &ScreenHandler.HandleSettings, nullptr), #if ENABLED(SINGLE_Z_CALIBRATION) - VPHELPER(VP_Z_CALIBRATE, nullptr, &DGUSScreenVariableHandler::HandleZCalibration, nullptr), + VPHELPER(VP_Z_CALIBRATE, nullptr, &ScreenHandler.HandleZCalibration, nullptr), #endif #if ENABLED(FIRST_LAYER_CAL) - VPHELPER(VP_Z_FIRST_LAYER_CAL, nullptr, &DGUSScreenVariableHandler::HandleFirstLayerCal, nullptr), + VPHELPER(VP_Z_FIRST_LAYER_CAL, nullptr, &ScreenHandler.HandleFirstLayerCal, nullptr), #endif - { .VP = VP_MARLIN_VERSION, .memadr = (void*)MarlinVersion, .size = VP_MARLIN_VERSION_LEN, .set_by_display_handler = nullptr, .send_to_display_handler =&DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM }, + { .VP = VP_MARLIN_VERSION, .memadr = (void*)MarlinVersion, .size = VP_MARLIN_VERSION_LEN, .set_by_display_handler = nullptr, .send_to_display_handler =&ScreenHandler.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 }, + { .VP = VP_M117, .memadr = nullptr, .size = VP_M117_LEN, .set_by_display_handler = nullptr, .send_to_display_handler =&ScreenHandler.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, &planner.flow_percentage[ExtUI::extruder_t::E0], DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_EPos, &destination.e, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>), - VPHELPER(VP_MOVE_E0, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr), - VPHELPER(VP_E0_CONTROL, &thermalManager.temp_hotend[0].target, &DGUSScreenVariableHandler::HandleHeaterControl, nullptr), - VPHELPER(VP_E0_STATUS, &thermalManager.temp_hotend[0].target, nullptr, &DGUSScreenVariableHandler::DGUSLCD_SendHeaterStatusToDisplay), + VPHELPER(VP_T_E0_Is, &thermalManager.temp_hotend[0].celsius, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<0>), + VPHELPER(VP_T_E0_Set, &thermalManager.temp_hotend[0].target, ScreenHandler.HandleTemperatureChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Flowrate_E0, &planner.flow_percentage[ExtUI::extruder_t::E0], ScreenHandler.HandleFlowRateChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_EPos, &destination.e, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>), + VPHELPER(VP_MOVE_E0, nullptr, &ScreenHandler.HandleManualExtrude, nullptr), + VPHELPER(VP_E0_CONTROL, &thermalManager.temp_hotend[0].target, &ScreenHandler.HandleHeaterControl, nullptr), + VPHELPER(VP_E0_STATUS, &thermalManager.temp_hotend[0].target, nullptr, &ScreenHandler.DGUSLCD_SendHeaterStatusToDisplay), #if ENABLED(DGUS_PREHEAT_UI) - VPHELPER(VP_E0_BED_PREHEAT, nullptr, &DGUSScreenVariableHandler::HandlePreheat, nullptr), + VPHELPER(VP_E0_BED_PREHEAT, nullptr, &ScreenHandler.HandlePreheat, nullptr), #endif #if ENABLED(PIDTEMP) - VPHELPER(VP_E0_PID_P, &thermalManager.temp_hotend[0].pid.Kp, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), - VPHELPER(VP_E0_PID_I, &thermalManager.temp_hotend[0].pid.Ki, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), - VPHELPER(VP_E0_PID_D, &thermalManager.temp_hotend[0].pid.Kd, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), - VPHELPER(VP_PID_AUTOTUNE_E0, nullptr, &DGUSScreenVariableHandler::HandlePIDAutotune, nullptr), + VPHELPER(VP_E0_PID_P, &thermalManager.temp_hotend[0].pid.Kp, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), + VPHELPER(VP_E0_PID_I, &thermalManager.temp_hotend[0].pid.Ki, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), + VPHELPER(VP_E0_PID_D, &thermalManager.temp_hotend[0].pid.Kd, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), + VPHELPER(VP_PID_AUTOTUNE_E0, nullptr, &ScreenHandler.HandlePIDAutotune, nullptr), #endif #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) - VPHELPER(VP_E0_FILAMENT_LOAD_UNLOAD, nullptr, &DGUSScreenVariableHandler::HandleFilamentOption, &DGUSScreenVariableHandler::HandleFilamentLoadUnload), + VPHELPER(VP_E0_FILAMENT_LOAD_UNLOAD, nullptr, &ScreenHandler.HandleFilamentOption, &ScreenHandler.HandleFilamentLoadUnload), #endif #endif #if HOTENDS >= 2 - VPHELPER(VP_T_E1_Is, &thermalManager.temp_hotend[1].celsius, nullptr, DGUSLCD_SendFloatAsLongValueToDisplay<0>), - VPHELPER(VP_T_E1_Set, &thermalManager.temp_hotend[1].target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Flowrate_E1, &planner.flow_percentage[ExtUI::extruder_t::E1], DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_MOVE_E1, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr), - VPHELPER(VP_E1_CONTROL, &thermalManager.temp_hotend[1].target, &DGUSScreenVariableHandler::HandleHeaterControl, nullptr), - VPHELPER(VP_E1_STATUS, &thermalManager.temp_hotend[1].target, nullptr, &DGUSScreenVariableHandler::DGUSLCD_SendHeaterStatusToDisplay), + VPHELPER(VP_T_E1_Is, &thermalManager.temp_hotend[1].celsius, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<0>), + VPHELPER(VP_T_E1_Set, &thermalManager.temp_hotend[1].target, ScreenHandler.HandleTemperatureChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Flowrate_E1, &planner.flow_percentage[ExtUI::extruder_t::E1], ScreenHandler.HandleFlowRateChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_MOVE_E1, nullptr, &ScreenHandler.HandleManualExtrude, nullptr), + VPHELPER(VP_E1_CONTROL, &thermalManager.temp_hotend[1].target, &ScreenHandler.HandleHeaterControl, nullptr), + VPHELPER(VP_E1_STATUS, &thermalManager.temp_hotend[1].target, nullptr, &ScreenHandler.DGUSLCD_SendHeaterStatusToDisplay), #if ENABLED(PIDTEMP) - VPHELPER(VP_PID_AUTOTUNE_E1, nullptr, &DGUSScreenVariableHandler::HandlePIDAutotune, nullptr), + VPHELPER(VP_PID_AUTOTUNE_E1, nullptr, &ScreenHandler.HandlePIDAutotune, nullptr), #endif - VPHELPER(VP_E1_FILAMENT_LOAD_UNLOAD, nullptr, &DGUSScreenVariableHandler::HandleFilamentOption, &DGUSScreenVariableHandler::HandleFilamentLoadUnload), + VPHELPER(VP_E1_FILAMENT_LOAD_UNLOAD, nullptr, &ScreenHandler.HandleFilamentOption, &ScreenHandler.HandleFilamentLoadUnload), #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), - VPHELPER(VP_BED_CONTROL, &thermalManager.temp_bed.target, &DGUSScreenVariableHandler::HandleHeaterControl, nullptr), - VPHELPER(VP_BED_STATUS, &thermalManager.temp_bed.target, nullptr, &DGUSScreenVariableHandler::DGUSLCD_SendHeaterStatusToDisplay), + VPHELPER(VP_T_Bed_Is, &thermalManager.temp_bed.celsius, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<0>), + VPHELPER(VP_T_Bed_Set, &thermalManager.temp_bed.target, ScreenHandler.HandleTemperatureChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_BED_CONTROL, &thermalManager.temp_bed.target, &ScreenHandler.HandleHeaterControl, nullptr), + VPHELPER(VP_BED_STATUS, &thermalManager.temp_bed.target, nullptr, &ScreenHandler.DGUSLCD_SendHeaterStatusToDisplay), #if ENABLED(PIDTEMPBED) - VPHELPER(VP_BED_PID_P, &thermalManager.temp_bed.pid.Kp, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), - VPHELPER(VP_BED_PID_I, &thermalManager.temp_bed.pid.Ki, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), - VPHELPER(VP_BED_PID_D, &thermalManager.temp_bed.pid.Kd, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), - VPHELPER(VP_PID_AUTOTUNE_BED, nullptr, &DGUSScreenVariableHandler::HandlePIDAutotune, nullptr), + VPHELPER(VP_BED_PID_P, &thermalManager.temp_bed.pid.Kp, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), + VPHELPER(VP_BED_PID_I, &thermalManager.temp_bed.pid.Ki, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), + VPHELPER(VP_BED_PID_D, &thermalManager.temp_bed.pid.Kd, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), + VPHELPER(VP_PID_AUTOTUNE_BED, nullptr, &ScreenHandler.HandlePIDAutotune, nullptr), #endif #endif // Fan Data - #if FAN_COUNT + #if HAS_FAN #define FAN_VPHELPER(N) \ - VPHELPER(VP_Fan##N##_Percentage, &thermalManager.fan_speed[N], DGUSScreenVariableHandler::DGUSLCD_PercentageToUint8, &DGUSScreenVariableHandler::DGUSLCD_SendPercentageToDisplay), \ - VPHELPER(VP_FAN##N##_CONTROL, &thermalManager.fan_speed[N], &DGUSScreenVariableHandler::HandleFanControl, nullptr), \ - VPHELPER(VP_FAN##N##_STATUS, &thermalManager.fan_speed[N], nullptr, &DGUSScreenVariableHandler::DGUSLCD_SendFanStatusToDisplay), + VPHELPER(VP_Fan##N##_Percentage, &thermalManager.fan_speed[N], ScreenHandler.DGUSLCD_PercentageToUint8, &ScreenHandler.DGUSLCD_SendPercentageToDisplay), \ + VPHELPER(VP_FAN##N##_CONTROL, &thermalManager.fan_speed[N], &ScreenHandler.HandleFanControl, nullptr), \ + VPHELPER(VP_FAN##N##_STATUS, &thermalManager.fan_speed[N], nullptr, &ScreenHandler.DGUSLCD_SendFanStatusToDisplay), REPEAT(FAN_COUNT, FAN_VPHELPER) #endif // Feedrate - VPHELPER(VP_Feedrate_Percentage, &feedrate_percentage, DGUSScreenVariableHandler::DGUSLCD_SetValueDirectly, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay ), + VPHELPER(VP_Feedrate_Percentage, &feedrate_percentage, ScreenHandler.DGUSLCD_SetValueDirectly, &ScreenHandler.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>), + VPHELPER(VP_XPos, ¤t_position.x, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>), + VPHELPER(VP_YPos, ¤t_position.y, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>), + VPHELPER(VP_ZPos, ¤t_position.z, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>), // Print Progress - VPHELPER(VP_PrintProgress_Percentage, nullptr, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintProgressToDisplay ), + VPHELPER(VP_PrintProgress_Percentage, nullptr, nullptr, ScreenHandler.DGUSLCD_SendPrintProgressToDisplay ), // Print Time - VPHELPER_STR(VP_PrintTime, nullptr, VP_PrintTime_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintTimeToDisplay), + VPHELPER_STR(VP_PrintTime, nullptr, VP_PrintTime_LEN, nullptr, ScreenHandler.DGUSLCD_SendPrintTimeToDisplay), #if ENABLED(PRINTCOUNTER) - VPHELPER_STR(VP_PrintAccTime, nullptr, VP_PrintAccTime_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintAccTimeToDisplay), - VPHELPER_STR(VP_PrintsTotal, nullptr, VP_PrintsTotal_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintsTotalToDisplay), + VPHELPER_STR(VP_PrintAccTime, nullptr, VP_PrintAccTime_LEN, nullptr, ScreenHandler.DGUSLCD_SendPrintAccTimeToDisplay), + VPHELPER_STR(VP_PrintsTotal, nullptr, VP_PrintsTotal_LEN, nullptr, ScreenHandler.DGUSLCD_SendPrintsTotalToDisplay), #endif - VPHELPER(VP_X_STEP_PER_MM, &planner.settings.axis_steps_per_mm[X_AXIS], DGUSScreenVariableHandler::HandleStepPerMMChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>), - VPHELPER(VP_Y_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Y_AXIS], DGUSScreenVariableHandler::HandleStepPerMMChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>), - VPHELPER(VP_Z_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Z_AXIS], DGUSScreenVariableHandler::HandleStepPerMMChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>), + VPHELPER(VP_X_STEP_PER_MM, &planner.settings.axis_steps_per_mm[X_AXIS], ScreenHandler.HandleStepPerMMChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>), + VPHELPER(VP_Y_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Y_AXIS], ScreenHandler.HandleStepPerMMChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>), + VPHELPER(VP_Z_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Z_AXIS], ScreenHandler.HandleStepPerMMChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>), #if HOTENDS >= 1 - VPHELPER(VP_E0_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(0)], DGUSScreenVariableHandler::HandleStepPerMMExtruderChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>), + VPHELPER(VP_E0_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(0)], ScreenHandler.HandleStepPerMMExtruderChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>), #endif #if HOTENDS >= 2 - VPHELPER(VP_E1_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(1)], DGUSScreenVariableHandler::HandleStepPerMMExtruderChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>), + VPHELPER(VP_E1_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(1)], ScreenHandler.HandleStepPerMMExtruderChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>), #endif // 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), - VPHELPER(VP_SD_Print_Setting, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_PrintTune, nullptr), + VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr), + VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr), + VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr), + VPHELPER_STR(VP_SD_FileName0, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename), + VPHELPER_STR(VP_SD_FileName1, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename), + VPHELPER_STR(VP_SD_FileName2, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename), + VPHELPER_STR(VP_SD_FileName3, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename), + VPHELPER_STR(VP_SD_FileName4, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename), + VPHELPER(VP_SD_ResumePauseAbort, nullptr, ScreenHandler.DGUSLCD_SD_ResumePauseAbort, nullptr), + VPHELPER(VP_SD_AbortPrintConfirmed, nullptr, ScreenHandler.DGUSLCD_SD_ReallyAbort, nullptr), + VPHELPER(VP_SD_Print_Setting, nullptr, ScreenHandler.DGUSLCD_SD_PrintTune, nullptr), #if HAS_BED_PROBE - VPHELPER(VP_SD_Print_ProbeOffsetZ, &probe.offset.z, DGUSScreenVariableHandler::HandleProbeOffsetZChanged, &DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<2>), + VPHELPER(VP_SD_Print_ProbeOffsetZ, &probe.offset.z, ScreenHandler.HandleProbeOffsetZChanged, &ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<2>), #if ENABLED(BABYSTEPPING) - VPHELPER(VP_SD_Print_LiveAdjustZ, nullptr, DGUSScreenVariableHandler::HandleLiveAdjustZ, nullptr), + VPHELPER(VP_SD_Print_LiveAdjustZ, nullptr, ScreenHandler.HandleLiveAdjustZ, nullptr), #endif #endif #endif #if ENABLED(DGUS_UI_WAITING) - VPHELPER(VP_WAITING_STATUS, nullptr, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendWaitingStatusToDisplay), + VPHELPER(VP_WAITING_STATUS, nullptr, nullptr, ScreenHandler.DGUSLCD_SendWaitingStatusToDisplay), #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 }, + { .VP = VP_MSGSTR1, .memadr = nullptr, .size = VP_MSGSTR1_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM }, + { .VP = VP_MSGSTR2, .memadr = nullptr, .size = VP_MSGSTR2_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM }, + { .VP = VP_MSGSTR3, .memadr = nullptr, .size = VP_MSGSTR3_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM }, + { .VP = VP_MSGSTR4, .memadr = nullptr, .size = VP_MSGSTR4_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM }, VPHELPER(0, 0, 0, 0) // must be last entry. }; diff --git a/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.h b/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.h index 309a23b9b5..f6a65fe8a0 100644 --- a/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -151,7 +151,7 @@ constexpr uint16_t VP_SETTINGS = 0x2400; // PID autotune constexpr uint16_t VP_PID_AUTOTUNE_E0 = 0x2410; -//constexpr uint16_t VP_PID_AUTOTUNE_E1 = 0x2412; +constexpr uint16_t VP_PID_AUTOTUNE_E1 = 0x2412; //constexpr uint16_t VP_PID_AUTOTUNE_E2 = 0x2414; //constexpr uint16_t VP_PID_AUTOTUNE_E3 = 0x2416; //constexpr uint16_t VP_PID_AUTOTUNE_E4 = 0x2418; @@ -246,7 +246,7 @@ constexpr uint16_t VP_FAN3_STATUS = 0x3306; // Heater status constexpr uint16_t VP_E0_STATUS = 0x3310; -//constexpr uint16_t VP_E1_STATUS = 0x3312; +constexpr uint16_t VP_E1_STATUS = 0x3312; //constexpr uint16_t VP_E2_STATUS = 0x3314; //constexpr uint16_t VP_E3_STATUS = 0x3316; //constexpr uint16_t VP_E4_STATUS = 0x3318; @@ -273,6 +273,9 @@ constexpr uint16_t VP_E1_STEP_PER_MM = 0x3612; constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , 2 byte unsigned int , 0~1638.4 constexpr uint16_t VP_E0_PID_I = 0x3702; constexpr uint16_t VP_E0_PID_D = 0x3704; +constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , 2 byte unsigned int , 0~1638.4 +constexpr uint16_t VP_E1_PID_I = 0x3708; +constexpr uint16_t VP_E1_PID_D = 0x370A; constexpr uint16_t VP_BED_PID_P = 0x3710; constexpr uint16_t VP_BED_PID_I = 0x3712; constexpr uint16_t VP_BED_PID_D = 0x3714; diff --git a/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp index 5fbb307ee8..82c06d7a4a 100644 --- a/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -28,6 +28,7 @@ #include "../DGUSDisplayDef.h" #include "../DGUSDisplay.h" +#include "../DGUSScreenHandler.h" #include "../../../../../module/temperature.h" #include "../../../../../module/motion.h" @@ -37,7 +38,7 @@ #include "../../../../ultralcd.h" #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) - uint16_t distanceToMove = 0.1; + uint16_t distanceToMove = 10; #endif const uint16_t VPList_Boot[] PROGMEM = { @@ -56,7 +57,7 @@ const uint16_t VPList_Main[] PROGMEM = { #if HAS_HEATED_BED VP_T_Bed_Is, VP_T_Bed_Set, VP_BED_STATUS, #endif - #if FAN_COUNT > 0 + #if HAS_FAN VP_Fan0_Percentage, VP_FAN0_STATUS, #endif VP_XPos, VP_YPos, VP_ZPos, @@ -92,7 +93,7 @@ const uint16_t VPList_Status[] PROGMEM = { #if HAS_HEATED_BED VP_T_Bed_Is, VP_T_Bed_Set, #endif - #if FAN_COUNT > 0 + #if HAS_FAN VP_Fan0_Percentage, #endif VP_XPos, VP_YPos, VP_ZPos, @@ -191,7 +192,7 @@ const uint16_t VPList_SD_PrintManipulation[] PROGMEM = { #if HAS_HEATED_BED VP_T_Bed_Is, VP_T_Bed_Set, #endif - #if FAN_COUNT > 0 + #if HAS_FAN VP_Fan0_Percentage, #if FAN_COUNT > 1 VP_Fan1_Percentage, @@ -212,7 +213,7 @@ const uint16_t VPList_SDPrintTune[] PROGMEM = { VP_T_Bed_Is, VP_T_Bed_Set, #endif VP_Feedrate_Percentage, - #if FAN_COUNT > 0 + #if HAS_FAN VP_Fan0_Percentage, #endif VP_Flowrate_E0, @@ -328,153 +329,155 @@ const char MarlinVersion[] PROGMEM = SHORT_BUILD_VERSION; 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_SCREENCHANGE, nullptr, ScreenHandler.ScreenChangeHook, nullptr), + VPHELPER(VP_SCREENCHANGE_ASK, nullptr, ScreenHandler.ScreenChangeHookIfIdle, nullptr), + #if ENABLED(SDSUPPORT) + VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, ScreenHandler.ScreenChangeHookIfSD, nullptr), + #endif + VPHELPER(VP_CONFIRMED, nullptr, ScreenHandler.ScreenConfirmedOK, nullptr), - VPHELPER(VP_TEMP_ALL_OFF, nullptr, &DGUSScreenVariableHandler::HandleAllHeatersOff, nullptr), + VPHELPER(VP_TEMP_ALL_OFF, nullptr, &ScreenHandler.HandleAllHeatersOff, nullptr), #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) - VPHELPER(VP_MOVE_OPTION, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMoveOption, nullptr), + VPHELPER(VP_MOVE_OPTION, &distanceToMove, &ScreenHandler.HandleManualMoveOption, nullptr), #endif #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) - VPHELPER(VP_MOVE_X, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMove, nullptr), - VPHELPER(VP_MOVE_Y, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMove, nullptr), - VPHELPER(VP_MOVE_Z, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMove, nullptr), - VPHELPER(VP_HOME_ALL, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMove, nullptr), + VPHELPER(VP_MOVE_X, &distanceToMove, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_MOVE_Y, &distanceToMove, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_MOVE_Z, &distanceToMove, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_HOME_ALL, &distanceToMove, &ScreenHandler.HandleManualMove, nullptr), #else - 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), + VPHELPER(VP_MOVE_X, nullptr, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_MOVE_Y, nullptr, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_MOVE_Z, nullptr, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_HOME_ALL, nullptr, &ScreenHandler.HandleManualMove, nullptr), #endif - VPHELPER(VP_MOTOR_LOCK_UNLOK, nullptr, &DGUSScreenVariableHandler::HandleMotorLockUnlock, nullptr), + VPHELPER(VP_MOTOR_LOCK_UNLOK, nullptr, &ScreenHandler.HandleMotorLockUnlock, nullptr), #if ENABLED(POWER_LOSS_RECOVERY) - VPHELPER(VP_POWER_LOSS_RECOVERY, nullptr, &DGUSScreenVariableHandler::HandlePowerLossRecovery, nullptr), + VPHELPER(VP_POWER_LOSS_RECOVERY, nullptr, &ScreenHandler.HandlePowerLossRecovery, nullptr), #endif - VPHELPER(VP_SETTINGS, nullptr, &DGUSScreenVariableHandler::HandleSettings, nullptr), + VPHELPER(VP_SETTINGS, nullptr, &ScreenHandler.HandleSettings, nullptr), #if ENABLED(SINGLE_Z_CALIBRATION) - VPHELPER(VP_Z_CALIBRATE, nullptr, &DGUSScreenVariableHandler::HandleZCalibration, nullptr), + VPHELPER(VP_Z_CALIBRATE, nullptr, &ScreenHandler.HandleZCalibration, nullptr), #endif #if ENABLED(FIRST_LAYER_CAL) - VPHELPER(VP_Z_FIRST_LAYER_CAL, nullptr, &DGUSScreenVariableHandler::HandleFirstLayerCal, nullptr), + VPHELPER(VP_Z_FIRST_LAYER_CAL, nullptr, &ScreenHandler.HandleFirstLayerCal, nullptr), #endif - { .VP = VP_MARLIN_VERSION, .memadr = (void*)MarlinVersion, .size = VP_MARLIN_VERSION_LEN, .set_by_display_handler = nullptr, .send_to_display_handler =&DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM }, + { .VP = VP_MARLIN_VERSION, .memadr = (void*)MarlinVersion, .size = VP_MARLIN_VERSION_LEN, .set_by_display_handler = nullptr, .send_to_display_handler =&ScreenHandler.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 }, + { .VP = VP_M117, .memadr = nullptr, .size = VP_M117_LEN, .set_by_display_handler = nullptr, .send_to_display_handler =&ScreenHandler.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, &planner.flow_percentage[ExtUI::extruder_t::E0], DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_EPos, &destination.e, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>), - VPHELPER(VP_MOVE_E0, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr), - VPHELPER(VP_E0_CONTROL, &thermalManager.temp_hotend[0].target, &DGUSScreenVariableHandler::HandleHeaterControl, nullptr), - VPHELPER(VP_E0_STATUS, &thermalManager.temp_hotend[0].target, nullptr, &DGUSScreenVariableHandler::DGUSLCD_SendHeaterStatusToDisplay), + VPHELPER(VP_T_E0_Is, &thermalManager.temp_hotend[0].celsius, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<0>), + VPHELPER(VP_T_E0_Set, &thermalManager.temp_hotend[0].target, ScreenHandler.HandleTemperatureChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Flowrate_E0, &planner.flow_percentage[ExtUI::extruder_t::E0], ScreenHandler.HandleFlowRateChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_EPos, &destination.e, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>), + VPHELPER(VP_MOVE_E0, nullptr, &ScreenHandler.HandleManualExtrude, nullptr), + VPHELPER(VP_E0_CONTROL, &thermalManager.temp_hotend[0].target, &ScreenHandler.HandleHeaterControl, nullptr), + VPHELPER(VP_E0_STATUS, &thermalManager.temp_hotend[0].target, nullptr, &ScreenHandler.DGUSLCD_SendHeaterStatusToDisplay), #if ENABLED(DGUS_PREHEAT_UI) - VPHELPER(VP_E0_BED_PREHEAT, nullptr, &DGUSScreenVariableHandler::HandlePreheat, nullptr), + VPHELPER(VP_E0_BED_PREHEAT, nullptr, &ScreenHandler.HandlePreheat, nullptr), #endif #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) - VPHELPER(VP_E0_FILAMENT_LOAD_UNLOAD, nullptr, &DGUSScreenVariableHandler::HandleFilamentOption, &DGUSScreenVariableHandler::HandleFilamentLoadUnload), + VPHELPER(VP_E0_FILAMENT_LOAD_UNLOAD, nullptr, &ScreenHandler.HandleFilamentOption, &ScreenHandler.HandleFilamentLoadUnload), #endif #if ENABLED(PIDTEMP) - VPHELPER(VP_E0_PID_P, &thermalManager.temp_hotend[0].pid.Kp, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), - VPHELPER(VP_E0_PID_I, &thermalManager.temp_hotend[0].pid.Ki, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), - VPHELPER(VP_E0_PID_D, &thermalManager.temp_hotend[0].pid.Kd, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), - VPHELPER(VP_PID_AUTOTUNE_E0, nullptr, &DGUSScreenVariableHandler::HandlePIDAutotune, nullptr), + VPHELPER(VP_E0_PID_P, &thermalManager.temp_hotend[0].pid.Kp, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), + VPHELPER(VP_E0_PID_I, &thermalManager.temp_hotend[0].pid.Ki, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), + VPHELPER(VP_E0_PID_D, &thermalManager.temp_hotend[0].pid.Kd, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), + VPHELPER(VP_PID_AUTOTUNE_E0, nullptr, &ScreenHandler.HandlePIDAutotune, nullptr), #endif #endif #if HOTENDS >= 2 VPHELPER(VP_T_E1_Is, &thermalManager.temp_hotend[1].celsius, nullptr, DGUSLCD_SendFloatAsLongValueToDisplay<0>), - VPHELPER(VP_T_E1_Set, &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), - VPHELPER(VP_E1_CONTROL, &thermalManager.temp_hotend[1].target, &DGUSScreenVariableHandler::HandleHeaterControl, nullptr), - VPHELPER(VP_E1_STATUS, &thermalManager.temp_hotend[1].target, nullptr, &DGUSScreenVariableHandler::DGUSLCD_SendHeaterStatusToDisplay), + VPHELPER(VP_T_E1_Set, &thermalManager.temp_hotend[1].target, ScreenHandler.HandleTemperatureChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Flowrate_E1, nullptr, ScreenHandler.HandleFlowRateChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_MOVE_E1, nullptr, &ScreenHandler.HandleManualExtrude, nullptr), + VPHELPER(VP_E1_CONTROL, &thermalManager.temp_hotend[1].target, &ScreenHandler.HandleHeaterControl, nullptr), + VPHELPER(VP_E1_STATUS, &thermalManager.temp_hotend[1].target, nullptr, &ScreenHandler.DGUSLCD_SendHeaterStatusToDisplay), #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), - VPHELPER(VP_BED_CONTROL, &thermalManager.temp_bed.target, &DGUSScreenVariableHandler::HandleHeaterControl, nullptr), - VPHELPER(VP_BED_STATUS, &thermalManager.temp_bed.target, nullptr, &DGUSScreenVariableHandler::DGUSLCD_SendHeaterStatusToDisplay), + VPHELPER(VP_T_Bed_Is, &thermalManager.temp_bed.celsius, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<0>), + VPHELPER(VP_T_Bed_Set, &thermalManager.temp_bed.target, ScreenHandler.HandleTemperatureChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_BED_CONTROL, &thermalManager.temp_bed.target, &ScreenHandler.HandleHeaterControl, nullptr), + VPHELPER(VP_BED_STATUS, &thermalManager.temp_bed.target, nullptr, &ScreenHandler.DGUSLCD_SendHeaterStatusToDisplay), #if ENABLED(PIDTEMP) - VPHELPER(VP_BED_PID_P, &thermalManager.temp_bed.pid.Kp, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), - VPHELPER(VP_BED_PID_I, &thermalManager.temp_bed.pid.Ki, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), - VPHELPER(VP_BED_PID_D, &thermalManager.temp_bed.pid.Kd, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), - VPHELPER(VP_PID_AUTOTUNE_BED, nullptr, &DGUSScreenVariableHandler::HandlePIDAutotune, nullptr), + VPHELPER(VP_BED_PID_P, &thermalManager.temp_bed.pid.Kp, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), + VPHELPER(VP_BED_PID_I, &thermalManager.temp_bed.pid.Ki, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), + VPHELPER(VP_BED_PID_D, &thermalManager.temp_bed.pid.Kd, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), + VPHELPER(VP_PID_AUTOTUNE_BED, nullptr, &ScreenHandler.HandlePIDAutotune, nullptr), #endif #endif // Fan Data - #if FAN_COUNT + #if HAS_FAN #define FAN_VPHELPER(N) \ - VPHELPER(VP_Fan##N##_Percentage, &thermalManager.fan_speed[N], DGUSScreenVariableHandler::DGUSLCD_PercentageToUint8, &DGUSScreenVariableHandler::DGUSLCD_SendPercentageToDisplay), \ - VPHELPER(VP_FAN##N##_CONTROL, &thermalManager.fan_speed[N], &DGUSScreenVariableHandler::HandleFanControl, nullptr), \ - VPHELPER(VP_FAN##N##_STATUS, &thermalManager.fan_speed[N], nullptr, &DGUSScreenVariableHandler::DGUSLCD_SendFanStatusToDisplay), + VPHELPER(VP_Fan##N##_Percentage, &thermalManager.fan_speed[N], ScreenHandler.DGUSLCD_PercentageToUint8, &ScreenHandler.DGUSLCD_SendPercentageToDisplay), \ + VPHELPER(VP_FAN##N##_CONTROL, &thermalManager.fan_speed[N], &ScreenHandler.HandleFanControl, nullptr), \ + VPHELPER(VP_FAN##N##_STATUS, &thermalManager.fan_speed[N], nullptr, &ScreenHandler.DGUSLCD_SendFanStatusToDisplay), REPEAT(FAN_COUNT, FAN_VPHELPER) #endif // Feedrate - VPHELPER(VP_Feedrate_Percentage, &feedrate_percentage, DGUSScreenVariableHandler::DGUSLCD_SetValueDirectly, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay ), + VPHELPER(VP_Feedrate_Percentage, &feedrate_percentage, ScreenHandler.DGUSLCD_SetValueDirectly, &ScreenHandler.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>), + VPHELPER(VP_XPos, ¤t_position.x, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>), + VPHELPER(VP_YPos, ¤t_position.y, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>), + VPHELPER(VP_ZPos, ¤t_position.z, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>), // Print Progress - VPHELPER(VP_PrintProgress_Percentage, nullptr, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintProgressToDisplay ), + VPHELPER(VP_PrintProgress_Percentage, nullptr, nullptr, ScreenHandler.DGUSLCD_SendPrintProgressToDisplay ), // Print Time - VPHELPER_STR(VP_PrintTime, nullptr, VP_PrintTime_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintTimeToDisplay ), + VPHELPER_STR(VP_PrintTime, nullptr, VP_PrintTime_LEN, nullptr, ScreenHandler.DGUSLCD_SendPrintTimeToDisplay ), #if ENABLED(PRINTCOUNTER) - VPHELPER_STR(VP_PrintAccTime, nullptr, VP_PrintAccTime_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintAccTimeToDisplay ), - VPHELPER_STR(VP_PrintsTotal, nullptr, VP_PrintsTotal_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintsTotalToDisplay ), + VPHELPER_STR(VP_PrintAccTime, nullptr, VP_PrintAccTime_LEN, nullptr, ScreenHandler.DGUSLCD_SendPrintAccTimeToDisplay ), + VPHELPER_STR(VP_PrintsTotal, nullptr, VP_PrintsTotal_LEN, nullptr, ScreenHandler.DGUSLCD_SendPrintsTotalToDisplay ), #endif - VPHELPER(VP_X_STEP_PER_MM, &planner.settings.axis_steps_per_mm[X_AXIS], DGUSScreenVariableHandler::HandleStepPerMMChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>), - VPHELPER(VP_Y_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Y_AXIS], DGUSScreenVariableHandler::HandleStepPerMMChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>), - VPHELPER(VP_Z_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Z_AXIS], DGUSScreenVariableHandler::HandleStepPerMMChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>), + VPHELPER(VP_X_STEP_PER_MM, &planner.settings.axis_steps_per_mm[X_AXIS], ScreenHandler.HandleStepPerMMChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>), + VPHELPER(VP_Y_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Y_AXIS], ScreenHandler.HandleStepPerMMChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>), + VPHELPER(VP_Z_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Z_AXIS], ScreenHandler.HandleStepPerMMChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>), #if HOTENDS >= 1 - VPHELPER(VP_E0_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(0)], DGUSScreenVariableHandler::HandleStepPerMMExtruderChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>), + VPHELPER(VP_E0_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(0)], ScreenHandler.HandleStepPerMMExtruderChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>), #endif #if HOTENDS >= 2 - VPHELPER(VP_E1_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(1)], DGUSScreenVariableHandler::HandleStepPerMMExtruderChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>), + VPHELPER(VP_E1_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(1)], ScreenHandler.HandleStepPerMMExtruderChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>), #endif // 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), - VPHELPER(VP_SD_Print_Setting, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_PrintTune, nullptr), + VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr), + VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr), + VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr), + VPHELPER_STR(VP_SD_FileName0, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), + VPHELPER_STR(VP_SD_FileName1, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), + VPHELPER_STR(VP_SD_FileName2, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), + VPHELPER_STR(VP_SD_FileName3, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), + VPHELPER_STR(VP_SD_FileName4, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), + VPHELPER(VP_SD_ResumePauseAbort, nullptr, ScreenHandler.DGUSLCD_SD_ResumePauseAbort, nullptr), + VPHELPER(VP_SD_AbortPrintConfirmed, nullptr, ScreenHandler.DGUSLCD_SD_ReallyAbort, nullptr), + VPHELPER(VP_SD_Print_Setting, nullptr, ScreenHandler.DGUSLCD_SD_PrintTune, nullptr), #if HAS_BED_PROBE - VPHELPER(VP_SD_Print_ProbeOffsetZ, &probe.offset.z, DGUSScreenVariableHandler::HandleProbeOffsetZChanged, &DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<2>), + VPHELPER(VP_SD_Print_ProbeOffsetZ, &probe.offset.z, ScreenHandler.HandleProbeOffsetZChanged, &ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<2>), #if ENABLED(BABYSTEPPING) - VPHELPER(VP_SD_Print_LiveAdjustZ, nullptr, DGUSScreenVariableHandler::HandleLiveAdjustZ, nullptr), + VPHELPER(VP_SD_Print_LiveAdjustZ, nullptr, ScreenHandler.HandleLiveAdjustZ, nullptr), #endif #endif #endif #if ENABLED(DGUS_UI_WAITING) - VPHELPER(VP_WAITING_STATUS, nullptr, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendWaitingStatusToDisplay), + VPHELPER(VP_WAITING_STATUS, nullptr, nullptr, ScreenHandler.DGUSLCD_SendWaitingStatusToDisplay), #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 }, + { .VP = VP_MSGSTR1, .memadr = nullptr, .size = VP_MSGSTR1_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM }, + { .VP = VP_MSGSTR2, .memadr = nullptr, .size = VP_MSGSTR2_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM }, + { .VP = VP_MSGSTR3, .memadr = nullptr, .size = VP_MSGSTR3_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM }, + { .VP = VP_MSGSTR4, .memadr = nullptr, .size = VP_MSGSTR4_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM }, VPHELPER(0, 0, 0, 0) // must be last entry. }; diff --git a/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.h b/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.h index 1bfdf54254..3ff5e06dc1 100644 --- a/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp index 37b7335e67..f9d4351e02 100644 --- a/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -28,16 +28,19 @@ #include "../DGUSDisplayDef.h" #include "../DGUSDisplay.h" +#include "../DGUSScreenHandler.h" #include "../../../../../module/temperature.h" #include "../../../../../module/motion.h" #include "../../../../../module/planner.h" #include "../../../../ultralcd.h" +#include "../../../ui_api.h" #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) - uint16_t distanceToMove = 0.1; + uint16_t distanceToMove = 10; #endif +using namespace ExtUI; const uint16_t VPList_Boot[] PROGMEM = { VP_MARLIN_VERSION, @@ -73,7 +76,7 @@ const uint16_t VPList_Status[] PROGMEM = { #if HAS_HEATED_BED VP_T_Bed_Is, VP_T_Bed_Set, #endif - #if FAN_COUNT > 0 + #if HAS_FAN VP_Fan0_Percentage, #endif VP_XPos, VP_YPos, VP_ZPos, @@ -153,152 +156,153 @@ const char MarlinVersion[] PROGMEM = SHORT_BUILD_VERSION; 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, nullptr, ScreenHandler.ScreenChangeHook, nullptr), + VPHELPER(VP_SCREENCHANGE_ASK, nullptr, ScreenHandler.ScreenChangeHookIfIdle, nullptr), #if ENABLED(SDSUPPORT) - VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, DGUSScreenVariableHandler::ScreenChangeHookIfSD, nullptr), + VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, ScreenHandler.ScreenChangeHookIfSD, nullptr), #endif - VPHELPER(VP_CONFIRMED, nullptr, DGUSScreenVariableHandler::ScreenConfirmedOK, nullptr), + VPHELPER(VP_CONFIRMED, nullptr, ScreenHandler.ScreenConfirmedOK, nullptr), - VPHELPER(VP_TEMP_ALL_OFF, nullptr, &DGUSScreenVariableHandler::HandleAllHeatersOff, nullptr), + VPHELPER(VP_TEMP_ALL_OFF, nullptr, &ScreenHandler.HandleAllHeatersOff, nullptr), #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) - VPHELPER(VP_MOVE_OPTION, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMoveOption, nullptr), + VPHELPER(VP_MOVE_OPTION, &distanceToMove, &ScreenHandler.HandleManualMoveOption, nullptr), #endif #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) - VPHELPER(VP_MOVE_X, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMove, nullptr), - VPHELPER(VP_MOVE_Y, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMove, nullptr), - VPHELPER(VP_MOVE_Z, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMove, nullptr), - VPHELPER(VP_HOME_ALL, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMove, nullptr), + VPHELPER(VP_MOVE_X, &distanceToMove, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_MOVE_Y, &distanceToMove, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_MOVE_Z, &distanceToMove, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_HOME_ALL, &distanceToMove, &ScreenHandler.HandleManualMove, nullptr), #else - 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), + VPHELPER(VP_MOVE_X, nullptr, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_MOVE_Y, nullptr, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_MOVE_Z, nullptr, &ScreenHandler.HandleManualMove, nullptr), + VPHELPER(VP_HOME_ALL, nullptr, &ScreenHandler.HandleManualMove, nullptr), #endif - VPHELPER(VP_MOTOR_LOCK_UNLOK, nullptr, &DGUSScreenVariableHandler::HandleMotorLockUnlock, nullptr), + VPHELPER(VP_MOTOR_LOCK_UNLOK, nullptr, &ScreenHandler.HandleMotorLockUnlock, nullptr), #if ENABLED(POWER_LOSS_RECOVERY) - VPHELPER(VP_POWER_LOSS_RECOVERY, nullptr, &DGUSScreenVariableHandler::HandlePowerLossRecovery, nullptr), + VPHELPER(VP_POWER_LOSS_RECOVERY, nullptr, &ScreenHandler.HandlePowerLossRecovery, nullptr), #endif - VPHELPER(VP_SETTINGS, nullptr, &DGUSScreenVariableHandler::HandleSettings, nullptr), + VPHELPER(VP_SETTINGS, nullptr, &ScreenHandler.HandleSettings, 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 }, + { .VP = VP_MARLIN_VERSION, .memadr = (void*)MarlinVersion, .size = VP_MARLIN_VERSION_LEN, .set_by_display_handler = nullptr, .send_to_display_handler =&ScreenHandler.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 }, + { .VP = VP_M117, .memadr = nullptr, .size = VP_M117_LEN, .set_by_display_handler = nullptr, .send_to_display_handler =&ScreenHandler.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), - VPHELPER(VP_E0_CONTROL, &thermalManager.temp_hotend[0].target, &DGUSScreenVariableHandler::HandleHeaterControl, nullptr), - VPHELPER(VP_E0_STATUS, &thermalManager.temp_hotend[0].target, nullptr, &DGUSScreenVariableHandler::DGUSLCD_SendHeaterStatusToDisplay), + VPHELPER(VP_T_E0_Is, nullptr, nullptr, SET_VARIABLE(getActualTemp_celsius, E0, long)), + VPHELPER(VP_T_E0_Set, nullptr, GET_VARIABLE(setTargetTemp_celsius, E0), + SET_VARIABLE(getTargetTemp_celsius, E0)), + VPHELPER(VP_Flowrate_E0, nullptr, ScreenHandler.HandleFlowRateChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_EPos, &destination.e, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>), + VPHELPER(VP_MOVE_E0, nullptr, &ScreenHandler.HandleManualExtrude, nullptr), + VPHELPER(VP_E0_CONTROL, &thermalManager.temp_hotend[0].target, &ScreenHandler.HandleHeaterControl, nullptr), + VPHELPER(VP_E0_STATUS, &thermalManager.temp_hotend[0].target, nullptr, &ScreenHandler.DGUSLCD_SendHeaterStatusToDisplay), #if ENABLED(DGUS_PREHEAT_UI) - VPHELPER(VP_E0_BED_PREHEAT, nullptr, &DGUSScreenVariableHandler::HandlePreheat, nullptr), + VPHELPER(VP_E0_BED_PREHEAT, nullptr, &ScreenHandler.HandlePreheat, nullptr), #endif #if ENABLED(PIDTEMP) - VPHELPER(VP_E0_PID_P, &thermalManager.temp_hotend[0].pid.Kp, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), - VPHELPER(VP_E0_PID_I, &thermalManager.temp_hotend[0].pid.Ki, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), - VPHELPER(VP_E0_PID_D, &thermalManager.temp_hotend[0].pid.Kd, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), - VPHELPER(VP_PID_AUTOTUNE_E0, nullptr, &DGUSScreenVariableHandler::HandlePIDAutotune, nullptr), + VPHELPER(VP_E0_PID_P, &thermalManager.temp_hotend[0].pid.Kp, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), + VPHELPER(VP_E0_PID_I, &thermalManager.temp_hotend[0].pid.Ki, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), + VPHELPER(VP_E0_PID_D, &thermalManager.temp_hotend[0].pid.Kd, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), + VPHELPER(VP_PID_AUTOTUNE_E0, nullptr, &ScreenHandler.HandlePIDAutotune, nullptr), #endif #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) - VPHELPER(VP_E0_FILAMENT_LOAD_UNLOAD, nullptr, &DGUSScreenVariableHandler::HandleFilamentOption, &DGUSScreenVariableHandler::HandleFilamentLoadUnload), + VPHELPER(VP_E0_FILAMENT_LOAD_UNLOAD, nullptr, &ScreenHandler.HandleFilamentOption, &ScreenHandler.HandleFilamentLoadUnload), #endif #endif #if HOTENDS >= 2 VPHELPER(VP_T_E1_Is, &thermalManager.temp_hotend[1].celsius, nullptr, DGUSLCD_SendFloatAsLongValueToDisplay<0>), - VPHELPER(VP_T_E1_Set, &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), - VPHELPER(VP_E1_CONTROL, &thermalManager.temp_hotend[1].target, &DGUSScreenVariableHandler::HandleHeaterControl, nullptr), - VPHELPER(VP_E1_STATUS, &thermalManager.temp_hotend[1].target, nullptr, &DGUSScreenVariableHandler::DGUSLCD_SendHeaterStatusToDisplay), + VPHELPER(VP_T_E1_Set, &thermalManager.temp_hotend[1].target, ScreenHandler.HandleTemperatureChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Flowrate_E1, nullptr, ScreenHandler.HandleFlowRateChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_MOVE_E1, nullptr, &ScreenHandler.HandleManualExtrude, nullptr), + VPHELPER(VP_E1_CONTROL, &thermalManager.temp_hotend[1].target, &ScreenHandler.HandleHeaterControl, nullptr), + VPHELPER(VP_E1_STATUS, &thermalManager.temp_hotend[1].target, nullptr, &ScreenHandler.DGUSLCD_SendHeaterStatusToDisplay), #if ENABLED(PIDTEMP) - VPHELPER(VP_PID_AUTOTUNE_E1, nullptr, &DGUSScreenVariableHandler::HandlePIDAutotune, nullptr), + VPHELPER(VP_PID_AUTOTUNE_E1, nullptr, &ScreenHandler.HandlePIDAutotune, nullptr), #endif #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), - VPHELPER(VP_BED_CONTROL, &thermalManager.temp_bed.target, &DGUSScreenVariableHandler::HandleHeaterControl, nullptr), - VPHELPER(VP_BED_STATUS, &thermalManager.temp_bed.target, nullptr, &DGUSScreenVariableHandler::DGUSLCD_SendHeaterStatusToDisplay), + VPHELPER(VP_T_Bed_Is, &thermalManager.temp_bed.celsius, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<0>), + VPHELPER(VP_T_Bed_Set, &thermalManager.temp_bed.target, ScreenHandler.HandleTemperatureChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_BED_CONTROL, &thermalManager.temp_bed.target, &ScreenHandler.HandleHeaterControl, nullptr), + VPHELPER(VP_BED_STATUS, &thermalManager.temp_bed.target, nullptr, &ScreenHandler.DGUSLCD_SendHeaterStatusToDisplay), #if ENABLED(PIDTEMPBED) - VPHELPER(VP_BED_PID_P, &thermalManager.temp_bed.pid.Kp, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), - VPHELPER(VP_BED_PID_I, &thermalManager.temp_bed.pid.Ki, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), - VPHELPER(VP_BED_PID_D, &thermalManager.temp_bed.pid.Kd, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID), + VPHELPER(VP_BED_PID_P, &thermalManager.temp_bed.pid.Kp, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), + VPHELPER(VP_BED_PID_I, &thermalManager.temp_bed.pid.Ki, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), + VPHELPER(VP_BED_PID_D, &thermalManager.temp_bed.pid.Kd, ScreenHandler.HandleTemperaturePIDChanged, ScreenHandler.DGUSLCD_SendTemperaturePID), #endif #endif // Fan Data - #if FAN_COUNT + #if HAS_FAN #define FAN_VPHELPER(N) \ - VPHELPER(VP_Fan##N##_Percentage, &thermalManager.fan_speed[N], DGUSScreenVariableHandler::DGUSLCD_PercentageToUint8, &DGUSScreenVariableHandler::DGUSLCD_SendPercentageToDisplay), \ - VPHELPER(VP_FAN##N##_CONTROL, &thermalManager.fan_speed[N], &DGUSScreenVariableHandler::HandleFanControl, nullptr), \ - VPHELPER(VP_FAN##N##_STATUS, &thermalManager.fan_speed[N], nullptr, &DGUSScreenVariableHandler::DGUSLCD_SendFanStatusToDisplay), + VPHELPER(VP_Fan##N##_Percentage, &thermalManager.fan_speed[N], ScreenHandler.DGUSLCD_PercentageToUint8, &ScreenHandler.DGUSLCD_SendPercentageToDisplay), \ + VPHELPER(VP_FAN##N##_CONTROL, &thermalManager.fan_speed[N], &ScreenHandler.HandleFanControl, nullptr), \ + VPHELPER(VP_FAN##N##_STATUS, &thermalManager.fan_speed[N], nullptr, &ScreenHandler.DGUSLCD_SendFanStatusToDisplay), REPEAT(FAN_COUNT, FAN_VPHELPER) #endif // Feedrate - VPHELPER(VP_Feedrate_Percentage, &feedrate_percentage, DGUSScreenVariableHandler::DGUSLCD_SetValueDirectly, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay ), + VPHELPER(VP_Feedrate_Percentage, &feedrate_percentage, ScreenHandler.DGUSLCD_SetValueDirectly, &ScreenHandler.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>), + VPHELPER(VP_XPos, ¤t_position.x, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>), + VPHELPER(VP_YPos, ¤t_position.y, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>), + VPHELPER(VP_ZPos, ¤t_position.z, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>), // Print Progress - VPHELPER(VP_PrintProgress_Percentage, nullptr, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintProgressToDisplay ), + VPHELPER(VP_PrintProgress_Percentage, nullptr, nullptr, ScreenHandler.DGUSLCD_SendPrintProgressToDisplay ), // Print Time - VPHELPER_STR(VP_PrintTime, nullptr, VP_PrintTime_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintTimeToDisplay ), + VPHELPER_STR(VP_PrintTime, nullptr, VP_PrintTime_LEN, nullptr, ScreenHandler.DGUSLCD_SendPrintTimeToDisplay ), #if ENABLED(PRINTCOUNTER) - VPHELPER_STR(VP_PrintAccTime, nullptr, VP_PrintAccTime_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintAccTimeToDisplay ), - VPHELPER_STR(VP_PrintsTotal, nullptr, VP_PrintsTotal_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintsTotalToDisplay ), + VPHELPER_STR(VP_PrintAccTime, nullptr, VP_PrintAccTime_LEN, nullptr, ScreenHandler.DGUSLCD_SendPrintAccTimeToDisplay ), + VPHELPER_STR(VP_PrintsTotal, nullptr, VP_PrintsTotal_LEN, nullptr, ScreenHandler.DGUSLCD_SendPrintsTotalToDisplay ), #endif - VPHELPER(VP_X_STEP_PER_MM, &planner.settings.axis_steps_per_mm[X_AXIS], DGUSScreenVariableHandler::HandleStepPerMMChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>), - VPHELPER(VP_Y_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Y_AXIS], DGUSScreenVariableHandler::HandleStepPerMMChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>), - VPHELPER(VP_Z_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Z_AXIS], DGUSScreenVariableHandler::HandleStepPerMMChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>), + VPHELPER(VP_X_STEP_PER_MM, &planner.settings.axis_steps_per_mm[X_AXIS], ScreenHandler.HandleStepPerMMChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>), + VPHELPER(VP_Y_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Y_AXIS], ScreenHandler.HandleStepPerMMChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>), + VPHELPER(VP_Z_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Z_AXIS], ScreenHandler.HandleStepPerMMChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>), #if HOTENDS >= 1 - VPHELPER(VP_E0_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(0)], DGUSScreenVariableHandler::HandleStepPerMMExtruderChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>), + VPHELPER(VP_E0_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(0)], ScreenHandler.HandleStepPerMMExtruderChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>), #endif #if HOTENDS >= 2 - VPHELPER(VP_E1_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(1)], DGUSScreenVariableHandler::HandleStepPerMMExtruderChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>), + VPHELPER(VP_E1_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(1)], ScreenHandler.HandleStepPerMMExtruderChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>), #endif // 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), - VPHELPER(VP_SD_Print_Setting, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_PrintTune, nullptr), + VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr), + VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr), + VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr), + VPHELPER_STR(VP_SD_FileName0, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), + VPHELPER_STR(VP_SD_FileName1, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), + VPHELPER_STR(VP_SD_FileName2, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), + VPHELPER_STR(VP_SD_FileName3, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), + VPHELPER_STR(VP_SD_FileName4, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename ), + VPHELPER(VP_SD_ResumePauseAbort, nullptr, ScreenHandler.DGUSLCD_SD_ResumePauseAbort, nullptr), + VPHELPER(VP_SD_AbortPrintConfirmed, nullptr, ScreenHandler.DGUSLCD_SD_ReallyAbort, nullptr), + VPHELPER(VP_SD_Print_Setting, nullptr, ScreenHandler.DGUSLCD_SD_PrintTune, nullptr), #if HAS_BED_PROBE - VPHELPER(VP_SD_Print_ProbeOffsetZ, &probe.offset.z, DGUSScreenVariableHandler::HandleProbeOffsetZChanged, &DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<2>), + VPHELPER(VP_SD_Print_ProbeOffsetZ, &probe.offset.z, ScreenHandler.HandleProbeOffsetZChanged, &ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<2>), #if ENABLED(BABYSTEPPING) - VPHELPER(VP_SD_Print_LiveAdjustZ, nullptr, DGUSScreenVariableHandler::HandleLiveAdjustZ, nullptr), + VPHELPER(VP_SD_Print_LiveAdjustZ, nullptr, ScreenHandler.HandleLiveAdjustZ, nullptr), #endif #endif #endif #if ENABLED(DGUS_UI_WAITING) - VPHELPER(VP_WAITING_STATUS, nullptr, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendWaitingStatusToDisplay), + VPHELPER(VP_WAITING_STATUS, nullptr, nullptr, ScreenHandler.DGUSLCD_SendWaitingStatusToDisplay), #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 }, + { .VP = VP_MSGSTR1, .memadr = nullptr, .size = VP_MSGSTR1_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM }, + { .VP = VP_MSGSTR2, .memadr = nullptr, .size = VP_MSGSTR2_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM }, + { .VP = VP_MSGSTR3, .memadr = nullptr, .size = VP_MSGSTR3_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM }, + { .VP = VP_MSGSTR4, .memadr = nullptr, .size = VP_MSGSTR4_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM }, VPHELPER(0, 0, 0, 0) // must be last entry. }; diff --git a/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.h b/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.h index 756b91ddbd..451c11adba 100644 --- a/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -192,7 +192,7 @@ constexpr uint16_t VP_Flowrate_E1 = 0x3092; // 2 Byte Integer //constexpr uint16_t VP_Flowrate_E5 = 0x309A; constexpr uint16_t VP_Fan0_Percentage = 0x3100; // 2 Byte Integer (0..100) -//constexpr uint16_t VP_Fan1_Percentage = 0x33A2; // 2 Byte Integer (0..100) +constexpr uint16_t VP_Fan1_Percentage = 0x33A2; // 2 Byte Integer (0..100) //constexpr uint16_t VP_Fan2_Percentage = 0x33A4; // 2 Byte Integer (0..100) //constexpr uint16_t VP_Fan3_Percentage = 0x33A6; // 2 Byte Integer (0..100) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp index c8cc6e8e9d..0c38c8216c 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../compat.h" @@ -453,9 +453,7 @@ bool UIFlashStorage::is_present = false; if (nBytes != write_page_size) break; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::yield(); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::yield()); } SERIAL_ECHOLNPGM("DONE"); @@ -493,21 +491,20 @@ bool UIFlashStorage::is_present = false; addr += nBytes; if (nBytes != write_page_size) break; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::yield(); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::yield()); }; if (verifyOk) { SERIAL_ECHOLNPGM("DONE"); return SUCCESS; - } else { + } + else { SERIAL_ECHOLNPGM("FAIL"); return VERIFY_ERROR; } #else return VERIFY_ERROR; - #endif // ENABLED(SDSUPPORT) + #endif // SDSUPPORT } bool UIFlashStorage::BootMediaReader::isAvailable(uint32_t slot) { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.h index 2917cb0b1e..3edc2a9de1 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ class SPIFlash { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp index 68886166c2..46683401dc 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../compat.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h index d64182fd5b..fcaa610e8b 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/compat.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/compat.h index c3e8052a0e..11ad0798b5 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/compat.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/compat.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/config.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/config.h index 458c901206..7476c9e67e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/config.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/config.h @@ -16,109 +16,11 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * 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 +// Configure this display with options in Configuration_adv.h diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/LICENSE.txt b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/LICENSE.txt index 94a9ed024d..e60008693e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/LICENSE.txt +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/LICENSE.txt @@ -1,7 +1,7 @@ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + 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. @@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found. GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. @@ -664,11 +664,11 @@ 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/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h index 68fc06f528..c09d10f148 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once @@ -25,24 +25,23 @@ #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; + 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; - + 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 @@ -53,30 +52,25 @@ #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 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 */ + 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 - * +/** + * Settings for the Haoyu Electronics, 4.3" Graphical LCD Touchscreen, 480x272, SPI, FT800 (FT800CB-HY43B) + * and 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 - * + * https://www.hantronix.com/files/data/1278363262430-3.pdf + * https://www.haoyuelectronics.com/Attachment/HY43-LCD/LCD%20DataSheet.pdf + * https://www.haoyuelectronics.com/Attachment/HY5-LCD-HD/KD50G21-40NT-A1.pdf */ - #elif defined(LCD_HAOYU_FT800CB) #if !HAS_RESOLUTION #define TOUCH_UI_480x272 @@ -86,25 +80,20 @@ #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 */ + 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 - * + * 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 - * + * https://www.haoyuelectronics.com/Attachment/HY5-LCD-HD/KD50G21-40NT-A1.pdf */ - #elif defined(LCD_HAOYU_FT810CB) #if !HAS_RESOLUTION #define TOUCH_UI_800x480 @@ -114,25 +103,20 @@ #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 */ + 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) - * - * https://4dsystems.com.au/4dlcd-ft843 - * + * https://4dsystems.com.au/4dlcd-ft843 * Datasheet: - * - * https://4dsystems.com.au/mwdownloads/download/link/id/52/ - * + * https://4dsystems.com.au/mwdownloads/download/link/id/52/ */ - #elif defined(LCD_4DSYSTEMS_4DLCD_FT843) #if !HAS_RESOLUTION #define TOUCH_UI_480x272 @@ -142,23 +126,17 @@ #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 */ + 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: - * - * https://www.hantronix.com/files/data/s1501799605s500-gh7.pdf - * + * Datasheet https://www.hantronix.com/files/data/s1501799605s500-gh7.pdf */ #elif defined(LCD_ALEPHOBJECTS_CLCD_UI) #if !HAS_RESOLUTION @@ -169,15 +147,38 @@ #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 */ + 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 */ } +/** + * FYSETC Color LCD + * https://www.aliexpress.com/item/4000627651757.html + * Product information: + * https://github.com/FYSETC/TFT81050 + */ +#elif defined(LCD_FYSETC_TFT81050) + #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'." + #error "Unknown or no TOUCH_UI_FTDI_EVE board specified. To add a new board, modify this file." + #endif diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp index f57d2d896a..a70268254f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_basic.h" @@ -58,7 +58,7 @@ void CLCD::FontMetrics::load(const uint8_t font) { 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(;;) { + for (;;) { const uint8_t val = *p++; n--; if (!val || n == 0) break; width += val < 128 ? char_widths[val] : 0; @@ -69,7 +69,7 @@ uint16_t CLCD::FontMetrics::get_text_width(const char *str, size_t n) const { uint16_t CLCD::FontMetrics::get_text_width(progmem_str str, size_t n) const { uint16_t width = 0; const uint8_t *p = (const uint8_t *) str; - for(;;) { + for (;;) { const uint8_t val = pgm_read_byte(p++); n--; if (!val || n == 0) break; width += val < 128 ? char_widths[val] : 0; @@ -79,7 +79,7 @@ uint16_t CLCD::FontMetrics::get_text_width(progmem_str str, size_t n) const { /************************** HOST COMMAND FUNCTION *********************************/ -void CLCD::host_cmd (unsigned char host_command, unsigned char byte2) { // Sends 24-Bit Host Command to LCD +void CLCD::host_cmd(unsigned char host_command, unsigned char byte2) { // Sends 24-Bit Host Command to LCD if (host_command != FTDI::ACTIVE) { host_command |= 0x40; } @@ -92,7 +92,7 @@ void CLCD::host_cmd (unsigned char host_command, unsigned char byte2) { // Send /************************** MEMORY READ FUNCTIONS *********************************/ -void CLCD::spi_read_addr (uint32_t reg_address) { +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] @@ -100,7 +100,7 @@ void CLCD::spi_read_addr (uint32_t reg_address) { } // Write 4-Byte Address, Read Multiple Bytes -void CLCD::mem_read_bulk (uint32_t reg_address, uint8_t *data, uint16_t len) { +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); @@ -108,7 +108,7 @@ void CLCD::mem_read_bulk (uint32_t reg_address, uint8_t *data, uint16_t len) { } // Write 4-Byte Address, Read 1-Byte Data -uint8_t CLCD::mem_read_8 (uint32_t reg_address) { +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(); @@ -117,7 +117,7 @@ uint8_t CLCD::mem_read_8 (uint32_t reg_address) { } // Write 4-Byte Address, Read 2-Bytes Data -uint16_t CLCD::mem_read_16 (uint32_t reg_address) { +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); @@ -127,7 +127,7 @@ uint16_t CLCD::mem_read_16 (uint32_t reg_address) { } // Write 4-Byte Address, Read 4-Bytes Data -uint32_t CLCD::mem_read_32 (uint32_t reg_address) { +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); @@ -147,14 +147,14 @@ static inline uint8_t reverse_byte(uint8_t a) { } 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) { +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) { +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); @@ -162,7 +162,7 @@ void CLCD::mem_write_bulk (uint32_t reg_address, const void *data, uint16_t len, } // 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) { +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); @@ -170,7 +170,7 @@ void CLCD::mem_write_bulk (uint32_t reg_address, progmem_str str, uint16_t len, } // 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) { +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); @@ -178,7 +178,7 @@ void CLCD::mem_write_pgm (uint32_t reg_address, const void *data, uint16_t len, } // 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) { +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); @@ -186,7 +186,7 @@ void CLCD::mem_write_xbm (uint32_t reg_address, progmem_str data, uint16_t len, } // Write 3-Byte Address, Write 1-Byte Data -void CLCD::mem_write_8 (uint32_t reg_address, uint8_t 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); @@ -194,16 +194,16 @@ void CLCD::mem_write_8 (uint32_t reg_address, uint8_t data) { } // Write 3-Byte Address, Write 2-Bytes Data -void CLCD::mem_write_16 (uint32_t reg_address, uint16_t 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_write_16(data); spi_ftdi_deselect(); } // Write 3-Byte Address, Write 4-Bytes Data -void CLCD::mem_write_32 (uint32_t reg_address, uint32_t 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); @@ -281,7 +281,7 @@ void CLCD::CommandFifo::text(int16_t x, int16_t y, int16_t font, uint16_t optio } // 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) { +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; @@ -303,7 +303,7 @@ void CLCD::CommandFifo::toggle (int16_t x, int16_t y, int16_t w, int16_t font, u } // 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) { +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; @@ -324,7 +324,7 @@ void CLCD::CommandFifo::keys (int16_t x, int16_t y, int16_t w, int16_t h, int16_ 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) +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; @@ -350,7 +350,7 @@ void CLCD::CommandFifo::clock (int16_t x, int16_t y, int16_t r, uint16_t options 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) +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; @@ -376,7 +376,7 @@ void CLCD::CommandFifo::gauge (int16_t x, int16_t y, int16_t r, uint16_t options 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) +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; @@ -396,7 +396,7 @@ void CLCD::CommandFifo::dial (int16_t x, int16_t y, int16_t r, uint16_t options, 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) { +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; @@ -421,7 +421,7 @@ void CLCD::CommandFifo::scrollbar (int16_t x, int16_t y, int16_t w, int16_t h, u 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) { +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; @@ -444,7 +444,7 @@ void CLCD::CommandFifo::progress (int16_t x, int16_t y, int16_t w, int16_t h, ui 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) { +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; @@ -467,7 +467,7 @@ void CLCD::CommandFifo::slider (int16_t x, int16_t y, int16_t w, int16_t h, uint 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) { +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; @@ -488,7 +488,7 @@ void CLCD::CommandFifo::gradient (int16_t x0, int16_t y0, uint32_t rgb0, int16_t 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) { +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; @@ -507,7 +507,7 @@ void CLCD::CommandFifo::number (int16_t x, int16_t y, int16_t font, uint16_t opt cmd( &cmd_data, sizeof(cmd_data) ); } -void CLCD::CommandFifo::memzero (uint32_t ptr, uint32_t size) { +void CLCD::CommandFifo::memzero(uint32_t ptr, uint32_t size) { struct { uint32_t type = CMD_MEMZERO; uint32_t ptr; @@ -520,7 +520,7 @@ void CLCD::CommandFifo::memzero (uint32_t ptr, uint32_t size) { cmd( &cmd_data, sizeof(cmd_data) ); } -void CLCD::CommandFifo::memset (uint32_t ptr, uint32_t val, uint32_t size) { +void CLCD::CommandFifo::memset(uint32_t ptr, uint32_t val, uint32_t size) { struct { uint32_t type = CMD_MEMSET; uint32_t ptr; @@ -535,7 +535,7 @@ void CLCD::CommandFifo::memset (uint32_t ptr, uint32_t val, uint32_t size) { cmd( &cmd_data, sizeof(cmd_data) ); } -void CLCD::CommandFifo::memcpy (uint32_t dst, uint32_t src, uint32_t size) { +void CLCD::CommandFifo::memcpy(uint32_t dst, uint32_t src, uint32_t size) { struct { uint32_t type = CMD_MEMCPY; uint32_t dst; @@ -550,7 +550,7 @@ void CLCD::CommandFifo::memcpy (uint32_t dst, uint32_t src, uint32_t size) { cmd( &cmd_data, sizeof(cmd_data) ); } -void CLCD::CommandFifo::memcrc (uint32_t ptr, uint32_t num, uint32_t result) { +void CLCD::CommandFifo::memcrc(uint32_t ptr, uint32_t num, uint32_t result) { struct { uint32_t type = CMD_MEMCRC; uint32_t ptr; @@ -565,7 +565,7 @@ void CLCD::CommandFifo::memcrc (uint32_t ptr, uint32_t num, uint32_t result) { cmd( &cmd_data, sizeof(cmd_data) ); } -void CLCD::CommandFifo::memwrite (uint32_t ptr, uint32_t value) { +void CLCD::CommandFifo::memwrite(uint32_t ptr, uint32_t value) { struct { uint32_t type = CMD_MEMWRITE; uint32_t ptr; @@ -580,7 +580,7 @@ void CLCD::CommandFifo::memwrite (uint32_t ptr, uint32_t value) { cmd( &cmd_data, sizeof(cmd_data) ); } -void CLCD::CommandFifo::append (uint32_t ptr, uint32_t size) { +void CLCD::CommandFifo::append(uint32_t ptr, uint32_t size) { struct { uint32_t type = CMD_APPEND; uint32_t ptr; @@ -593,7 +593,7 @@ void CLCD::CommandFifo::append (uint32_t ptr, uint32_t size) { cmd( &cmd_data, sizeof(cmd_data) ); } -void CLCD::CommandFifo::inflate (uint32_t ptr) { +void CLCD::CommandFifo::inflate(uint32_t ptr) { struct { uint32_t type = CMD_INFLATE; uint32_t ptr; @@ -604,7 +604,7 @@ void CLCD::CommandFifo::inflate (uint32_t ptr) { cmd( &cmd_data, sizeof(cmd_data) ); } -void CLCD::CommandFifo::getptr (uint32_t result) { +void CLCD::CommandFifo::getptr(uint32_t result) { struct { uint32_t type = CMD_GETPTR; uint32_t result; @@ -696,7 +696,7 @@ void CLCD::CommandFifo::loadimage(uint32_t ptr, uint32_t options) { cmd( &cmd_data, sizeof(cmd_data) ); } -void CLCD::CommandFifo::getprops (uint32_t ptr, uint32_t width, uint32_t height) { +void CLCD::CommandFifo::getprops(uint32_t ptr, uint32_t width, uint32_t height) { struct { uint32_t type = CMD_GETPROPS; uint32_t ptr; @@ -735,7 +735,7 @@ void CLCD::CommandFifo::rotate(int32_t a) { cmd( &cmd_data, sizeof(cmd_data) ); } -void CLCD::CommandFifo::translate (int32_t tx, int32_t ty) { +void CLCD::CommandFifo::translate(int32_t tx, int32_t ty) { struct { uint32_t type = CMD_TRANSLATE; int32_t tx; @@ -749,7 +749,7 @@ void CLCD::CommandFifo::translate (int32_t tx, int32_t ty) { } #if FTDI_API_LEVEL >= 810 -void CLCD::CommandFifo::setbase (uint8_t base) { +void CLCD::CommandFifo::setbase(uint8_t base) { struct { int32_t type = CMD_SETBASE; uint32_t base; @@ -855,7 +855,7 @@ void CLCD::CommandFifo::playvideo(uint32_t options) { #endif #if FTDI_API_LEVEL >= 810 -void CLCD::CommandFifo::setrotate (uint8_t rotation) { +void CLCD::CommandFifo::setrotate(uint8_t rotation) { struct { uint32_t type = CMD_SETROTATE; uint32_t rotation; @@ -868,7 +868,7 @@ void CLCD::CommandFifo::setrotate (uint8_t rotation) { #endif #if FTDI_API_LEVEL >= 810 -void CLCD::CommandFifo::romfont (uint8_t font, uint8_t romslot) { +void CLCD::CommandFifo::romfont(uint8_t font, uint8_t romslot) { struct { uint32_t type = CMD_ROMFONT; uint32_t font; @@ -922,9 +922,8 @@ template bool CLCD::CommandFifo::_write_unaligned(T data, uint16_t len 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()."); - } + 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 */ @@ -933,7 +932,8 @@ template bool CLCD::CommandFifo::_write_unaligned(T data, uint16_t len if (command_read_ptr <= command_write_ptr) { bytes_tail = 4096U - command_write_ptr; bytes_head = command_read_ptr; - } else { + } + else { bytes_tail = command_read_ptr - command_write_ptr; bytes_head = 0; } @@ -1055,18 +1055,14 @@ 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(Use_Crystal ? CLKEXT : CLKINT, 0); host_cmd(FTDI::ACTIVE, 0); // Activate the System Clock + delay(40); // FTDI/BRT recommendation: no SPI traffic during startup. EVE needs at the very least 45ms to start, so leave her alone for a little while. + /* 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++) { + 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) @@ -1074,9 +1070,9 @@ void CLCD::init() { #endif break; } - else { + else delay(1); - } + if (counter == 249) { #if ENABLED(TOUCH_UI_DEBUG) SERIAL_ECHO_START(); @@ -1085,6 +1081,24 @@ void CLCD::init() { } } + /* make sure that all units are in working conditions, usually the touch-controller needs a little more time */ + for (counter = 0; counter < 100; counter++) { + uint8_t reset_status = mem_read_8(REG::CPURESET) & 0x03; + if (reset_status == 0x00) { + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_MSG("FTDI chip all units running "); + #endif + break; + } + else + delay(1); + + if (ENABLED(TOUCH_UI_DEBUG) && counter == 99) { + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR("Timeout waiting for reset status. Should be 0x00, got ", reset_status); + } + } + mem_write_8(REG::PWM_DUTY, 0); // turn off Backlight, Frequency already is set to 250Hz default /* Configure the FT8xx Registers */ @@ -1131,14 +1145,11 @@ void CLCD::init() { 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); + 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(); } @@ -1158,26 +1169,13 @@ 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 - } + CommandFifo cmd; + cmd.setrotate( + ENABLED(TOUCH_UI_MIRRORED) * 4 + + ENABLED(TOUCH_UI_PORTRAIT) * 2 + + ENABLED(TOUCH_UI_INVERTED) * 1 + ); + cmd.execute(); #elif ANY(TOUCH_UI_PORTRAIT, TOUCH_UI_MIRRORED) #error "PORTRAIT or MIRRORED orientation not supported on the FT800." #elif ENABLED(TOUCH_UI_INVERTED) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h index 0426911edb..1bb35a5995 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /**************************************************************************** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/constants.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/constants.h index 5f60881bdd..1e6642fedc 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/constants.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/constants.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /**************************************************************************** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/ftdi_basic.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/ftdi_basic.h index e8f9f424d0..75a2d54fca 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/ftdi_basic.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/ftdi_basic.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft800.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft800.h index ff17d019d7..11151a5741 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft800.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft800.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /**************************************************************************** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft810.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft810.h index 3e4044e194..7e3165c266 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft810.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft810.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /**************************************************************************** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h index 471530cadf..dd4be7a793 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp index 6621ea3cbf..d91d08fbfa 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_basic.h" @@ -27,8 +27,15 @@ /********************************* SPI Functions *********************************/ namespace FTDI { + #ifndef CLCD_USE_SOFT_SPI - SPISettings SPI::spi_settings(SPI_FREQUENCY, MSBFIRST, SPI_MODE0); + #ifdef CLCD_SPI_BUS + SPIClass EVE_SPI(CLCD_SPI_BUS); + #endif + #ifndef CLCD_HW_SPI_SPEED + #define CLCD_HW_SPI_SPEED 8000000 >> SPI_SPEED + #endif + SPISettings SPI::spi_settings(CLCD_HW_SPI_SPEED, MSBFIRST, SPI_MODE0); #endif void SPI::spi_init() { @@ -57,12 +64,12 @@ namespace FTDI { SET_INPUT_PULLUP(CLCD_SOFT_SPI_MISO); #else - ::SPI.begin(); + SPI_OBJ.begin(); #endif } #ifdef CLCD_USE_SOFT_SPI - uint8_t SPI::_soft_spi_xfer (uint8_t spiOutByte) { + uint8_t SPI::_soft_spi_xfer(uint8_t spiOutByte) { uint8_t spiIndex = 0x80; uint8_t spiInByte = 0; uint8_t k; @@ -71,8 +78,8 @@ namespace FTDI { 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 + if (READ(CLCD_SOFT_SPI_MISO)) spiInByte |= spiIndex; // MISO changes on the falling edge of clock, so sample it before WRITE(CLCD_SOFT_SPI_SCLK, 0); - if (READ(CLCD_SOFT_SPI_MISO)) spiInByte |= spiIndex; spiIndex >>= 1; } interrupts(); @@ -81,7 +88,7 @@ namespace FTDI { #endif #ifdef CLCD_USE_SOFT_SPI - void SPI::_soft_spi_send (uint8_t spiOutByte) { + void SPI::_soft_spi_send(uint8_t spiOutByte) { uint8_t k, spiIndex = 0x80; noInterrupts(); @@ -95,16 +102,12 @@ namespace FTDI { } #endif - void SPI::spi_read_bulk (void *data, uint16_t len) { + 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 + while (len--) *p++ = spi_recv(); } - bool SPI::spi_verify_bulk (const void *data, uint16_t len) { + 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; @@ -113,7 +116,7 @@ namespace FTDI { // CLCD SPI - Chip Select void SPI::spi_ftdi_select() { #ifndef CLCD_USE_SOFT_SPI - ::SPI.beginTransaction(spi_settings); + SPI_OBJ.beginTransaction(spi_settings); #endif WRITE(CLCD_SPI_CS, 0); #ifdef CLCD_SPI_EXTRA_CS @@ -129,25 +132,25 @@ namespace FTDI { WRITE(CLCD_SPI_EXTRA_CS, 1); #endif #ifndef CLCD_USE_SOFT_SPI - ::SPI.endTransaction(); + SPI_OBJ.endTransaction(); #endif } #ifdef SPI_FLASH_SS // Serial SPI Flash SPI - Chip Select - void SPI::spi_flash_select () { + void SPI::spi_flash_select() { #ifndef CLCD_USE_SOFT_SPI - ::SPI.beginTransaction(spi_settings); + SPI_OBJ.beginTransaction(spi_settings); #endif WRITE(SPI_FLASH_SS, 0); delayMicroseconds(1); } // Serial SPI Flash SPI - Chip Deselect - void SPI::spi_flash_deselect () { + void SPI::spi_flash_deselect() { WRITE(SPI_FLASH_SS, 1); #ifndef CLCD_USE_SOFT_SPI - ::SPI.endTransaction(); + SPI_OBJ.endTransaction(); #endif } #endif diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h index 38f0e35d5a..30ec786c60 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once @@ -27,6 +27,14 @@ #endif namespace FTDI { + + #if !defined(CLCD_SPI_BUS) || defined(CLCD_USE_SOFT_SPI) + #define SPI_OBJ ::SPI + #else + extern SPIClass EVE_SPI; + #define SPI_OBJ EVE_SPI + #endif + namespace SPI { #ifndef CLCD_USE_SOFT_SPI extern SPISettings spi_settings; @@ -47,7 +55,7 @@ namespace FTDI { #ifdef CLCD_USE_SOFT_SPI return _soft_spi_xfer(0x00); #else - return ::SPI.transfer(0x00); + return SPI_OBJ.transfer(0x00); #endif }; @@ -55,7 +63,7 @@ namespace FTDI { #ifdef CLCD_USE_SOFT_SPI _soft_spi_send(val); #else - ::SPI.transfer(val); + SPI_OBJ.transfer(val); #endif }; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h index 3023a1c6bc..436c67edf2 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h @@ -12,7 +12,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once @@ -206,14 +206,58 @@ // 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 EITHER(A,B) (ENABLED(A) || ENABLED(B)) - #define BOTH(A,B) (ENABLED(A) && ENABLED(B)) - #define NONE(A,B) (DISABLED(A) && DISABLED(B)) + #define _CAT(a,V...) a##V + #define CAT(a,V...) _CAT(a,V) + + #define FIRST(a,...) a + #define SECOND(a,b,...) b + #define THIRD(a,b,c,...) c + + #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 _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) + + #define _ISENA_ ~,1 + #define _ISENA_1 ~,1 + #define _ISENA_0x1 ~,1 + #define _ISENA_true ~,1 + #define _ISENA(V...) IS_PROBE(V) + #define _ENA_1(O) _ISENA(CAT(_IS,CAT(ENA_, O))) + #define _DIS_1(O) NOT(_ENA_1(O)) + #define ENABLED(V...) DO(ENA,&&,V) + #define DISABLED(V...) DO(DIS,&&,V) + + #define TERN(O,A,B) _TERN(_ENA_1(O),B,A) // OPTION converted to '0' or '1' + #define TERN0(O,A) _TERN(_ENA_1(O),0,A) // OPTION converted to A or '0' + #define TERN1(O,A) _TERN(_ENA_1(O),1,A) // OPTION converted to A or '1' + #define TERN_(O,A) _TERN(_ENA_1(O),,A) // OPTION converted to A or '' + #define _TERN(E,V...) __TERN(_CAT(T_,E),V) // Prepend 'T_' to get 'T_0' or 'T_1' + #define __TERN(T,V...) ___TERN(_CAT(_NO,T),V) // Prepend '_NO' to get '_NOT_0' or '_NOT_1' + #define ___TERN(P,V...) THIRD(P,V) // If first argument has a comma, A. Else B. + + #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) // Remove compiler warning on an unused variable #ifndef UNUSED diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/bitmap_info.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/bitmap_info.h index 2a095c3445..b763c890c2 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/bitmap_info.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/bitmap_info.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp index 08d2082020..7224b681bb 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h index b045ca203a..94ccbb7a60 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once @@ -78,7 +78,8 @@ class CommandProcessor : public CLCD::CommandFifo { y += (h - th) / 2; w -= tracker ? th * 5.0 : th * 2; h = th; - } else { + } + else { x += (w - th) / 2; y += tracker ? th * 2.5 : th; w = th; @@ -254,7 +255,8 @@ class CommandProcessor : public CLCD::CommandFifo { if (is_tracking) { if (FTDI::EventLoop::is_touch_held()) { return CLCD::get_tracker(value); - } else { + } + else { CLCD::CommandFifo::track(0, 0, 0, 0, 0); CLCD::CommandFifo::execute(); is_tracking = false; @@ -313,13 +315,14 @@ class CommandProcessor : public CLCD::CommandFifo { #ifdef TOUCH_UI_USE_UTF8 const bool is_utf8 = has_utf8_chars(text); #endif - for (;font >= 26;) { + 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 + } + else #endif { CLCD::FontMetrics fm(font); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp index 9a55c55ae6..728e433154 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h index f025b6a18d..4ae4bce3ef 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once @@ -33,10 +33,10 @@ * DLCache dlcache(UNIQUE_ID); * * if (dlcache.hasData()) { - * dlcache.append(); + * dlcache.append(); * } else { - * // Add stuff to the DL - * dlcache.store(); + * // Add stuff to the DL + * dlcache.store(); * } */ class DLCache { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp index b338758ed1..9c5599ebe8 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_extended.h" @@ -140,15 +140,12 @@ namespace FTDI { 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 { + // 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 = (lastScreen != current_screen.getScreen()); + } + else { touch_timer.start(); } break; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.h index 7eeea9c815..d9bede92df 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h index 329bea46f1..e1904511b2 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h index ec8154b22f..1975d36af7 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h index 4560996da7..7da6213211 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/rgb_t.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/rgb_t.h index fde5052873..2b18244e22 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/rgb_t.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/rgb_t.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp index ec1c0d1cbb..bebee5467d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h index f1ec4fc476..972c38395b 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once @@ -209,7 +209,8 @@ class CachedScreen { if (dlcache.has_data()) { dlcache.append(); - } else { + } + else { #ifdef TOUCH_UI_USE_UTF8 load_utf8_bitmaps(cmd); #endif diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h index a53ed95159..fbdfe2fe99 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once @@ -30,9 +30,9 @@ class SoundList { public: static const uint8_t n; static inline const char* name(uint8_t val) { - return (const char* ) pgm_read_ptr_near(&list[val].name); + return (const char* ) pgm_read_ptr_far(&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); + return (FTDI::SoundPlayer::sound_t*) pgm_read_ptr_far(&list[val].data); } }; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp index a6d84dde5f..6a5b6e3cf8 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_extended.h" @@ -98,7 +98,8 @@ namespace FTDI { if (ms == 0 && fx == SILENCE && nt == END_SONG) { sequence = 0; play(SILENCE, REST); - } else { + } + else { wait = ms; timer.start(); play(fx, nt); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h index e177ec57df..e2650b10ae 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp index 75a445a926..9600bd1289 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.h index a0f99c6b08..261995147c 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp index c7b35e92df..58ec96ac15 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.h index 9db9127529..700da7bcf2 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp index 87baeb6d20..c5126721ab 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../ftdi_extended.h" @@ -45,7 +45,8 @@ namespace FTDI { cmd.cmd(BITMAP_HANDLE(handle)); cmd.cmd(CELL(cell)); cmd.cmd(VERTEX2F(x * 16, y * 16)); - } else { + } + else { cmd.cmd(VERTEX2II(x, y, handle, cell)); } } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h index 85ece6b774..f1e22e17dd 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.cpp index c449f11537..733cf8f660 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.cpp @@ -16,12 +16,12 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../ftdi_extended.h" -#if defined(FTDI_EXTENDED) && ENABLED(TOUCH_UI_USE_UTF8) +#if BOTH(FTDI_EXTENDED, TOUCH_UI_USE_UTF8) namespace FTDI { // Returns the height of a standard FTDI romfont diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.h index 9cf6c181f5..f5bf644ef9 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp index fb049aee3b..b50c12fc6d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp @@ -16,12 +16,12 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../ftdi_extended.h" -#if defined(FTDI_EXTENDED) && ENABLED(TOUCH_UI_USE_UTF8) +#if BOTH(FTDI_EXTENDED, TOUCH_UI_USE_UTF8) constexpr static uint8_t std_font = 31; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h index 17ccfe6e30..7decdfd38f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ namespace FTDI { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp index d717f7f154..09473c1c26 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp @@ -16,12 +16,12 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../ftdi_extended.h" -#if defined(FTDI_EXTENDED) && ENABLED(TOUCH_UI_USE_UTF8) +#if BOTH(FTDI_EXTENDED, TOUCH_UI_USE_UTF8) using namespace FTDI; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h index fedb89d172..16f7e197b5 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp index e2ce15dc8f..4aa2580c63 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp @@ -16,12 +16,12 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../ftdi_extended.h" -#if defined(FTDI_EXTENDED) && BOTH(TOUCH_UI_USE_UTF8, TOUCH_UI_UTF8_WESTERN_CHARSET) +#if ALL(FTDI_EXTENDED, TOUCH_UI_USE_UTF8, TOUCH_UI_UTF8_WESTERN_CHARSET) #include "western_char_set_bitmap_31.h" @@ -45,81 +45,81 @@ 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 + #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; + constexpr int8_t mid_a = 12, + mid_e = 12, + mid_i = 5, + mid_o = 12, + mid_u = 12, + mid_y = 11, + mid_n = 12, + mid_c = 12, + mid_A = 13, + mid_E = 13, + mid_I = 6, + mid_O = 14, + mid_U = 14, + mid_Y = 13, + mid_N = 15, + mid_C = 13; /* Centerline of accent glyphs */ @@ -144,148 +144,148 @@ 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 + #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} }; @@ -424,7 +424,8 @@ accent_char = 0; if (c == UTF8('°')) x -= fs.scale(deg_sign_leading); - } else { + } + else { // Regular character with accent: accent_dx = alt_data - mid_accent; accent_dy = isupper(std_char) ? -7 : 0; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h index 704de95088..2adad2327a 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ namespace FTDI { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h index 64a14121d9..37e03238e0 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/bitmap2cpp.py b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/bitmap2cpp.py index c295dfc5b8..a7de06d68b 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/bitmap2cpp.py +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/bitmap2cpp.py @@ -13,7 +13,7 @@ # GNU General Public License for more details. # # To view a copy of the GNU General Public License, go to the following -# location: . +# location: . from __future__ import print_function from PIL import Image diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/circular_progress.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/circular_progress.h index da6a2bc325..5357de3ef3 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/circular_progress.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/circular_progress.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/poly_ui.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/poly_ui.h index 9f531146e1..3abc6fca2d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/poly_ui.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/poly_ui.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once @@ -92,7 +92,8 @@ class PolyReader { close_loop(); else p = NULL; - } else { + } + else { x = pgm_read_word_far(p++); if (x == eol) close_loop(); @@ -225,7 +226,8 @@ class DeduplicatedPolyReader : public POLY_READER { } 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 { + } + else { last_x = POLY_READER::x; last_y = POLY_READER::y; } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py index 2778f94d98..da08014e89 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py @@ -13,7 +13,7 @@ # GNU General Public License for more details. # # To view a copy of the GNU General Public License, go to the following -# location: . +# location: . from __future__ import print_function import argparse, re, sys @@ -56,7 +56,7 @@ header = ''' * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/ftdi_eve_lib.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/ftdi_eve_lib.h index 5a7d3c960b..5c1a74f66e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/ftdi_eve_lib.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/ftdi_eve_lib.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.cpp index 624c58576c..912c95731d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.h index 54f8439933..873e84455a 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h index ebd60aed31..b00c836ce4 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once @@ -74,7 +74,7 @@ namespace Language_en { PROGMEM Language_Str MSG_LICENSE = u8"This program is free software: you can redistribute it and/or modify it under the terms of " "the GNU General Public License as published by the Free Software Foundation, either version 3 " "of the License, or (at your option) any later version.\n\nTo view a copy of the GNU General " - "Public License, go to the following location: http://www.gnu.org/licenses."; + "Public License, go to the following location: https://www.gnu.org/licenses."; 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"; @@ -147,6 +147,8 @@ namespace Language_en { 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"; PROGMEM Language_Str MSG_AUTOLEVEL_X_AXIS = u8"Level X Axis"; + PROGMEM Language_Str MSG_BED_MAPPING_DONE = u8"Bed mapping finished"; + PROGMEM Language_Str MSG_RESET_BLTOUCH = u8"Reset BLTouch"; #ifdef TOUCH_UI_LULZBOT_BIO PROGMEM Language_Str MSG_MOVE_TO_HOME = u8"Move to Home"; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp index bed32cc606..a9b4ec6cd8 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "compat.h" @@ -51,12 +51,17 @@ namespace ExtUI { } 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) + if (isPrintingFromMedia()) { + stopPrint(); + InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FAILED); } + else + sound.play(media_removed, PLAY_ASYNCHRONOUS); + + if (AT_SCREEN(StatusScreen) || isPrintingFromMedia()) + StatusScreen::setStatusMessage(GET_TEXT_F(MSG_MEDIA_REMOVED)); + + if (AT_SCREEN(FilesScreen)) GOTO_SCREEN(StatusScreen) } void onMediaError() { @@ -127,7 +132,12 @@ namespace ExtUI { } #if HAS_LEVELING && HAS_MESH - void onMeshUpdate(const int8_t, const int8_t, const float) { + void onMeshUpdate(const int8_t x, const int8_t y, const float val) { + BedMeshScreen::onMeshUpdate(x, y, val); + } + + void onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::probe_state_t state) { + BedMeshScreen::onMeshUpdate(x, y, state); } #endif @@ -140,19 +150,19 @@ namespace ExtUI { #if HAS_PID_HEATING void onPidTuning(const result_t rst) { // Called for temperature PID tuning result - SERIAL_ECHOLNPAIR("OnPidTuning:", rst); + //SERIAL_ECHOLNPAIR("OnPidTuning:", rst); switch (rst) { case PID_BAD_EXTRUDER_NUM: - StatusScreen::setStatusMessage(STR_PID_BAD_EXTRUDER_NUM); + StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PID_BAD_EXTRUDER_NUM)); break; case PID_TEMP_TOO_HIGH: - StatusScreen::setStatusMessage(STR_PID_TEMP_TOO_HIGH); + StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH)); break; case PID_TUNING_TIMEOUT: - StatusScreen::setStatusMessage(STR_PID_TIMEOUT); + StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PID_TIMEOUT)); break; case PID_DONE: - StatusScreen::setStatusMessage(STR_PID_AUTOTUNE_FINISHED); + StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PID_AUTOTUNE_DONE)); break; } GOTO_SCREEN(StatusScreen); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/pin_mappings.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/pin_mappings.h index b5b0f22e11..5ad84c60b0 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/pin_mappings.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/pin_mappings.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once @@ -27,39 +27,35 @@ * without adding new pin definitions to the board. */ -#ifdef S6_TFT_PINMAP - #ifndef __MARLIN_FIRMWARE__ - #error "This pin mapping requires Marlin." - #endif +#include "../../../../inc/MarlinConfig.h" - #define CLCD_SPI_CS PC7 - #define CLCD_MOD_RESET PC6 -#endif +#if ENABLED(F6_TFT_PINMAP) // FYSETC F6 - ATmega2560 -#ifdef CR10_TFT_PINMAP - #ifndef __MARLIN_FIRMWARE__ - #error "This pin mapping requires Marlin." - #endif + #define CLCD_SPI_CS 33 + #define CLCD_MOD_RESET 31 + +#elif ENABLED(S6_TFT_PINMAP) // FYSETC S6 - STM32F4 + + #define CLCD_SPI_CS PC7 + #define CLCD_MOD_RESET PC6 + +#elif ENABLED(CR10_TFT_PINMAP) // FYSETC S6 - STM32F4 - with TOUCH_UI_ULTIPANEL #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 + #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 -/** - * The AlephObjects pinout for re-purposing the UltraLCD - * connector EXP1 for software SPI (rev B, obsolete) - */ +#elif ENABLED(AO_EXP1_DEPRECATED_PINMAP) -#ifdef AO_EXP1_DEPRECATED_PINMAP - #ifndef __MARLIN_FIRMWARE__ - #error "This pin mapping requires Marlin." - #endif + /** + * This AlephObjects pinout re-purposes the UltraLCD + * connector EXP1 for Software SPI (rev B, obsolete) + */ #define CLCD_MOD_RESET LCD_PINS_D4 #define CLCD_SPI_CS LCD_PINS_D5 @@ -72,34 +68,30 @@ #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. - */ +#elif ENABLED(AO_EXP1_PINMAP) -#ifdef AO_EXP1_PINMAP - #ifndef __MARLIN_FIRMWARE__ - #error "This pin mapping requires Marlin." - #endif + /** + * AO_EXP1_PINMAP with TOUCH_UI_ULTIPANEL + * + * This AlephObjects mapping re-purposes 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. + */ #define CLCD_MOD_RESET LCD_PINS_ENABLE #define CLCD_SPI_CS LCD_PINS_D4 @@ -108,49 +100,45 @@ #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 allows daisy-chaining of the - * display and SD/USB on EXP2, except for [2] - * - * [2] The Ultimachine Einsy boards have a level shifter - * on MISO enabled by SD_CSEL chip select, hence it - * is not possible to run both the display and the - * 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. - */ +#elif ENABLED(AO_EXP2_PINMAP) -#ifdef AO_EXP2_PINMAP - #ifndef __MARLIN_FIRMWARE__ - #error "This pin mapping requires Marlin." - #endif + /** + * AO_EXP2_PINMAP with TOUCH_UI_ULTIPANEL + * + * 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 allows daisy-chaining of the + * display and SD/USB on EXP2, except for [2] + * + * [2] The Ultimachine Einsy boards have a level shifter + * on MISO enabled by SD_CSEL chip select, hence it + * is not possible to run both the display and the + * 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. + */ #define CLCD_SPI_CS BTN_EN1 #define CLCD_MOD_RESET BTN_EN2 - #if MB(EINSY_RAMBO, EINSY_RETRO) && DISABLED(SDSUPPORT) #define CLCD_SPI_EXTRA_CS SDSS #endif + #endif diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp index 70acc09071..47a35cd0a8 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -55,9 +55,11 @@ void AboutScreen::onRedraw(draw_mode_t) { #define _INSET_POS(x,y,w,h) x + w/10, y, w - w/5, h #define INSET_POS(pos) _INSET_POS(pos) - char about_str[ - strlen_P(GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2)) + - strlen_P(TOOLHEAD_NAME) + 1 + char about_str[1 + + strlen_P(GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2)) + #ifdef TOOLHEAD_NAME + + strlen_P(TOOLHEAD_NAME) + #endif ]; #ifdef TOOLHEAD_NAME // If MSG_ABOUT_TOUCH_PANEL_2 has %s, substitute in the toolhead name. @@ -78,7 +80,13 @@ void AboutScreen::onRedraw(draw_mode_t) { #endif , OPT_CENTER, font_xlarge ); - draw_text_box(cmd, FW_VERS_POS, progmem_str(getFirmwareName_str()), OPT_CENTER, font_medium); + draw_text_box(cmd, FW_VERS_POS, + #ifdef TOUCH_UI_VERSION + F(TOUCH_UI_VERSION) + #else + progmem_str(getFirmwareName_str()) + #endif + , OPT_CENTER, font_medium); draw_text_box(cmd, FW_INFO_POS, about_str, OPT_CENTER, font_medium); draw_text_box(cmd, INSET_POS(LICENSE_POS), GET_TEXT_F(MSG_LICENSE), OPT_CENTER, font_tiny); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp index 57137c5d4a..12bfe5e68d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -38,7 +38,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { } #ifdef TOUCH_UI_PORTRAIT - #if HAS_CASE_LIGHT || ENABLED(SENSORLESS_HOMING) + #if EITHER(HAS_CASE_LIGHT, SENSORLESS_HOMING) #define GRID_ROWS 9 #else #define GRID_ROWS 8 @@ -59,7 +59,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { #define BACKLASH_POS BTN_POS(2,7), BTN_SIZE(1,1) #define CASE_LIGHT_POS BTN_POS(1,8), BTN_SIZE(1,1) #define TMC_HOMING_THRS_POS BTN_POS(2,8), BTN_SIZE(1,1) - #if HAS_CASE_LIGHT || ENABLED(SENSORLESS_HOMING) + #if EITHER(HAS_CASE_LIGHT, SENSORLESS_HOMING) #define BACK_POS BTN_POS(1,9), BTN_SIZE(2,1) #else #define BACK_POS BTN_POS(1,8), BTN_SIZE(2,1) @@ -89,42 +89,18 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { CommandProcessor cmd; cmd.colors(normal_btn) .font(Theme::font_medium) - .enabled( - #if HAS_BED_PROBE - 1 - #endif - ) + .enabled(ENABLED(HAS_BED_PROBE)) .tag(2) .button( ZPROBE_ZOFFSET_POS, GET_TEXT_F(MSG_ZPROBE_ZOFFSET)) - .enabled( - #if HAS_CASE_LIGHT - 1 - #endif - ) + .enabled(ENABLED(HAS_CASE_LIGHT)) .tag(16).button( CASE_LIGHT_POS, GET_TEXT_F(MSG_CASE_LIGHT)) .tag(3) .button( STEPS_PER_MM_POS, GET_TEXT_F(MSG_STEPS_PER_MM)) - .enabled( - #if HAS_TRINAMIC_CONFIG - 1 - #endif - ) + .enabled(ENABLED(HAS_TRINAMIC_CONFIG)) .tag(13).button( TMC_CURRENT_POS, GET_TEXT_F(MSG_TMC_CURRENT)) - .enabled( - #if ENABLED(SENSORLESS_HOMING) - 1 - #endif - ) + .enabled(ENABLED(SENSORLESS_HOMING)) .tag(14).button( TMC_HOMING_THRS_POS, GET_TEXT_F(MSG_TMC_HOMING_THRS)) - .enabled( - #if HOTENDS > 1 - 1 - #endif - ) - .tag(4) .button( OFFSETS_POS, GET_TEXT_F(MSG_OFFSETS_MENU)) - .enabled( - #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) - 1 - #endif - ) + .enabled(EITHER(HAS_MULTI_HOTEND, BLTOUCH)) + .tag(4) .button( OFFSETS_POS, GET_TEXT_F(TERN(HAS_MULTI_HOTEND, MSG_OFFSETS_MENU, MSG_RESET_BLTOUCH))) + .enabled(EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)) .tag(11).button( FILAMENT_POS, GET_TEXT_F(MSG_FILAMENT)) .tag(12).button( ENDSTOPS_POS, GET_TEXT_F(MSG_LCD_ENDSTOPS)) .tag(15).button( DISPLAY_POS, GET_TEXT_F(MSG_DISPLAY_MENU)) @@ -132,18 +108,8 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { .tag(10).button( RESTORE_DEFAULTS_POS, GET_TEXT_F(MSG_RESTORE_DEFAULTS)) .tag(5) .button( VELOCITY_POS, GET_TEXT_F(MSG_VELOCITY)) .tag(6) .button( ACCELERATION_POS, GET_TEXT_F(MSG_ACCELERATION)) - .tag(7) .button( JERK_POS, GET_TEXT_F( - #if DISABLED(CLASSIC_JERK) - MSG_JUNCTION_DEVIATION - #else - JERK_POS - #endif - )) - .enabled( - #if ENABLED(BACKLASH_GCODE) - 1 - #endif - ) + .tag(7) .button( JERK_POS, GET_TEXT_F(TERN(HAS_JUNCTION_DEVIATION, MSG_JUNCTION_DEVIATION, MSG_JERK))) + .enabled(ENABLED(BACKLASH_GCODE)) .tag(8).button( BACKLASH_POS, GET_TEXT_F(MSG_BACKLASH)) .colors(action_btn) .tag(1).button( BACK_POS, GET_TEXT_F(MSG_BACK)); @@ -152,27 +118,25 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) { switch (tag) { - case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; + case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; #if HAS_BED_PROBE - case 2: GOTO_SCREEN(ZOffsetScreen); break; + 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); + case 3: GOTO_SCREEN(StepsScreen); break; + case 4: + #if HAS_MULTI_HOTEND + GOTO_SCREEN(NozzleOffsetScreen); + #elif ENABLED(BLTOUCH) + injectCommands_P(PSTR("M280 P0 S60")); #endif break; + case 5: GOTO_SCREEN(MaxVelocityScreen); break; + case 6: GOTO_SCREEN(DefaultAccelerationScreen); break; + case 7: GOTO_SCREEN(TERN(HAS_JUNCTION_DEVIATION, JunctionDeviationScreen, JerkScreen)); break; #if ENABLED(BACKLASH_GCODE) - case 8: GOTO_SCREEN(BacklashCompensationScreen); break; + case 8: GOTO_SCREEN(BacklashCompensationScreen); break; #endif - case 9: GOTO_SCREEN(InterfaceSettingsScreen); LockScreen::check_passcode(); break; + 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; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/alert_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/alert_dialog_box.cpp index 17750c02ec..bd09d2a5cd 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/alert_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/alert_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/backlash_compensation_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/backlash_compensation_screen.cpp index 0d6b97d46a..8d65518455 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/backlash_compensation_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/backlash_compensation_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp index 3e3f1d48a2..1c4ef594bb 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -73,13 +73,13 @@ void BaseNumericAdjustmentScreen::widgets_t::_button_style(CommandProcessor &cmd const btn_colors *old_colors = &normal_btn; const btn_colors *new_colors = &normal_btn; - switch(_style) { + 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) { + 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; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp index 7e88b7883a..c84dd45f00 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -46,7 +46,7 @@ bool BaseScreen::buttonStyleCallback(CommandProcessor &cmd, uint8_t tag, uint8_t return false; } - #if LCD_TIMEOUT_TO_STATUS + #if LCD_TIMEOUT_TO_STATUS > 0 if (EventLoop::get_pressed_tag() != 0) { reset_menu_timeout(); } @@ -66,7 +66,7 @@ bool BaseScreen::buttonStyleCallback(CommandProcessor &cmd, uint8_t tag, uint8_t } void BaseScreen::onIdle() { - #if LCD_TIMEOUT_TO_STATUS + #if LCD_TIMEOUT_TO_STATUS > 0 if ((millis() - last_interaction) > LCD_TIMEOUT_TO_STATUS) { reset_menu_timeout(); #if ENABLED(TOUCH_UI_DEBUG) @@ -78,12 +78,12 @@ void BaseScreen::onIdle() { } void BaseScreen::reset_menu_timeout() { - #if LCD_TIMEOUT_TO_STATUS + #if LCD_TIMEOUT_TO_STATUS > 0 last_interaction = millis(); #endif } -#if LCD_TIMEOUT_TO_STATUS +#if LCD_TIMEOUT_TO_STATUS > 0 uint32_t BaseScreen::last_interaction; #endif diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp new file mode 100644 index 0000000000..f8a30e8241 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp @@ -0,0 +1,306 @@ +/*********************** + * bed_mesh_screen.cpp * + ***********************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2020 * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT 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, HAS_MESH) + +#include "screens.h" +#include "screen_data.h" + +using namespace FTDI; +using namespace Theme; +using namespace ExtUI; + +#ifdef TOUCH_UI_PORTRAIT + #define GRID_COLS 2 + #define GRID_ROWS 10 + + #define MESH_POS BTN_POS(1, 2), BTN_SIZE(2,5) + #define MESSAGE_POS BTN_POS(1, 7), BTN_SIZE(2,1) + #define Z_LABEL_POS BTN_POS(1, 8), BTN_SIZE(1,1) + #define Z_VALUE_POS BTN_POS(2, 8), BTN_SIZE(1,1) + #define OKAY_POS BTN_POS(1,10), BTN_SIZE(2,1) +#else + #define GRID_COLS 5 + #define GRID_ROWS 5 + + #define MESH_POS BTN_POS(1,1), BTN_SIZE(3,5) + #define MESSAGE_POS BTN_POS(4,1), BTN_SIZE(2,1) + #define Z_LABEL_POS BTN_POS(4,2), BTN_SIZE(2,1) + #define Z_VALUE_POS BTN_POS(4,3), BTN_SIZE(2,1) + #define OKAY_POS BTN_POS(4,5), BTN_SIZE(2,1) +#endif + +void BedMeshScreen::drawMesh(int16_t x, int16_t y, int16_t w, int16_t h, ExtUI::bed_mesh_t data, uint8_t opts, float autoscale_max) { + constexpr uint8_t rows = GRID_MAX_POINTS_Y; + constexpr uint8_t cols = GRID_MAX_POINTS_X; + + #define VALUE(X,Y) (data ? data[X][Y] : 0) + #define ISVAL(X,Y) (data ? !isnan(VALUE(X,Y)) : true) + #define HEIGHT(X,Y) (ISVAL(X,Y) ? (VALUE(X,Y) - val_min) * scale_z : 0) + + // Compute the mean, min and max for the points + + float val_mean = 0; + float val_max = -INFINITY; + float val_min = INFINITY; + uint8_t val_cnt = 0; + + if (data && (opts & USE_AUTOSCALE)) { + for (uint8_t y = 0; y < rows; y++) { + for (uint8_t x = 0; x < cols; x++) { + if (ISVAL(x,y)) { + const float val = VALUE(x,y); + val_mean += val; + val_max = max(val_max, val); + val_min = min(val_min, val); + val_cnt++; + } + } + } + } + if (val_cnt) { + val_mean /= val_cnt; + } else { + val_mean = 0; + val_min = 0; + val_max = 0; + } + + const float scale_z = ((val_max == val_min) ? 1 : 1/(val_max - val_min)) * autoscale_max; + + // These equations determine the appearance of the grid on the screen. + + #define TRANSFORM_5(X,Y,Z) (X), (Y) // No transform + #define TRANSFORM_4(X,Y,Z) TRANSFORM_5((X)/(Z),(Y)/-(Z), 0) // Perspective + #define TRANSFORM_3(X,Y,Z) TRANSFORM_4((X), (Z), (Y)) // Swap Z and Y + #define TRANSFORM_2(X,Y,Z) TRANSFORM_3((X), (Y) + 2.5, (Z) - 1) // Translate + #define TRANSFORM(X,Y,Z) TRANSFORM_2(float(X)/(cols-1) - 0.5, float(Y)/(rows-1) - 0.5, (Z)) // Normalize + + // Compute the bounding box for the grid prior to scaling. Do this at compile-time by + // transforming the four corner points via the transformation equations and finding + // the min and max for each axis. + + constexpr float bounds[][3] = {{TRANSFORM(0 , 0 , 0)}, + {TRANSFORM(cols-1, 0 , 0)}, + {TRANSFORM(0 , rows-1, 0)}, + {TRANSFORM(cols-1, rows-1, 0)}}; + #define APPLY(FUNC, AXIS) FUNC(FUNC(bounds[0][AXIS], bounds[1][AXIS]), FUNC(bounds[2][AXIS], bounds[3][AXIS])) + constexpr float grid_x = APPLY(min,0); + constexpr float grid_y = APPLY(min,1); + constexpr float grid_w = APPLY(max,0) - grid_x; + constexpr float grid_h = APPLY(max,1) - grid_y; + constexpr float grid_cx = grid_x + grid_w/2; + constexpr float grid_cy = grid_y + grid_h/2; + + // Figure out scale and offset such that the grid fits within the rectangle given by (x,y,w,h) + + const float scale_x = float(w)/grid_w; + const float scale_y = float(h)/grid_h; + const float center_x = x + w/2; + const float center_y = y + h/2; + + #undef TRANSFORM_5 + #define TRANSFORM_5(X,Y,Z) center_x + (X - grid_cx) * scale_x, center_y + (Y - grid_cy) * scale_y // Fit to bounds + + // Draw the grid + + const uint16_t basePointSize = min(w,h) / max(cols,rows); + + CommandProcessor cmd; + cmd.cmd(SAVE_CONTEXT()) + .cmd(VERTEX_FORMAT(0)) + .cmd(TAG_MASK(false)) + .cmd(SAVE_CONTEXT()); + + for (uint8_t y = 0; y < rows; y++) { + for (uint8_t x = 0; x < cols; x++) { + if (ISVAL(x,y)) { + const bool hasLeftSegment = x < cols - 1 && ISVAL(x+1,y); + const bool hasRightSegment = y < rows - 1 && ISVAL(x,y+1); + if (hasLeftSegment || hasRightSegment) { + cmd.cmd(BEGIN(LINE_STRIP)); + if (hasLeftSegment) cmd.cmd(VERTEX2F(TRANSFORM(x + 1, y , HEIGHT(x + 1, y )))); + cmd.cmd( VERTEX2F(TRANSFORM(x , y , HEIGHT(x , y )))); + if (hasRightSegment) cmd.cmd(VERTEX2F(TRANSFORM(x , y + 1, HEIGHT(x , y + 1)))); + } + } + } + + if (opts & USE_POINTS) { + const float sq_min = sq(val_min - val_mean); + const float sq_max = sq(val_max - val_mean); + cmd.cmd(POINT_SIZE(basePointSize * 2)); + cmd.cmd(BEGIN(POINTS)); + for (uint8_t x = 0; x < cols; x++) { + if (ISVAL(x,y)) { + if (opts & USE_COLORS) { + const float val_dev = VALUE(x, y) - val_mean; + const uint8_t neg_byte = sq(val_dev) / (val_dev < 0 ? sq_min : sq_max) * 0xFF; + const uint8_t pos_byte = 255 - neg_byte; + cmd.cmd(COLOR_RGB(pos_byte, pos_byte, 0xFF)); + } + cmd.cmd(VERTEX2F(TRANSFORM(x, y, HEIGHT(x, y)))); + } + } + if (opts & USE_COLORS) { + cmd.cmd(RESTORE_CONTEXT()) + .cmd(SAVE_CONTEXT()); + } + } + } + cmd.cmd(RESTORE_CONTEXT()) + .cmd(TAG_MASK(true)); + + if (opts & USE_TAGS) { + cmd.cmd(COLOR_MASK(false, false, false, false)) + .cmd(POINT_SIZE(basePointSize * 10)) + .cmd(BEGIN(POINTS)); + for (uint8_t y = 0; y < rows; y++) { + for (uint8_t x = 0; x < cols; x++) { + const uint8_t tag = pointToTag(x, y); + cmd.tag(tag).cmd(VERTEX2F(TRANSFORM(x, y, HEIGHT(x, y)))); + } + } + cmd.cmd(COLOR_MASK(true, true, true, true)); + } + + if (opts & USE_HIGHLIGHT) { + const uint8_t tag = screen_data.BedMeshScreen.highlightedTag; + uint8_t x, y; + if (tagToPoint(tag, x, y)) { + cmd.cmd(COLOR_A(128)) + .cmd(POINT_SIZE(basePointSize * 6)) + .cmd(BEGIN(POINTS)) + .tag(tag).cmd(VERTEX2F(TRANSFORM(x, y, HEIGHT(x, y)))); + } + } + cmd.cmd(END()); + cmd.cmd(RESTORE_CONTEXT()); +} + +uint8_t BedMeshScreen::pointToTag(uint8_t x, uint8_t y) { + return y * (GRID_MAX_POINTS_X) + x + 10; +} + +bool BedMeshScreen::tagToPoint(uint8_t tag, uint8_t &x, uint8_t &y) { + if (tag < 10) return false; + x = (tag - 10) % (GRID_MAX_POINTS_X); + y = (tag - 10) / (GRID_MAX_POINTS_X); + return true; +} + +void BedMeshScreen::onEntry() { + screen_data.BedMeshScreen.highlightedTag = 0; + screen_data.BedMeshScreen.count = 0; + BaseScreen::onEntry(); +} + +float BedMeshScreen::getHightlightedValue() { + if (screen_data.BedMeshScreen.highlightedTag) { + xy_uint8_t pt; + tagToPoint(screen_data.BedMeshScreen.highlightedTag, pt.x, pt.y); + return ExtUI::getMeshPoint(pt); + } + return NAN; +} + +void BedMeshScreen::drawHighlightedPointValue() { + char str[16]; + const float val = getHightlightedValue(); + const bool isGood = !isnan(val); + if (isGood) + dtostrf(val, 5, 3, str); + else + strcpy_P(str, PSTR("-")); + + CommandProcessor cmd; + cmd.font(Theme::font_medium) + .text(Z_LABEL_POS, GET_TEXT_F(MSG_MESH_EDIT_Z)) + .text(Z_VALUE_POS, str) + .colors(action_btn) + .tag(1).button( OKAY_POS, GET_TEXT_F(MSG_BUTTON_OKAY)) + .tag(0); +} + +void BedMeshScreen::onRedraw(draw_mode_t what) { + #define _INSET_POS(x,y,w,h) x + min(w,h)/10, y + min(w,h)/10, w - min(w,h)/5, h - min(w,h)/5 + #define INSET_POS(pos) _INSET_POS(pos) + + if (what & BACKGROUND) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)); + + // Draw the shadow and tags + cmd.cmd(COLOR_RGB(0x444444)); + BedMeshScreen::drawMesh(INSET_POS(MESH_POS), nullptr, USE_POINTS | USE_TAGS); + cmd.cmd(COLOR_RGB(bg_text_enabled)); + } + + if (what & FOREGROUND) { + constexpr float autoscale_max_amplitude = 0.03; + const bool levelingFinished = screen_data.BedMeshScreen.count >= GRID_MAX_POINTS; + const float levelingProgress = sq(float(screen_data.BedMeshScreen.count) / GRID_MAX_POINTS); + if (levelingFinished) { + drawHighlightedPointValue(); + CommandProcessor cmd; + cmd.font(Theme::font_medium) + .text(MESSAGE_POS, GET_TEXT_F(MSG_BED_MAPPING_DONE)); + } + + BedMeshScreen::drawMesh(INSET_POS(MESH_POS), ExtUI::getMeshArray(), + USE_POINTS | USE_HIGHLIGHT | USE_AUTOSCALE | (levelingFinished ? USE_COLORS : 0), + autoscale_max_amplitude * levelingProgress + ); + } +} + +bool BedMeshScreen::onTouchStart(uint8_t tag) { + screen_data.BedMeshScreen.highlightedTag = tag; + return true; +} + +bool BedMeshScreen::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: + GOTO_PREVIOUS(); + return true; + default: + return false; + } +} + +void BedMeshScreen::onMeshUpdate(const int8_t, const int8_t, const float) { + if (AT_SCREEN(BedMeshScreen)) + onRefresh(); +} + +void BedMeshScreen::onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::probe_state_t state) { + if (state == ExtUI::PROBE_FINISH) { + screen_data.BedMeshScreen.highlightedTag = pointToTag(x, y); + screen_data.BedMeshScreen.count++; + } + BedMeshScreen::onMeshUpdate(x, y, 0); +} + +#endif // TOUCH_UI_FTDI_EVE && HAS_MESH diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp index ed8bcee557..76ebdca587 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -58,7 +58,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { .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 + #if HAS_MULTI_HOTEND 1 #endif ) @@ -68,7 +68,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { .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) + #if HAS_JUNCTION_DEVIATION .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)) @@ -105,7 +105,7 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) { case 4: GOTO_SCREEN(StepperBumpSensitivityScreen); break; #endif case 5: GOTO_SCREEN(EndstopStatesScreen); break; - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND case 6: GOTO_SCREEN(NozzleOffsetScreen); break; #endif @@ -113,7 +113,7 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) { case 8: GOTO_SCREEN(MaxVelocityScreen); break; case 9: GOTO_SCREEN(DefaultAccelerationScreen); break; case 10: - #if DISABLED(CLASSIC_JERK) + #if HAS_JUNCTION_DEVIATION GOTO_SCREEN(JunctionDeviationScreen); #else GOTO_SCREEN(JerkScreen); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp index 79a6112e4f..da772971ce 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp index 3ae2d680ce..48ce320482 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp index 1f6aa45c17..e2bb8a2414 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_landscape.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_landscape.h index 1c7c02093d..9279fd7df0 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_landscape.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_landscape.h @@ -11,7 +11,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_portrait.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_portrait.h index 32f52f8e46..f03e3413f8 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_portrait.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_portrait.h @@ -11,7 +11,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp index 4013065086..c5e26da98a 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -102,12 +102,11 @@ bool BioPrintingDialogBox::onTouchEnd(uint8_t 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; + if (isPrinting()) + GOTO_SCREEN(ConfirmAbortPrintDialogBox); + else + GOTO_SCREEN(StatusScreen); + break; default: return false; } return true; @@ -136,9 +135,8 @@ void BioPrintingDialogBox::setStatusMessage(const char* message) { SERIAL_ECHOLNPAIR("New status message: ", message); #endif - if (AT_SCREEN(BioPrintingDialogBox)) { + if (AT_SCREEN(BioPrintingDialogBox)) current_screen.onRefresh(); - } } void BioPrintingDialogBox::onIdle() { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp index ec7f2bcffb..6d72fc92a2 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp @@ -18,7 +18,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -198,16 +198,14 @@ void StatusScreen::draw_temperature(draw_mode_t what) { 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) + const float fill_level = ( + #ifdef E_MAX_POS + 1.0 - min(1.0, max(0.0, getAxisPosition_mm(E0) / E_MAX_POS)) + #else + 0.75 #endif ); + const bool e_homed = TERN0(TOUCH_UI_LULZBOT_BIO, isAxisPositionKnown(E0)); CommandProcessor cmd; PolyUI ui(cmd, what); @@ -237,12 +235,8 @@ void StatusScreen::draw_syringe(draw_mode_t what) { } 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); + const bool e_homed = TERN1(TOUCH_UI_LULZBOT_BIO, isAxisPositionKnown(E0)), + z_homed = isAxisPositionKnown(Z); CommandProcessor cmd; PolyUI ui(cmd, what); @@ -299,12 +293,8 @@ void StatusScreen::draw_fine_motion(draw_mode_t what) { } 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); + const bool e_homed = TERN1(TOUCH_UI_LULZBOT_BIO, isAxisPositionKnown(E0)), + z_homed = isAxisPositionKnown(Z); CommandProcessor cmd; PolyUI ui(cmd, what); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp index 27312c733f..0d8d71b45c 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -50,11 +50,7 @@ void TuneMenu::onRedraw(draw_mode_t what) { .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 - ) + .enabled(TERN_(BABYSTEPPING, true)) .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)) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp index 5e022b58e7..2c2c0c6a18 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp @@ -18,7 +18,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -68,10 +68,10 @@ void BootScreen::onIdle() { InterfaceSettingsScreen::failSafeSettings(); StatusScreen::loadBitmaps(); + StatusScreen::setStatusMessage(GET_TEXT_F(WELCOME_MSG)); GOTO_SCREEN(TouchCalibrationScreen); current_screen.forget(); PUSH_SCREEN(StatusScreen); - StatusScreen::setStatusMessage(GET_TEXT_F(WELCOME_MSG)); } else { if (!UIFlashStorage::is_valid()) { StatusScreen::loadBitmaps(); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/case_light_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/case_light_screen.cpp index b82149c859..776a9fe5f7 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/case_light_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/case_light_screen.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp index 2b5963fdf6..afa3211a01 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -172,8 +172,8 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) { 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; + #if HAS_MULTI_HOTEND + const bool tog11 = screen_data.ChangeFilamentScreen.e_tag == 11; #endif #ifdef TOUCH_UI_PORTRAIT diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp index 933894259e..e23592a46e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_auto_calibration_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_auto_calibration_dialog_box.cpp index deae90fe93..974ce3a6e1 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_auto_calibration_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_auto_calibration_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_erase_flash_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_erase_flash_dialog_box.cpp index 1e16546003..574de21088 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_erase_flash_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_erase_flash_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_start_print_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_start_print_dialog_box.cpp index 5c691cb9a1..4e5b174d53 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_start_print_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_start_print_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -31,11 +31,6 @@ 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]; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp index cc132064ec..6b6affadd5 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp index 21be095f96..8496955f73 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp index b3b674ebd3..8e56c4197b 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp index 7f3a27e9e8..782ae7bbc7 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/display_tuning_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/display_tuning_screen.cpp index b449634b1a..8845dfb5c0 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/display_tuning_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/display_tuning_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp index 4510c93416..6044d0a951 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -92,12 +92,12 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) { PIN_DISABLED(5, 3, PSTR(STR_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) + PIN_ENABLED (1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT, FIL_RUNOUT_STATE) #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) + #if ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT2) && EXTRUDERS > 1 + PIN_ENABLED (3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2, FIL_RUNOUT_STATE) #else PIN_DISABLED(3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2) #endif diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/feedrate_percent_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/feedrate_percent_screen.cpp index bd8e648e11..2698708e51 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/feedrate_percent_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/feedrate_percent_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp index 3972a14ef9..575f75a74e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp index 9830123abb..f1808bf20e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -35,7 +35,7 @@ void FilamentRunoutScreen::onRedraw(draw_mode_t what) { w.heading( GET_TEXT_F(MSG_FILAMENT)); w.toggle( 2, GET_TEXT_F(MSG_RUNOUT_SENSOR), getFilamentRunoutEnabled()); - #ifdef FILAMENT_RUNOUT_DISTANCE_MM + #if HAS_FILAMENT_RUNOUT_DISTANCE extern const char NUL_STR[]; w.heading(GET_TEXT_F(MSG_RUNOUT_DISTANCE_MM)); w.units(GET_TEXT_F(MSG_UNITS_MM)); @@ -51,7 +51,7 @@ bool FilamentRunoutScreen::onTouchHeld(uint8_t tag) { const float increment = getIncrement(); switch (tag) { case 2: setFilamentRunoutEnabled(!getFilamentRunoutEnabled()); break; - #ifdef FILAMENT_RUNOUT_DISTANCE_MM + #if HAS_FILAMENT_RUNOUT_DISTANCE case 10: UI_DECREMENT(FilamentRunoutDistance_mm); break; case 11: UI_INCREMENT(FilamentRunoutDistance_mm); break; #endif diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp index d32ec4d07f..e304302422 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -89,11 +89,7 @@ void FilesScreen::drawFileButton(const char* filename, uint8_t tag, bool is_dir, cmd.cmd(MACRO(0)); } #endif - cmd.text (BTN_POS(1,header_h+line), BTN_SIZE(6,1), filename, OPT_CENTERY - #if ENABLED(SCROLL_LONG_FILENAMES) - | OPT_NOFIT - #endif - ); + cmd.text (BTN_POS(1,header_h+line), BTN_SIZE(6,1), filename, OPT_CENTERY | TERN0(SCROLL_LONG_FILENAMES, OPT_NOFIT)); if (is_dir) { cmd.text(BTN_POS(1,header_h+line), BTN_SIZE(6,1), F("> "), OPT_CENTERY | OPT_RIGHTX); } @@ -118,7 +114,8 @@ void FilesScreen::drawFileList() { for(uint8_t i = 0; i < files_per_page; i++, fileIndex++) { if (files.seek(fileIndex)) { drawFileButton(files.filename(), getTagForLine(i), files.isDir(), false); - } else { + } + else { break; } } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp index 4e165aa448..b52096a13b 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -74,7 +74,9 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) { #define EDGE_R 30 .font(font_small) .tag(0) + #if DISABLED(LCD_FYSETC_TFT81050) .text(BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_LCD_BRIGHTNESS), OPT_RIGHTX | OPT_CENTERY) + #endif .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); #if DISABLED(TOUCH_UI_NO_BOOTSCREEN) @@ -93,7 +95,9 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) { cmd.font(font_medium) #define EDGE_R 30 .colors(ui_slider) + #if DISABLED(LCD_FYSETC_TFT81050) .tag(2).slider(BTN_POS(3,2), BTN_SIZE(2,1), screen_data.InterfaceSettingsScreen.brightness, 128) + #endif .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()) @@ -157,7 +161,7 @@ void InterfaceSettingsScreen::onIdle() { CommandProcessor cmd; switch (cmd.track_tag(value)) { case 2: - screen_data.InterfaceSettingsScreen.brightness = float(value) * 128 / 0xFFFF; + screen_data.InterfaceSettingsScreen.brightness = max(11, (value * 128UL) / 0xFFFF); CLCD::set_brightness(screen_data.InterfaceSettingsScreen.brightness); SaveSettingsDialogBox::settingsChanged(); break; @@ -250,9 +254,7 @@ void InterfaceSettingsScreen::loadSettings(const char *buff) { 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 + TERN_(TOUCH_UI_DEVELOPER_MENU, StressTestScreen::startupCheck()); } #ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp index 48fae863a7..6c05c3a887 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/jerk_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/jerk_screen.cpp index c208014cc7..b96c2be7c8 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/jerk_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/jerk_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp index 034ac15c42..d365b12eb1 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp @@ -17,12 +17,12 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && DISABLED(CLASSIC_JERK) +#if BOTH(TOUCH_UI_FTDI_EVE, HAS_JUNCTION_DEVIATION) #include "screens.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/kill_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/kill_screen.cpp index 9c27ae6af5..d98324623c 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/kill_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/kill_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/language_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/language_menu.cpp index 8906a14cf0..5b4c1c9175 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/language_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/language_menu.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/linear_advance_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/linear_advance_screen.cpp index 0e35b45475..fb90ae1133 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/linear_advance_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/linear_advance_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp index f012a2218b..7854ce5e39 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -72,19 +72,11 @@ void LockScreen::onRedraw(draw_mode_t what) { 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 = passcode ? GET_TEXT_F(MSG_PASSCODE_REQUEST) : GET_TEXT_F(MSG_PASSCODE_SELECT); } message_style() = '\0'; // Terminate the string. - #ifdef TOUCH_UI_PORTRAIT - constexpr uint8_t l = 6; - #else - constexpr uint8_t l = 3; - #endif + constexpr uint8_t l = TERN(TOUCH_UI_PORTRAIT, 6, 3); const uint8_t pressed = EventLoop::get_pressed_tag(); @@ -144,7 +136,8 @@ void LockScreen::onPasscodeEntered() { onRefresh(); sound.play(twinkle, PLAY_SYNCHRONOUS); GOTO_PREVIOUS(); - } else { + } + else { message_style() = 'w'; onRefresh(); sound.play(sad_trombone, PLAY_SYNCHRONOUS); @@ -162,7 +155,8 @@ bool LockScreen::onTouchEnd(uint8_t tag) { // Backspace deletes previous entered characters. *--c = '_'; } - } else { + } + else { // Append character to passcode *c++ = tag; if (*c == '\0') { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp index 5d165edef0..12cb8d0891 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp @@ -18,7 +18,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -137,7 +137,7 @@ bool MainMenu::onTouchEnd(uint8_t tag) { 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) && HAS_CASE_LIGHT + #if BOTH(TOUCH_UI_COCOA_PRESS, HAS_CASE_LIGHT) case 7: GOTO_SCREEN(CaseLightScreen); break; #else case 7: GOTO_SCREEN(ChangeFilamentScreen); break; @@ -146,14 +146,18 @@ bool MainMenu::onTouchEnd(uint8_t tag) { #ifdef AXIS_LEVELING_COMMANDS case 9: SpinnerDialogBox::enqueueAndWait_P(F(AXIS_LEVELING_COMMANDS)); break; #endif - #ifdef HAS_LEVELING - case 10: SpinnerDialogBox::enqueueAndWait_P(F( - #ifdef BED_LEVELING_COMMANDS - BED_LEVELING_COMMANDS - #else - "G29" - #endif - )); break; + #if HAS_LEVELING + case 10: + #ifndef BED_LEVELING_COMMANDS + #define BED_LEVELING_COMMANDS "G29" + #endif + #if HAS_MESH + GOTO_SCREEN(BedMeshScreen); + injectCommands_P(PSTR(BED_LEVELING_COMMANDS)); + #else + SpinnerDialogBox::enqueueAndWait_P(F(BED_LEVELING_COMMANDS)); + #endif + break; #endif case 11: GOTO_SCREEN(AboutScreen); break; default: diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/max_acceleration_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/max_acceleration_screen.cpp index 8f7af4b81e..29ac2f1b40 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/max_acceleration_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/max_acceleration_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -38,16 +38,16 @@ void MaxAccelerationScreen::onRedraw(draw_mode_t what) { 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) + #if DISTINCT_E == 1 w.color(e_axis).adjuster( 8, GET_TEXT_F(MSG_AMAX_E), getAxisMaxAcceleration_mm_s2(E0) ); - #elif EXTRUDERS > 1 + #elif DISTINCT_E > 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 + #if DISTINCT_E > 2 w.color(e_axis).adjuster(12, F(LCD_STR_E2), getAxisMaxAcceleration_mm_s2(E2) ); #endif - #if EXTRUDERS > 3 + #if DISTINCT_E > 3 w.color(e_axis).adjuster(14, F(LCD_STR_E3), getAxisMaxAcceleration_mm_s2(E3) ); #endif #endif @@ -65,15 +65,15 @@ bool MaxAccelerationScreen::onTouchHeld(uint8_t tag) { 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) + #if DISTINCT_E > 1 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) + #if DISTINCT_E > 2 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) + #if DISTINCT_E > 3 case 14: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E3); break; case 15: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E3); break; #endif diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/max_velocity_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/max_velocity_screen.cpp index 864f6b735d..95e29c197d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/max_velocity_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/max_velocity_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -64,17 +64,19 @@ bool MaxVelocityScreen::onTouchHeld(uint8_t tag) { 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; + #if DISTINCT_E > 0 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) + #endif + #if DISTINCT_E > 1 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) + #if DISTINCT_E > 2 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) + #if DISTINCT_E > 3 case 14: UI_DECREMENT(AxisMaxFeedrate_mm_s, E3); break; case 15: UI_INCREMENT(AxisMaxFeedrate_mm_s, E3); break; #endif diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/media_player_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/media_player_screen.cpp index 95a4e6b44a..d7e476e04e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/media_player_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/media_player_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp index 4bf8ed190e..14ca6fe297 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp index ae224e9c11..07d6900c16 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp @@ -17,12 +17,12 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && HOTENDS > 1 +#if BOTH(TOUCH_UI_FTDI_EVE, HAS_MULTI_HOTEND) #include "screens.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp index d9910ffa04..091ad8f124 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -72,7 +72,7 @@ void NudgeNozzleScreen::onRedraw(draw_mode_t what) { w.text_field(0, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), str); #endif - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND 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 diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_menu.cpp index f0b5dd887b..a8891162ea 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_menu.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -39,7 +39,7 @@ void PreheatMenu::onRedraw(draw_mode_t what) { #define GRID_ROWS 3 #define GRID_COLS 2 - + if (what & FOREGROUND) { CommandProcessor cmd; cmd.cmd(COLOR_RGB(bg_text_enabled)) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp index 7d68ae2d67..69eecaf54b 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/restore_failsafe_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/restore_failsafe_dialog_box.cpp index a5fe95490f..94b8ac0fb5 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/restore_failsafe_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/restore_failsafe_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp index 5ffe20cce1..f4a99accd6 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screen_data.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screen_data.h index 6e2cb97a98..207277b824 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screen_data.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screen_data.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once @@ -60,6 +60,12 @@ union screen_data_t { struct base_numeric_adjustment_t placeholder; float e_rel[ExtUI::extruderCount]; } MoveAxisScreen; +#if HAS_MESH + struct { + uint8_t count; + uint8_t highlightedTag; + } BedMeshScreen; +#endif #if ENABLED(TOUCH_UI_DEVELOPER_MENU) struct { uint32_t next_watchdog_trigger; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp index ce75462040..82d1831e62 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -55,6 +55,9 @@ SCREEN_TABLE { #endif #if ENABLED(BABYSTEPPING) DECL_SCREEN(NudgeNozzleScreen), +#endif +#if HAS_MESH + DECL_SCREEN(BedMeshScreen), #endif DECL_SCREEN(MoveAxisScreen), DECL_SCREEN(StepsScreen), @@ -65,7 +68,7 @@ SCREEN_TABLE { #if HAS_BED_PROBE DECL_SCREEN(ZOffsetScreen), #endif -#if HOTENDS > 1 +#if HAS_MULTI_HOTEND DECL_SCREEN(NozzleOffsetScreen), #endif #if ENABLED(BACKLASH_GCODE) @@ -75,7 +78,7 @@ SCREEN_TABLE { DECL_SCREEN(MaxVelocityScreen), DECL_SCREEN(MaxAccelerationScreen), DECL_SCREEN(DefaultAccelerationScreen), -#if DISABLED(CLASSIC_JERK) +#if HAS_JUNCTION_DEVIATION DECL_SCREEN(JunctionDeviationScreen), #else DECL_SCREEN(JerkScreen), diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h index 346d122a0f..276727fc46 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once @@ -55,7 +55,10 @@ enum { MAX_VELOCITY_SCREEN_CACHE, MAX_ACCELERATION_SCREEN_CACHE, DEFAULT_ACCELERATION_SCREEN_CACHE, -#if DISABLED(CLASSIC_JERK) +#if HAS_MESH + BED_MESH_SCREEN_CACHE, +#endif +#if HAS_JUNCTION_DEVIATION JUNC_DEV_SCREEN_CACHE, #else JERK_SCREEN_CACHE, @@ -100,7 +103,7 @@ enum { class BaseScreen : public UIScreen { protected: - #if LCD_TIMEOUT_TO_STATUS + #if LCD_TIMEOUT_TO_STATUS > 0 static uint32_t last_interaction; #endif @@ -130,6 +133,33 @@ class AboutScreen : public BaseScreen, public UncachedScreen { static bool onTouchEnd(uint8_t tag); }; +#if HAS_MESH +class BedMeshScreen : public BaseScreen, public CachedScreen { + private: + enum MeshOpts { + USE_POINTS = 0x01, + USE_COLORS = 0x02, + USE_TAGS = 0x04, + USE_HIGHLIGHT = 0x08, + USE_AUTOSCALE = 0x10 + }; + + static uint8_t pointToTag(uint8_t x, uint8_t y); + static bool tagToPoint(uint8_t tag, uint8_t &x, uint8_t &y); + static float getHightlightedValue(); + static void drawHighlightedPointValue(); + static void drawMesh(int16_t x, int16_t y, int16_t w, int16_t h, ExtUI::bed_mesh_t data, uint8_t opts, float autoscale_max = 0.1); + + public: + static void onMeshUpdate(const int8_t x, const int8_t y, const float val); + static void onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::probe_state_t); + static void onEntry(); + static void onRedraw(draw_mode_t); + static bool onTouchStart(uint8_t tag); + static bool onTouchEnd(uint8_t tag); +}; +#endif + #if ENABLED(PRINTCOUNTER) class StatisticsScreen : public BaseScreen, public UncachedScreen { public: @@ -193,7 +223,6 @@ class ConfirmStartPrintDialogBox : public DialogBoxBaseClass, public UncachedScr static const char *getFilename(bool longName); public: - static void onEntry(); static void onRedraw(draw_mode_t); static bool onTouchEnd(uint8_t); @@ -484,7 +513,7 @@ class StepsScreen : public BaseNumericAdjustmentScreen, public CachedScreen 1 +#if HAS_MULTI_HOTEND class NozzleOffsetScreen : public BaseNumericAdjustmentScreen, public CachedScreen { public: static void onEntry(); @@ -536,7 +565,7 @@ class DefaultAccelerationScreen : public BaseNumericAdjustmentScreen, public Cac static bool onTouchHeld(uint8_t tag); }; -#if DISABLED(CLASSIC_JERK) +#if HAS_JUNCTION_DEVIATION class JunctionDeviationScreen : public BaseNumericAdjustmentScreen, public CachedScreen { public: static void onRedraw(draw_mode_t); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/spinner_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/spinner_dialog_box.cpp index 05df0f3995..de7eb92a88 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/spinner_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/spinner_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/statistics_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/statistics_screen.cpp index e28e5d9b81..cb26324808 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/statistics_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/statistics_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp index 98d0bba759..ac1fccd579 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -246,7 +246,7 @@ void StatusScreen::draw_progress(draw_mode_t what) { sprintf_P(progress_str, PSTR("%-3d %%"), getProgress_percent() ); cmd.font(font_medium) - .tag(0).text(TIME_POS, time_str) + .tag(7).text(TIME_POS, time_str) .text(PROGRESS_POS, progress_str); } } @@ -272,8 +272,8 @@ void StatusScreen::draw_interaction_buttons(draw_mode_t what) { CommandProcessor cmd; cmd.colors(normal_btn) .font(Theme::font_medium) - .enabled(has_media) .colors(has_media ? action_btn : normal_btn) + .enabled(has_media) .tag(3).button(MEDIA_BTN_POS, isPrintingFromMedia() ? GET_TEXT_F(MSG_PRINTING) : GET_TEXT_F(MSG_BUTTON_MEDIA)) .colors(!has_media ? action_btn : normal_btn) .tag(4).button( MENU_BTN_POS, GET_TEXT_F(MSG_BUTTON_MENU)); @@ -360,6 +360,7 @@ void StatusScreen::onRedraw(draw_mode_t what) { } void StatusScreen::onEntry() { + BaseScreen::onEntry(); onRefresh(); } @@ -379,16 +380,27 @@ bool StatusScreen::onTouchEnd(uint8_t tag) { case 4: if (isPrinting()) { GOTO_SCREEN(TuneMenu); - } else { + } + else { GOTO_SCREEN(MainMenu); } break; case 5: GOTO_SCREEN(TemperatureScreen); break; case 6: - if (!isPrinting()) { + if (isPrinting()) { + #if ENABLED(BABYSTEPPING) + GOTO_SCREEN(NudgeNozzleScreen); + #elif HAS_BED_PROBE + GOTO_SCREEN(ZOffsetScreen); + #else + return false; + #endif + } + else { GOTO_SCREEN(MoveAxisScreen); } break; + case 7: GOTO_SCREEN(FeedratePercentScreen); break; default: return true; } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stepper_bump_sensitivity_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stepper_bump_sensitivity_screen.cpp index 2e05ad5c57..693d125fbf 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stepper_bump_sensitivity_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stepper_bump_sensitivity_screen.cpp @@ -17,12 +17,12 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && HAS_TRINAMIC_CONFIG +#if BOTH(TOUCH_UI_FTDI_EVE, HAS_TRINAMIC_CONFIG) #include "screens.h" @@ -34,39 +34,21 @@ 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.color(x_axis) .adjuster( 2, GET_TEXT_F(MSG_AXIS_X), getTMCBumpSensitivity(X), ENABLED(X_SENSORLESS)); + w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_AXIS_Y), getTMCBumpSensitivity(Y), ENABLED(Y_SENSORLESS)); + w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_AXIS_Z), getTMCBumpSensitivity(Z), ENABLED(Z_SENSORLESS)); 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; + 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; } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stepper_current_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stepper_current_screen.cpp index 5abcea7a67..a8e948a9c3 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stepper_current_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stepper_current_screen.cpp @@ -17,12 +17,12 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && HAS_TRINAMIC_CONFIG +#if BOTH(TOUCH_UI_FTDI_EVE, HAS_TRINAMIC_CONFIG) #include "screens.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/steps_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/steps_screen.cpp index f47707f965..f3957c0173 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/steps_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/steps_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp index b5e9263efa..321c608abd 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -87,9 +87,8 @@ void StressTestScreen::runTestOnBootup(bool enable) { } void StressTestScreen::startupCheck() { - if (LockScreen::get_hash() == 0xDEAD) { + if (LockScreen::get_hash() == 0xDEAD) GOTO_SCREEN(StressTestScreen); - } } void StressTestScreen::onEntry() { @@ -120,19 +119,20 @@ void StressTestScreen::onIdle() { 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 (!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)) { @@ -140,10 +140,10 @@ void StressTestScreen::onIdle() { } if (watchDogTestNow()) { - if (random(2) % 2) - iterativeLockup(); - else - recursiveLockup(); + if (random(2) % 2) + iterativeLockup(); + else + recursiveLockup(); } BaseScreen::onIdle(); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.cpp index ca4fdad3ce..340ffd0553 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.h index d6e26fb5cb..ce3af4db87 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp index 81cde5a341..c254d2997f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -35,7 +35,7 @@ void TemperatureScreen::onRedraw(draw_mode_t what) { #if TOUCH_UI_LCD_TEMP_SCALING == 10 w.precision(1) #else - w.precision(0) + w.precision(0, getTargetTemp_celsius(E0) == 0 ? DEFAULT_HIGHEST : DEFAULT_MIDRANGE) #endif .color(temp).units(GET_TEXT_F(MSG_UNITS_C)); w.heading(GET_TEXT_F(MSG_TEMPERATURE)); @@ -60,7 +60,7 @@ void TemperatureScreen::onRedraw(draw_mode_t what) { #if HAS_HEATED_CHAMBER w.adjuster( 22, GET_TEXT_F(MSG_CHAMBER), getTargetTemp_celsius(CHAMBER)); #endif - #if FAN_COUNT > 0 + #if HAS_FAN w.color(fan_speed).units(GET_TEXT_F(MSG_UNITS_PERCENT)); w.adjuster( 10, GET_TEXT_F(MSG_FAN_SPEED), getTargetFan_percent(FAN0)); #endif @@ -78,7 +78,7 @@ bool TemperatureScreen::onTouchHeld(uint8_t tag) { case 2: UI_DECREMENT(TargetTemp_celsius, E0); break; case 3: UI_INCREMENT(TargetTemp_celsius, E0); break; #endif - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND case 4: UI_DECREMENT(TargetTemp_celsius, E1); break; case 5: UI_INCREMENT(TargetTemp_celsius, E1); break; #endif @@ -90,20 +90,16 @@ bool TemperatureScreen::onTouchHeld(uint8_t tag) { case 8: UI_DECREMENT(TargetTemp_celsius, E3); break; case 9: UI_INCREMENT(TargetTemp_celsius, E3); break; #endif - #if FAN_COUNT > 0 + #if HAS_FAN 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 + TERN_(HAS_HEATED_BED, setTargetTemp_celsius(0,BED)); + TERN_(HAS_HEATED_CHAMBER, setTargetTemp_celsius(0,CHAMBER)); + #if HAS_FAN setTargetFan_percent(0,FAN0); #endif break; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp index b6c5ecae3d..436445024a 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -32,6 +32,8 @@ using namespace Theme; #define GRID_COLS 4 #define GRID_ROWS 16 +#define TEXT_POS BTN_POS(1,1), BTN_SIZE(4,12) + void TouchCalibrationScreen::onEntry() { CommandProcessor cmd; @@ -45,7 +47,7 @@ void TouchCalibrationScreen::onEntry() { .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); + draw_text_box(cmd, TEXT_POS, GET_TEXT_F(MSG_TOUCH_CALIBRATION_START), OPT_CENTER, font_large); cmd.cmd(DL::DL_DISPLAY) .cmd(CMD_SWAP) .execute(); @@ -76,7 +78,7 @@ void TouchCalibrationScreen::onRedraw(draw_mode_t) { .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); + draw_text_box(cmd, TEXT_POS, GET_TEXT_F(MSG_TOUCH_CALIBRATION_PROMPT), OPT_CENTER, font_large); cmd.cmd(CMD_CALIBRATE); } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp index 4d7477b300..8c3bc856b3 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp index 8b4f0942fb..4e3fb7d17e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" @@ -39,9 +39,25 @@ void TuneMenu::onRedraw(draw_mode_t what) { #ifdef TOUCH_UI_PORTRAIT #define GRID_ROWS 8 #define GRID_COLS 2 + #define TEMPERATURE_POS BTN_POS(1,1), BTN_SIZE(2,1) + #define FIL_CHANGE_POS BTN_POS(1,2), BTN_SIZE(2,1) + #define FILAMENT_POS BTN_POS(1,3), BTN_SIZE(2,1) + #define NUDGE_NOZ_POS BTN_POS(1,4), BTN_SIZE(2,1) + #define SPEED_POS BTN_POS(1,5), BTN_SIZE(2,1) + #define PAUSE_POS BTN_POS(1,6), BTN_SIZE(2,1) + #define STOP_POS BTN_POS(1,7), BTN_SIZE(2,1) + #define BACK_POS BTN_POS(1,8), BTN_SIZE(2,1) #else #define GRID_ROWS 4 #define GRID_COLS 2 + #define TEMPERATURE_POS BTN_POS(1,1), BTN_SIZE(1,1) + #define NUDGE_NOZ_POS BTN_POS(2,1), BTN_SIZE(1,1) + #define FIL_CHANGE_POS BTN_POS(1,2), BTN_SIZE(1,1) + #define SPEED_POS BTN_POS(2,2), BTN_SIZE(1,1) + #define PAUSE_POS BTN_POS(1,3), BTN_SIZE(1,1) + #define STOP_POS BTN_POS(2,3), BTN_SIZE(1,1) + #define FILAMENT_POS BTN_POS(1,4), BTN_SIZE(1,1) + #define BACK_POS BTN_POS(2,4), BTN_SIZE(1,1) #endif if (what & FOREGROUND) { @@ -50,81 +66,21 @@ void TuneMenu::onRedraw(draw_mode_t what) { 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(2).button( TEMPERATURE_POS, GET_TEXT_F(MSG_TEMPERATURE)) + .enabled(!isPrinting() || isPrintingFromMediaPaused()) + .tag(3).button( FIL_CHANGE_POS, GET_TEXT_F(MSG_FILAMENTCHANGE)) + .enabled(EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)) + .tag(9).button( FILAMENT_POS, GET_TEXT_F(MSG_FILAMENT)) + .enabled(EITHER(HAS_BED_PROBE, BABYSTEPPING)) + .tag(4).button( NUDGE_NOZ_POS, GET_TEXT_F(TERN(BABYSTEPPING, MSG_NUDGE_NOZZLE, MSG_ZPROBE_ZOFFSET))) + .tag(5).button( SPEED_POS, 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 + .enabled(TERN0(SDSUPPORT, isPrintingFromMedia())) + .button( PAUSE_POS, isPrintingFromMediaPaused() ? GET_TEXT_F(MSG_RESUME_PRINT) : GET_TEXT_F(MSG_PAUSE_PRINT)) + .enabled(TERN0(SDSUPPORT, isPrintingFromMedia())) + .tag(8).button( STOP_POS, GET_TEXT_F(MSG_STOP_PRINT)) + .tag(1).colors(action_btn) + .button( BACK_POS, GET_TEXT_F(MSG_BACK)); } #undef GRID_COLS #undef GRID_ROWS diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp index b77cb5143e..d7c4562041 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp index 65a2ad0e8e..f5cd03697c 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp @@ -17,12 +17,12 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && HAS_BED_PROBE +#if BOTH(TOUCH_UI_FTDI_EVE, HAS_BED_PROBE) #include "screens.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/bitmaps.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/bitmaps.h index 00952cfc5b..2cb039c84d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/bitmaps.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/bitmaps.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/colors.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/colors.h index e2770d8116..f99c0fd3eb 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/colors.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/colors.h @@ -18,7 +18,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once @@ -129,7 +129,7 @@ namespace Theme { #if ENABLED(TOUCH_UI_ROYAL_THEME) constexpr uint32_t x_axis = hsl_to_rgb(0, 1.00, 0.26); constexpr uint32_t y_axis = hsl_to_rgb(120, 1.00, 0.13); - constexpr uint32_t z_axis = hsl_to_rgb(240, 1.00, 0.10); + constexpr uint32_t z_axis = hsl_to_rgb(240, 1.00, 0.10); #else constexpr uint32_t x_axis = hsl_to_rgb(0, 1.00, 0.5); constexpr uint32_t y_axis = hsl_to_rgb(120, 1.00, 0.37); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/fonts.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/fonts.h index 3e5a985cc3..63115b4187 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/fonts.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/fonts.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h index a65cbea52a..eb9cadeba1 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h @@ -11,7 +11,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h index a9c1d4049e..dd5088e0ce 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h @@ -11,7 +11,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.cpp index e08373390f..f4a80bcc09 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../compat.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.h index c728d0012f..b2b8890386 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/theme.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/theme.h index 6a73a07163..df7782ce87 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/theme.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/theme.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp new file mode 100644 index 0000000000..0febc4edbd --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp @@ -0,0 +1,338 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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(TFT_LVGL_UI_SPI) + +#include "SPI_TFT.h" +#include "pic_manager.h" + +#include "../../../../inc/MarlinConfig.h" + +#include + +TFT SPI_TFT; + +#ifndef SPI_TFT_MISO_PIN + #define SPI_TFT_MISO_PIN PA6 +#endif +#ifndef SPI_TFT_MOSI_PIN + #define SPI_TFT_MOSI_PIN PA7 +#endif +#ifndef SPI_TFT_SCK_PIN + #define SPI_TFT_SCK_PIN PA5 +#endif +#ifndef SPI_TFT_CS_PIN + #define SPI_TFT_CS_PIN PD11 +#endif +#ifndef SPI_TFT_DC_PIN + #define SPI_TFT_DC_PIN PD10 +#endif +#ifndef SPI_TFT_RST_PIN + #define SPI_TFT_RST_PIN PC6 +#endif + +// use SPI1 for the spi tft. +void TFT::spi_init(uint8_t spiRate) { + + SPI_TFT_CS_H; + + /** + * 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 + */ + uint8_t clock; + switch (spiRate) { + case SPI_FULL_SPEED: clock = SPI_CLOCK_DIV4; 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(1); + SPI.begin(); + SPI.setClockDivider(clock); + SPI.setBitOrder(MSBFIRST); + SPI.setDataMode(SPI_MODE0); +} + +uint8_t TFT::spi_Rec() { + uint8_t returnByte = SPI.transfer(ff); + return returnByte; +} + +uint8_t TFT::spi_read_write_byte(uint8_t data) { + uint8_t returnByte = SPI.transfer(data); + 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 TFT::spi_Read(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 TFT::spi_Send(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 TFT::spi_SendBlock(uint8_t token, const uint8_t* buf) { + SPI.send(token); + SPI.dmaSend(const_cast(buf), 512); +} + +void TFT::LCD_WR_REG(uint8_t cmd) { + SPI_TFT_CS_L; + SPI_TFT_DC_L; + spi_Send(cmd); + SPI_TFT_CS_H; +} +void TFT::LCD_WR_DATA(uint8_t data) { + SPI_TFT_CS_L; + SPI_TFT_DC_H; + spi_Send(data); + SPI_TFT_CS_H; +} +void TFT::LCD_WriteRAM_Prepare() {LCD_WR_REG(0X2C);} +void TFT::SetCursor(uint16_t x, uint16_t y) { + LCD_WR_REG(0x2A); + LCD_WR_DATA(x >> 8); + LCD_WR_DATA(x); + LCD_WR_DATA(x >> 8); + LCD_WR_DATA(x); + + LCD_WR_REG(0x2B); + LCD_WR_DATA(y >> 8); + LCD_WR_DATA(y); + LCD_WR_DATA(y >> 8); + LCD_WR_DATA(y); +} + +void TFT::SetPoint(uint16_t x, uint16_t y, uint16_t point) { + if ((x > 480) || (y > 320)) return; + + SetCursor(x, y); + + LCD_WriteRAM_Prepare(); + LCD_WR_DATA((uint8_t)(point >> 8)); + LCD_WR_DATA((uint8_t)point); +} + +void TFT::SetWindows(uint16_t x, uint16_t y, uint16_t with, uint16_t height) { + LCD_WR_REG(0x2A); + LCD_WR_DATA(x >> 8); + LCD_WR_DATA(x); + LCD_WR_DATA((x + with - 1) >> 8); + LCD_WR_DATA((x + with - 1)); + + LCD_WR_REG(0x2B); + LCD_WR_DATA(y >> 8); + LCD_WR_DATA(y); + LCD_WR_DATA((y + height - 1) >> 8); + LCD_WR_DATA(y + height - 1); +} + +void TFT::LCD_init() { + SPI_TFT_RST_H; + delay(150); + SPI_TFT_RST_L; + delay(150); + SPI_TFT_RST_H; + + delay(120); + LCD_WR_REG(0x11); + delay(120); + + LCD_WR_REG(0xF0); + LCD_WR_DATA(0xC3); + LCD_WR_REG(0xF0); + LCD_WR_DATA(0x96); + + LCD_WR_REG(0x36); + LCD_WR_DATA(0x28); + + LCD_WR_REG(0x3A); + LCD_WR_DATA(0x55); + + LCD_WR_REG(0xB4); + LCD_WR_DATA(0x01); + LCD_WR_REG(0xB7); + LCD_WR_DATA(0xC6); + LCD_WR_REG(0xE8); + LCD_WR_DATA(0x40); + LCD_WR_DATA(0x8A); + LCD_WR_DATA(0x00); + LCD_WR_DATA(0x00); + LCD_WR_DATA(0x29); + LCD_WR_DATA(0x19); + LCD_WR_DATA(0xA5); + LCD_WR_DATA(0x33); + LCD_WR_REG(0xC1); + LCD_WR_DATA(0x06); + LCD_WR_REG(0xC2); + LCD_WR_DATA(0xA7); + LCD_WR_REG(0xC5); + LCD_WR_DATA(0x18); + LCD_WR_REG(0xE0); // Positive Voltage Gamma Control + LCD_WR_DATA(0xF0); + LCD_WR_DATA(0x09); + LCD_WR_DATA(0x0B); + LCD_WR_DATA(0x06); + LCD_WR_DATA(0x04); + LCD_WR_DATA(0x15); + LCD_WR_DATA(0x2F); + LCD_WR_DATA(0x54); + LCD_WR_DATA(0x42); + LCD_WR_DATA(0x3C); + LCD_WR_DATA(0x17); + LCD_WR_DATA(0x14); + LCD_WR_DATA(0x18); + LCD_WR_DATA(0x1B); + LCD_WR_REG(0xE1); // Negative Voltage Gamma Control + LCD_WR_DATA(0xF0); + LCD_WR_DATA(0x09); + LCD_WR_DATA(0x0B); + LCD_WR_DATA(0x06); + LCD_WR_DATA(0x04); + LCD_WR_DATA(0x03); + LCD_WR_DATA(0x2D); + LCD_WR_DATA(0x43); + LCD_WR_DATA(0x42); + LCD_WR_DATA(0x3B); + LCD_WR_DATA(0x16); + LCD_WR_DATA(0x14); + LCD_WR_DATA(0x17); + LCD_WR_DATA(0x1B); + LCD_WR_REG(0xF0); + LCD_WR_DATA(0x3C); + LCD_WR_REG(0xF0); + LCD_WR_DATA(0x69); + delay(120); // Delay 120ms + LCD_WR_REG(0x29); // Display ON + + LCD_clear(0x0000); // + LCD_Draw_Logo(); + SPI_TFT_BLK_H; + delay(2000); +} + +void TFT::LCD_clear(uint16_t color) { + unsigned int i; + uint8_t tbuf[960]; + + SetCursor(0, 0); + SetWindows(0, 0, 480 - 1, 320 - 1); + LCD_WriteRAM_Prepare(); + SPI_TFT_CS_L; + SPI_TFT_DC_H; + for (i = 0; i < 960;) { + tbuf[i] = color >> 8; + tbuf[i + 1] = color; + i += 2; + } + for (i = 0; i < 320; i++) { + // for (m=0;m<480;m++) + // { + // LCD_WR_DATA(color>>8); + // LCD_WR_DATA(color); + SPI.dmaSend(tbuf, 960, true); + // SPI_TFT_CS_H; + // } + } + SPI_TFT_CS_H; +} + +extern unsigned char bmp_public_buf[17 * 1024]; + +void TFT::LCD_Draw_Logo() { + uint16_t i,y_off = 0; + uint16_t *p_index; + uint16_t Color; + + #if 1 + for (y_off = 0; y_off < 320; y_off ++) { + Pic_Logo_Read((uint8_t *)"", (uint8_t *)bmp_public_buf, 960); + + SPI_TFT.spi_init(SPI_FULL_SPEED); + SetWindows(0, y_off, 480, 1); + LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */ + for (i = 0; i < 960;) { + p_index = (uint16_t *)(&bmp_public_buf[i]); + Color = (*p_index >> 8); + *p_index = Color | ((*p_index & 0xFF) << 8); + i+=2; + } + SPI_TFT_CS_L; + SPI_TFT_DC_H; + SPI.dmaSend(bmp_public_buf,960,true); + SPI_TFT_CS_H; + } + + #else + + for (index = 0; index < 40; index ++) { + Pic_Logo_Read((uint8_t *)"", bmp_public_buf, 480*8*2); + i = 0; + SetCursor(0,0); + SetWindows(0, y_off * 8, 480, 8); + LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */ + for (i = 0; i < 480 * 8 * 2;) { + p_index = (uint16_t *)(&bmp_public_buf[i]); + Color = (*p_index >> 8); + *p_index = Color | ((*p_index & 0xFF) << 8); + i += 2; + } + SPI_TFT_CS_L; + SPI_TFT_DC_H; + SPI.dmaSend(bmp_public_buf,480*8*2,true); + SPI_TFT_CS_H; + + y_off++; + } + #endif + + SetWindows(0, 0, 479, 319); +} + +#endif // HAS_TFT_LVGL_UI_SPI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h new file mode 100644 index 0000000000..9b67684313 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h @@ -0,0 +1,57 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 + +#define SPI_TFT_CS_H OUT_WRITE(SPI_TFT_CS_PIN, HIGH) +#define SPI_TFT_CS_L OUT_WRITE(SPI_TFT_CS_PIN, LOW) + +#define SPI_TFT_DC_H OUT_WRITE(SPI_TFT_DC_PIN, HIGH) +#define SPI_TFT_DC_L OUT_WRITE(SPI_TFT_DC_PIN, LOW) + +#define SPI_TFT_RST_H OUT_WRITE(SPI_TFT_RST_PIN, HIGH) +#define SPI_TFT_RST_L OUT_WRITE(SPI_TFT_RST_PIN, LOW) + +#define SPI_TFT_BLK_H OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH) +#define SPI_TFT_BLK_L OUT_WRITE(LCD_BACKLIGHT_PIN, LOW) + +class TFT { +public: + void spi_init(uint8_t spiRate); + uint8_t spi_Rec(); + uint8_t spi_read_write_byte(uint8_t data); + void spi_Read(uint8_t* buf, uint16_t nbyte); + void spi_Send(uint8_t b); + void spi_SendBlock(uint8_t token, const uint8_t* buf); + void LCD_WR_REG(uint8_t cmd); + void LCD_WR_DATA(uint8_t data); + void SetCursor(uint16_t x, uint16_t y); + void SetPoint(uint16_t x, uint16_t y, uint16_t point); + void SetWindows(uint16_t x, uint16_t y, uint16_t with, uint16_t height); + void LCD_init(); + void LCD_clear(uint16_t color); + void LCD_WriteRAM_Prepare(); + void LCD_Draw_Logo(); +}; + +extern TFT SPI_TFT; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.cpp b/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.cpp new file mode 100644 index 0000000000..60b4d0b7ea --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.cpp @@ -0,0 +1,395 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 1 // ENABLED(SPI_FLASH) +#if HAS_TFT_LVGL_UI + +#include +#include "../../../../inc/MarlinConfig.h" + +#include "W25Qxx.h" + +#ifndef SPI_FLASH_MISO_PIN + #define SPI_FLASH_MISO_PIN W25QXX_MISO_PIN +#endif +#ifndef SPI_FLASH_MOSI_PIN + #define SPI_FLASH_MOSI_PIN W25QXX_MOSI_PIN +#endif +#ifndef SPI_FLASH_SCK_PIN + #define SPI_FLASH_SCK_PIN W25QXX_SCK_PIN +#endif +#ifndef SPI_FLASH_CS_PIN + #define SPI_FLASH_CS_PIN W25QXX_CS_PIN +#endif + +#define W25QXX_CS_H OUT_WRITE(SPI_FLASH_CS_PIN, HIGH) +#define W25QXX_CS_L OUT_WRITE(SPI_FLASH_CS_PIN, LOW) + +ext_FLASH W25QXX; + +void ext_FLASH::init(uint8_t spiRate) { + + OUT_WRITE(SPI_FLASH_CS_PIN, HIGH); + + /** + * 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 ext_FLASH::spi_flash_Rec() { + uint8_t returnByte = SPI.transfer(ff); + return returnByte; +} + +uint8_t ext_FLASH::spi_flash_read_write_byte(uint8_t data) { + uint8_t returnByte = SPI.transfer(data); + 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 ext_FLASH::spi_flash_Read(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 ext_FLASH::spi_flash_Send(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 ext_FLASH::spi_flash_SendBlock(uint8_t token, const uint8_t* buf) { + SPI.send(token); + SPI.dmaSend(const_cast(buf), 512); +} + +uint16_t ext_FLASH::W25QXX_ReadID(void) { + uint16_t Temp = 0; + W25QXX_CS_L; + spi_flash_Send(0x90); + spi_flash_Send(0x00); + spi_flash_Send(0x00); + spi_flash_Send(0x00); + Temp |= spi_flash_Rec() << 8; + Temp |= spi_flash_Rec(); + W25QXX_CS_H; + return Temp; +} + +void ext_FLASH::SPI_FLASH_WriteEnable(void) { + /* Select the FLASH: Chip Select low */ + W25QXX_CS_L; + /* Send "Write Enable" instruction */ + spi_flash_Send(W25X_WriteEnable); + /* Deselect the FLASH: Chip Select high */ + W25QXX_CS_H; +} + +/******************************************************************************* +* Function Name : SPI_FLASH_WaitForWriteEnd +* Description : Polls the status of the Write In Progress (WIP) flag in the +* FLASH's status register and loop until write opertaion +* has completed. +* Input : None +* Output : None +* Return : None +*******************************************************************************/ +void ext_FLASH::SPI_FLASH_WaitForWriteEnd(void) { + uint8_t FLASH_Status = 0; + + /* Select the FLASH: Chip Select low */ + W25QXX_CS_L; + /* Send "Read Status Register" instruction */ + spi_flash_Send(W25X_ReadStatusReg); + + /* Loop as long as the memory is busy with a write cycle */ + do + /* Send a dummy byte to generate the clock needed by the FLASH + and put the value of the status register in FLASH_Status variable */ + FLASH_Status = spi_flash_Rec(); + while ((FLASH_Status & WIP_Flag) == 0x01); /* Write in progress */ + + /* Deselect the FLASH: Chip Select high */ + W25QXX_CS_H; +} + +void ext_FLASH::SPI_FLASH_SectorErase(uint32_t SectorAddr) { + /* Send write enable instruction */ + SPI_FLASH_WriteEnable(); + + /* Sector Erase */ + /* Select the FLASH: Chip Select low */ + W25QXX_CS_L; + /* Send Sector Erase instruction */ + spi_flash_Send(W25X_SectorErase); + /* Send SectorAddr high nibble address byte */ + spi_flash_Send((SectorAddr & 0xFF0000) >> 16); + /* Send SectorAddr medium nibble address byte */ + spi_flash_Send((SectorAddr & 0xFF00) >> 8); + /* Send SectorAddr low nibble address byte */ + spi_flash_Send(SectorAddr & 0xFF); + /* Deselect the FLASH: Chip Select high */ + + W25QXX_CS_H; + /* Wait the end of Flash writing */ + SPI_FLASH_WaitForWriteEnd(); +} + +void ext_FLASH::SPI_FLASH_BlockErase(uint32_t BlockAddr) { + SPI_FLASH_WriteEnable(); + W25QXX_CS_L; + /* Send Sector Erase instruction */ + spi_flash_Send(W25X_BlockErase); + /* Send SectorAddr high nibble address byte */ + spi_flash_Send((BlockAddr & 0xFF0000) >> 16); + /* Send SectorAddr medium nibble address byte */ + spi_flash_Send((BlockAddr & 0xFF00) >> 8); + /* Send SectorAddr low nibble address byte */ + spi_flash_Send(BlockAddr & 0xFF); + + W25QXX_CS_H; + + SPI_FLASH_WaitForWriteEnd(); +} + +/******************************************************************************* +* Function Name : SPI_FLASH_BulkErase +* Description : Erases the entire FLASH. +* Input : None +* Output : None +* Return : None +*******************************************************************************/ +void ext_FLASH::SPI_FLASH_BulkErase(void) { + /* Send write enable instruction */ + SPI_FLASH_WriteEnable(); + + /* Bulk Erase */ + /* Select the FLASH: Chip Select low */ + W25QXX_CS_L; + + /* Send Bulk Erase instruction */ + spi_flash_Send(W25X_ChipErase); + /* Deselect the FLASH: Chip Select high */ + W25QXX_CS_H; + /* Wait the end of Flash writing */ + SPI_FLASH_WaitForWriteEnd(); +} + +/******************************************************************************* +* Function Name : SPI_FLASH_PageWrite +* Description : Writes more than one byte to the FLASH with a single WRITE +* cycle(Page WRITE sequence). The number of byte can't exceed +* the FLASH page size. +* Input : - pBuffer : pointer to the buffer containing the data to be +* written to the FLASH. +* - WriteAddr : FLASH's internal address to write to. +* - NumByteToWrite : number of bytes to write to the FLASH, +* must be equal or less than "SPI_FLASH_PageSize" value. +* Output : None +* Return : None +*******************************************************************************/ +void ext_FLASH::SPI_FLASH_PageWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite) { + /* Enable the write access to the FLASH */ + SPI_FLASH_WriteEnable(); + + /* Select the FLASH: Chip Select low */ + W25QXX_CS_L; + /* Send "Write to Memory " instruction */ + spi_flash_Send(W25X_PageProgram); + /* Send WriteAddr high nibble address byte to write to */ + spi_flash_Send((WriteAddr & 0xFF0000) >> 16); + /* Send WriteAddr medium nibble address byte to write to */ + spi_flash_Send((WriteAddr & 0xFF00) >> 8); + /* Send WriteAddr low nibble address byte to write to */ + spi_flash_Send(WriteAddr & 0xFF); + + NOMORE(NumByteToWrite, SPI_FLASH_PerWritePageSize); + + /* while there is data to be written on the FLASH */ + while (NumByteToWrite--) { + /* Send the current byte */ + spi_flash_Send(*pBuffer); + /* Point on the next byte to be written */ + pBuffer++; + } + + /* Deselect the FLASH: Chip Select high */ + W25QXX_CS_H; + + /* Wait the end of Flash writing */ + SPI_FLASH_WaitForWriteEnd(); +} + +/******************************************************************************* +* Function Name : SPI_FLASH_BufferWrite +* Description : Writes block of data to the FLASH. In this function, the +* number of WRITE cycles are reduced, using Page WRITE sequence. +* Input : - pBuffer : pointer to the buffer containing the data to be +* written to the FLASH. +* - WriteAddr : FLASH's internal address to write to. +* - NumByteToWrite : number of bytes to write to the FLASH. +* Output : None +* Return : None +*******************************************************************************/ +void ext_FLASH::SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite) { + uint8_t NumOfPage = 0, NumOfSingle = 0, Addr = 0, count = 0, temp = 0; + + Addr = WriteAddr % SPI_FLASH_PageSize; + count = SPI_FLASH_PageSize - Addr; + NumOfPage = NumByteToWrite / SPI_FLASH_PageSize; + NumOfSingle = NumByteToWrite % SPI_FLASH_PageSize; + + if (Addr == 0) { /* WriteAddr is SPI_FLASH_PageSize aligned */ + if (NumOfPage == 0) { /* NumByteToWrite < SPI_FLASH_PageSize */ + SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumByteToWrite); + } + else { /* NumByteToWrite > SPI_FLASH_PageSize */ + while (NumOfPage--) { + SPI_FLASH_PageWrite(pBuffer, WriteAddr, SPI_FLASH_PageSize); + WriteAddr += SPI_FLASH_PageSize; + pBuffer += SPI_FLASH_PageSize; + } + SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumOfSingle); + } + } + else { /* WriteAddr is not SPI_FLASH_PageSize aligned */ + if (NumOfPage == 0) { /* NumByteToWrite < SPI_FLASH_PageSize */ + if (NumOfSingle > count) { /* (NumByteToWrite + WriteAddr) > SPI_FLASH_PageSize */ + temp = NumOfSingle - count; + SPI_FLASH_PageWrite(pBuffer, WriteAddr, count); + WriteAddr += count; + pBuffer += count; + SPI_FLASH_PageWrite(pBuffer, WriteAddr, temp); + } + else { + SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumByteToWrite); + } + } + else { /* NumByteToWrite > SPI_FLASH_PageSize */ + NumByteToWrite -= count; + NumOfPage = NumByteToWrite / SPI_FLASH_PageSize; + NumOfSingle = NumByteToWrite % SPI_FLASH_PageSize; + + SPI_FLASH_PageWrite(pBuffer, WriteAddr, count); + WriteAddr += count; + pBuffer += count; + + while (NumOfPage--) { + SPI_FLASH_PageWrite(pBuffer, WriteAddr, SPI_FLASH_PageSize); + WriteAddr += SPI_FLASH_PageSize; + pBuffer += SPI_FLASH_PageSize; + } + + if (NumOfSingle != 0) + SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumOfSingle); + } + } +} + +/******************************************************************************* +* Function Name : SPI_FLASH_BufferRead +* Description : Reads a block of data from the FLASH. +* Input : - pBuffer : pointer to the buffer that receives the data read +* from the FLASH. +* - ReadAddr : FLASH's internal address to read from. +* - NumByteToRead : number of bytes to read from the FLASH. +* Output : None +* Return : None +*******************************************************************************/ +void ext_FLASH::SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead) { + /* Select the FLASH: Chip Select low */ + W25QXX_CS_L; + + /* Send "Read from Memory " instruction */ + spi_flash_Send(W25X_ReadData); + + /* Send ReadAddr high nibble address byte to read from */ + spi_flash_Send((ReadAddr & 0xFF0000) >> 16); + /* Send ReadAddr medium nibble address byte to read from */ + spi_flash_Send((ReadAddr & 0xFF00) >> 8); + /* Send ReadAddr low nibble address byte to read from */ + spi_flash_Send(ReadAddr & 0xFF); + + if (NumByteToRead < 33) { + while (NumByteToRead--) { /* while there is data to be read */ + /* Read a byte from the FLASH */ + *pBuffer = spi_flash_Rec(); + /* Point to the next location where the byte read will be saved */ + pBuffer++; + } + } + else { + spi_flash_Read(pBuffer, NumByteToRead); + } + W25QXX_CS_H; +} + +void ext_FLASH::lv_pic_read(uint8_t *P_Rbuff, uint32_t addr, uint32_t size) {SPI_FLASH_BufferRead((uint8_t *)P_Rbuff, addr, size);} + +#endif // HAS_TFT_LVGL_UI +#endif // 1 ... SPI_FLASH diff --git a/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h b/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h new file mode 100644 index 0000000000..88d5d6c2f5 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h @@ -0,0 +1,124 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +//extern "C" { /* C-declarations for C++ */ +//#endif + +#include + +#define W25X_WriteEnable 0x06 +#define W25X_WriteDisable 0x04 +#define W25X_ReadStatusReg 0x05 +#define W25X_WriteStatusReg 0x01 +#define W25X_ReadData 0x03 +#define W25X_FastReadData 0x0B +#define W25X_FastReadDual 0x3B +#define W25X_PageProgram 0x02 +#define W25X_BlockErase 0xD8 +#define W25X_SectorErase 0x20 +#define W25X_ChipErase 0xC7 +#define W25X_PowerDown 0xB9 +#define W25X_ReleasePowerDown 0xAB +#define W25X_DeviceID 0xAB +#define W25X_ManufactDeviceID 0x90 +#define W25X_JedecDeviceID 0x9F + +#define WIP_Flag 0x01 /* Write In Progress (WIP) flag */ + +#define Dummy_Byte 0xA5 + +#define SPI_FLASH_SectorSize 4096 +#define SPI_FLASH_PageSize 256 +#define SPI_FLASH_PerWritePageSize 256 + +#if 0 + + #define PIC_NAME_MAX_LEN 50 + + #define LOGO_MAX_SIZE (300*1024) + #define TITLELOGO_MAX_SIZE (150*1024) + #define DEFAULT_VIEW_MAX_SIZE (200*200*2) + #define FLASH_VIEW_MAX_SIZE (200*200*2) + + //Robin 2 + #define PIC_NAME_ADDR 0x003000 + #define PIC_SIZE_ADDR 0x007000 + #define PIC_COUNTER_ADDR 0x008000 + #define PIC_LOGO_ADDR 0x009000 + //#define PIC_DATA_ADDR 0x02f000 + + #define DEFAULT_VIEW_ADDR 0XC5800 + #define BAK_VIEW_ADDR (DEFAULT_VIEW_ADDR+90*1024) + #define PIC_ICON_LOGO_ADDR (BAK_VIEW_ADDR+80*1024) + + #define PIC_DATA_ADDR (PIC_ICON_LOGO_ADDR+350*1024) + + #define FONTINFOADDR 0x600000 + #define UNIGBK_FLASH_ADDR (FONTINFOADDR+4096) // 4*1024 + #define GBK_FLASH_ADDR (UNIGBK_FLASH_ADDR+180224) // 176*1024 + + #define PER_PIC_MAX_SPACE (32*1024) + + union union32 { + uint8_t bytes[4]; + uint32_t dwords; + }; + + struct pic_msg { + uint8_t name[PIC_NAME_MAX_LEN]; + union union32 size; + }; + + typedef struct pic_msg PIC_MSG; + +#endif // if 0 + +class ext_FLASH { +public: + void init(uint8_t spiRate); + static uint8_t spi_flash_Rec(); + static uint8_t spi_flash_read_write_byte(uint8_t data); + static void spi_flash_Read(uint8_t* buf, uint16_t nbyte); + static void spi_flash_Send(uint8_t b); + static void spi_flash_SendBlock(uint8_t token, const uint8_t* buf); + static uint16_t W25QXX_ReadID(void); + static void SPI_FLASH_WriteEnable(void); + static void SPI_FLASH_WaitForWriteEnd(void); + static void SPI_FLASH_SectorErase(uint32_t SectorAddr); + static void SPI_FLASH_BlockErase(uint32_t BlockAddr); + static void SPI_FLASH_BulkErase(void); + static void SPI_FLASH_PageWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite); + static void SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite); + static void SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead); + //uint32_t lv_get_pic_addr(uint8_t *Pname); + void lv_pic_read(uint8_t *P_Rbuff, uint32_t addr, uint32_t size); +}; + +extern ext_FLASH W25QXX; + +//extern uint32_t lv_get_pic_addr(uint8_t *Pname); + +//#ifdef __cplusplus +//} /* C-declarations for C++ */ +//#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp new file mode 100644 index 0000000000..94a865d045 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp @@ -0,0 +1,126 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" + +#include "../../../../MarlinCore.h" +#include "../../../../module/temperature.h" + +static lv_obj_t * scr; +static lv_obj_t * fw_type, *board, *fw_version; + +#define ID_A_RETURN 1 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_A_RETURN: + if (event == LV_EVENT_CLICKED) { + // do nothing + } + else if (event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + } +} + +void lv_draw_about(void) { + lv_obj_t *buttonBack, *label_Back; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ABOUT_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = ABOUT_UI; + } + disp_state = ABOUT_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonBack = lv_imgbtn_create(scr, NULL); + + #if 1 + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_A_RETURN, "bmp_return.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif + + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + /*Create a label on the Image button*/ + + label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + + fw_version = lv_label_create(scr, NULL); + lv_obj_set_style(fw_version, &tft_style_label_rel); + lv_label_set_text(fw_version, SHORT_BUILD_VERSION); + lv_obj_align(fw_version, NULL, LV_ALIGN_CENTER, 0, -60); + + fw_type = lv_label_create(scr, NULL); + lv_obj_set_style(fw_type, &tft_style_label_rel); + lv_label_set_text(fw_type, + #if MB(MKS_ROBIN_PRO) + "Firmware: Robin_Pro35" + #elif MB(MKS_ROBIN_NANO, MKS_ROBIN_NANO_V2) + "Firmware: Robin_Nano35" + #else + CUSTOM_MACHINE_NAME + #endif + ); + lv_obj_align(fw_type, NULL, LV_ALIGN_CENTER, 0, -20); + + board = lv_label_create(scr, NULL); + lv_obj_set_style(board, &tft_style_label_rel); + lv_label_set_text(board, "Board: " BOARD_INFO_NAME); + lv_obj_align(board, NULL, LV_ALIGN_CENTER, 0, 20); +} + +void lv_clear_about() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h new file mode 100644 index 0000000000..4c6c288d08 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_about(void); +extern void lv_clear_about(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp new file mode 100644 index 0000000000..b6906a6dfe --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp @@ -0,0 +1,483 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" + +#include "../../../../MarlinCore.h" +#include "../../../../module/planner.h" + +static lv_obj_t * scr; + +#define ID_ACCE_RETURN 1 +#define ID_ACCE_PRINT 2 +#define ID_ACCE_RETRA 3 +#define ID_ACCE_TRAVEL 4 +#define ID_ACCE_X 5 +#define ID_ACCE_Y 6 +#define ID_ACCE_Z 7 +#define ID_ACCE_E0 8 +#define ID_ACCE_E1 9 +#define ID_ACCE_UP 10 +#define ID_ACCE_DOWN 11 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_ACCE_RETURN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + uiCfg.para_ui_page = 0; + lv_clear_acceleration_settings(); + draw_return_ui(); + } + break; + case ID_ACCE_PRINT: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = PrintAcceleration; + lv_clear_acceleration_settings(); + lv_draw_number_key(); + } + break; + case ID_ACCE_RETRA: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = RetractAcceleration; + lv_clear_acceleration_settings(); + lv_draw_number_key(); + } + break; + case ID_ACCE_TRAVEL: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = TravelAcceleration; + lv_clear_acceleration_settings(); + lv_draw_number_key(); + } + break; + case ID_ACCE_X: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = XAcceleration; + lv_clear_acceleration_settings(); + lv_draw_number_key(); + } + break; + case ID_ACCE_Y: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = YAcceleration; + lv_clear_acceleration_settings(); + lv_draw_number_key(); + } + break; + case ID_ACCE_Z: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = ZAcceleration; + lv_clear_acceleration_settings(); + lv_draw_number_key(); + } + break; + case ID_ACCE_E0: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = E0Acceleration; + lv_clear_acceleration_settings(); + lv_draw_number_key(); + } + break; + case ID_ACCE_E1: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = E1Acceleration; + lv_clear_acceleration_settings(); + lv_draw_number_key(); + } + break; + case ID_ACCE_UP: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + uiCfg.para_ui_page = 0; + lv_clear_acceleration_settings(); + lv_draw_acceleration_settings(); + } + break; + case ID_ACCE_DOWN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + uiCfg.para_ui_page = 1; + lv_clear_acceleration_settings(); + lv_draw_acceleration_settings(); + } + break; + } +} + +void lv_draw_acceleration_settings(void) { + lv_obj_t *buttonBack = NULL, *label_Back = NULL, *buttonTurnPage = NULL, *labelTurnPage = NULL; + lv_obj_t *buttonPrintText = NULL, *labelPrintText = NULL, *buttonPrintValue = NULL, *labelPrintValue = NULL; + lv_obj_t *buttonRetraText = NULL, *labelRetraText = NULL, *buttonRetraValue = NULL, *labelRetraValue = NULL; + lv_obj_t *buttonTravelText = NULL, *labelTravelText = NULL, *buttonTravelValue = NULL, *labelTravelValue = NULL; + lv_obj_t *buttonXText = NULL, *labelXText = NULL, *buttonXValue = NULL, *labelXValue = NULL; + lv_obj_t *buttonYText = NULL, *labelYText = NULL, *buttonYValue = NULL, *labelYValue = NULL; + lv_obj_t *buttonZText = NULL, *labelZText = NULL, *buttonZValue = NULL, *labelZValue = NULL; + lv_obj_t *buttonE0Text = NULL, *labelE0Text = NULL, *buttonE0Value = NULL, *labelE0Value = NULL; + lv_obj_t *buttonE1Text = NULL, *labelE1Text = NULL, *buttonE1Value = NULL, *labelE1Value = NULL; + lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ACCELERATION_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = ACCELERATION_UI; + } + disp_state = ACCELERATION_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, machine_menu.AccelerationConfTitle); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_para_back); + // LV_IMG_DECLARE(bmp_para_arrow); + LV_IMG_DECLARE(bmp_para_bank); + + if (uiCfg.para_ui_page != 1) { + buttonPrintText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonPrintText, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonPrintText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonPrintText, event_handler); + lv_btn_set_style(buttonPrintText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonPrintText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonPrintText, LV_LAYOUT_OFF); + labelPrintText = lv_label_create(buttonPrintText, NULL); /*Add a label to the button*/ + + buttonPrintValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonPrintValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonPrintValue, event_handler, ID_ACCE_PRINT, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonPrintValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonPrintValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonPrintValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonPrintValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonPrintValue, LV_LAYOUT_OFF); + labelPrintValue = lv_label_create(buttonPrintValue, NULL); + + line1 = lv_line_create(scr, NULL); + lv_ex_line(line1, line_points[0]); + + buttonRetraText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonRetraText, PARA_UI_POS_X, PARA_UI_POS_Y * 2); /*Set its position*/ + lv_obj_set_size(buttonRetraText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonRetraText, event_handler); + lv_btn_set_style(buttonRetraText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonRetraText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonRetraText, LV_LAYOUT_OFF); + labelRetraText = lv_label_create(buttonRetraText, NULL); /*Add a label to the button*/ + + buttonRetraValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonRetraValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonRetraValue, event_handler, ID_ACCE_RETRA, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonRetraValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonRetraValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonRetraValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonRetraValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonRetraValue, LV_LAYOUT_OFF); + labelRetraValue = lv_label_create(buttonRetraValue, NULL); + + line2 = lv_line_create(scr, NULL); + lv_ex_line(line2, line_points[1]); + + buttonTravelText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonTravelText, PARA_UI_POS_X, PARA_UI_POS_Y * 3); /*Set its position*/ + lv_obj_set_size(buttonTravelText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonTravelText, event_handler); + lv_btn_set_style(buttonTravelText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonTravelText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonTravelText, LV_LAYOUT_OFF); + labelTravelText = lv_label_create(buttonTravelText, NULL); /*Add a label to the button*/ + + buttonTravelValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonTravelValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonTravelValue, event_handler, ID_ACCE_TRAVEL, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonTravelValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonTravelValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonTravelValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonTravelValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonTravelValue, LV_LAYOUT_OFF); + labelTravelValue = lv_label_create(buttonTravelValue, NULL); + + line3 = lv_line_create(scr, NULL); + lv_ex_line(line3, line_points[2]); + + buttonXText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonXText, PARA_UI_POS_X, PARA_UI_POS_Y * 4); /*Set its position*/ + lv_obj_set_size(buttonXText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonXText, event_handler); + lv_btn_set_style(buttonXText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonXText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonXText, LV_LAYOUT_OFF); + labelXText = lv_label_create(buttonXText, NULL); /*Add a label to the button*/ + + buttonXValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonXValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonXValue, event_handler, ID_ACCE_X, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonXValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonXValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonXValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonXValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonXValue, LV_LAYOUT_OFF); + labelXValue = lv_label_create(buttonXValue, NULL); + + line4 = lv_line_create(scr, NULL); + lv_ex_line(line4, line_points[3]); + + buttonTurnPage = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_ACCE_DOWN, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_REL, &tft_style_label_rel); + } + else { + buttonYText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonYText, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonYText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonYText, event_handler); + lv_btn_set_style(buttonYText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonYText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonYText, LV_LAYOUT_OFF); + labelYText = lv_label_create(buttonYText, NULL); /*Add a label to the button*/ + + buttonYValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonYValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonYValue, event_handler, ID_ACCE_Y, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonYValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonYValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonYValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonYValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonYValue, LV_LAYOUT_OFF); + labelYValue = lv_label_create(buttonYValue, NULL); + + line1 = lv_line_create(scr, NULL); + lv_ex_line(line1, line_points[0]); + + buttonZText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonZText, PARA_UI_POS_X, PARA_UI_POS_Y * 2); /*Set its position*/ + lv_obj_set_size(buttonZText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonZText, event_handler); + lv_btn_set_style(buttonZText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonZText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonZText, LV_LAYOUT_OFF); + labelZText = lv_label_create(buttonZText, NULL); /*Add a label to the button*/ + + buttonZValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonZValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonZValue, event_handler, ID_ACCE_Z, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonZValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonZValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonZValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonZValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonZValue, LV_LAYOUT_OFF); + labelZValue = lv_label_create(buttonZValue, NULL); + + line2 = lv_line_create(scr, NULL); + lv_ex_line(line2, line_points[1]); + + buttonE0Text = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonE0Text, PARA_UI_POS_X, PARA_UI_POS_Y * 3); /*Set its position*/ + lv_obj_set_size(buttonE0Text, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonE0Text, event_handler); + lv_btn_set_style(buttonE0Text, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonE0Text, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonE0Text, LV_LAYOUT_OFF); + labelE0Text = lv_label_create(buttonE0Text, NULL); /*Add a label to the button*/ + + buttonE0Value = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonE0Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonE0Value, event_handler, ID_ACCE_E0, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonE0Value, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonE0Value, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonE0Value, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonE0Value, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonE0Value, LV_LAYOUT_OFF); + labelE0Value = lv_label_create(buttonE0Value, NULL); + + line3 = lv_line_create(scr, NULL); + lv_ex_line(line3, line_points[2]); + + buttonE1Text = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonE1Text, PARA_UI_POS_X, PARA_UI_POS_Y * 4); /*Set its position*/ + lv_obj_set_size(buttonE1Text, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonE1Text, event_handler); + lv_btn_set_style(buttonE1Text, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonE1Text, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonE1Text, LV_LAYOUT_OFF); + labelE1Text = lv_label_create(buttonE1Text, NULL); /*Add a label to the button*/ + + buttonE1Value = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonE1Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonE1Value, event_handler, ID_ACCE_E1, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonE1Value, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonE1Value, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonE1Value, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonE1Value, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonE1Value, LV_LAYOUT_OFF); + labelE1Value = lv_label_create(buttonE1Value, NULL); + + line4 = lv_line_create(scr, NULL); + lv_ex_line(line4, line_points[3]); + + buttonTurnPage = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_ACCE_UP, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_REL, &tft_style_label_rel); + } + + lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); + lv_btn_set_layout(buttonTurnPage, LV_LAYOUT_OFF); + labelTurnPage = lv_label_create(buttonTurnPage, NULL); + + buttonBack = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_ACCE_RETURN, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + if (uiCfg.para_ui_page != 1) { + lv_label_set_text(labelPrintText, machine_menu.PrintAcceleration); + lv_obj_align(labelPrintText, buttonPrintText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelRetraText, machine_menu.RetractAcceleration); + lv_obj_align(labelRetraText, buttonRetraText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelTravelText, machine_menu.TravelAcceleration); + lv_obj_align(labelTravelText, buttonTravelText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelXText, machine_menu.X_Acceleration); + lv_obj_align(labelXText, buttonXText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelTurnPage, machine_menu.next); + lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.acceleration); + lv_label_set_text(labelPrintValue, public_buf_l); + lv_obj_align(labelPrintValue, buttonPrintValue, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.retract_acceleration); + lv_label_set_text(labelRetraValue, public_buf_l); + lv_obj_align(labelRetraValue, buttonRetraValue, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.travel_acceleration); + lv_label_set_text(labelTravelValue, public_buf_l); + lv_obj_align(labelTravelValue, buttonTravelValue, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[X_AXIS]); + lv_label_set_text(labelXValue, public_buf_l); + lv_obj_align(labelXValue, buttonXValue, LV_ALIGN_CENTER, 0, 0); + } + else { + lv_label_set_text(labelYText, machine_menu.Y_Acceleration); + lv_obj_align(labelYText, buttonYText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelZText, machine_menu.Z_Acceleration); + lv_obj_align(labelZText, buttonZText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelE0Text, machine_menu.E0_Acceleration); + lv_obj_align(labelE0Text, buttonE0Text, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelE1Text, machine_menu.E1_Acceleration); + lv_obj_align(labelE1Text, buttonE1Text, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelTurnPage, machine_menu.previous); + lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[Y_AXIS]); + lv_label_set_text(labelYValue, public_buf_l); + lv_obj_align(labelYValue, buttonYValue, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[Z_AXIS]); + lv_label_set_text(labelZValue, public_buf_l); + lv_obj_align(labelZValue, buttonZValue, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[E_AXIS]); + lv_label_set_text(labelE0Value, public_buf_l); + lv_obj_align(labelE0Value, buttonE0Value, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)]); + lv_label_set_text(labelE1Value, public_buf_l); + lv_obj_align(labelE1Value, buttonE1Value, LV_ALIGN_CENTER, 0, 0); + } + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); + } +} + +void lv_clear_acceleration_settings() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.h new file mode 100644 index 0000000000..b5b62fdc4c --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.h @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_acceleration_settings(void); +extern void lv_clear_acceleration_settings(); + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp new file mode 100644 index 0000000000..7d3eab436b --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp @@ -0,0 +1,140 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" + +#include "../../../../MarlinCore.h" + +static lv_obj_t * scr; + +#define ID_ADVANCE_RETURN 1 +#define ID_PAUSE_POS 2 +#define ID_PAUSE_POS_ARROW 3 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_ADVANCE_RETURN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_advance_settings(); + draw_return_ui(); + } + break; + case ID_PAUSE_POS: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_advance_settings(); + lv_draw_pause_position(); + } + break; + case ID_PAUSE_POS_ARROW: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_advance_settings(); + lv_draw_pause_position(); + } + break; + } +} + +void lv_draw_advance_settings(void) { + lv_obj_t *buttonBack, *label_Back; + lv_obj_t *buttonPausePos, *labelPausePos, *buttonPausePosNarrow; + lv_obj_t * line1; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ADVANCED_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = ADVANCED_UI; + } + disp_state = ADVANCED_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, machine_menu.AdvancedConfTitle); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_para_back); + LV_IMG_DECLARE(bmp_para_arrow); + + buttonPausePos = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonPausePos, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonPausePos, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + //lv_obj_set_event_cb(buttonMachine, event_handler); + lv_obj_set_event_cb_mks(buttonPausePos, event_handler, ID_PAUSE_POS, NULL, 0); + lv_btn_set_style(buttonPausePos, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonPausePos, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonPausePos, LV_LAYOUT_OFF); + labelPausePos = lv_label_create(buttonPausePos, NULL); /*Add a label to the button*/ + + buttonPausePosNarrow = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonPausePosNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V); + lv_obj_set_event_cb_mks(buttonPausePosNarrow, event_handler, ID_PAUSE_POS_ARROW, "bmp_arrow.bin", 0); + lv_imgbtn_set_src(buttonPausePosNarrow, LV_BTN_STATE_REL, &bmp_para_arrow); + lv_imgbtn_set_src(buttonPausePosNarrow, LV_BTN_STATE_PR, &bmp_para_arrow); + lv_imgbtn_set_style(buttonPausePosNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonPausePosNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonPausePosNarrow, LV_LAYOUT_OFF); + + line1 = lv_line_create(lv_scr_act(), NULL); + lv_ex_line(line1, line_points[0]); + + buttonBack = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_ADVANCE_RETURN, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); + + lv_label_set_text(labelPausePos, machine_menu.PausePosition); + lv_obj_align(labelPausePos, buttonPausePos, LV_ALIGN_IN_LEFT_MID, 0, 0); + } + +} + +void lv_clear_advance_settings() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.h new file mode 100644 index 0000000000..bfd76125bb --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.h @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_advance_settings(void); +extern void lv_clear_advance_settings(); + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp new file mode 100644 index 0000000000..264d528c03 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp @@ -0,0 +1,335 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" + +#include "../../../../MarlinCore.h" +#include "../../../../module/temperature.h" +#include "../../../../module/planner.h" + +static lv_obj_t * scr; +static lv_obj_t * labelStep, *buttonStep, *buttonMov, *buttonExt; +static lv_obj_t * labelMov, *labelExt; +static lv_obj_t * printSpeedText; + +#define ID_C_ADD 1 +#define ID_C_DEC 2 +#define ID_C_MOVE 3 +#define ID_C_EXT 4 +#define ID_C_STEP 5 +#define ID_C_RETURN 6 + +static uint8_t speedType; + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_C_ADD: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (speedType == 0) { + if (feedrate_percentage < MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) + feedrate_percentage += uiCfg.stepPrintSpeed; + else + feedrate_percentage = MAX_EXT_SPEED_PERCENT; + } + else if (speedType == 1) { + if (planner.flow_percentage[0] < MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) + planner.flow_percentage[0] += uiCfg.stepPrintSpeed; + else + planner.flow_percentage[0] = MAX_EXT_SPEED_PERCENT; + //planner.e_factor[0]= planner.flow_percentage[0]*0.01; + //planner.flow_percentage[1] = planner.flow_percentage[0]; + //planner.e_factor[1]= planner.flow_percentage[1]*0.01; + planner.refresh_e_factor(0); + if (EXTRUDERS == 2) { + planner.flow_percentage[1] = planner.flow_percentage[0]; + planner.refresh_e_factor(1); + } + } + disp_print_speed(); + } + break; + case ID_C_DEC: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (speedType == 0) { + if (feedrate_percentage > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) + feedrate_percentage -= uiCfg.stepPrintSpeed; + else + feedrate_percentage = MIN_EXT_SPEED_PERCENT; + } + else if (speedType == 1) { + if (planner.flow_percentage[0] > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) + planner.flow_percentage[0] -= uiCfg.stepPrintSpeed; + else + planner.flow_percentage[0] = MIN_EXT_SPEED_PERCENT; + //planner.e_factor[0]= planner.flow_percentage[0] * 0.01; + //planner.flow_percentage[1] = planner.flow_percentage[0]; + //planner.e_factor[1]= planner.flow_percentage[1] * 0.01; + planner.refresh_e_factor(0); + if (EXTRUDERS == 2) { + planner.flow_percentage[1] = planner.flow_percentage[0]; + planner.refresh_e_factor(1); + } + } + disp_print_speed(); + } + break; + case ID_C_MOVE: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + speedType = 0; + disp_speed_type(); + disp_print_speed(); + } + break; + case ID_C_EXT: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + speedType = 1; + disp_speed_type(); + disp_print_speed(); + } + break; + case ID_C_STEP: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (uiCfg.stepPrintSpeed == 1) + uiCfg.stepPrintSpeed = 5; + else if (uiCfg.stepPrintSpeed == 5) + uiCfg.stepPrintSpeed = 10; + else + uiCfg.stepPrintSpeed = 1; + disp_speed_step(); + } + break; + case ID_C_RETURN: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + } +} + +void lv_draw_change_speed(void) { + lv_obj_t *buttonAdd, *buttonDec; + lv_obj_t *buttonBack; + + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != CHANGE_SPEED_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = CHANGE_SPEED_UI; + } + disp_state = CHANGE_SPEED_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonAdd = lv_imgbtn_create(scr, NULL); + buttonDec = lv_imgbtn_create(scr, NULL); + buttonMov = lv_imgbtn_create(scr, NULL); + buttonExt = lv_imgbtn_create(scr, NULL); + buttonStep = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonAdd, event_handler, ID_C_ADD, "bmp_Add.bin", 0); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); + + #if 1 + lv_obj_set_event_cb_mks(buttonDec, event_handler, ID_C_DEC, "bmp_Dec.bin", 0); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_imgbtn_set_src(buttonMov, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonMov, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonMov, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonMov, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_imgbtn_set_src(buttonExt, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonExt, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonExt, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonExt, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_C_RETURN, "bmp_return.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif + + lv_obj_set_pos(buttonAdd, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonDec, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttonMov, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonExt, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonStep, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonMov, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonExt, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); + lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); + labelMov = lv_label_create(buttonMov, NULL); + labelExt = lv_label_create(buttonExt, NULL); + labelStep = lv_label_create(buttonStep, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelAdd, speed_menu.add); + lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelDec, speed_menu.dec); + lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + disp_speed_type(); + disp_speed_step(); + + printSpeedText = lv_label_create(scr, NULL); + lv_obj_set_style(printSpeedText, &tft_style_label_rel); + disp_print_speed(); +} + +void disp_speed_step() { + if (uiCfg.stepPrintSpeed == 1) + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_C_STEP, "bmp_step1_percent.bin", 0); + else if (uiCfg.stepPrintSpeed == 5) + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_C_STEP, "bmp_step5_percent.bin", 0); + else if (uiCfg.stepPrintSpeed == 10) + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_C_STEP, "bmp_step10_percent.bin", 0); + + if (gCfgItems.multiple_language != 0) { + if (uiCfg.stepPrintSpeed == 1) { + lv_label_set_text(labelStep, speed_menu.step_1percent); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + else if (uiCfg.stepPrintSpeed == 5) { + lv_label_set_text(labelStep, speed_menu.step_5percent); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + else if (uiCfg.stepPrintSpeed == 10) { + lv_label_set_text(labelStep, speed_menu.step_10percent); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + } +} + +void disp_print_speed() { + char buf[30] = {0}; + + public_buf_l[0] = '\0'; + + if (speedType == 0) { // move + strcat(public_buf_l, speed_menu.move_speed); + strcat_P(public_buf_l, PSTR(": ")); + sprintf_P(buf, PSTR("%d%%"), feedrate_percentage); + strcat(public_buf_l, buf); + } + else if (speedType == 1) { // e1 + strcat(public_buf_l, speed_menu.extrude_speed); + strcat_P(public_buf_l, PSTR(": ")); + sprintf_P(buf, PSTR("%d%%"), planner.flow_percentage[0]); + strcat(public_buf_l, buf); + } + lv_label_set_text(printSpeedText, public_buf_l); + lv_obj_align(printSpeedText, NULL, LV_ALIGN_CENTER, 0, -65); +} + +void disp_speed_type() { + switch (speedType) { + case 1: + lv_obj_set_event_cb_mks(buttonExt, event_handler, ID_C_EXT, "bmp_extruct_sel.bin", 0); + lv_obj_set_event_cb_mks(buttonMov, event_handler, ID_C_MOVE, "bmp_mov_changeSpeed.bin", 0); + break; + + default: + lv_obj_set_event_cb_mks(buttonExt, event_handler, ID_C_EXT, "bmp_speed_extruct.bin", 0); + lv_obj_set_event_cb_mks(buttonMov, event_handler, ID_C_MOVE, "bmp_mov_sel.bin", 0); + break; + } + lv_obj_refresh_ext_draw_pad(buttonExt); + lv_obj_refresh_ext_draw_pad(buttonMov); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelMov, speed_menu.move); + lv_obj_align(labelMov, buttonMov, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelExt, speed_menu.extrude); + lv_obj_align(labelExt, buttonExt, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } +} + +void lv_clear_change_speed() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h new file mode 100644 index 0000000000..d071da20bb --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h @@ -0,0 +1,40 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +#define MIN_EXT_SPEED_PERCENT 10 +#define MAX_EXT_SPEED_PERCENT 999 + +extern void lv_draw_change_speed(void); +extern void lv_clear_change_speed(); +extern void disp_speed_step(); +extern void disp_print_speed(); +extern void disp_speed_type(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp new file mode 100644 index 0000000000..9ef27afc9b --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp @@ -0,0 +1,372 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * draw_dialog.cpp + */ + +#include "../../../../inc/MarlinConfigPre.h" + +#if HAS_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" + +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" + +#include "../../../../MarlinCore.h" +#include "../../../../sd/cardreader.h" +#include "../../../../gcode/queue.h" +#include "../../../../module/temperature.h" +#include "../../../../module/planner.h" + +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../../../feature/powerloss.h" +#endif + +#if ENABLED(PARK_HEAD_ON_PAUSE) + #include "../../../../feature/pause.h" +#endif +#include "../../../../gcode/gcode.h" + +static lv_obj_t * scr; +extern uint8_t sel_id; +extern uint8_t once_flag; +extern uint8_t gcode_preview_over; +uint8_t DialogType; + +static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) { + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (DialogType == DIALOG_TYPE_PRINT_FILE) { + #if HAS_GCODE_PREVIEW + preview_gcode_prehandle(list_file.file_name[sel_id]); + #endif + reset_print_time(); + start_print_time(); + + uiCfg.print_state = WORKING; + lv_clear_dialog(); + lv_draw_printing(); + + #if ENABLED(SDSUPPORT) + if (gcode_preview_over != 1) { + char *cur_name; + cur_name = strrchr(list_file.file_name[sel_id], '/'); + + SdFile file, *curDir; + card.endFilePrint(); + const char * const fname = card.diveToFile(true, curDir, cur_name); + if (!fname) return; + if (file.open(curDir, fname, O_READ)) { + gCfgItems.curFilesize = file.fileSize(); + file.close(); + update_spi_flash(); + } + card.openFileRead(cur_name); + if (card.isFileOpen()) { + feedrate_percentage = 100; + //saved_feedrate_percentage = feedrate_percentage; + planner.flow_percentage[0] = 100; + planner.e_factor[0] = planner.flow_percentage[0] * 0.01f; + #if EXTRUDERS == 2 + planner.flow_percentage[1] = 100; + planner.e_factor[1] = planner.flow_percentage[1] * 0.01f; + #endif + card.startFileprint(); + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.prepare(); + #endif + once_flag = 0; + } + } + #endif + } + else if (DialogType == DIALOG_TYPE_STOP) { + stop_print_time(); + lv_clear_dialog(); + lv_draw_ready_print(); + + #if ENABLED(SDSUPPORT) + //card.endFilePrint(); + //wait_for_heatup = false; + uiCfg.print_state = IDLE; + card.flag.abort_sd_printing = true; + //queue.clear(); + //quickstop_stepper(); + //print_job_timer.stop(); + //thermalManager.disable_all_heaters(); + + //#if ENABLED(POWER_LOSS_RECOVERY) + // recovery.purge(); + //#endif + //queue.enqueue_now_P(PSTR("G91\nG1 Z10\nG90\nG28 X0 Y0")); + //queue.inject_P(PSTR("G91\nG1 Z10\nG90\nG28 X0 Y0\nM84\nM107")); + #endif + } + else if (DialogType == DIALOG_TYPE_FINISH_PRINT) { + clear_cur_ui(); + lv_draw_ready_print(); + } + #if ENABLED(ADVANCED_PAUSE_FEATURE) + else if (DialogType == DIALOG_PAUSE_MESSAGE_WAITING + || DialogType == DIALOG_PAUSE_MESSAGE_INSERT + || DialogType == DIALOG_PAUSE_MESSAGE_HEAT + ) { + wait_for_user = false; + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_OPTION) { + pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_RESUME) { + clear_cur_ui(); + draw_return_ui(); + } + #endif + else if (DialogType == DIALOG_STORE_EEPROM_TIPS) { + gcode.process_subcommands_now_P(PSTR("M500")); + clear_cur_ui(); + draw_return_ui(); + } + else if (DialogType == DIALOG_READ_EEPROM_TIPS) { + gcode.process_subcommands_now_P(PSTR("M501")); + clear_cur_ui(); + draw_return_ui(); + } + else if (DialogType == DIALOG_REVERT_EEPROM_TIPS) { + gcode.process_subcommands_now_P(PSTR("M502")); + clear_cur_ui(); + draw_return_ui(); + } + } +} + +static void btn_cancel_event_cb(lv_obj_t * btn, lv_event_t event) { + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (DialogType == DIALOG_PAUSE_MESSAGE_OPTION) { + #if ENABLED(ADVANCED_PAUSE_FEATURE) + pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; + #endif + } + else { + clear_cur_ui(); + draw_return_ui(); + } + } +} + +void lv_draw_dialog(uint8_t type) { + + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != DIALOG_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = DIALOG_UI; + } + disp_state = DIALOG_UI; + + DialogType = type; + + scr = lv_obj_create(NULL, NULL); + + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + //LV_IMG_DECLARE(bmp_pic); + + static lv_style_t style_btn_rel; // A variable to store the released style + lv_style_copy(&style_btn_rel, &lv_style_plain); // Initialize from a built-in style + style_btn_rel.body.border.color = lv_color_hex3(0x269); + style_btn_rel.body.border.width = 1; + style_btn_rel.body.main_color = lv_color_hex3(0xADF); + style_btn_rel.body.grad_color = lv_color_hex3(0x46B); + style_btn_rel.body.shadow.width = 4; + style_btn_rel.body.shadow.type = LV_SHADOW_BOTTOM; + style_btn_rel.body.radius = LV_RADIUS_CIRCLE; + style_btn_rel.text.color = lv_color_hex3(0xDEF); + style_btn_rel.text.font = &TERN(HAS_SPI_FLASH_FONT, gb2312_puhui32, lv_font_roboto_22); + + static lv_style_t style_btn_pr; // A variable to store the pressed style + lv_style_copy(&style_btn_pr, &style_btn_rel); // Initialize from the released style + style_btn_pr.body.border.color = lv_color_hex3(0x46B); + style_btn_pr.body.main_color = lv_color_hex3(0x8BD); + style_btn_pr.body.grad_color = lv_color_hex3(0x24A); + style_btn_pr.body.shadow.width = 2; + style_btn_pr.text.color = lv_color_hex3(0xBCD); + style_btn_pr.text.font = &TERN(HAS_SPI_FLASH_FONT, gb2312_puhui32, lv_font_roboto_22); + + lv_obj_t * labelDialog = lv_label_create(scr, NULL); + lv_obj_set_style(labelDialog, &tft_style_label_rel); + + if (DialogType == DIALOG_TYPE_FINISH_PRINT || DialogType == DIALOG_PAUSE_MESSAGE_RESUME) { + lv_obj_t * btnOk = lv_btn_create(scr, NULL); // Add a button the current screen + lv_obj_set_pos(btnOk, BTN_OK_X + 90, BTN_OK_Y); // Set its position + lv_obj_set_size(btnOk, 100, 50); // Set its size + lv_obj_set_event_cb(btnOk, btn_ok_event_cb); + lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); // Set the button's released style + lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); // Set the button's pressed style + lv_obj_t * labelOk = lv_label_create(btnOk, NULL); // Add a label to the button + lv_label_set_text(labelOk, print_file_dialog_menu.confirm); // Set the labels text + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_WAITING + || DialogType == DIALOG_PAUSE_MESSAGE_INSERT + || DialogType == DIALOG_PAUSE_MESSAGE_HEAT + ) { + lv_obj_t * btnOk = lv_btn_create(scr, NULL); // Add a button the current screen + lv_obj_set_pos(btnOk, BTN_OK_X + 90, BTN_OK_Y); // Set its position + lv_obj_set_size(btnOk, 100, 50); // Set its size + lv_obj_set_event_cb(btnOk, btn_ok_event_cb); + lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); // Set the button's released style + lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); // Set the button's pressed style + lv_obj_t * labelOk = lv_label_create(btnOk, NULL); // Add a label to the button + lv_label_set_text(labelOk, print_file_dialog_menu.confirm); // Set the labels text + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_PAUSING + || DialogType == DIALOG_PAUSE_MESSAGE_CHANGING + || DialogType == DIALOG_PAUSE_MESSAGE_UNLOAD + || DialogType == DIALOG_PAUSE_MESSAGE_LOAD + || DialogType == DIALOG_PAUSE_MESSAGE_PURGE + || DialogType == DIALOG_PAUSE_MESSAGE_RESUME + || DialogType == DIALOG_PAUSE_MESSAGE_HEATING + ) { + // nothing to do + } + else { + lv_obj_t * btnOk = lv_btn_create(scr, NULL); // Add a button the current screen + lv_obj_set_pos(btnOk, BTN_OK_X, BTN_OK_Y); // Set its position + lv_obj_set_size(btnOk, 100, 50); // Set its size + lv_obj_set_event_cb(btnOk, btn_ok_event_cb); + lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); // Set the button's released style + lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); // Set the button's pressed style + lv_obj_t * labelOk = lv_label_create(btnOk, NULL); // Add a label to the button + + lv_obj_t * btnCancel = lv_btn_create(scr, NULL); // Add a button the current screen + lv_obj_set_pos(btnCancel, BTN_CANCEL_X, BTN_CANCEL_Y); // Set its position + lv_obj_set_size(btnCancel, 100, 50); // Set its size + lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); + lv_btn_set_style(btnCancel, LV_BTN_STYLE_REL, &style_btn_rel); // Set the button's released style + lv_btn_set_style(btnCancel, LV_BTN_STYLE_PR, &style_btn_pr); // Set the button's pressed style + lv_obj_t * labelCancel = lv_label_create(btnCancel, NULL); // Add a label to the button + + if (DialogType == DIALOG_PAUSE_MESSAGE_OPTION) { + lv_label_set_text(labelOk, pause_msg_menu.purgeMore); // Set the labels text + lv_label_set_text(labelCancel, pause_msg_menu.continuePrint); + } + else { + lv_label_set_text(labelOk, print_file_dialog_menu.confirm); // Set the labels text + lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); + } + } + if (DialogType == DIALOG_TYPE_PRINT_FILE) { + lv_label_set_text(labelDialog, print_file_dialog_menu.print_file); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + + lv_obj_t * labelFile = lv_label_create(scr, NULL); + lv_obj_set_style(labelFile, &tft_style_label_rel); + + lv_label_set_text(labelFile, list_file.long_name[sel_id]); + lv_obj_align(labelFile, NULL, LV_ALIGN_CENTER, 0, -60); + } + else if (DialogType == DIALOG_TYPE_STOP) { + lv_label_set_text(labelDialog, print_file_dialog_menu.cancle_print); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_TYPE_FINISH_PRINT) { + lv_label_set_text(labelDialog, print_file_dialog_menu.print_finish); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_PAUSING) { + lv_label_set_text(labelDialog, pause_msg_menu.pausing); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_CHANGING) { + lv_label_set_text(labelDialog, pause_msg_menu.changing); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_UNLOAD) { + lv_label_set_text(labelDialog, pause_msg_menu.unload); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_WAITING) { + lv_label_set_text(labelDialog, pause_msg_menu.waiting); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_INSERT) { + lv_label_set_text(labelDialog, pause_msg_menu.insert); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_LOAD) { + lv_label_set_text(labelDialog, pause_msg_menu.load); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_PURGE) { + lv_label_set_text(labelDialog, pause_msg_menu.purge); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_RESUME) { + lv_label_set_text(labelDialog, pause_msg_menu.resume); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_HEAT) { + lv_label_set_text(labelDialog, pause_msg_menu.heat); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_HEATING) { + lv_label_set_text(labelDialog, pause_msg_menu.heating); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_OPTION) { + lv_label_set_text(labelDialog, pause_msg_menu.option); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_STORE_EEPROM_TIPS) { + lv_label_set_text(labelDialog, eeprom_menu.storeTips); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_READ_EEPROM_TIPS) { + lv_label_set_text(labelDialog, eeprom_menu.readTips); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_REVERT_EEPROM_TIPS) { + lv_label_set_text(labelDialog, eeprom_menu.revertTips); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } +} + +void lv_clear_dialog() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h new file mode 100644 index 0000000000..a5b829a2cf --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h @@ -0,0 +1,83 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +#define DIALOG_TYPE_STOP 0 +#define DIALOG_TYPE_PRINT_FILE 1 +#define DIALOG_TYPE_REPRINT_NO_FILE 2 + +#define DIALOG_TYPE_M80_FAIL 3 //** +#define DIALOG_TYPE_MESSAGE_ERR1 4 //** + +#define DIALOG_TYPE_UPDATE_ESP_FIRMARE 5 +#define DIALOG_TYPE_UPDATE_ESP_DATA 6 +#define DIALOG_TYPE_UPLOAD_FILE 7 +#define DIALOG_TYPE_UNBIND 8 + +#define DIALOG_TYPE_FILAMENT_LOAD_HEAT 9 +#define DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED 10 +#define DIALOG_TYPE_FILAMENT_LOADING 11 +#define DIALOG_TYPE_FILAMENT_LOAD_COMPLETED 12 +#define DIALOG_TYPE_FILAMENT_UNLOAD_HEAT 13 +#define DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED 14 +#define DIALOG_TYPE_FILAMENT_UNLOADING 15 +#define DIALOG_TYPE_FILAMENT_UNLOAD_COMPLETED 16 + +#define DIALOG_TYPE_FILE_LOADING 17 //** + +#define DIALOG_TYPE_FILAMENT_NO_PRESS 18 +#define DIALOG_TYPE_FINISH_PRINT 19 + +#define WIFI_ENABLE_TIPS 20 + +#define DIALOG_PAUSE_MESSAGE_PAUSING 21 +#define DIALOG_PAUSE_MESSAGE_CHANGING 22 +#define DIALOG_PAUSE_MESSAGE_UNLOAD 23 +#define DIALOG_PAUSE_MESSAGE_WAITING 24 +#define DIALOG_PAUSE_MESSAGE_INSERT 25 +#define DIALOG_PAUSE_MESSAGE_LOAD 26 +#define DIALOG_PAUSE_MESSAGE_PURGE 27 +#define DIALOG_PAUSE_MESSAGE_RESUME 28 +#define DIALOG_PAUSE_MESSAGE_HEAT 29 +#define DIALOG_PAUSE_MESSAGE_HEATING 30 +#define DIALOG_PAUSE_MESSAGE_OPTION 31 + +#define DIALOG_STORE_EEPROM_TIPS 32 +#define DIALOG_READ_EEPROM_TIPS 33 +#define DIALOG_REVERT_EEPROM_TIPS 34 + +#define BTN_OK_X 100 +#define BTN_OK_Y 180 +#define BTN_CANCEL_X 280 +#define BTN_CANCEL_Y 180 + +extern void lv_draw_dialog(uint8_t type); +extern void lv_clear_dialog(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp new file mode 100644 index 0000000000..f340ca4632 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp @@ -0,0 +1,237 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" + +#include "../../../../MarlinCore.h" + +static lv_obj_t * scr; + +#define ID_EEPROM_RETURN 1 +#define ID_EEPROM_STORE 2 +#define ID_EEPROM_STORE_ARROW 3 +#define ID_EEPROM_READ 4 +#define ID_EEPROM_READ_ARROW 5 +#define ID_EEPROM_REVERT 6 +#define ID_EEPROM_REVERT_ARROW 7 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_EEPROM_RETURN: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_eeprom_settings(); + draw_return_ui(); + } + break; + + #if 0 + case ID_EEPROM_STORE: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_eeprom_settings(); + lv_draw_dialog(DIALOG_STORE_EEPROM_TIPS); + } + break; + case ID_EEPROM_STORE_ARROW: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_eeprom_settings(); + lv_draw_dialog(DIALOG_STORE_EEPROM_TIPS); + } + break; + case ID_EEPROM_READ: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_eeprom_settings(); + lv_draw_dialog(DIALOG_READ_EEPROM_TIPS); + } + break; + case ID_EEPROM_READ_ARROW: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_eeprom_settings(); + lv_draw_dialog(DIALOG_READ_EEPROM_TIPS); + } + break; + #endif + + case ID_EEPROM_REVERT: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_eeprom_settings(); + lv_draw_dialog(DIALOG_REVERT_EEPROM_TIPS); + } + break; + case ID_EEPROM_REVERT_ARROW: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_eeprom_settings(); + lv_draw_dialog(DIALOG_REVERT_EEPROM_TIPS); + } + break; + } +} + +void lv_draw_eeprom_settings(void) { + lv_obj_t *buttonBack, *label_Back; + //lv_obj_t *buttonStore,*labelStore,*buttonStoreNarrow; + //lv_obj_t *buttonRead,*labelRead,*buttonReadNarrow; + lv_obj_t *buttonRevert, *labelRevert, *buttonRevertNarrow; + lv_obj_t * line1; // * line2,* line3; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != EEPROM_SETTINGS_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = EEPROM_SETTINGS_UI; + } + disp_state = EEPROM_SETTINGS_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_para_back); + LV_IMG_DECLARE(bmp_para_arrow); + #if 0 + buttonStore = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonStore, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonStore, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + //lv_obj_set_event_cb(buttonMachine, event_handler); + lv_obj_set_event_cb_mks(buttonStore, event_handler, ID_EEPROM_STORE, NULL, 0); + lv_btn_set_style(buttonStore, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonStore, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonStore, LV_LAYOUT_OFF); + labelStore = lv_label_create(buttonStore, NULL); /*Add a label to the button*/ + + buttonStoreNarrow = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonStoreNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V); + lv_obj_set_event_cb_mks(buttonStoreNarrow, event_handler, ID_EEPROM_STORE_ARROW, "bmp_arrow.bin", 0); + lv_imgbtn_set_src(buttonStoreNarrow, LV_BTN_STATE_REL, &bmp_para_arrow); + lv_imgbtn_set_src(buttonStoreNarrow, LV_BTN_STATE_PR, &bmp_para_arrow); + lv_imgbtn_set_style(buttonStoreNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonStoreNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonStoreNarrow, LV_LAYOUT_OFF); + + line1 = lv_line_create(scr, NULL); + lv_ex_line(line1, line_points[0]); + + buttonRead = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonRead, PARA_UI_POS_X, PARA_UI_POS_Y * 2); /*Set its position*/ + lv_obj_set_size(buttonRead, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + //lv_obj_set_event_cb(buttonMotor, event_handler); + lv_obj_set_event_cb_mks(buttonRead, event_handler, ID_EEPROM_READ, NULL, 0); + lv_btn_set_style(buttonRead, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonRead, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonRead, LV_LAYOUT_OFF); + labelRead = lv_label_create(buttonRead, NULL); /*Add a label to the button*/ + + buttonReadNarrow = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonReadNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V); + lv_obj_set_event_cb_mks(buttonReadNarrow, event_handler, ID_EEPROM_READ_ARROW, "bmp_arrow.bin", 0); + lv_imgbtn_set_src(buttonReadNarrow, LV_BTN_STATE_REL, &bmp_para_arrow); + lv_imgbtn_set_src(buttonReadNarrow, LV_BTN_STATE_PR, &bmp_para_arrow); + lv_imgbtn_set_style(buttonReadNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonReadNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonReadNarrow, LV_LAYOUT_OFF); + + line2 = lv_line_create(scr, NULL); + lv_ex_line(line2, line_points[1]); + #endif // if 0 + buttonRevert = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonRevert, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonRevert, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + //lv_obj_set_event_cb(buttonMotor, event_handler); + lv_obj_set_event_cb_mks(buttonRevert, event_handler, ID_EEPROM_REVERT, NULL, 0); + lv_btn_set_style(buttonRevert, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonRevert, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonRevert, LV_LAYOUT_OFF); + labelRevert = lv_label_create(buttonRevert, NULL); /*Add a label to the button*/ + + buttonRevertNarrow = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonRevertNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V); + lv_obj_set_event_cb_mks(buttonRevertNarrow, event_handler, ID_EEPROM_REVERT_ARROW, "bmp_arrow.bin", 0); + lv_imgbtn_set_src(buttonRevertNarrow, LV_BTN_STATE_REL, &bmp_para_arrow); + lv_imgbtn_set_src(buttonRevertNarrow, LV_BTN_STATE_PR, &bmp_para_arrow); + lv_imgbtn_set_style(buttonRevertNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonRevertNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonRevertNarrow, LV_LAYOUT_OFF); + + //line3 = lv_line_create(scr, NULL); + //lv_ex_line(line3,line_points[2]); + line1 = lv_line_create(scr, NULL); + lv_ex_line(line1, line_points[0]); + + buttonBack = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_EEPROM_RETURN, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); + + //lv_label_set_text(labelStore, eeprom_menu.store); + //lv_obj_align(labelStore, buttonStore, LV_ALIGN_IN_LEFT_MID,0, 0); + + //lv_label_set_text(labelRead, eeprom_menu.read); + //lv_obj_align(labelRead, buttonRead, LV_ALIGN_IN_LEFT_MID,0, 0); + + lv_label_set_text(labelRevert, eeprom_menu.revert); + lv_obj_align(labelRevert, buttonRevert, LV_ALIGN_IN_LEFT_MID, 0, 0); + } + +} + +void lv_clear_eeprom_settings() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.h new file mode 100644 index 0000000000..da699353ba --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.h @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_eeprom_settings(void); +extern void lv_clear_eeprom_settings(); + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp new file mode 100644 index 0000000000..1bcdccda41 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp @@ -0,0 +1,88 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#if ENABLED(TFT_LVGL_UI_SPI) + #include "SPI_TFT.h" +#endif + +#include "lv_conf.h" +#include "draw_ui.h" +#include "tft_lvgl_configuration.h" +#include "mks_hardware_test.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" + +#include "../../../../MarlinCore.h" + +static lv_obj_t * scr; + +void lv_draw_error_message(PGM_P const msg) { + #if 0 + static lv_obj_t * message = NULL, *kill_message = NULL, *reset_tips = NULL; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ERROR_MESSAGE_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = ERROR_MESSAGE_UI; + } + disp_state = ERROR_MESSAGE_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + if (msg) { + message = lv_label_create(scr, NULL); + lv_obj_set_style(message, &tft_style_label_rel); + lv_label_set_text(message, msg); + lv_obj_align(message, NULL, LV_ALIGN_CENTER, 0, -50); + } + + kill_message = lv_label_create(scr, NULL); + lv_obj_set_style(kill_message, &tft_style_label_rel); + lv_label_set_text(kill_message, "PRINTER HALTED"); + lv_obj_align(kill_message, NULL, LV_ALIGN_CENTER, 0, -10); + + reset_tips = lv_label_create(scr, NULL); + lv_obj_set_style(reset_tips, &tft_style_label_rel); + lv_label_set_text(reset_tips, "Please Reset"); + lv_obj_align(reset_tips, NULL, LV_ALIGN_CENTER, 0, 30); + + lv_task_handler(); + #endif + + TERN(TFT_LVGL_UI_SPI, SPI_TFT.LCD_clear, LCD_Clear)(0x0000); + if (msg) disp_string((TFT_WIDTH - strlen(msg) * 16) / 2, 100, msg, 0xFFFF, 0x0000); + disp_string((TFT_WIDTH - strlen("PRINTER HALTED") * 16) / 2, 140, "PRINTER HALTED", 0xFFFF, 0x0000); + disp_string((TFT_WIDTH - strlen("Please Reset") * 16) / 2, 180, "Please Reset", 0xFFFF, 0x0000); +} + +void lv_clear_error_message() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h new file mode 100644 index 0000000000..010b612ff7 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h @@ -0,0 +1,38 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +#ifndef PGM_P + #define PGM_P const char * +#endif + +extern void lv_draw_error_message(PGM_P const msg); +extern void lv_clear_error_message(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp new file mode 100644 index 0000000000..ca84b4b5ec --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp @@ -0,0 +1,377 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" + +#include "../../../../MarlinCore.h" +#include "../../../../module/temperature.h" +#include "../../../../gcode/queue.h" + +static lv_obj_t * scr; +static lv_obj_t * buttoType, *buttonStep, *buttonSpeed; +static lv_obj_t * labelType; +static lv_obj_t * labelStep; +static lv_obj_t * labelSpeed; +static lv_obj_t * tempText; +static lv_obj_t * ExtruText; + +#define ID_E_ADD 1 +#define ID_E_DEC 2 +#define ID_E_TYPE 3 +#define ID_E_STEP 4 +#define ID_E_SPEED 5 +#define ID_E_RETURN 6 + +static int32_t extructAmount; + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_E_ADD: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= EXTRUDE_MINTEMP) { + queue.enqueue_now_P(PSTR("G91")); + ZERO(public_buf_l); + sprintf_P((char *)public_buf_l, PSTR("G1 E%d F%d"), uiCfg.extruStep, 60 * uiCfg.extruSpeed); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G90")); + extructAmount += uiCfg.extruStep; + disp_extru_amount(); + } + } + break; + case ID_E_DEC: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= EXTRUDE_MINTEMP) { + queue.enqueue_now_P(PSTR("G91")); + ZERO(public_buf_l); + sprintf_P((char *)public_buf_l, PSTR("G1 E%d F%d"), 0 - uiCfg.extruStep, 60 * uiCfg.extruSpeed); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G90")); + extructAmount -= uiCfg.extruStep; + disp_extru_amount(); + } + } + break; + case ID_E_TYPE: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (EXTRUDERS == 2) { + if (uiCfg.curSprayerChoose == 0) { + uiCfg.curSprayerChoose = 1; + queue.inject_P(PSTR("T1")); + } + else { + uiCfg.curSprayerChoose = 0; + queue.inject_P(PSTR("T0")); + } + } + else { + uiCfg.curSprayerChoose = 0; + } + extructAmount = 0; + disp_hotend_temp(); + disp_ext_type(); + disp_extru_amount(); + } + break; + case ID_E_STEP: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + switch (abs(uiCfg.extruStep)) { + case 1: uiCfg.extruStep = 5; break; + case 5: uiCfg.extruStep = 10; break; + case 10: uiCfg.extruStep = 1; break; + default: break; + } + disp_ext_step(); + } + break; + case ID_E_SPEED: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + switch (uiCfg.extruSpeed) { + case 1: uiCfg.extruSpeed = 10; break; + case 10: uiCfg.extruSpeed = 20; break; + case 20: uiCfg.extruSpeed = 1; break; + default: break; + } + disp_ext_speed(); + } + break; + case ID_E_RETURN: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + } +} + + +void lv_draw_extrusion(void) { + lv_obj_t *buttonAdd, *buttonDec, *buttonBack; + + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != EXTRUSION_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = EXTRUSION_UI; + } + disp_state = EXTRUSION_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonAdd = lv_imgbtn_create(scr, NULL); + buttonDec = lv_imgbtn_create(scr, NULL); + buttoType = lv_imgbtn_create(scr, NULL); + buttonStep = lv_imgbtn_create(scr, NULL); + buttonSpeed = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonAdd, event_handler, ID_E_ADD, "bmp_in.bin", 0); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonDec, event_handler, ID_E_DEC, "bmp_out.bin", 0); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttoType, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttoType, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_E_RETURN, "bmp_return.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif + + lv_obj_set_pos(buttonAdd, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonDec, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttoType, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonStep, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonSpeed, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); + lv_btn_set_layout(buttoType, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonSpeed, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); + lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); + labelType = lv_label_create(buttoType, NULL); + labelStep = lv_label_create(buttonStep, NULL); + labelSpeed = lv_label_create(buttonSpeed, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelAdd, extrude_menu.in); + lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelDec, extrude_menu.out); + lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + + disp_ext_type(); + disp_ext_step(); + disp_ext_speed(); + + tempText = lv_label_create(scr, NULL); + lv_obj_set_style(tempText, &tft_style_label_rel); + disp_hotend_temp(); + + ExtruText = lv_label_create(scr, NULL); + lv_obj_set_style(ExtruText, &tft_style_label_rel); + disp_extru_amount(); +} + +void disp_ext_type() { + if (uiCfg.curSprayerChoose == 1) { + lv_obj_set_event_cb_mks(buttoType, event_handler, ID_E_TYPE, "bmp_extru2.bin", 0); + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelType, extrude_menu.ext2); + lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + } + else { + lv_obj_set_event_cb_mks(buttoType, event_handler, ID_E_TYPE, "bmp_extru1.bin", 0); + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelType, extrude_menu.ext1); + lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + } +} + +void disp_ext_speed() { + if (uiCfg.extruSpeed == 20) + lv_obj_set_event_cb_mks(buttonSpeed, event_handler, ID_E_SPEED, "bmp_speed_high.bin", 0); + else if (uiCfg.extruSpeed == 1) + lv_obj_set_event_cb_mks(buttonSpeed, event_handler, ID_E_SPEED, "bmp_speed_slow.bin", 0); + else + lv_obj_set_event_cb_mks(buttonSpeed, event_handler, ID_E_SPEED, "bmp_speed_normal.bin", 0); + + if (gCfgItems.multiple_language != 0) { + if (uiCfg.extruSpeed == 20) { + lv_label_set_text(labelSpeed, extrude_menu.high); + lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + else if (uiCfg.extruSpeed == 1) { + lv_label_set_text(labelSpeed, extrude_menu.low); + lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + else { + lv_label_set_text(labelSpeed, extrude_menu.normal); + lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + } +} + +void disp_hotend_temp() { + char buf[20] = {0}; + public_buf_l[0] = '\0'; + strcat(public_buf_l, extrude_menu.temper_text); + sprintf(buf, extrude_menu.temp_value, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); + strcat(public_buf_l, buf); + lv_label_set_text(tempText, public_buf_l); + lv_obj_align(tempText, NULL, LV_ALIGN_CENTER, 0, -50); +} + +void disp_extru_amount() { + char buf1[10] = {0}; + + public_buf_l[0] = '\0'; + + if (extructAmount < 999 && extructAmount > -99) { + sprintf(buf1, extrude_menu.count_value_mm, extructAmount); + if (uiCfg.curSprayerChoose < 1) + strcat(public_buf_l, extrude_menu.ext1); + else + strcat(public_buf_l, extrude_menu.ext2); + strcat(public_buf_l, buf1); + } + else if (extructAmount < 9999 && extructAmount > -999) { + sprintf(buf1, extrude_menu.count_value_cm, extructAmount / 10); + if (uiCfg.curSprayerChoose < 1) + strcat(public_buf_l, extrude_menu.ext1); + else + strcat(public_buf_l, extrude_menu.ext2); + strcat(public_buf_l, buf1); + } + else { + sprintf(buf1, extrude_menu.count_value_m, extructAmount / 1000); + if (uiCfg.curSprayerChoose < 1) + strcat(public_buf_l, extrude_menu.ext1); + else + strcat(public_buf_l, extrude_menu.ext2); + strcat(public_buf_l, buf1); + } + + lv_label_set_text(ExtruText, public_buf_l); + lv_obj_align(ExtruText, NULL, LV_ALIGN_CENTER, 0, -75); +} + +void disp_ext_step() { + if (uiCfg.extruStep == 1) + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_E_STEP, "bmp_step1_mm.bin", 0); + else if (uiCfg.extruStep == 5) + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_E_STEP, "bmp_step5_mm.bin", 0); + else if (uiCfg.extruStep == 10) + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_E_STEP, "bmp_step10_mm.bin", 0); + + if (gCfgItems.multiple_language != 0) { + if (uiCfg.extruStep == 1) { + lv_label_set_text(labelStep, extrude_menu.step_1mm); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + else if (uiCfg.extruStep == 5) { + lv_label_set_text(labelStep, extrude_menu.step_5mm); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + else if (uiCfg.extruStep == 10) { + lv_label_set_text(labelStep, extrude_menu.step_10mm); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + } +} + +void lv_clear_extrusion() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h new file mode 100644 index 0000000000..a7b2afcd8a --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h @@ -0,0 +1,39 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_extrusion(void); +extern void lv_clear_extrusion(); +extern void disp_ext_type(); +extern void disp_ext_step(); +extern void disp_ext_speed(); +extern void disp_hotend_temp(); +extern void disp_extru_amount(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp new file mode 100644 index 0000000000..4dcac62aee --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp @@ -0,0 +1,250 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "../../../../MarlinCore.h" +#include "lv_conf.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +#include "../../../../../Configuration.h" +#include "draw_ui.h" +#include "../../../../module/temperature.h" +#include "../../../../gcode/queue.h" +#include "../../../../gcode/gcode.h" + +static lv_obj_t * scr; +static lv_obj_t * fanText; + +#define ID_F_ADD 1 +#define ID_F_DEC 2 +#define ID_F_HIGH 3 +#define ID_F_MID 4 +#define ID_F_OFF 5 +#define ID_F_RETURN 6 + +static uint8_t fanSpeed; + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_F_ADD: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (fanSpeed + 1 <= 255) { + fanSpeed++; + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("M106 S%d"), fanSpeed); + gcode.process_subcommands_now(public_buf_l); + } + } + break; + case ID_F_DEC: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (fanSpeed > 0) { + fanSpeed--; + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("M106 S%d"), fanSpeed); + gcode.process_subcommands_now(public_buf_l); + } + } + + break; + case ID_F_HIGH: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + gcode.process_subcommands_now_P(PSTR("M106 S255")); + } + break; + case ID_F_MID: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + gcode.process_subcommands_now_P(PSTR("M106 S127")); + } + break; + case ID_F_OFF: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + gcode.process_subcommands_now_P(PSTR("M107")); + } + break; + case ID_F_RETURN: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + } +} + +void lv_draw_fan(void) { + lv_obj_t *buttonAdd, *buttonDec, *buttonHigh, *buttonMid; + lv_obj_t *buttonOff, *buttonBack; + + #if HAS_FAN + fanSpeed = thermalManager.fan_speed[0]; + #endif + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != FAN_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = FAN_UI; + } + disp_state = FAN_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonAdd = lv_imgbtn_create(scr, NULL); + buttonDec = lv_imgbtn_create(scr, NULL); + buttonHigh = lv_imgbtn_create(scr, NULL); + buttonMid = lv_imgbtn_create(scr, NULL); + buttonOff = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonAdd, event_handler, ID_F_ADD, "bmp_Add.bin", 0); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonDec, event_handler, ID_F_DEC, "bmp_Dec.bin", 0); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonHigh, event_handler,ID_F_HIGH,"bmp_speed255.bin",0); + lv_imgbtn_set_src(buttonHigh, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonHigh, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonHigh, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonHigh, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonMid, event_handler,ID_F_MID,"bmp_speed127.bin",0); + lv_imgbtn_set_src(buttonMid, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonMid, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonMid, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonMid, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonOff, event_handler,ID_F_OFF,"bmp_speed0.bin",0); + lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_F_RETURN,"bmp_return.bin",0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif + + lv_obj_set_pos(buttonAdd, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonDec, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttonHigh, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonMid, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonOff, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHigh, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonMid, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonOff, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); + lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); + lv_obj_t * labelHigh = lv_label_create(buttonHigh, NULL); + lv_obj_t * labelMid = lv_label_create(buttonMid, NULL); + lv_obj_t * labelOff = lv_label_create(buttonOff, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelAdd, fan_menu.add); + lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelDec, fan_menu.dec); + lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelHigh, fan_menu.full); + lv_obj_align(labelHigh, buttonHigh, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelMid, fan_menu.half); + lv_obj_align(labelMid, buttonMid, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelOff, fan_menu.off); + lv_obj_align(labelOff, buttonOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + + fanText = lv_label_create(scr, NULL); + lv_obj_set_style(fanText, &tft_style_label_rel); + disp_fan_value(); +} + +void disp_fan_value() { + char buf1[10] = {0}; + public_buf_l[0] = '\0'; + strcat(public_buf_l, fan_menu.state); + strcat_P(public_buf_l, PSTR(": ")); + sprintf_P(buf1, PSTR("%3d"), thermalManager.fan_speed[0]); + strcat(public_buf_l, buf1); + lv_label_set_text(fanText, public_buf_l); + lv_obj_align(fanText, NULL, LV_ALIGN_CENTER, 0, -65); +} + +void lv_clear_fan() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h new file mode 100644 index 0000000000..ef17885926 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h @@ -0,0 +1,35 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_fan(void); +extern void lv_clear_fan(); +extern void disp_fan_value(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp new file mode 100644 index 0000000000..35d442ebae --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp @@ -0,0 +1,270 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "../../../../MarlinCore.h" +#include "draw_ready_print.h" +#include "draw_set.h" +#include "lv_conf.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +#include "draw_ui.h" +#include "../../../../gcode/queue.h" + +static lv_obj_t * scr; + +#define ID_H_ALL 1 +#define ID_H_X 2 +#define ID_H_Y 3 +#define ID_H_Z 4 +#define ID_H_RETURN 5 +#define ID_H_OFF_ALL 6 +#define ID_H_OFF_XY 7 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_H_ALL: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("G28")); + } + break; + case ID_H_X: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("G28 X0")); + } + break; + case ID_H_Y: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("G28 Y0")); + } + break; + case ID_H_Z: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("G28 Z0")); + } + break; + case ID_H_OFF_ALL: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("M84")); + } + break; + case ID_H_OFF_XY: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("M84 X Y")); + } + break; + case ID_H_RETURN: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_tool(); + } + break; + + } +} + +void lv_draw_home(void) { + lv_obj_t *buttonHomeAll, *buttonHomeX, *buttonHomeY, *buttonHomeZ; + lv_obj_t *buttonBack; + lv_obj_t *buttonOffAll, *buttonOffXY; + + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ZERO_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = ZERO_UI; + } + disp_state = ZERO_UI; + + scr = lv_obj_create(NULL, NULL); + + //static lv_style_t tool_style; + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + //buttonWifi = lv_imgbtn_create(scr, NULL); + buttonHomeAll = lv_imgbtn_create(scr, NULL); + buttonHomeX = lv_imgbtn_create(scr, NULL); + //buttonContinue = lv_imgbtn_create(scr, NULL); + buttonHomeY = lv_imgbtn_create(scr, NULL); + buttonHomeZ = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + buttonOffAll = lv_imgbtn_create(scr, NULL); + buttonOffXY = lv_imgbtn_create(scr, NULL); + + //lv_obj_set_event_cb_mks(buttonWifi, event_handler,ID_S_WIFI,"bmp_Wifi.bin",0); + //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_REL, &bmp_pic); + //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_PR, &tft_style_label_pre); + //lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_REL, &tft_style_label_rel); + //lv_obj_clear_protect(buttonWifi, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonHomeAll, event_handler,ID_H_ALL,"bmp_zero.bin",0); + lv_imgbtn_set_src(buttonHomeAll, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonHomeAll, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonHomeAll, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonHomeAll, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonHomeX, event_handler, ID_H_X, "bmp_zeroX.bin", 0); + lv_imgbtn_set_src(buttonHomeX, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonHomeX, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonHomeX, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonHomeX, LV_BTN_STATE_REL, &tft_style_label_rel); + + //lv_obj_set_event_cb_mks(buttonContinue, event_handler,ID_S_CONTINUE,"bmp_Breakpoint.bin",0); + //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_REL, &bmp_pic); + //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_PR, &tft_style_label_pre); + //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonHomeY, event_handler, ID_H_Y, "bmp_zeroY.bin", 0); + lv_imgbtn_set_src(buttonHomeY, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonHomeY, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonHomeY, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonHomeY, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonHomeZ, event_handler, ID_H_Z, "bmp_zeroZ.bin", 0); + lv_imgbtn_set_src(buttonHomeZ, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonHomeZ, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonHomeZ, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonHomeZ, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonOffAll, event_handler,ID_H_OFF_ALL,"bmp_function1.bin",0); + lv_imgbtn_set_src(buttonOffAll, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonOffAll, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonOffAll, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonOffAll, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonOffXY, event_handler,ID_H_OFF_XY,"bmp_function1.bin",0); + lv_imgbtn_set_src(buttonOffXY, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonOffXY, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonOffXY, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonOffXY, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_H_RETURN,"bmp_return.bin",0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif + + /*lv_obj_set_pos(buttonWifi, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonFan, BTN_X_PIXEL+INTERVAL_V*2, titleHeight); + lv_obj_set_pos(buttonAbout, BTN_X_PIXEL*2+INTERVAL_V*3, titleHeight); + lv_obj_set_pos(buttonContinue, BTN_X_PIXEL*3+INTERVAL_V*4, titleHeight); + lv_obj_set_pos(buMotorOff, INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonLanguage, BTN_X_PIXEL+INTERVAL_V*2, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight);*/ + + //lv_obj_set_pos(buttonWifi, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonHomeX, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); + lv_obj_set_pos(buttonHomeY, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); + //lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttonHomeZ, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttonHomeAll, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonOffAll, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonOffXY, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + //lv_btn_set_layout(buttonWifi, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHomeAll, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHomeX, LV_LAYOUT_OFF); + //lv_btn_set_layout(buttonContinue, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHomeY, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHomeZ, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonOffAll, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonOffXY, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + //lv_obj_t * labelWifi= lv_label_create(buttonWifi, NULL); + lv_obj_t * labelHomeAll = lv_label_create(buttonHomeAll, NULL); + lv_obj_t * labelHomeX = lv_label_create(buttonHomeX, NULL); + //lv_obj_t * label_Continue = lv_label_create(buttonContinue, NULL); + lv_obj_t * labelHomeY = lv_label_create(buttonHomeY, NULL); + lv_obj_t * labelHomeZ = lv_label_create(buttonHomeZ, NULL); + lv_obj_t * labelOffAll = lv_label_create(buttonOffAll, NULL); + lv_obj_t * labelOffXY = lv_label_create(buttonOffXY, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if (gCfgItems.multiple_language != 0) { + //lv_label_set_text(labelWifi, set_menu.wifi); + //lv_obj_align(labelWifi, buttonWifi, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelHomeAll, home_menu.home_all); + lv_obj_align(labelHomeAll, buttonHomeAll, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelHomeX, home_menu.home_x); + lv_obj_align(labelHomeX, buttonHomeX, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + //lv_label_set_text(label_Continue, set_menu.breakpoint); + //lv_obj_align(label_Continue, buttonContinue, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelHomeY, home_menu.home_y); + lv_obj_align(labelHomeY, buttonHomeY, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelHomeZ, home_menu.home_z); + lv_obj_align(labelHomeZ, buttonHomeZ, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelOffAll, set_menu.motoroff); + lv_obj_align(labelOffAll, buttonOffAll, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelOffXY, set_menu.motoroffXY); + lv_obj_align(labelOffXY, buttonOffXY, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } +} + +void lv_clear_home() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h new file mode 100644 index 0000000000..e93c0a0fad --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_home(void); +extern void lv_clear_home(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp new file mode 100644 index 0000000000..a552762cf3 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp @@ -0,0 +1,263 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 BOTH(HAS_TFT_LVGL_UI, HAS_CLASSIC_JERK) + +#include "lv_conf.h" +#include "draw_ui.h" + +#include "../../../../MarlinCore.h" +#include "../../../../module/planner.h" + +static lv_obj_t * scr; + +#define ID_JERK_RETURN 1 +#define ID_JERK_X 2 +#define ID_JERK_Y 3 +#define ID_JERK_Z 4 +#define ID_JERK_E 5 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_JERK_RETURN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_jerk_settings(); + draw_return_ui(); + } + break; + case ID_JERK_X: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = XJerk; + lv_clear_jerk_settings(); + lv_draw_number_key(); + } + break; + case ID_JERK_Y: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = YJerk; + lv_clear_jerk_settings(); + lv_draw_number_key(); + } + break; + case ID_JERK_Z: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = ZJerk; + lv_clear_jerk_settings(); + lv_draw_number_key(); + } + break; + case ID_JERK_E: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = EJerk; + lv_clear_jerk_settings(); + lv_draw_number_key(); + } + break; + } +} + +void lv_draw_jerk_settings(void) { + lv_obj_t *buttonBack = NULL, *label_Back = NULL; + lv_obj_t *buttonXText = NULL, *labelXText = NULL, *buttonXValue = NULL, *labelXValue = NULL; + lv_obj_t *buttonYText = NULL, *labelYText = NULL, *buttonYValue = NULL, *labelYValue = NULL; + lv_obj_t *buttonZText = NULL, *labelZText = NULL, *buttonZValue = NULL, *labelZValue = NULL; + lv_obj_t *buttonEText = NULL, *labelEText = NULL, *buttonEValue = NULL, *labelEValue = NULL; + lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != JERK_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = JERK_UI; + } + disp_state = JERK_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, machine_menu.JerkConfTitle); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_para_back); + // LV_IMG_DECLARE(bmp_para_arrow); + LV_IMG_DECLARE(bmp_para_bank); + + buttonXText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonXText, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonXText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonXText, event_handler); + lv_btn_set_style(buttonXText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonXText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonXText, LV_LAYOUT_OFF); + labelXText = lv_label_create(buttonXText, NULL); /*Add a label to the button*/ + + buttonXValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonXValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonXValue, event_handler, ID_JERK_X, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonXValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonXValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonXValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonXValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonXValue, LV_LAYOUT_OFF); + labelXValue = lv_label_create(buttonXValue, NULL); + + line1 = lv_line_create(scr, NULL); + lv_ex_line(line1, line_points[0]); + + buttonYText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonYText, PARA_UI_POS_X, PARA_UI_POS_Y * 2); /*Set its position*/ + lv_obj_set_size(buttonYText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonYText, event_handler); + lv_btn_set_style(buttonYText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonYText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonYText, LV_LAYOUT_OFF); + labelYText = lv_label_create(buttonYText, NULL); /*Add a label to the button*/ + + buttonYValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonYValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonYValue, event_handler, ID_JERK_Y, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonYValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonYValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonYValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonYValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonYValue, LV_LAYOUT_OFF); + labelYValue = lv_label_create(buttonYValue, NULL); + + line2 = lv_line_create(scr, NULL); + lv_ex_line(line2, line_points[1]); + + buttonZText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonZText, PARA_UI_POS_X, PARA_UI_POS_Y * 3); /*Set its position*/ + lv_obj_set_size(buttonZText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonZText, event_handler); + lv_btn_set_style(buttonZText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonZText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonZText, LV_LAYOUT_OFF); + labelZText = lv_label_create(buttonZText, NULL); /*Add a label to the button*/ + + buttonZValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonZValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonZValue, event_handler, ID_JERK_Z, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonZValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonZValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonZValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonZValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonZValue, LV_LAYOUT_OFF); + labelZValue = lv_label_create(buttonZValue, NULL); + + line3 = lv_line_create(scr, NULL); + lv_ex_line(line3, line_points[2]); + + buttonEText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonEText, PARA_UI_POS_X, PARA_UI_POS_Y * 4); /*Set its position*/ + lv_obj_set_size(buttonEText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonEText, event_handler); + lv_btn_set_style(buttonEText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonEText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonEText, LV_LAYOUT_OFF); + labelEText = lv_label_create(buttonEText, NULL); /*Add a label to the button*/ + + buttonEValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonEValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonEValue, event_handler, ID_JERK_E, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonEValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonEValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonEValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonEValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonEValue, LV_LAYOUT_OFF); + labelEValue = lv_label_create(buttonEValue, NULL); + + line4 = lv_line_create(scr, NULL); + lv_ex_line(line4, line_points[3]); + + buttonBack = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_JERK_RETURN, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[X_AXIS]); + lv_label_set_text(labelXValue, public_buf_l); + lv_obj_align(labelXValue, buttonXValue, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[Y_AXIS]); + lv_label_set_text(labelYValue, public_buf_l); + lv_obj_align(labelYValue, buttonYValue, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[Z_AXIS]); + lv_label_set_text(labelZValue, public_buf_l); + lv_obj_align(labelZValue, buttonZValue, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[E_AXIS]); + lv_label_set_text(labelEValue, public_buf_l); + lv_obj_align(labelEValue, buttonEValue, LV_ALIGN_CENTER, 0, 0); + + lv_label_set_text(labelXText, machine_menu.X_Jerk); + lv_obj_align(labelXText, buttonXText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelYText, machine_menu.Y_Jerk); + lv_obj_align(labelYText, buttonYText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelZText, machine_menu.Z_Jerk); + lv_obj_align(labelZText, buttonZText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelEText, machine_menu.E_Jerk); + lv_obj_align(labelEText, buttonEText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); + } +} + +void lv_clear_jerk_settings() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI && HAS_CLASSIC_JERK diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.h new file mode 100644 index 0000000000..5badcde529 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.h @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_jerk_settings(void); +extern void lv_clear_jerk_settings(); + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp new file mode 100644 index 0000000000..65d0961248 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp @@ -0,0 +1,368 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" + +#include "../../../../MarlinCore.h" +#include + +//static lv_obj_t *buttonMoveZ,*buttonTest,*buttonZ0,*buttonStop,*buttonReturn; + +#define ID_CN 1 +#define ID_T_CN 2 +#define ID_EN 3 +#define ID_RU 4 +#define ID_ES 5 +#define ID_FR 6 +#define ID_IT 7 +#define ID_L_RETURN 8 + +#define SELECTED 1 +#define UNSELECTED 0 + +static void disp_language(uint8_t language, uint8_t state); + +static lv_obj_t * scr; +static lv_obj_t *buttonCN, *buttonT_CN, *buttonEN, *buttonRU; +static lv_obj_t *buttonES, *buttonFR, *buttonIT, *buttonBack; + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_CN: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language, UNSELECTED); + lv_obj_set_event_cb_mks(buttonCN, event_handler, ID_CN, "bmp_simplified_cn_sel.bin", 0); + gCfgItems.language = LANG_SIMPLE_CHINESE; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_T_CN: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language, UNSELECTED); + lv_obj_set_event_cb_mks(buttonT_CN, event_handler, ID_T_CN, "bmp_traditional_cn_sel.bin", 0); + gCfgItems.language = LANG_COMPLEX_CHINESE; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_EN: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language, UNSELECTED); + lv_obj_set_event_cb_mks(buttonEN, event_handler, ID_EN, "bmp_english_sel.bin", 0); + gCfgItems.language = LANG_ENGLISH; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_RU: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language, UNSELECTED); + lv_obj_set_event_cb_mks(buttonRU, event_handler, ID_RU, "bmp_russian_sel.bin", 0); + gCfgItems.language = LANG_RUSSIAN; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_ES: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language, UNSELECTED); + lv_obj_set_event_cb_mks(buttonES, event_handler, ID_ES, "bmp_spanish_sel.bin", 0); + gCfgItems.language = LANG_SPANISH; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_FR: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language, UNSELECTED); + lv_obj_set_event_cb_mks(buttonFR, event_handler, ID_FR, "bmp_french_sel.bin", 0); + gCfgItems.language = LANG_FRENCH; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_IT: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language, UNSELECTED); + lv_obj_set_event_cb_mks(buttonIT, event_handler, ID_FR, "bmp_italy_sel.bin", 0); + gCfgItems.language = LANG_ITALY; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_L_RETURN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + + buttonCN = NULL; + buttonT_CN = NULL; + buttonEN = NULL; + buttonRU = NULL; + buttonES = NULL; + buttonFR = NULL; + buttonFR = NULL; + buttonIT = NULL; + buttonBack = NULL; + + lv_obj_del(scr); + lv_draw_set(); + } + break; + + } +} + +static void disp_language(uint8_t language, uint8_t state) { + uint16_t id; + lv_obj_t *obj; + + public_buf_l[0] = '\0'; + + switch (language) { + case LANG_SIMPLE_CHINESE: + id = ID_CN; + strcpy_P(public_buf_l, PSTR("bmp_simplified_cn")); + obj = buttonCN; + break; + case LANG_COMPLEX_CHINESE: + id = ID_T_CN; + strcpy_P(public_buf_l, PSTR("bmp_traditional_cn")); + obj = buttonT_CN; + break; + case LANG_ENGLISH: + id = ID_EN; + strcpy_P(public_buf_l, PSTR("bmp_english")); + obj = buttonEN; + break; + case LANG_RUSSIAN: + id = ID_RU; + strcpy_P(public_buf_l, PSTR("bmp_russian")); + obj = buttonRU; + break; + case LANG_SPANISH: + id = ID_ES; + strcpy_P(public_buf_l, PSTR("bmp_spanish")); + obj = buttonES; + break; + case LANG_FRENCH: + id = ID_FR; + strcpy_P(public_buf_l, PSTR("bmp_french")); + obj = buttonFR; + break; + case LANG_ITALY: + id = ID_IT; + strcpy_P(public_buf_l, PSTR("bmp_italy")); + obj = buttonIT; + break; + default: + id = ID_CN; + strcpy_P(public_buf_l, PSTR("bmp_simplified_cn")); + obj = buttonCN; + break; + } + + if (state == SELECTED) strcat_P(public_buf_l, PSTR("_sel")); + + strcat_P(public_buf_l, PSTR(".bin")); + + lv_obj_set_event_cb_mks(obj, event_handler, id, public_buf_l, 0); + + if (state == UNSELECTED) lv_obj_refresh_ext_draw_pad(obj); +} + +void lv_draw_language(void) { + + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != LANGUAGE_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = LANGUAGE_UI; + } + disp_state = LANGUAGE_UI; + + scr = lv_obj_create(NULL, NULL); + + // static lv_style_t tool_style; + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonCN = lv_imgbtn_create(scr, NULL); + buttonT_CN = lv_imgbtn_create(scr, NULL); + buttonEN = lv_imgbtn_create(scr, NULL); + buttonRU = lv_imgbtn_create(scr, NULL); + buttonES = lv_imgbtn_create(scr, NULL); + buttonFR = lv_imgbtn_create(scr, NULL); + buttonIT = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonCN, event_handler, ID_CN, "bmp_simplified_cn.bin", 0); + lv_imgbtn_set_src(buttonCN, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonCN, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonCN, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonCN, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_clear_protect(buttonCN, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonT_CN, event_handler, ID_T_CN, "bmp_traditional_cn.bin", 0); + lv_imgbtn_set_src(buttonT_CN, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonT_CN, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonT_CN, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonT_CN, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonEN, event_handler, ID_EN, "bmp_english.bin", 0); + lv_imgbtn_set_src(buttonEN, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonEN, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonEN, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonEN, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonRU, event_handler, ID_RU, "bmp_russian.bin", 0); + lv_imgbtn_set_src(buttonRU, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonRU, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonRU, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonRU, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonES, event_handler, ID_ES, "bmp_spanish.bin", 0); + lv_imgbtn_set_src(buttonES, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonES, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonES, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonES, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonFR, event_handler, ID_FR, "bmp_french.bin", 0); + lv_imgbtn_set_src(buttonFR, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonFR, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonFR, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonFR, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonIT, event_handler, ID_IT, "bmp_italy.bin", 0); + lv_imgbtn_set_src(buttonIT, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonIT, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonIT, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonIT, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_L_RETURN, "bmp_return.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif // if 1 + + lv_obj_set_pos(buttonCN, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonT_CN, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); + lv_obj_set_pos(buttonEN, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); + lv_obj_set_pos(buttonRU, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttonES, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonFR, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonIT, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonCN, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonT_CN, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonEN, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonRU, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonES, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonFR, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonIT, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * label_CN = lv_label_create(buttonCN, NULL); + lv_obj_t * label_T_CN = lv_label_create(buttonT_CN, NULL); + lv_obj_t * label_EN = lv_label_create(buttonEN, NULL); + lv_obj_t * label_RU = lv_label_create(buttonRU, NULL); + lv_obj_t * label_ES = lv_label_create(buttonES, NULL); + lv_obj_t * label_FR = lv_label_create(buttonFR, NULL); + lv_obj_t * label_IT = lv_label_create(buttonIT, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + disp_language(gCfgItems.language, SELECTED); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(label_CN, language_menu.chinese_s); + lv_obj_align(label_CN, buttonCN, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_T_CN, language_menu.chinese_t); + lv_obj_align(label_T_CN, buttonT_CN, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_EN, language_menu.english); + lv_obj_align(label_EN, buttonEN, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_RU, language_menu.russian); + lv_obj_align(label_RU, buttonRU, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_ES, language_menu.spanish); + lv_obj_align(label_ES, buttonES, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_FR, language_menu.french); + lv_obj_align(label_FR, buttonFR, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_IT, language_menu.italy); + lv_obj_align(label_IT, buttonIT, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } +} + +void lv_clear_language() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h new file mode 100644 index 0000000000..4b6b2b0221 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_language(void); +extern void lv_clear_language(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp new file mode 100644 index 0000000000..d441f2ac51 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp @@ -0,0 +1,232 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" + +#include "../../../../MarlinCore.h" + +static lv_obj_t * scr; + +#define ID_PARA_RETURN 1 +#define ID_PARA_MACHINE 2 +#define ID_PARA_MACHINE_ARROW 3 +#define ID_PARA_MOTOR 4 +#define ID_PARA_MOTOR_ARROW 5 +#define ID_PARA_ADVANCE 6 +#define ID_PARA_ADVANCE_ARROW 7 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_PARA_RETURN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_machine_para(); + draw_return_ui(); + } + break; + case ID_PARA_MACHINE: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_machine_para(); + lv_draw_machine_settings(); + } + break; + case ID_PARA_MACHINE_ARROW: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_machine_para(); + lv_draw_machine_settings(); + } + break; + case ID_PARA_MOTOR: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_machine_para(); + lv_draw_motor_settings(); + } + break; + case ID_PARA_MOTOR_ARROW: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_machine_para(); + lv_draw_motor_settings(); + } + break; + case ID_PARA_ADVANCE: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_machine_para(); + lv_draw_advance_settings(); + } + break; + case ID_PARA_ADVANCE_ARROW: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_machine_para(); + lv_draw_advance_settings(); + } + break; + } +} + +void lv_draw_machine_para(void) { + lv_obj_t *buttonBack, *label_Back; + lv_obj_t *buttonMachine, *labelMachine, *buttonMachineNarrow; + lv_obj_t *buttonMotor, *labelMotor, *buttonMotorNarrow; + lv_obj_t *buttonAdvance, *labelAdvance, *buttonAdvanceNarrow; + lv_obj_t * line1, * line2, * line3; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MACHINE_PARA_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = MACHINE_PARA_UI; + } + disp_state = MACHINE_PARA_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_para_back); + LV_IMG_DECLARE(bmp_para_arrow); + + buttonMachine = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonMachine, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonMachine, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + //lv_obj_set_event_cb(buttonMachine, event_handler); + lv_obj_set_event_cb_mks(buttonMachine, event_handler, ID_PARA_MACHINE, NULL, 0); + lv_btn_set_style(buttonMachine, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonMachine, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonMachine, LV_LAYOUT_OFF); + labelMachine = lv_label_create(buttonMachine, NULL); /*Add a label to the button*/ + + buttonMachineNarrow = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonMachineNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V); + lv_obj_set_event_cb_mks(buttonMachineNarrow, event_handler, ID_PARA_MACHINE_ARROW, "bmp_arrow.bin", 0); + lv_imgbtn_set_src(buttonMachineNarrow, LV_BTN_STATE_REL, &bmp_para_arrow); + lv_imgbtn_set_src(buttonMachineNarrow, LV_BTN_STATE_PR, &bmp_para_arrow); + lv_imgbtn_set_style(buttonMachineNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonMachineNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonMachineNarrow, LV_LAYOUT_OFF); + + line1 = lv_line_create(scr, NULL); + lv_ex_line(line1, line_points[0]); + + buttonMotor = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonMotor, PARA_UI_POS_X, PARA_UI_POS_Y * 2); /*Set its position*/ + lv_obj_set_size(buttonMotor, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + //lv_obj_set_event_cb(buttonMotor, event_handler); + lv_obj_set_event_cb_mks(buttonMotor, event_handler, ID_PARA_MOTOR, NULL, 0); + lv_btn_set_style(buttonMotor, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonMotor, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonMotor, LV_LAYOUT_OFF); + labelMotor = lv_label_create(buttonMotor, NULL); /*Add a label to the button*/ + + buttonMotorNarrow = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonMotorNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V); + lv_obj_set_event_cb_mks(buttonMotorNarrow, event_handler, ID_PARA_MOTOR_ARROW, "bmp_arrow.bin", 0); + lv_imgbtn_set_src(buttonMotorNarrow, LV_BTN_STATE_REL, &bmp_para_arrow); + lv_imgbtn_set_src(buttonMotorNarrow, LV_BTN_STATE_PR, &bmp_para_arrow); + lv_imgbtn_set_style(buttonMotorNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonMotorNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonMotorNarrow, LV_LAYOUT_OFF); + + line2 = lv_line_create(scr, NULL); + lv_ex_line(line2, line_points[1]); + + buttonAdvance = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonAdvance, PARA_UI_POS_X, PARA_UI_POS_Y * 3); /*Set its position*/ + lv_obj_set_size(buttonAdvance, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + //lv_obj_set_event_cb(buttonMotor, event_handler); + lv_obj_set_event_cb_mks(buttonAdvance, event_handler, ID_PARA_ADVANCE, NULL, 0); + lv_btn_set_style(buttonAdvance, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonAdvance, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonAdvance, LV_LAYOUT_OFF); + labelAdvance = lv_label_create(buttonAdvance, NULL); /*Add a label to the button*/ + + buttonAdvanceNarrow = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonAdvanceNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 3 + PARA_UI_ARROW_V); + lv_obj_set_event_cb_mks(buttonAdvanceNarrow, event_handler, ID_PARA_ADVANCE_ARROW, "bmp_arrow.bin", 0); + lv_imgbtn_set_src(buttonAdvanceNarrow, LV_BTN_STATE_REL, &bmp_para_arrow); + lv_imgbtn_set_src(buttonAdvanceNarrow, LV_BTN_STATE_PR, &bmp_para_arrow); + lv_imgbtn_set_style(buttonAdvanceNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonAdvanceNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonAdvanceNarrow, LV_LAYOUT_OFF); + + line3 = lv_line_create(scr, NULL); + lv_ex_line(line3, line_points[2]); + + buttonBack = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_PARA_RETURN, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); + + lv_label_set_text(labelMachine, MachinePara_menu.MachineSetting); + lv_obj_align(labelMachine, buttonMachine, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelMotor, MachinePara_menu.MotorSetting); + lv_obj_align(labelMotor, buttonMotor, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelAdvance, MachinePara_menu.AdvanceSetting); + lv_obj_align(labelAdvance, buttonAdvance, LV_ALIGN_IN_LEFT_MID, 0, 0); + } + +} + +void lv_clear_machine_para() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.h new file mode 100644 index 0000000000..d75df293b1 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.h @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_machine_para(void); +extern void lv_clear_machine_para(); + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp new file mode 100644 index 0000000000..88a66c6599 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp @@ -0,0 +1,241 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" + +#include "../../../../MarlinCore.h" + +static lv_obj_t * scr; + +#define ID_MACHINE_RETURN 1 +#define ID_MACHINE_ACCELERATION 2 +#define ID_MACHINE_ACCELERATION_ARROW 3 +#define ID_MACHINE_FEEDRATE 4 +#define ID_MACHINE_FEEDRATE_ARROW 5 +#define ID_MACHINE_JERK 6 +#define ID_MACHINE_JERK_ARROW 7 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_MACHINE_RETURN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_machine_settings(); + draw_return_ui(); + } + break; + case ID_MACHINE_ACCELERATION: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_machine_settings(); + lv_draw_acceleration_settings(); + } + break; + case ID_MACHINE_ACCELERATION_ARROW: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_machine_settings(); + lv_draw_acceleration_settings(); + } + break; + case ID_MACHINE_FEEDRATE: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_machine_settings(); + lv_draw_max_feedrate_settings(); + } + break; + case ID_MACHINE_FEEDRATE_ARROW: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_machine_settings(); + lv_draw_max_feedrate_settings(); + } + break; + #if HAS_CLASSIC_JERK + case ID_MACHINE_JERK: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_machine_settings(); + lv_draw_jerk_settings(); + } + break; + case ID_MACHINE_JERK_ARROW: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_machine_settings(); + lv_draw_jerk_settings(); + } + break; + #endif + } +} + +void lv_draw_machine_settings(void) { + lv_obj_t *buttonBack, *label_Back; + lv_obj_t *buttonAcceleration, *labelAcceleration, *buttonAccelerationNarrow; + lv_obj_t *buttonMaxFeedrate, *labelMaxFeedrate, *buttonMaxFeedrateNarrow; + #if HAS_CLASSIC_JERK + lv_obj_t *buttonJerk, *labelJerk, *buttonJerkNarrow; + #endif + lv_obj_t * line1, * line2; + #if HAS_CLASSIC_JERK + lv_obj_t * line3; + #endif + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MACHINE_SETTINGS_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = MACHINE_SETTINGS_UI; + } + disp_state = MACHINE_SETTINGS_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, machine_menu.MachineConfigTitle); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_para_back); + LV_IMG_DECLARE(bmp_para_arrow); + + buttonAcceleration = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonAcceleration, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + //lv_obj_set_event_cb(buttonMachine, event_handler); + lv_obj_set_event_cb_mks(buttonAcceleration, event_handler, ID_MACHINE_ACCELERATION, NULL, 0); + lv_btn_set_style(buttonAcceleration, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonAcceleration, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonAcceleration, LV_LAYOUT_OFF); + labelAcceleration = lv_label_create(buttonAcceleration, NULL); /*Add a label to the button*/ + + buttonAccelerationNarrow = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonAccelerationNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V); + lv_obj_set_event_cb_mks(buttonAccelerationNarrow, event_handler, ID_MACHINE_ACCELERATION_ARROW, "bmp_arrow.bin", 0); + lv_imgbtn_set_src(buttonAccelerationNarrow, LV_BTN_STATE_REL, &bmp_para_arrow); + lv_imgbtn_set_src(buttonAccelerationNarrow, LV_BTN_STATE_PR, &bmp_para_arrow); + lv_imgbtn_set_style(buttonAccelerationNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonAccelerationNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonAccelerationNarrow, LV_LAYOUT_OFF); + + line1 = lv_line_create(lv_scr_act(), NULL); + lv_ex_line(line1, line_points[0]); + + buttonMaxFeedrate = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonMaxFeedrate, PARA_UI_POS_X, PARA_UI_POS_Y * 2); /*Set its position*/ + lv_obj_set_size(buttonMaxFeedrate, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + //lv_obj_set_event_cb(buttonMachine, event_handler); + lv_obj_set_event_cb_mks(buttonMaxFeedrate, event_handler, ID_MACHINE_FEEDRATE, NULL, 0); + lv_btn_set_style(buttonMaxFeedrate, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonMaxFeedrate, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonMaxFeedrate, LV_LAYOUT_OFF); + labelMaxFeedrate = lv_label_create(buttonMaxFeedrate, NULL); /*Add a label to the button*/ + + buttonMaxFeedrateNarrow = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonMaxFeedrateNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V); + lv_obj_set_event_cb_mks(buttonMaxFeedrateNarrow, event_handler, ID_MACHINE_FEEDRATE_ARROW, "bmp_arrow.bin", 0); + lv_imgbtn_set_src(buttonMaxFeedrateNarrow, LV_BTN_STATE_REL, &bmp_para_arrow); + lv_imgbtn_set_src(buttonMaxFeedrateNarrow, LV_BTN_STATE_PR, &bmp_para_arrow); + lv_imgbtn_set_style(buttonMaxFeedrateNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonMaxFeedrateNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonMaxFeedrateNarrow, LV_LAYOUT_OFF); + + line2 = lv_line_create(lv_scr_act(), NULL); + lv_ex_line(line2, line_points[1]); + + #if HAS_CLASSIC_JERK + buttonJerk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonJerk, PARA_UI_POS_X, PARA_UI_POS_Y * 3); /*Set its position*/ + lv_obj_set_size(buttonJerk, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + //lv_obj_set_event_cb(buttonMotor, event_handler); + lv_obj_set_event_cb_mks(buttonJerk, event_handler, ID_MACHINE_JERK, NULL, 0); + lv_btn_set_style(buttonJerk, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonJerk, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonJerk, LV_LAYOUT_OFF); + labelJerk = lv_label_create(buttonJerk, NULL); /*Add a label to the button*/ + + buttonJerkNarrow = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonJerkNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 3 + PARA_UI_ARROW_V); + lv_obj_set_event_cb_mks(buttonJerkNarrow, event_handler, ID_MACHINE_JERK_ARROW, "bmp_arrow.bin", 0); + lv_imgbtn_set_src(buttonJerkNarrow, LV_BTN_STATE_REL, &bmp_para_arrow); + lv_imgbtn_set_src(buttonJerkNarrow, LV_BTN_STATE_PR, &bmp_para_arrow); + lv_imgbtn_set_style(buttonJerkNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonJerkNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonJerkNarrow, LV_LAYOUT_OFF); + + line3 = lv_line_create(lv_scr_act(), NULL); + lv_ex_line(line3, line_points[2]); + #endif + + buttonBack = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_MACHINE_RETURN, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); + + lv_label_set_text(labelAcceleration, machine_menu.AccelerationConf); + lv_obj_align(labelAcceleration, buttonAcceleration, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelMaxFeedrate, machine_menu.MaxFeedRateConf); + lv_obj_align(labelMaxFeedrate, buttonMaxFeedrate, LV_ALIGN_IN_LEFT_MID, 0, 0); + #if HAS_CLASSIC_JERK + lv_label_set_text(labelJerk, machine_menu.JerkConf); + lv_obj_align(labelJerk, buttonJerk, LV_ALIGN_IN_LEFT_MID, 0, 0); + #endif + } +} + +void lv_clear_machine_settings() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.h new file mode 100644 index 0000000000..37029c85c4 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.h @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_machine_settings(void); +extern void lv_clear_machine_settings(); + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp new file mode 100644 index 0000000000..ab4d9eb881 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp @@ -0,0 +1,281 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "../../../../MarlinCore.h" +#include "lv_conf.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +#include "draw_ui.h" +#include "../../../../gcode/queue.h" + +//static lv_obj_t *buttonMoveZ,*buttonTest,*buttonZ0,*buttonStop,*buttonReturn; +static lv_obj_t * scr; + +#define ID_M_POINT1 1 +#define ID_M_POINT2 2 +#define ID_M_POINT3 3 +#define ID_M_POINT4 4 +#define ID_M_POINT5 5 +#define ID_MANUAL_RETURN 6 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_M_POINT1: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + + if (queue.length == 0) { + if (uiCfg.leveling_first_time) { + queue.enqueue_now_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; + } + + queue.enqueue_now_P(PSTR("G1 Z10")); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("G1 X%d Y%d"), X_MIN_POS + 30, Y_MIN_POS + 30); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G1 Z0")); + } + } + break; + case ID_M_POINT2: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length == 0) { + if (uiCfg.leveling_first_time) { + queue.enqueue_now_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; + } + + queue.enqueue_now_P(PSTR("G1 Z10")); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("G1 X%d Y%d"), X_MAX_POS - 30, Y_MIN_POS + 30); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G1 Z0")); + } + } + break; + case ID_M_POINT3: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length == 0) { + if (uiCfg.leveling_first_time) { + queue.enqueue_now_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; + } + + queue.enqueue_now_P(PSTR("G1 Z10")); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("G1 X%d Y%d"), X_MAX_POS - 30, Y_MAX_POS - 30); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G1 Z0")); + } + } + + break; + case ID_M_POINT4: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length == 0) { + if (uiCfg.leveling_first_time) { + queue.enqueue_now_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; + } + + queue.enqueue_now_P(PSTR("G1 Z10")); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("G1 X%d Y%d"), X_MIN_POS + 30, Y_MAX_POS - 30); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G1 Z0")); + } + } + break; + case ID_M_POINT5: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length == 0) { + if (uiCfg.leveling_first_time) { + queue.enqueue_now_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; + } + + queue.enqueue_now_P(PSTR("G1 Z10")); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("G1 X%d Y%d"), X_BED_SIZE / 2, Y_BED_SIZE / 2); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G1 Z0")); + } + } + + break; + case ID_MANUAL_RETURN: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_manualLevel(); + lv_draw_tool(); + } + break; + } +} + + +void lv_draw_manualLevel(void) { + lv_obj_t *buttonPoint1, *buttonPoint2, *buttonPoint3, *buttonPoint4, *buttonPoint5; + lv_obj_t *buttonBack; + + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != LEVELING_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = LEVELING_UI; + } + disp_state = LEVELING_UI; + + scr = lv_obj_create(NULL, NULL); + + // static lv_style_t tool_style; + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonPoint1 = lv_imgbtn_create(scr, NULL); + buttonPoint2 = lv_imgbtn_create(scr, NULL); + buttonPoint3 = lv_imgbtn_create(scr, NULL); + buttonPoint4 = lv_imgbtn_create(scr, NULL); + buttonPoint5 = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonPoint1, event_handler, ID_M_POINT1, "bmp_leveling1.bin", 0); + lv_imgbtn_set_src(buttonPoint1, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPoint1, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPoint1, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonPoint1, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_clear_protect(buttonPoint1, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonPoint2, event_handler, ID_M_POINT2, "bmp_leveling2.bin", 0); + lv_imgbtn_set_src(buttonPoint2, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPoint2, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPoint2, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonPoint2, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonPoint3, event_handler, ID_M_POINT3, "bmp_leveling3.bin", 0); + lv_imgbtn_set_src(buttonPoint3, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPoint3, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPoint3, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonPoint3, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonPoint4, event_handler, ID_M_POINT4, "bmp_leveling4.bin", 0); + lv_imgbtn_set_src(buttonPoint4, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPoint4, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPoint4, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonPoint4, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonPoint5, event_handler, ID_M_POINT5, "bmp_leveling5.bin", 0); + lv_imgbtn_set_src(buttonPoint5, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPoint5, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPoint5, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonPoint5, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_MANUAL_RETURN, "bmp_return.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif + + lv_obj_set_pos(buttonPoint1, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonPoint2, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); + lv_obj_set_pos(buttonPoint3, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); + lv_obj_set_pos(buttonPoint4, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttonPoint5, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonPoint1, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPoint2, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPoint3, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPoint4, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPoint5, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * label_Point1 = lv_label_create(buttonPoint1, NULL); + lv_obj_t * label_Point2 = lv_label_create(buttonPoint2, NULL); + lv_obj_t * label_Point3 = lv_label_create(buttonPoint3, NULL); + lv_obj_t * label_Point4 = lv_label_create(buttonPoint4, NULL); + lv_obj_t * label_Point5 = lv_label_create(buttonPoint5, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(label_Point1, leveling_menu.position1); + lv_obj_align(label_Point1, buttonPoint1, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Point2, leveling_menu.position2); + lv_obj_align(label_Point2, buttonPoint2, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Point3, leveling_menu.position3); + lv_obj_align(label_Point3, buttonPoint3, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Point4, leveling_menu.position4); + lv_obj_align(label_Point4, buttonPoint4, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Point5, leveling_menu.position5); + lv_obj_align(label_Point5, buttonPoint5, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } +} + +void lv_clear_manualLevel() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h new file mode 100644 index 0000000000..4ec33afce3 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_manualLevel(void); +extern void lv_clear_manualLevel(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp new file mode 100644 index 0000000000..c78c6f5bb8 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp @@ -0,0 +1,359 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" + +#include "../../../../MarlinCore.h" +#include "../../../../module/planner.h" + +static lv_obj_t * scr; + +#define ID_FEED_RETURN 1 +#define ID_FEED_X 2 +#define ID_FEED_Y 3 +#define ID_FEED_Z 4 +#define ID_FEED_E0 5 +#define ID_FEED_E1 6 +#define ID_FEED_DOWN 7 +#define ID_FEED_UP 8 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_FEED_RETURN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + uiCfg.para_ui_page = 0; + lv_clear_max_feedrate_settings(); + draw_return_ui(); + } + break; + case ID_FEED_X: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = XMaxFeedRate; + lv_clear_max_feedrate_settings(); + lv_draw_number_key(); + } + break; + case ID_FEED_Y: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = YMaxFeedRate; + lv_clear_max_feedrate_settings(); + lv_draw_number_key(); + } + break; + case ID_FEED_Z: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = ZMaxFeedRate; + lv_clear_max_feedrate_settings(); + lv_draw_number_key(); + } + break; + case ID_FEED_E0: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = E0MaxFeedRate; + lv_clear_max_feedrate_settings(); + lv_draw_number_key(); + } + break; + case ID_FEED_E1: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = E1MaxFeedRate; + lv_clear_max_feedrate_settings(); + lv_draw_number_key(); + } + break; + case ID_FEED_UP: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + uiCfg.para_ui_page = 0; + lv_clear_max_feedrate_settings(); + lv_draw_max_feedrate_settings(); + } + break; + case ID_FEED_DOWN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + uiCfg.para_ui_page = 1; + lv_clear_max_feedrate_settings(); + lv_draw_max_feedrate_settings(); + } + break; + } +} + +void lv_draw_max_feedrate_settings(void) { + lv_obj_t *buttonBack = NULL, *label_Back = NULL, *buttonTurnPage = NULL, *labelTurnPage = NULL; + lv_obj_t *buttonXText = NULL, *labelXText = NULL, *buttonXValue = NULL, *labelXValue = NULL; + lv_obj_t *buttonYText = NULL, *labelYText = NULL, *buttonYValue = NULL, *labelYValue = NULL; + lv_obj_t *buttonZText = NULL, *labelZText = NULL, *buttonZValue = NULL, *labelZValue = NULL; + lv_obj_t *buttonE0Text = NULL, *labelE0Text = NULL, *buttonE0Value = NULL, *labelE0Value = NULL; + lv_obj_t *buttonE1Text = NULL, *labelE1Text = NULL, *buttonE1Value = NULL, *labelE1Value = NULL; + lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MAXFEEDRATE_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = MAXFEEDRATE_UI; + } + disp_state = MAXFEEDRATE_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, machine_menu.MaxFeedRateConfTitle); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_para_back); + // LV_IMG_DECLARE(bmp_para_arrow); + LV_IMG_DECLARE(bmp_para_bank); + + if (uiCfg.para_ui_page != 1) { + buttonXText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonXText, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonXText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonXText, event_handler); + lv_btn_set_style(buttonXText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonXText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonXText, LV_LAYOUT_OFF); + labelXText = lv_label_create(buttonXText, NULL); /*Add a label to the button*/ + + buttonXValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonXValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonXValue, event_handler, ID_FEED_X, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonXValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonXValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonXValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonXValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonXValue, LV_LAYOUT_OFF); + labelXValue = lv_label_create(buttonXValue, NULL); + + line1 = lv_line_create(scr, NULL); + lv_ex_line(line1, line_points[0]); + + buttonYText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonYText, PARA_UI_POS_X, PARA_UI_POS_Y * 2); /*Set its position*/ + lv_obj_set_size(buttonYText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonYText, event_handler); + lv_btn_set_style(buttonYText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonYText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonYText, LV_LAYOUT_OFF); + labelYText = lv_label_create(buttonYText, NULL); /*Add a label to the button*/ + + buttonYValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonYValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonYValue, event_handler, ID_FEED_Y, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonYValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonYValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonYValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonYValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonYValue, LV_LAYOUT_OFF); + labelYValue = lv_label_create(buttonYValue, NULL); + + line2 = lv_line_create(scr, NULL); + lv_ex_line(line2, line_points[1]); + + buttonZText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonZText, PARA_UI_POS_X, PARA_UI_POS_Y * 3); /*Set its position*/ + lv_obj_set_size(buttonZText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonZText, event_handler); + lv_btn_set_style(buttonZText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonZText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonZText, LV_LAYOUT_OFF); + labelZText = lv_label_create(buttonZText, NULL); /*Add a label to the button*/ + + buttonZValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonZValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonZValue, event_handler, ID_FEED_Z, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonZValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonZValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonZValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonZValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonZValue, LV_LAYOUT_OFF); + labelZValue = lv_label_create(buttonZValue, NULL); + + line3 = lv_line_create(scr, NULL); + lv_ex_line(line3, line_points[2]); + + buttonE0Text = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonE0Text, PARA_UI_POS_X, PARA_UI_POS_Y * 4); /*Set its position*/ + lv_obj_set_size(buttonE0Text, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonE0Text, event_handler); + lv_btn_set_style(buttonE0Text, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonE0Text, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonE0Text, LV_LAYOUT_OFF); + labelE0Text = lv_label_create(buttonE0Text, NULL); /*Add a label to the button*/ + + buttonE0Value = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonE0Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonE0Value, event_handler, ID_FEED_E0, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonE0Value, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonE0Value, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonE0Value, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonE0Value, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonE0Value, LV_LAYOUT_OFF); + labelE0Value = lv_label_create(buttonE0Value, NULL); + + line4 = lv_line_create(scr, NULL); + lv_ex_line(line4, line_points[3]); + + buttonTurnPage = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_FEED_DOWN, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_REL, &tft_style_label_rel); + } + else { + buttonE1Text = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonE1Text, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonE1Text, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonE1Text, event_handler); + lv_btn_set_style(buttonE1Text, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonE1Text, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonE1Text, LV_LAYOUT_OFF); + labelE1Text = lv_label_create(buttonE1Text, NULL); /*Add a label to the button*/ + + buttonE1Value = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonE1Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonE1Value, event_handler, ID_FEED_E1, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonE1Value, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonE1Value, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonE1Value, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonE1Value, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonE1Value, LV_LAYOUT_OFF); + labelE1Value = lv_label_create(buttonE1Value, NULL); + + line1 = lv_line_create(scr, NULL); + lv_ex_line(line1, line_points[0]); + + buttonTurnPage = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_FEED_UP, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_REL, &tft_style_label_rel); + } + + lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); + lv_btn_set_layout(buttonTurnPage, LV_LAYOUT_OFF); + labelTurnPage = lv_label_create(buttonTurnPage, NULL); + + + buttonBack = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_FEED_RETURN, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + if (uiCfg.para_ui_page != 1) { + lv_label_set_text(labelXText, machine_menu.XMaxFeedRate); + lv_obj_align(labelXText, buttonXText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelYText, machine_menu.YMaxFeedRate); + lv_obj_align(labelYText, buttonYText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelZText, machine_menu.ZMaxFeedRate); + lv_obj_align(labelZText, buttonZText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelE0Text, machine_menu.E0MaxFeedRate); + lv_obj_align(labelE0Text, buttonE0Text, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelTurnPage, machine_menu.next); + lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[X_AXIS]); + lv_label_set_text(labelXValue, public_buf_l); + lv_obj_align(labelXValue, buttonXValue, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[Y_AXIS]); + lv_label_set_text(labelYValue, public_buf_l); + lv_obj_align(labelYValue, buttonYValue, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[Z_AXIS]); + lv_label_set_text(labelZValue, public_buf_l); + lv_obj_align(labelZValue, buttonZValue, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[E_AXIS]); + lv_label_set_text(labelE0Value, public_buf_l); + lv_obj_align(labelE0Value, buttonE0Value, LV_ALIGN_CENTER, 0, 0); + } + else { + lv_label_set_text(labelE1Text, machine_menu.E1MaxFeedRate); + lv_obj_align(labelE1Text, buttonE1Text, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelTurnPage, machine_menu.previous); + lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[E_AXIS_N(1)]); + lv_label_set_text(labelE1Value, public_buf_l); + lv_obj_align(labelE1Value, buttonE1Value, LV_ALIGN_CENTER, 0, 0); + } + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); + } +} + +void lv_clear_max_feedrate_settings() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.h new file mode 100644 index 0000000000..24edae27e4 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.h @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_max_feedrate_settings(void); +extern void lv_clear_max_feedrate_settings(); + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp new file mode 100644 index 0000000000..7da477bd51 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp @@ -0,0 +1,247 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" + +#include "../../../../MarlinCore.h" + +static lv_obj_t * scr; + +#define ID_MOTOR_RETURN 1 +#define ID_MOTOR_STEPS 2 +#define ID_MOTOR_STEPS_ARROW 3 +#define ID_MOTOR_TMC_CURRENT 4 +#define ID_MOTOR_TMC_CURRENT_ARROW 5 +#define ID_MOTOR_STEP_MODE 6 +#define ID_MOTOR_STEP_MODE_ARROW 7 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_MOTOR_RETURN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_motor_settings(); + draw_return_ui(); + } + break; + case ID_MOTOR_STEPS: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_motor_settings(); + lv_draw_step_settings(); + } + break; + case ID_MOTOR_STEPS_ARROW: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_motor_settings(); + lv_draw_step_settings(); + } + break; + #if HAS_TRINAMIC_CONFIG + case ID_MOTOR_TMC_CURRENT: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_motor_settings(); + lv_draw_tmc_current_settings(); + } + break; + case ID_MOTOR_TMC_CURRENT_ARROW: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_motor_settings(); + lv_draw_tmc_current_settings(); + } + break; + #if HAS_STEALTHCHOP + case ID_MOTOR_STEP_MODE: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_motor_settings(); + lv_draw_tmc_step_mode_settings(); + } + break; + case ID_MOTOR_STEP_MODE_ARROW: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_motor_settings(); + lv_draw_tmc_step_mode_settings(); + } + break; + #endif + #endif + } +} + +void lv_draw_motor_settings(void) { + lv_obj_t *buttonBack, *label_Back; + lv_obj_t *buttonSteps, *labelSteps, *buttonStepsNarrow; + #if HAS_TRINAMIC_CONFIG + lv_obj_t *buttonTMCcurrent, *labelTMCcurrent, *buttonTMCcurrentNarrow; + lv_obj_t * line2; + #if HAS_STEALTHCHOP + lv_obj_t *buttonStepMode, *labelStepMode, *buttonStepModeNarrow; + lv_obj_t * line3; + #endif + #endif + lv_obj_t * line1; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MOTOR_SETTINGS_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = MOTOR_SETTINGS_UI; + } + disp_state = MOTOR_SETTINGS_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, machine_menu.MotorConfTitle); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_para_back); + LV_IMG_DECLARE(bmp_para_arrow); + + buttonSteps = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonSteps, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonSteps, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + //lv_obj_set_event_cb(buttonMachine, event_handler); + lv_obj_set_event_cb_mks(buttonSteps, event_handler, ID_MOTOR_STEPS, NULL, 0); + lv_btn_set_style(buttonSteps, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonSteps, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonSteps, LV_LAYOUT_OFF); + labelSteps = lv_label_create(buttonSteps, NULL); /*Add a label to the button*/ + + buttonStepsNarrow = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonStepsNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V); + lv_obj_set_event_cb_mks(buttonStepsNarrow, event_handler, ID_MOTOR_STEPS_ARROW, "bmp_arrow.bin", 0); + lv_imgbtn_set_src(buttonStepsNarrow, LV_BTN_STATE_REL, &bmp_para_arrow); + lv_imgbtn_set_src(buttonStepsNarrow, LV_BTN_STATE_PR, &bmp_para_arrow); + lv_imgbtn_set_style(buttonStepsNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonStepsNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonStepsNarrow, LV_LAYOUT_OFF); + + line1 = lv_line_create(lv_scr_act(), NULL); + lv_ex_line(line1, line_points[0]); + #if HAS_TRINAMIC_CONFIG + buttonTMCcurrent = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonTMCcurrent, PARA_UI_POS_X, PARA_UI_POS_Y * 2); /*Set its position*/ + lv_obj_set_size(buttonTMCcurrent, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + //lv_obj_set_event_cb(buttonMachine, event_handler); + lv_obj_set_event_cb_mks(buttonTMCcurrent, event_handler, ID_MOTOR_TMC_CURRENT, NULL, 0); + lv_btn_set_style(buttonTMCcurrent, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonTMCcurrent, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonTMCcurrent, LV_LAYOUT_OFF); + labelTMCcurrent = lv_label_create(buttonTMCcurrent, NULL); /*Add a label to the button*/ + + buttonTMCcurrentNarrow = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonTMCcurrentNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V); + lv_obj_set_event_cb_mks(buttonTMCcurrentNarrow, event_handler, ID_MOTOR_TMC_CURRENT_ARROW, "bmp_arrow.bin", 0); + lv_imgbtn_set_src(buttonTMCcurrentNarrow, LV_BTN_STATE_REL, &bmp_para_arrow); + lv_imgbtn_set_src(buttonTMCcurrentNarrow, LV_BTN_STATE_PR, &bmp_para_arrow); + lv_imgbtn_set_style(buttonTMCcurrentNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonTMCcurrentNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonTMCcurrentNarrow, LV_LAYOUT_OFF); + + line2 = lv_line_create(lv_scr_act(), NULL); + lv_ex_line(line2, line_points[1]); + + #if HAS_STEALTHCHOP + buttonStepMode = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonStepMode, PARA_UI_POS_X, PARA_UI_POS_Y * 3); /*Set its position*/ + lv_obj_set_size(buttonStepMode, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + //lv_obj_set_event_cb(buttonMachine, event_handler); + lv_obj_set_event_cb_mks(buttonStepMode, event_handler, ID_MOTOR_STEP_MODE, NULL, 0); + lv_btn_set_style(buttonStepMode, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonStepMode, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonStepMode, LV_LAYOUT_OFF); + labelStepMode = lv_label_create(buttonStepMode, NULL); /*Add a label to the button*/ + + buttonStepModeNarrow = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonStepModeNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 3 + PARA_UI_ARROW_V); + lv_obj_set_event_cb_mks(buttonStepModeNarrow, event_handler, ID_MOTOR_STEP_MODE_ARROW, "bmp_arrow.bin", 0); + lv_imgbtn_set_src(buttonStepModeNarrow, LV_BTN_STATE_REL, &bmp_para_arrow); + lv_imgbtn_set_src(buttonStepModeNarrow, LV_BTN_STATE_PR, &bmp_para_arrow); + lv_imgbtn_set_style(buttonStepModeNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonStepModeNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonStepModeNarrow, LV_LAYOUT_OFF); + + line3 = lv_line_create(lv_scr_act(), NULL); + lv_ex_line(line3, line_points[2]); + #endif + #endif // HAS_TRINAMIC_CONFIG + + buttonBack = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_MOTOR_RETURN, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); + + lv_label_set_text(labelSteps, machine_menu.StepsConf); + lv_obj_align(labelSteps, buttonSteps, LV_ALIGN_IN_LEFT_MID, 0, 0); + #if HAS_TRINAMIC_CONFIG + lv_label_set_text(labelTMCcurrent, machine_menu.TMCcurrentConf); + lv_obj_align(labelTMCcurrent, buttonTMCcurrent, LV_ALIGN_IN_LEFT_MID, 0, 0); + #if HAS_STEALTHCHOP + lv_label_set_text(labelStepMode, machine_menu.TMCStepModeConf); + lv_obj_align(labelStepMode, buttonStepMode, LV_ALIGN_IN_LEFT_MID, 0, 0); + #endif + #endif + } + +} + +void lv_clear_motor_settings() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.h new file mode 100644 index 0000000000..bae1918ad5 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.h @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_motor_settings(void); +extern void lv_clear_motor_settings(); + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp new file mode 100644 index 0000000000..e0d29467e6 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp @@ -0,0 +1,324 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "../../../../MarlinCore.h" +#include "lv_conf.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +#include "draw_ui.h" +#include "../../../../gcode/queue.h" + +static lv_obj_t * scr; + +static lv_obj_t * labelV, *buttonV; + +#define ID_M_X_P 1 +#define ID_M_X_N 2 +#define ID_M_Y_P 3 +#define ID_M_Y_N 4 +#define ID_M_Z_P 5 +#define ID_M_Z_N 6 +#define ID_M_STEP 7 +#define ID_M_RETURN 8 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_M_X_P: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE - 3)) { + ZERO(public_buf_l); + queue.enqueue_one_P(PSTR("G91")); + sprintf_P(public_buf_l, PSTR("G1 X%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_one_P(PSTR("G90")); + } + } + break; + case ID_M_X_N: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE - 3)) { + ZERO(public_buf_l); + queue.enqueue_now_P(PSTR("G91")); + sprintf_P(public_buf_l, PSTR("G1 X-%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G90")); + } + } + break; + case ID_M_Y_P: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE - 3)) { + ZERO(public_buf_l); + queue.enqueue_now_P(PSTR("G91")); + sprintf_P(public_buf_l, PSTR("G1 Y%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G90")); + } + } + break; + case ID_M_Y_N: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE - 3)) { + ZERO(public_buf_l); + queue.enqueue_now_P(PSTR("G91")); + sprintf_P(public_buf_l, PSTR("G1 Y-%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G90")); + } + } + break; + case ID_M_Z_P: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE - 3)) { + ZERO(public_buf_l); + queue.enqueue_now_P(PSTR("G91")); + sprintf_P(public_buf_l, PSTR("G1 Z%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G90")); + } + } + break; + case ID_M_Z_N: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE - 3)) { + ZERO(public_buf_l); + queue.enqueue_now_P(PSTR("G91")); + sprintf_P(public_buf_l, PSTR("G1 Z-%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G90")); + } + } + break; + case ID_M_STEP: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (abs(10 * (int)uiCfg.move_dist) == 100) + uiCfg.move_dist = 0.1; + else + uiCfg.move_dist *= (float)10; + + disp_move_dist(); + } + + break; + case ID_M_RETURN: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + } +} + +void lv_draw_move_motor(void) { + lv_obj_t *buttonXI, *buttonXD, *buttonYI, *buttonYD, *buttonZI, *buttonZD, *buttonBack; + + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MOVE_MOTOR_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = MOVE_MOTOR_UI; + } + disp_state = MOVE_MOTOR_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonXI = lv_imgbtn_create(scr, NULL); + buttonXD = lv_imgbtn_create(scr, NULL); + buttonYI = lv_imgbtn_create(scr, NULL); + buttonYD = lv_imgbtn_create(scr, NULL); + buttonZI = lv_imgbtn_create(scr, NULL); + buttonZD = lv_imgbtn_create(scr, NULL); + buttonV = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonXI, event_handler, ID_M_X_P, "bmp_xAdd.bin", 0); + lv_imgbtn_set_src(buttonXI, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonXI, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonXI, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonXI, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_clear_protect(buttonXI, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonXD, event_handler, ID_M_X_N, "bmp_xDec.bin", 0); + lv_imgbtn_set_src(buttonXD, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonXD, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonXD, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonXD, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonYI, event_handler, ID_M_Y_P, "bmp_yAdd.bin", 0); + lv_imgbtn_set_src(buttonYI, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonYI, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonYI, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonYI, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonYD, event_handler, ID_M_Y_N, "bmp_yDec.bin", 0); + lv_imgbtn_set_src(buttonYD, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonYD, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonYD, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonYD, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonZI, event_handler, ID_M_Z_P, "bmp_zAdd.bin", 0); + lv_imgbtn_set_src(buttonZI, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonZI, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonZI, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonZI, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonZD, event_handler, ID_M_Z_N, "bmp_zDec.bin", 0); + lv_imgbtn_set_src(buttonZD, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonZD, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_REL, &tft_style_label_rel); + + //lv_obj_set_event_cb_mks(buttonV, event_handler,ID_T_MORE,"bmp_More.bin",0); + lv_imgbtn_set_src(buttonV, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonV, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonV, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_M_RETURN, "bmp_return.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif // if 1 + lv_obj_set_pos(buttonXI, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonYI, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); + lv_obj_set_pos(buttonZI, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); + lv_obj_set_pos(buttonV, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttonXD, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonYD, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonZD, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonXI, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonXD, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonYI, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonYD, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonZI, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonZD, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonV, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * labelXI = lv_label_create(buttonXI, NULL); + lv_obj_t * labelXD = lv_label_create(buttonXD, NULL); + lv_obj_t * labelYI = lv_label_create(buttonYI, NULL); + lv_obj_t * labelYD = lv_label_create(buttonYD, NULL); + lv_obj_t * labelZI = lv_label_create(buttonZI, NULL); + lv_obj_t * labelZD = lv_label_create(buttonZD, NULL); + labelV = lv_label_create(buttonV, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelXI, move_menu.x_add); + lv_obj_align(labelXI, buttonXI, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelXD, move_menu.x_dec); + lv_obj_align(labelXD, buttonXD, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelYI, move_menu.y_add); + lv_obj_align(labelYI, buttonYI, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelYD, move_menu.y_dec); + lv_obj_align(labelYD, buttonYD, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelZI, move_menu.z_add); + lv_obj_align(labelZI, buttonZI, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelZD, move_menu.z_dec); + lv_obj_align(labelZD, buttonZD, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + + disp_move_dist(); +} + +void disp_move_dist() { + // char buf[30] = {0}; + + if ((int)(10 * uiCfg.move_dist) == 1) + lv_obj_set_event_cb_mks(buttonV, event_handler, ID_M_STEP, "bmp_step_move0_1.bin", 0); + else if ((int)(10 * uiCfg.move_dist) == 10) + lv_obj_set_event_cb_mks(buttonV, event_handler, ID_M_STEP, "bmp_step_move1.bin", 0); + else if ((int)(10 * uiCfg.move_dist) == 100) + lv_obj_set_event_cb_mks(buttonV, event_handler, ID_M_STEP, "bmp_step_move10.bin", 0); + if (gCfgItems.multiple_language != 0) { + if ((int)(10 * uiCfg.move_dist) == 1) { + lv_label_set_text(labelV, move_menu.step_01mm); + lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + else if ((int)(10 * uiCfg.move_dist) == 10) { + lv_label_set_text(labelV, move_menu.step_1mm); + lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + else if ((int)(10 * uiCfg.move_dist) == 100) { + lv_label_set_text(labelV, move_menu.step_10mm); + lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + } +} + +void lv_clear_move_motor() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h new file mode 100644 index 0000000000..c2583c7ef3 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h @@ -0,0 +1,35 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_move_motor(void); +extern void lv_clear_move_motor(); +extern void disp_move_dist(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp new file mode 100644 index 0000000000..7a4e7257e2 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp @@ -0,0 +1,799 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +//#include "../../MarlinCore.h" +#include "draw_ui.h" + +#include "../../../../MarlinCore.h" +#include "../../../../module/temperature.h" +#include "../../../../gcode/queue.h" +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../../../../feature/powerloss.h" +#endif + +#include "../../../../gcode/gcode.h" +#include "../../../../module/planner.h" + +#if HAS_TRINAMIC_CONFIG + #include "../../../../module/stepper/indirection.h" + #include "../../../../feature/tmc_util.h" +#endif + +static lv_obj_t * scr; +static lv_obj_t *buttonValue = NULL; +static lv_obj_t *labelValue = NULL; + +static char key_value[11] = {0}; +static uint8_t cnt = 0; +static char point_flg = 1; + +#define ID_NUM_KEY1 1 +#define ID_NUM_KEY2 2 +#define ID_NUM_KEY3 3 +#define ID_NUM_KEY4 4 +#define ID_NUM_KEY5 5 +#define ID_NUM_KEY6 6 +#define ID_NUM_KEY7 7 +#define ID_NUM_KEY8 8 +#define ID_NUM_KEY9 9 +#define ID_NUM_KEY0 10 +#define ID_NUM_BACK 11 +#define ID_NUM_RESET 12 +#define ID_NUM_CONFIRM 13 +#define ID_NUM_POINT 14 +#define ID_NUM_NAGETIVE 15 + +static void disp_key_value() { + char *temp; + #if HAS_TRINAMIC_CONFIG + float milliamps; + #endif + + switch (value) { + case PrintAcceleration: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.acceleration); + break; + case RetractAcceleration: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.retract_acceleration); + break; + case TravelAcceleration: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.travel_acceleration); + break; + case XAcceleration: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[X_AXIS]); + break; + case YAcceleration: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[Y_AXIS]); + break; + case ZAcceleration: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[Z_AXIS]); + break; + case E0Acceleration: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[E_AXIS]); + break; + case E1Acceleration: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)]); + break; + case XMaxFeedRate: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[X_AXIS]); + break; + case YMaxFeedRate: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[Y_AXIS]); + break; + case ZMaxFeedRate: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[Z_AXIS]); + break; + case E0MaxFeedRate: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[E_AXIS]); + break; + case E1MaxFeedRate: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[E_AXIS_N(1)]); + break; + + case XJerk: + #if HAS_CLASSIC_JERK + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), planner.max_jerk[X_AXIS]); + #endif + break; + case YJerk: + #if HAS_CLASSIC_JERK + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), planner.max_jerk[Y_AXIS]); + #endif + break; + case ZJerk: + #if HAS_CLASSIC_JERK + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), planner.max_jerk[Z_AXIS]); + #endif + break; + case EJerk: + #if HAS_CLASSIC_JERK + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), planner.max_jerk[E_AXIS]); + #endif + break; + + case Xstep: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.axis_steps_per_mm[X_AXIS]); + + break; + case Ystep: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.axis_steps_per_mm[Y_AXIS]); + + break; + case Zstep: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.axis_steps_per_mm[Z_AXIS]); + + break; + case E0step: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.axis_steps_per_mm[E_AXIS]); + + break; + case E1step: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.axis_steps_per_mm[E_AXIS_N(1)]); + break; + + case Xcurrent: + #if AXIS_IS_TMC(X) + ZERO(public_buf_m); + milliamps = stepperX.getMilliamps(); + sprintf_P(public_buf_m, PSTR("%.1f"), milliamps); + #endif + break; + + case Ycurrent: + #if AXIS_IS_TMC(Y) + ZERO(public_buf_m); + milliamps = stepperY.getMilliamps(); + sprintf_P(public_buf_m, PSTR("%.1f"), milliamps); + #endif + break; + + case Zcurrent: + #if AXIS_IS_TMC(Z) + ZERO(public_buf_m); + milliamps = stepperZ.getMilliamps(); + sprintf_P(public_buf_m, PSTR("%.1f"), milliamps); + #endif + break; + + case E0current: + #if AXIS_IS_TMC(E0) + ZERO(public_buf_m); + milliamps = stepperE0.getMilliamps(); + sprintf_P(public_buf_m, PSTR("%.1f"), milliamps); + #endif + break; + + case E1current: + #if AXIS_IS_TMC(E1) + ZERO(public_buf_m); + milliamps = stepperE1.getMilliamps(); + sprintf_P(public_buf_m, PSTR("%.1f"), milliamps); + #endif + break; + + case pause_pos_x: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), gCfgItems.pausePosX); + break; + case pause_pos_y: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), gCfgItems.pausePosY); + break; + case pause_pos_z: + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("%.1f"), gCfgItems.pausePosZ); + break; + } + ZERO(key_value); + strcpy(key_value, public_buf_m); + cnt = strlen(key_value); + temp = strchr(key_value, '.'); + if (temp) + point_flg = 0; + else + point_flg = 1; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + +} + +static void set_value_confirm() { + #if HAS_TRINAMIC_CONFIG + uint16_t current_mA; + #endif + switch (value) { + case PrintAcceleration: + planner.settings.acceleration = atof(key_value); + + break; + case RetractAcceleration: + planner.settings.retract_acceleration = atof(key_value); + + break; + case TravelAcceleration: + planner.settings.travel_acceleration = atof(key_value); + + break; + case XAcceleration: + planner.settings.max_acceleration_mm_per_s2[X_AXIS] = atof(key_value); + break; + case YAcceleration: + planner.settings.max_acceleration_mm_per_s2[Y_AXIS] = atof(key_value); + break; + case ZAcceleration: + planner.settings.max_acceleration_mm_per_s2[Z_AXIS] = atof(key_value); + break; + case E0Acceleration: + planner.settings.max_acceleration_mm_per_s2[E_AXIS] = atof(key_value); + break; + case E1Acceleration: + planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)] = atof(key_value); + break; + case XMaxFeedRate: + planner.settings.max_feedrate_mm_s[X_AXIS] = atof(key_value); + break; + case YMaxFeedRate: + planner.settings.max_feedrate_mm_s[Y_AXIS] = atof(key_value); + break; + case ZMaxFeedRate: + planner.settings.max_feedrate_mm_s[Z_AXIS] = atof(key_value); + break; + case E0MaxFeedRate: + planner.settings.max_feedrate_mm_s[E_AXIS] = atof(key_value); + break; + case E1MaxFeedRate: + planner.settings.max_feedrate_mm_s[E_AXIS_N(1)] = atof(key_value); + break; + + case XJerk: + #if HAS_CLASSIC_JERK + planner.max_jerk[X_AXIS] = atof(key_value); + #endif + break; + case YJerk: + #if HAS_CLASSIC_JERK + planner.max_jerk[Y_AXIS] = atof(key_value); + #endif + break; + case ZJerk: + #if HAS_CLASSIC_JERK + planner.max_jerk[Z_AXIS] = atof(key_value); + #endif + break; + case EJerk: + #if HAS_CLASSIC_JERK + planner.max_jerk[E_AXIS] = atof(key_value); + #endif + break; + + case Xstep: + planner.settings.axis_steps_per_mm[X_AXIS] = atof(key_value); + break; + case Ystep: + planner.settings.axis_steps_per_mm[Y_AXIS] = atof(key_value); + break; + case Zstep: + planner.settings.axis_steps_per_mm[Z_AXIS] = atof(key_value); + break; + case E0step: + planner.settings.axis_steps_per_mm[E_AXIS] = atof(key_value); + break; + case E1step: + planner.settings.axis_steps_per_mm[E_AXIS_N(1)] = atof(key_value); + break; + + case Xcurrent: + #if AXIS_IS_TMC(X) + current_mA = atoi(key_value); + stepperX.rms_current(current_mA); + #endif + break; + + case Ycurrent: + #if AXIS_IS_TMC(Y) + current_mA = atoi(key_value); + stepperY.rms_current(current_mA); + #endif + break; + + case Zcurrent: + #if AXIS_IS_TMC(Z) + current_mA = atoi(key_value); + stepperZ.rms_current(current_mA); + #endif + break; + + case E0current: + #if AXIS_IS_TMC(E0) + current_mA = atoi(key_value); + stepperE0.rms_current(current_mA); + #endif + break; + + case E1current: + #if AXIS_IS_TMC(E1) + current_mA = atoi(key_value); + stepperE1.rms_current(current_mA); + #endif + break; + + break; + case pause_pos_x: + gCfgItems.pausePosX = atof(key_value); + update_spi_flash(); + break; + case pause_pos_y: + gCfgItems.pausePosY = atof(key_value); + update_spi_flash(); + break; + case pause_pos_z: + gCfgItems.pausePosZ = atof(key_value); + update_spi_flash(); + break; + } + gcode.process_subcommands_now_P(PSTR("M500")); +} + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_NUM_KEY1: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (cnt <= 10) { + key_value[cnt] = (char)'1'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; + } + } + break; + case ID_NUM_KEY2: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (cnt <= 10) { + key_value[cnt] = (char)'2'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; + } + } + break; + case ID_NUM_KEY3: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (cnt <= 10) { + key_value[cnt] = (char)'3'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; + } + } + break; + case ID_NUM_KEY4: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (cnt <= 10) { + key_value[cnt] = (char)'4'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; + } + } + break; + case ID_NUM_KEY5: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (cnt <= 10) { + key_value[cnt] = (char)'5'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; + } + } + break; + case ID_NUM_KEY6: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (cnt <= 10) { + key_value[cnt] = (char)'6'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; + } + } + break; + case ID_NUM_KEY7: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (cnt <= 10) { + key_value[cnt] = (char)'7'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; + } + } + break; + case ID_NUM_KEY8: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (cnt <= 10) { + key_value[cnt] = (char)'8'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; + } + } + break; + case ID_NUM_KEY9: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (cnt <= 10) { + key_value[cnt] = (char)'9'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; + } + } + break; + case ID_NUM_KEY0: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (cnt <= 10) { + key_value[cnt] = (char)'0'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; + } + } + break; + case ID_NUM_BACK: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (cnt > 0) + cnt--; + if (key_value[cnt] == (char)'.') point_flg = 1; + key_value[cnt] = (char)'\0'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + } + break; + case ID_NUM_RESET: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + ZERO(key_value); + cnt = 0; + key_value[cnt] = (char)'0'; + point_flg = 1; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + } + break; + case ID_NUM_POINT: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if ((cnt != 0) && (point_flg == 1)) { + point_flg = 0; + key_value[cnt] = (char)'.'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; + } + } + break; + case ID_NUM_NAGETIVE: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (cnt == 0) { + key_value[cnt] = (char)'-'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; + } + } + break; + case ID_NUM_CONFIRM: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + last_disp_state = NUMBER_KEY_UI; + if (strlen(key_value) != 0) + set_value_confirm(); + lv_clear_number_key(); + draw_return_ui(); + } + break; + } +} + +void lv_draw_number_key(void) { + lv_obj_t *NumberKey_1 = NULL, *NumberKey_2 = NULL, *NumberKey_3 = NULL, *NumberKey_4 = NULL, *NumberKey_5 = NULL; + lv_obj_t *NumberKey_6 = NULL, *NumberKey_7 = NULL, *NumberKey_8 = NULL, *NumberKey_9 = NULL, *NumberKey_0 = NULL; + lv_obj_t *KeyPoint = NULL, *KeyConfirm = NULL, *KeyReset = NULL, *KeyBack = NULL; + lv_obj_t *Minus = NULL; + lv_obj_t *labelKey_1 = NULL, *labelKey_2 = NULL, *labelKey_3 = NULL, *labelKey_4 = NULL, *labelKey_5 = NULL; + lv_obj_t *labelKey_6 = NULL, *labelKey_7 = NULL, *labelKey_8 = NULL, *labelKey_9 = NULL, *labelKey_0 = NULL; + lv_obj_t *labelKeyPoint = NULL, *labelKeyConfirm = NULL, *labelKeyReset = NULL, *labelKeyBack = NULL; + lv_obj_t *labelMinus = NULL; + + buttonValue = NULL; + labelValue = NULL; + + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != NUMBER_KEY_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = NUMBER_KEY_UI; + } + disp_state = NUMBER_KEY_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + //lv_obj_t * title = lv_label_create(scr, NULL); + //lv_obj_set_style(title, &tft_style_label_rel); + //lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + //lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + //LV_IMG_DECLARE(bmp_pic); + + buttonValue = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonValue, 92, 40); /*Set its position*/ + lv_obj_set_size(buttonValue, 296, 40); + lv_obj_set_event_cb_mks(buttonValue, event_handler, ID_NUM_KEY1, NULL, 0); + lv_btn_set_style(buttonValue, LV_BTN_STYLE_REL, &style_num_text); /*Set the button's released style*/ + lv_btn_set_style(buttonValue, LV_BTN_STYLE_PR, &style_num_text); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonValue, LV_LAYOUT_OFF); + labelValue = lv_label_create(buttonValue, NULL); /*Add a label to the button*/ + + NumberKey_1 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(NumberKey_1, 92, 90); /*Set its position*/ + lv_obj_set_size(NumberKey_1, 68, 40); + lv_obj_set_event_cb_mks(NumberKey_1, event_handler, ID_NUM_KEY1, NULL, 0); + lv_btn_set_style(NumberKey_1, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ + lv_btn_set_style(NumberKey_1, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ + lv_btn_set_layout(NumberKey_1, LV_LAYOUT_OFF); + labelKey_1 = lv_label_create(NumberKey_1, NULL); /*Add a label to the button*/ + lv_label_set_text(labelKey_1, machine_menu.key_1); + lv_obj_align(labelKey_1, NumberKey_1, LV_ALIGN_CENTER, 0, 0); + + NumberKey_2 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(NumberKey_2, 168, 90); /*Set its position*/ + lv_obj_set_size(NumberKey_2, 68, 40); + lv_obj_set_event_cb_mks(NumberKey_2, event_handler, ID_NUM_KEY2, NULL, 0); + lv_btn_set_style(NumberKey_2, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ + lv_btn_set_style(NumberKey_2, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ + lv_btn_set_layout(NumberKey_2, LV_LAYOUT_OFF); + labelKey_2 = lv_label_create(NumberKey_2, NULL); /*Add a label to the button*/ + lv_label_set_text(labelKey_2, machine_menu.key_2); + lv_obj_align(labelKey_2, NumberKey_2, LV_ALIGN_CENTER, 0, 0); + + NumberKey_3 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(NumberKey_3, 244, 90); /*Set its position*/ + lv_obj_set_size(NumberKey_3, 68, 40); + lv_obj_set_event_cb_mks(NumberKey_3, event_handler, ID_NUM_KEY3, NULL, 0); + lv_btn_set_style(NumberKey_3, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ + lv_btn_set_style(NumberKey_3, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ + lv_btn_set_layout(NumberKey_3, LV_LAYOUT_OFF); + labelKey_3 = lv_label_create(NumberKey_3, NULL); /*Add a label to the button*/ + lv_label_set_text(labelKey_3, machine_menu.key_3); + lv_obj_align(labelKey_3, NumberKey_3, LV_ALIGN_CENTER, 0, 0); + + NumberKey_4 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(NumberKey_4, 92, 140); /*Set its position*/ + lv_obj_set_size(NumberKey_4, 68, 40); + lv_obj_set_event_cb_mks(NumberKey_4, event_handler, ID_NUM_KEY4, NULL, 0); + lv_btn_set_style(NumberKey_4, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ + lv_btn_set_style(NumberKey_4, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ + lv_btn_set_layout(NumberKey_4, LV_LAYOUT_OFF); + labelKey_4 = lv_label_create(NumberKey_4, NULL); /*Add a label to the button*/ + lv_label_set_text(labelKey_4, machine_menu.key_4); + lv_obj_align(labelKey_4, NumberKey_4, LV_ALIGN_CENTER, 0, 0); + + NumberKey_5 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(NumberKey_5, 168, 140); /*Set its position*/ + lv_obj_set_size(NumberKey_5, 68, 40); + lv_obj_set_event_cb_mks(NumberKey_5, event_handler, ID_NUM_KEY5, NULL, 0); + lv_btn_set_style(NumberKey_5, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ + lv_btn_set_style(NumberKey_5, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ + lv_btn_set_layout(NumberKey_5, LV_LAYOUT_OFF); + labelKey_5 = lv_label_create(NumberKey_5, NULL); /*Add a label to the button*/ + lv_label_set_text(labelKey_5, machine_menu.key_5); + lv_obj_align(labelKey_5, NumberKey_5, LV_ALIGN_CENTER, 0, 0); + + NumberKey_6 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(NumberKey_6, 244, 140); /*Set its position*/ + lv_obj_set_size(NumberKey_6, 68, 40); + lv_obj_set_event_cb_mks(NumberKey_6, event_handler, ID_NUM_KEY6, NULL, 0); + lv_btn_set_style(NumberKey_6, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ + lv_btn_set_style(NumberKey_6, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ + lv_btn_set_layout(NumberKey_6, LV_LAYOUT_OFF); + labelKey_6 = lv_label_create(NumberKey_6, NULL); /*Add a label to the button*/ + lv_label_set_text(labelKey_6, machine_menu.key_6); + lv_obj_align(labelKey_6, NumberKey_6, LV_ALIGN_CENTER, 0, 0); + + NumberKey_7 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(NumberKey_7, 92, 190); /*Set its position*/ + lv_obj_set_size(NumberKey_7, 68, 40); + lv_obj_set_event_cb_mks(NumberKey_7, event_handler, ID_NUM_KEY7, NULL, 0); + lv_btn_set_style(NumberKey_7, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ + lv_btn_set_style(NumberKey_7, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ + lv_btn_set_layout(NumberKey_7, LV_LAYOUT_OFF); + labelKey_7 = lv_label_create(NumberKey_7, NULL); /*Add a label to the button*/ + lv_label_set_text(labelKey_7, machine_menu.key_7); + lv_obj_align(labelKey_7, NumberKey_7, LV_ALIGN_CENTER, 0, 0); + + NumberKey_8 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(NumberKey_8, 168, 190); /*Set its position*/ + lv_obj_set_size(NumberKey_8, 68, 40); + lv_obj_set_event_cb_mks(NumberKey_8, event_handler, ID_NUM_KEY8, NULL, 0); + lv_btn_set_style(NumberKey_8, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ + lv_btn_set_style(NumberKey_8, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ + lv_btn_set_layout(NumberKey_8, LV_LAYOUT_OFF); + labelKey_8 = lv_label_create(NumberKey_8, NULL); /*Add a label to the button*/ + lv_label_set_text(labelKey_8, machine_menu.key_8); + lv_obj_align(labelKey_8, NumberKey_8, LV_ALIGN_CENTER, 0, 0); + + NumberKey_9 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(NumberKey_9, 244, 190); /*Set its position*/ + lv_obj_set_size(NumberKey_9, 68, 40); + lv_obj_set_event_cb_mks(NumberKey_9, event_handler, ID_NUM_KEY9, NULL, 0); + lv_btn_set_style(NumberKey_9, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ + lv_btn_set_style(NumberKey_9, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ + lv_btn_set_layout(NumberKey_9, LV_LAYOUT_OFF); + labelKey_9 = lv_label_create(NumberKey_9, NULL); /*Add a label to the button*/ + lv_label_set_text(labelKey_9, machine_menu.key_9); + lv_obj_align(labelKey_9, NumberKey_9, LV_ALIGN_CENTER, 0, 0); + + NumberKey_0 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(NumberKey_0, 92, 240); /*Set its position*/ + lv_obj_set_size(NumberKey_0, 68, 40); + lv_obj_set_event_cb_mks(NumberKey_0, event_handler, ID_NUM_KEY0, NULL, 0); + lv_btn_set_style(NumberKey_0, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ + lv_btn_set_style(NumberKey_0, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ + lv_btn_set_layout(NumberKey_0, LV_LAYOUT_OFF); + labelKey_0 = lv_label_create(NumberKey_0, NULL); /*Add a label to the button*/ + lv_label_set_text(labelKey_0, machine_menu.key_0); + lv_obj_align(labelKey_0, NumberKey_0, LV_ALIGN_CENTER, 0, 0); + + KeyBack = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(KeyBack, 320, 90); /*Set its position*/ + lv_obj_set_size(KeyBack, 68, 40); + lv_obj_set_event_cb_mks(KeyBack, event_handler, ID_NUM_BACK, NULL, 0); + lv_btn_set_style(KeyBack, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ + lv_btn_set_style(KeyBack, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ + lv_btn_set_layout(KeyBack, LV_LAYOUT_OFF); + labelKeyBack = lv_label_create(KeyBack, NULL); /*Add a label to the button*/ + lv_label_set_text(labelKeyBack, machine_menu.key_back); + lv_obj_align(labelKeyBack, KeyBack, LV_ALIGN_CENTER, 0, 0); + + KeyReset = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(KeyReset, 320, 140); /*Set its position*/ + lv_obj_set_size(KeyReset, 68, 40); + lv_obj_set_event_cb_mks(KeyReset, event_handler, ID_NUM_RESET, NULL, 0); + lv_btn_set_style(KeyReset, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ + lv_btn_set_style(KeyReset, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ + lv_btn_set_layout(KeyReset, LV_LAYOUT_OFF); + labelKeyReset = lv_label_create(KeyReset, NULL); /*Add a label to the button*/ + lv_label_set_text(labelKeyReset, machine_menu.key_reset); + lv_obj_align(labelKeyReset, KeyReset, LV_ALIGN_CENTER, 0, 0); + + KeyConfirm = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(KeyConfirm, 320, 190); /*Set its position*/ + lv_obj_set_size(KeyConfirm, 68, 90); + lv_obj_set_event_cb_mks(KeyConfirm, event_handler, ID_NUM_CONFIRM, NULL, 0); + lv_btn_set_style(KeyConfirm, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ + lv_btn_set_style(KeyConfirm, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ + lv_btn_set_layout(KeyConfirm, LV_LAYOUT_OFF); + labelKeyConfirm = lv_label_create(KeyConfirm, NULL); /*Add a label to the button*/ + lv_label_set_text(labelKeyConfirm, machine_menu.key_confirm); + lv_obj_align(labelKeyConfirm, KeyConfirm, LV_ALIGN_CENTER, 0, 0); + + KeyPoint = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(KeyPoint, 244, 240); /*Set its position*/ + lv_obj_set_size(KeyPoint, 68, 40); + lv_obj_set_event_cb_mks(KeyPoint, event_handler, ID_NUM_POINT, NULL, 0); + lv_btn_set_style(KeyPoint, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ + lv_btn_set_style(KeyPoint, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ + lv_btn_set_layout(KeyPoint, LV_LAYOUT_OFF); + labelKeyPoint = lv_label_create(KeyPoint, NULL); /*Add a label to the button*/ + lv_label_set_text(labelKeyPoint, machine_menu.key_point); + lv_obj_align(labelKeyPoint, KeyPoint, LV_ALIGN_CENTER, 0, 0); + + Minus = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(Minus, 168, 240); /*Set its position*/ + lv_obj_set_size(Minus, 68, 40); + lv_obj_set_event_cb_mks(Minus, event_handler, ID_NUM_NAGETIVE, NULL, 0); + lv_btn_set_style(Minus, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ + lv_btn_set_style(Minus, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ + lv_btn_set_layout(Minus, LV_LAYOUT_OFF); + labelMinus = lv_label_create(Minus, NULL); /*Add a label to the button*/ + lv_label_set_text(labelMinus, machine_menu.negative); + lv_obj_align(labelMinus, Minus, LV_ALIGN_CENTER, 0, 0); + + disp_key_value(); +} + +void lv_clear_number_key() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.h new file mode 100644 index 0000000000..d35cee6343 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.h @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_number_key(void); +extern void lv_clear_number_key(); + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp new file mode 100644 index 0000000000..ad8cad03e0 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp @@ -0,0 +1,326 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" + +#include "../../../../MarlinCore.h" + +static lv_obj_t * scr; + +#define ID_O_PRE_HEAT 1 +#define ID_O_EXTRUCT 2 +#define ID_O_MOV 3 +#define ID_O_FILAMENT 4 +#define ID_O_SPEED 5 +#define ID_O_RETURN 6 +#define ID_O_FAN 7 +#define ID_O_POWER_OFF 8 + +static lv_obj_t *label_PowerOff; +static lv_obj_t *buttonPowerOff; + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_O_PRE_HEAT: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_operation(); + lv_draw_preHeat(); + } + break; + case ID_O_EXTRUCT: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_operation(); + lv_draw_extrusion(); + } + break; + case ID_O_MOV: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_operation(); + lv_draw_move_motor(); + } + break; + case ID_O_FILAMENT: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + } + break; + case ID_O_FAN: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_operation(); + lv_draw_fan(); + } + break; + case ID_O_SPEED: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_operation(); + lv_draw_change_speed(); + } + break; + case ID_O_RETURN: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + case ID_O_POWER_OFF: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (gCfgItems.finish_power_off == 1) { + gCfgItems.finish_power_off = 0; + lv_obj_set_event_cb_mks(obj, event_handler, ID_O_POWER_OFF, "bmp_manual_off.bin", 0); // didn't find bmp_Mamual... + lv_label_set_text(label_PowerOff, printing_more_menu.manual); + lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + lv_obj_refresh_ext_draw_pad(label_PowerOff); + update_spi_flash(); + } + else { + gCfgItems.finish_power_off = 1; + lv_obj_set_event_cb_mks(obj, event_handler, ID_O_POWER_OFF, "bmp_auto_off.bin", 0); + lv_label_set_text(label_PowerOff, printing_more_menu.auto_close); + lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + lv_obj_refresh_ext_draw_pad(label_PowerOff); + update_spi_flash(); + } + } + break; + + } +} + +void lv_draw_operation(void) { + lv_obj_t *buttonPreHeat, *buttonExtrusion, *buttonSpeed; + lv_obj_t *buttonBack, *buttonFan; + lv_obj_t *labelPreHeat, *labelExtrusion; + lv_obj_t *label_Back, *label_Speed, *label_Fan; + lv_obj_t *buttonMove = NULL, *label_Move = NULL; + + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != OPERATE_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = OPERATE_UI; + } + disp_state = OPERATE_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonPreHeat = lv_imgbtn_create(scr, NULL); + buttonExtrusion = lv_imgbtn_create(scr, NULL); + buttonFan = lv_imgbtn_create(scr, NULL); + buttonSpeed = lv_imgbtn_create(scr, NULL); + + if (uiCfg.print_state != WORKING) { + //buttonFilament = lv_imgbtn_create(scr, NULL); + //} else { + buttonMove = lv_imgbtn_create(scr, NULL); + } + + buttonPowerOff = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonPreHeat, event_handler, ID_O_PRE_HEAT, "bmp_temp.bin", 0); + lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_clear_protect(buttonPreHeat, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonExtrusion, event_handler, ID_O_EXTRUCT, "bmp_extrude_opr.bin", 0); + lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonFan, event_handler, ID_O_FAN, "bmp_fan.bin", 0); + lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonSpeed, event_handler, ID_O_SPEED, "bmp_speed.bin", 0); + lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_REL, &tft_style_label_rel); + + if (uiCfg.print_state != WORKING) { + /* + lv_obj_set_event_cb_mks(buttonFilament, event_handler,ID_O_FILAMENT,"bmp_Filamentchange.bin",0); + lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_REL, &tft_style_label_rel); + } else { + */ + lv_obj_set_event_cb_mks(buttonMove, event_handler, ID_O_MOV, "bmp_move_opr.bin", 0); + lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_REL, &tft_style_label_rel); + } + if (gCfgItems.finish_power_off == 1) + lv_obj_set_event_cb_mks(buttonPowerOff, event_handler, ID_O_POWER_OFF, "bmp_auto_off.bin", 0); + else + lv_obj_set_event_cb_mks(buttonPowerOff, event_handler, ID_O_POWER_OFF, "bmp_manual_off.bin", 0); + lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPowerOff, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonPowerOff, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_O_RETURN, "bmp_return.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif // if 1 + + lv_obj_set_pos(buttonPreHeat, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonExtrusion, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); + + lv_obj_set_pos(buttonFan, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); + lv_obj_set_pos(buttonSpeed, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + + if (uiCfg.print_state != WORKING) { + /* + lv_obj_set_pos(buttonFilament,INTERVAL_V,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + } else { + */ + lv_obj_set_pos(buttonMove, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonPowerOff, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + } + else { + lv_obj_set_pos(buttonPowerOff, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + } + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonPreHeat, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonExtrusion, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonFan, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonSpeed, LV_LAYOUT_OFF); + + if (uiCfg.print_state != WORKING) { + /* + lv_btn_set_layout(buttonFilament, LV_LAYOUT_OFF); + } else { + */ + lv_btn_set_layout(buttonMove, LV_LAYOUT_OFF); + } + lv_btn_set_layout(buttonPowerOff, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + labelPreHeat = lv_label_create(buttonPreHeat, NULL); + labelExtrusion = lv_label_create(buttonExtrusion, NULL); + + label_Fan = lv_label_create(buttonFan, NULL); + label_Speed = lv_label_create(buttonSpeed, NULL); + + if (uiCfg.print_state != WORKING) { + /* + label_Filament = lv_label_create(buttonFilament, NULL); + } else { + */ + label_Move = lv_label_create(buttonMove, NULL); + } + label_PowerOff = lv_label_create(buttonPowerOff, NULL); + + label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelPreHeat, operation_menu.temp); + lv_obj_align(labelPreHeat, buttonPreHeat, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelExtrusion, operation_menu.extr); + lv_obj_align(labelExtrusion, buttonExtrusion, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Fan, operation_menu.fan); + lv_obj_align(label_Fan, buttonFan, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Speed, operation_menu.speed); + lv_obj_align(label_Speed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + if (uiCfg.print_state != WORKING) { + /* + lv_label_set_text(label_Filament, operation_menu.filament); + lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } else { + */ + lv_label_set_text(label_Move, operation_menu.move); + lv_obj_align(label_Move, buttonMove, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + + if (gCfgItems.finish_power_off == 1) + lv_label_set_text(label_PowerOff, printing_more_menu.auto_close); + else + lv_label_set_text(label_PowerOff, printing_more_menu.manual); + lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } +} + +void lv_clear_operation() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.h new file mode 100644 index 0000000000..e2eaaf06a4 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_operation(void); +extern void lv_clear_operation(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp new file mode 100644 index 0000000000..f7dd2060b8 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp @@ -0,0 +1,55 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 BOTH(HAS_TFT_LVGL_UI, ADVANCED_PAUSE_FEATURE) + +#include "draw_ui.h" +#include "lv_conf.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" + +#include "../../../../MarlinCore.h" +#include "../../../../feature/pause.h" + +void lv_draw_pause_message(const PauseMessage msg) { + switch (msg) { + case PAUSE_MESSAGE_PAUSING: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_PAUSING); break; + case PAUSE_MESSAGE_CHANGING: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_CHANGING); break; + case PAUSE_MESSAGE_UNLOAD: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_UNLOAD); break; + case PAUSE_MESSAGE_WAITING: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_WAITING); break; + case PAUSE_MESSAGE_INSERT: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_INSERT); break; + case PAUSE_MESSAGE_LOAD: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_LOAD); break; + case PAUSE_MESSAGE_PURGE: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_PURGE); break; + case PAUSE_MESSAGE_RESUME: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_RESUME); break; + case PAUSE_MESSAGE_HEAT: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_HEAT); break; + case PAUSE_MESSAGE_HEATING: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_HEATING); break; + case PAUSE_MESSAGE_OPTION: pause_menu_response = PAUSE_RESPONSE_WAIT_FOR; + clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_OPTION); break; + case PAUSE_MESSAGE_STATUS: + default: break; + } +} + +#endif // HAS_TFT_LVGL_UI && ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h new file mode 100644 index 0000000000..ce541ee68b --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_pause_message(const PauseMessage msg); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp new file mode 100644 index 0000000000..56caf812b1 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp @@ -0,0 +1,222 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" + +#include "../../../../MarlinCore.h" +#include "../../../../module/planner.h" + +static lv_obj_t * scr; + +#define ID_PAUSE_RETURN 1 +#define ID_PAUSE_X 2 +#define ID_PAUSE_Y 3 +#define ID_PAUSE_Z 4 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_PAUSE_RETURN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_pause_position(); + draw_return_ui(); + } + break; + case ID_PAUSE_X: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = pause_pos_x; + lv_clear_pause_position(); + lv_draw_number_key(); + } + break; + case ID_PAUSE_Y: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = pause_pos_y; + lv_clear_pause_position(); + lv_draw_number_key(); + } + break; + case ID_PAUSE_Z: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = pause_pos_z; + lv_clear_pause_position(); + lv_draw_number_key(); + } + break; + } +} + +void lv_draw_pause_position(void) { + lv_obj_t *buttonBack = NULL, *label_Back = NULL; + lv_obj_t *buttonXText = NULL, *labelXText = NULL, *buttonXValue = NULL, *labelXValue = NULL; + lv_obj_t *buttonYText = NULL, *labelYText = NULL, *buttonYValue = NULL, *labelYValue = NULL; + lv_obj_t *buttonZText = NULL, *labelZText = NULL, *buttonZValue = NULL, *labelZValue = NULL; + + lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != PAUSE_POS_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = PAUSE_POS_UI; + } + disp_state = PAUSE_POS_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, machine_menu.PausePosText); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_para_back); + // LV_IMG_DECLARE(bmp_para_arrow); + LV_IMG_DECLARE(bmp_para_bank); + + buttonXText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonXText, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonXText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonXText, event_handler); + lv_btn_set_style(buttonXText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonXText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonXText, LV_LAYOUT_OFF); + labelXText = lv_label_create(buttonXText, NULL); /*Add a label to the button*/ + + buttonXValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonXValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonXValue, event_handler, ID_PAUSE_X, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonXValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonXValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonXValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonXValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonXValue, LV_LAYOUT_OFF); + labelXValue = lv_label_create(buttonXValue, NULL); + + line1 = lv_line_create(scr, NULL); + lv_ex_line(line1, line_points[0]); + + buttonYText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonYText, PARA_UI_POS_X, PARA_UI_POS_Y * 2); /*Set its position*/ + lv_obj_set_size(buttonYText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonYText, event_handler); + lv_btn_set_style(buttonYText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonYText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonYText, LV_LAYOUT_OFF); + labelYText = lv_label_create(buttonYText, NULL); /*Add a label to the button*/ + + buttonYValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonYValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonYValue, event_handler, ID_PAUSE_Y, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonYValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonYValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonYValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonYValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonYValue, LV_LAYOUT_OFF); + labelYValue = lv_label_create(buttonYValue, NULL); + + line2 = lv_line_create(scr, NULL); + lv_ex_line(line2, line_points[1]); + + buttonZText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonZText, PARA_UI_POS_X, PARA_UI_POS_Y * 3); /*Set its position*/ + lv_obj_set_size(buttonZText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonZText, event_handler); + lv_btn_set_style(buttonZText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonZText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonZText, LV_LAYOUT_OFF); + labelZText = lv_label_create(buttonZText, NULL); /*Add a label to the button*/ + + buttonZValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonZValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonZValue, event_handler, ID_PAUSE_Z, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonZValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonZValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonZValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonZValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonZValue, LV_LAYOUT_OFF); + labelZValue = lv_label_create(buttonZValue, NULL); + + line3 = lv_line_create(scr, NULL); + lv_ex_line(line3, line_points[2]); + + buttonBack = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_PAUSE_RETURN, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosX); + lv_label_set_text(labelXValue, public_buf_l); + lv_obj_align(labelXValue, buttonXValue, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosY); + lv_label_set_text(labelYValue, public_buf_l); + lv_obj_align(labelYValue, buttonYValue, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosZ); + lv_label_set_text(labelZValue, public_buf_l); + lv_obj_align(labelZValue, buttonZValue, LV_ALIGN_CENTER, 0, 0); + + lv_label_set_text(labelXText, machine_menu.xPos); + lv_obj_align(labelXText, buttonXText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelYText, machine_menu.yPos); + lv_obj_align(labelYText, buttonYText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelZText, machine_menu.zPos); + lv_obj_align(labelZText, buttonZText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); + } +} + +void lv_clear_pause_position() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.h new file mode 100644 index 0000000000..5f1b4dc960 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.h @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_pause_position(void); +extern void lv_clear_pause_position(); + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp new file mode 100644 index 0000000000..801114e6b2 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp @@ -0,0 +1,387 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" + +#include "../../../../MarlinCore.h" +#include "../../../../module/temperature.h" + +static lv_obj_t * scr; +static lv_obj_t *buttoType, *buttonStep; +static lv_obj_t * labelType; +static lv_obj_t * labelStep; +static lv_obj_t * tempText1; + +#define ID_P_ADD 1 +#define ID_P_DEC 2 +#define ID_P_TYPE 3 +#define ID_P_STEP 4 +#define ID_P_OFF 5 +#define ID_P_RETURN 6 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_P_ADD: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (uiCfg.curTempType == 0) { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target += uiCfg.stepHeat; + if (uiCfg.curSprayerChoose == 0) { + if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); + } + } + #if !defined(SINGLENOZZLE) && EXTRUDERS >= 2 + else if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); + } + #endif + } + #if HAS_HEATED_BED + else { + thermalManager.temp_bed.target += uiCfg.stepHeat; + if ((int)thermalManager.temp_bed.target > BED_MAXTEMP - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) { + thermalManager.temp_bed.target = (float)BED_MAXTEMP - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1); + thermalManager.start_watching_bed(); + } + } + #endif + disp_desire_temp(); + } + break; + case ID_P_DEC: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (uiCfg.curTempType == 0) { + if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > uiCfg.stepHeat) { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target -= uiCfg.stepHeat; + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); + } + else { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)0; + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); + } + } + #if HAS_HEATED_BED + else { + if ((int)thermalManager.temp_bed.target > uiCfg.stepHeat) { + thermalManager.temp_bed.target -= uiCfg.stepHeat; + thermalManager.start_watching_bed(); + } + else { + thermalManager.temp_bed.target = (float)0; + thermalManager.start_watching_bed(); + } + } + #endif + disp_desire_temp(); + } + + break; + case ID_P_TYPE: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (uiCfg.curTempType == 0) { + if (EXTRUDERS == 2) { + if (uiCfg.curSprayerChoose == 0) { + uiCfg.curSprayerChoose = 1; + } + else if (uiCfg.curSprayerChoose == 1) { + if (TEMP_SENSOR_BED != 0) { + uiCfg.curTempType = 1; + } + else { + uiCfg.curTempType = 0; + uiCfg.curSprayerChoose = 0; + } + } + } + else if (uiCfg.curSprayerChoose == 0) { + if (TEMP_SENSOR_BED != 0) + uiCfg.curTempType = 1; + else + uiCfg.curTempType = 0; + } + } + else if (uiCfg.curTempType == 1) { + uiCfg.curSprayerChoose = 0; + uiCfg.curTempType = 0; + } + disp_temp_type(); + } + break; + case ID_P_STEP: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + switch (uiCfg.stepHeat) { + case 1: uiCfg.stepHeat = 5; break; + case 5: uiCfg.stepHeat = 10; break; + case 10: uiCfg.stepHeat = 1; break; + default: break; + } + disp_step_heat(); + } + break; + case ID_P_OFF: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (uiCfg.curTempType == 0) { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)0; + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); + } + #if HAS_HEATED_BED + else { + thermalManager.temp_bed.target = (float)0; + thermalManager.start_watching_bed(); + } + #endif + disp_desire_temp(); + } + break; + case ID_P_RETURN: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + } +} + +void lv_draw_preHeat(void) { + lv_obj_t *buttonAdd, *buttonDec; + lv_obj_t *buttonOff, *buttonBack; + + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != PRE_HEAT_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = PRE_HEAT_UI; + } + disp_state = PRE_HEAT_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonAdd = lv_imgbtn_create(scr, NULL); + buttonDec = lv_imgbtn_create(scr, NULL); + buttoType = lv_imgbtn_create(scr, NULL); + buttonStep = lv_imgbtn_create(scr, NULL); + buttonOff = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonAdd, event_handler, ID_P_ADD, "bmp_Add.bin", 0); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonDec, event_handler, ID_P_DEC, "bmp_Dec.bin", 0); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_label_rel); + + + lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttoType, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttoType, LV_BTN_STATE_REL, &tft_style_label_rel); + + + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonOff, event_handler, ID_P_OFF, "bmp_speed0.bin", 0); + lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_P_RETURN, "bmp_return.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif + + lv_obj_set_pos(buttonAdd, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonDec, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttoType, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonStep, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonOff, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); + lv_btn_set_layout(buttoType, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonOff, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); + lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); + labelType = lv_label_create(buttoType, NULL); + labelStep = lv_label_create(buttonStep, NULL); + lv_obj_t * labelOff = lv_label_create(buttonOff, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelAdd, preheat_menu.add); + lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelDec, preheat_menu.dec); + lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelOff, preheat_menu.off); + lv_obj_align(labelOff, buttonOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + + disp_temp_type(); + disp_step_heat(); + + tempText1 = lv_label_create(scr, NULL); + lv_obj_set_style(tempText1, &tft_style_label_rel); + disp_desire_temp(); +} + +void disp_temp_type() { + + if (uiCfg.curTempType == 0) { + if (uiCfg.curSprayerChoose == 1) { + lv_obj_set_event_cb_mks(buttoType, event_handler, ID_P_TYPE, "bmp_extru2.bin", 0); + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelType, preheat_menu.ext2); + lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + } + else { + lv_obj_set_event_cb_mks(buttoType, event_handler, ID_P_TYPE, "bmp_extru1.bin", 0); + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelType, preheat_menu.ext1); + lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + } + + } + else { + lv_obj_set_event_cb_mks(buttoType, event_handler, ID_P_TYPE, "bmp_bed.bin", 0); + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelType, preheat_menu.hotbed); + lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + } + +} + +void disp_desire_temp() { + char buf[20] = {0}; + + public_buf_l[0] = '\0'; + + if (uiCfg.curTempType == 0) { + if (uiCfg.curSprayerChoose < 1) + strcat(public_buf_l, preheat_menu.ext1); + else + strcat(public_buf_l, preheat_menu.ext2); + sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); + } + #if HAS_HEATED_BED + else { + strcat(public_buf_l, preheat_menu.hotbed); + sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_bed.celsius, (int)thermalManager.temp_bed.target); + } + #endif + strcat_P(public_buf_l, PSTR(": ")); + strcat(public_buf_l, buf); + lv_label_set_text(tempText1, public_buf_l); + lv_obj_align(tempText1, NULL, LV_ALIGN_CENTER, 0, -50); +} + +void disp_step_heat() { + if (uiCfg.stepHeat == 1) + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_P_STEP, "bmp_step1_degree.bin", 0); + else if (uiCfg.stepHeat == 5) + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_P_STEP, "bmp_step5_degree.bin", 0); + else if (uiCfg.stepHeat == 10) + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_P_STEP, "bmp_step10_degree.bin", 0); + + if (gCfgItems.multiple_language != 0) { + if (uiCfg.stepHeat == 1) { + lv_label_set_text(labelStep, preheat_menu.step_1c); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + else if (uiCfg.stepHeat == 5) { + lv_label_set_text(labelStep, preheat_menu.step_5c); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + else if (uiCfg.stepHeat == 10) { + lv_label_set_text(labelStep, preheat_menu.step_10c); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + } +} + +void lv_clear_preHeat() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h new file mode 100644 index 0000000000..db0e361764 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h @@ -0,0 +1,37 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_preHeat(void); +extern void lv_clear_preHeat(); +extern void disp_temp_type(); +extern void disp_step_heat(); +extern void disp_desire_temp(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp new file mode 100644 index 0000000000..33405a905f --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp @@ -0,0 +1,621 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "../../../../MarlinCore.h" +#include "lv_conf.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +#include "draw_ui.h" +#include "../../../../sd/cardreader.h" + +static lv_obj_t * scr; + +static lv_obj_t *buttonPageUp, *buttonPageDown, *buttonBack, + *buttonGcode[FILE_BTN_CNT], *labelPageUp[FILE_BTN_CNT], *buttonText[FILE_BTN_CNT]; + +#define ID_P_UP 7 +#define ID_P_DOWN 8 +#define ID_P_RETURN 9 + +int8_t curDirLever = 0; +LIST_FILE list_file; +DIR_OFFSET dir_offset[10]; + +extern uint8_t public_buf[512]; +extern char public_buf_m[100]; + +uint8_t sel_id = 0; + +#if ENABLED(SDSUPPORT) + + static uint8_t search_file() { + int valid_name_cnt = 0; + //char tmp[SHORT_NEME_LEN*MAX_DIR_LEVEL+1]; + + list_file.Sd_file_cnt = 0; + //list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; + + //root2.rewind(); + //SERIAL_ECHOLN(list_file.curDirPath); + + if (curDirLever != 0) card.cd(list_file.curDirPath); + else card.cdroot(); // while(card.cdup()); + + const uint16_t fileCnt = card.get_num_Files(); + + for (uint16_t i = 0; i < fileCnt; i++) { + if (list_file.Sd_file_cnt == list_file.Sd_file_offset) { + const uint16_t nr = SD_ORDER(i, fileCnt); + card.getfilename_sorted(nr); + + if (card.flag.filenameIsDir) { + //SERIAL_ECHOLN(card.longest_filename); + list_file.IsFolder[valid_name_cnt] = 1; + } + else { + //SERIAL_ECHOLN(card.longFilename); + list_file.IsFolder[valid_name_cnt] = 0; + } + + #if 1 + // + memset(list_file.file_name[valid_name_cnt], 0, strlen(list_file.file_name[valid_name_cnt])); + strcpy(list_file.file_name[valid_name_cnt], list_file.curDirPath); + strcat_P(list_file.file_name[valid_name_cnt], PSTR("/")); + strcat(list_file.file_name[valid_name_cnt], card.filename); + // + memset(list_file.long_name[valid_name_cnt], 0, strlen(list_file.long_name[valid_name_cnt])); + if (card.longFilename[0] == 0) + strncpy(list_file.long_name[valid_name_cnt], card.filename, strlen(card.filename)); + else + strncpy(list_file.long_name[valid_name_cnt], card.longFilename, strlen(card.longFilename)); + + valid_name_cnt++; + if (valid_name_cnt == 1) + dir_offset[curDirLever].cur_page_first_offset = list_file.Sd_file_offset; + if (valid_name_cnt >= FILE_NUM) { + dir_offset[curDirLever].cur_page_last_offset = list_file.Sd_file_offset; + list_file.Sd_file_offset++; + break; + } + list_file.Sd_file_offset++; + #endif + } + list_file.Sd_file_cnt++; + } + //card.closefile(false); + return valid_name_cnt; + } + +#endif // SDSUPPORT + +uint8_t have_pre_pic(char *path) { + #if ENABLED(SDSUPPORT) + char *ps1, *ps2, *cur_name = strrchr(path, '/'); + + card.openFileRead(cur_name); + card.read(public_buf, 512); + ps1 = strstr((char *)public_buf, ";simage:"); + card.read(public_buf, 512); + ps2 = strstr((char *)public_buf, ";simage:"); + if (ps1 || ps2) { + card.closefile(); + return 1; + } + card.closefile(); + #endif + + return 0; +} + +LV_IMG_DECLARE(bmp_pic_117x92); +LV_IMG_DECLARE(bmp_pic_100x100); +LV_IMG_DECLARE(bmp_pic); +LV_IMG_DECLARE(bmp_pic_100x40); + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + uint8_t i, file_count = 0; + //switch (obj->mks_obj_id) + //{ + if (obj->mks_obj_id == ID_P_UP) { + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (dir_offset[curDirLever].curPage > 0) { + // 2015.05.19 + list_file.Sd_file_cnt = 0; + + if (dir_offset[curDirLever].cur_page_first_offset >= FILE_NUM) + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset - FILE_NUM; + + #if ENABLED(SDSUPPORT) + file_count = search_file(); + #endif + if (file_count != 0) { + dir_offset[curDirLever].curPage--; + lv_obj_del(scr); + disp_gcode_icon(file_count); + } + } + } + } + else if (obj->mks_obj_id == ID_P_DOWN) { + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (dir_offset[curDirLever].cur_page_last_offset > 0) { + list_file.Sd_file_cnt = 0; + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_last_offset + 1; + #if ENABLED(SDSUPPORT) + file_count = search_file(); + #endif + if (file_count != 0) { + dir_offset[curDirLever].curPage++; + lv_obj_del(scr); + disp_gcode_icon(file_count); + } + if (file_count < FILE_NUM) + dir_offset[curDirLever].cur_page_last_offset = 0; + } + } + } + else if (obj->mks_obj_id == ID_P_RETURN) { + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (curDirLever > 0) { + int8_t *ch = (int8_t *)strrchr(list_file.curDirPath, '/'); + if (ch) { + *ch = 0; + #if ENABLED(SDSUPPORT) + card.cdup(); + #endif + dir_offset[curDirLever].curPage = 0; + dir_offset[curDirLever].cur_page_first_offset = 0; + dir_offset[curDirLever].cur_page_last_offset = 0; + curDirLever--; + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; + #if ENABLED(SDSUPPORT) + file_count = search_file(); + #endif + lv_obj_del(scr); + disp_gcode_icon(file_count); + } + } + else { + lv_obj_del(scr); + lv_draw_ready_print(); + } + } + } + else { + for (i = 0; i < FILE_BTN_CNT; i++) { + if (obj->mks_obj_id == (i + 1)) { + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (list_file.file_name[i][0] != 0) { + if (list_file.IsFolder[i] == 1) { + ZERO(list_file.curDirPath); + strcpy(list_file.curDirPath, list_file.file_name[i]); + curDirLever++; + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; + #if ENABLED(SDSUPPORT) + file_count = search_file(); + #endif + lv_obj_del(scr); + disp_gcode_icon(file_count); + } + else { + sel_id = i; + lv_obj_del(scr); + lv_draw_dialog(DIALOG_TYPE_PRINT_FILE); + } + break; + } + } + } + } + } +} + +void lv_draw_print_file(void) { + //uint8_t i; + uint8_t file_count; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != PRINT_FILE_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINT_FILE_UI; + } + disp_state = PRINT_FILE_UI; + + curDirLever = 0; + dir_offset[curDirLever].curPage = 0; + + list_file.Sd_file_offset = 0; + list_file.Sd_file_cnt = 0; + + ZERO(dir_offset); + ZERO(list_file.IsFolder); + ZERO(list_file.curDirPath); + + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; + #if ENABLED(SDSUPPORT) + card.mount(); + file_count = search_file(); + #endif + disp_gcode_icon(file_count); + + //lv_obj_t * labelPageUp = lv_label_create(buttonPageUp, NULL); + //lv_obj_t * labelPageDown = lv_label_create(buttonPageDown, NULL); + //lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + /* + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelPageUp, tool_menu.preheat); + lv_obj_align(labelPageUp, buttonPageUp, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelPageDown, tool_menu.extrude); + lv_obj_align(labelPageDown, buttonPageDown, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + */ +} + +void disp_gcode_icon(uint8_t file_num) { + uint8_t i; + + scr = lv_obj_create(NULL, NULL); + + //static lv_style_t tool_style; + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + buttonPageUp = lv_imgbtn_create(scr, NULL); + buttonPageDown = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonPageUp, event_handler, ID_P_UP, "bmp_pageUp.bin", 0); + lv_imgbtn_set_src(buttonPageUp, LV_BTN_STATE_REL, &bmp_pic_117x92); + lv_imgbtn_set_src(buttonPageUp, LV_BTN_STATE_PR, &bmp_pic_117x92); + lv_imgbtn_set_style(buttonPageUp, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonPageUp, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_clear_protect(buttonPageUp, LV_PROTECT_FOLLOW); + + #if 1 + lv_obj_set_event_cb_mks(buttonPageDown, event_handler, ID_P_DOWN, "bmp_pageDown.bin", 0); + lv_imgbtn_set_src(buttonPageDown, LV_BTN_STATE_REL, &bmp_pic_117x92); + lv_imgbtn_set_src(buttonPageDown, LV_BTN_STATE_PR, &bmp_pic_117x92); + lv_imgbtn_set_style(buttonPageDown, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonPageDown, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_P_RETURN, "bmp_back.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic_117x92); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic_117x92); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif + + lv_obj_set_pos(buttonPageUp, OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttonPageDown, OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight + OTHER_BTN_YPIEL + INTERVAL_H); + lv_obj_set_pos(buttonBack, OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight + OTHER_BTN_YPIEL * 2 + INTERVAL_H * 2); + + /*Create a label on the Image button*/ + + lv_btn_set_layout(buttonPageUp, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPageDown, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + for (i = 0; i < FILE_BTN_CNT; i++) { + /* + if (seq) { + j = (FILE_BTN_CNT-1) - i; + back_flg = 1; + } + else { + j = i; + back_flg = 0; + } + */ + if (i >= file_num) break; + + #ifdef TFT35 + buttonGcode[i] = lv_imgbtn_create(scr, NULL); + + lv_imgbtn_set_style(buttonGcode[i], LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonGcode[i], LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_clear_protect(buttonGcode[i], LV_PROTECT_FOLLOW); + lv_btn_set_layout(buttonGcode[i], LV_LAYOUT_OFF); + + ZERO(public_buf_m); + cutFileName((char *)list_file.long_name[i], 16, 8, (char *)public_buf_m); + + if (list_file.IsFolder[i] == 1) { + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), "bmp_dir.bin", 0); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, &bmp_pic); + if (i < 3) + lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1), titleHeight); + else + lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * (i - 3) + INTERVAL_V * ((i - 3) + 1), BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + labelPageUp[i] = lv_label_create(buttonGcode[i], NULL); + lv_obj_set_style(labelPageUp[i], &tft_style_label_rel); + lv_label_set_text(labelPageUp[i], public_buf_m); + lv_obj_align(labelPageUp[i], buttonGcode[i], LV_ALIGN_IN_BOTTOM_MID, 0, -5); + } + else { + if (have_pre_pic((char *)list_file.file_name[i])) { + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), list_file.file_name[i], 1); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, &bmp_pic_100x100); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, &bmp_pic_100x100); + if (i < 3) { + lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1) + FILE_PRE_PIC_X_OFFSET, titleHeight + FILE_PRE_PIC_Y_OFFSET); + buttonText[i] = lv_btn_create(scr, NULL); + //lv_obj_set_event_cb(buttonText[i], event_handler); + + lv_btn_set_style(buttonText[i], LV_BTN_STATE_PR, &tft_style_label_pre); + lv_btn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_label_rel); + //lv_obj_set_style(buttonText[i], &tft_style_label_pre); + //lv_obj_set_style(buttonText[i], &tft_style_label_rel); + lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW); + lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF); + //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),NULL,0); + //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_REL, &bmp_pic_100x40); + //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_PR, &bmp_pic_100x40); + lv_obj_set_pos(buttonText[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1) + FILE_PRE_PIC_X_OFFSET, titleHeight + FILE_PRE_PIC_Y_OFFSET + 100); + lv_obj_set_size(buttonText[i], 100, 40); + } + else { + lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * (i - 3) + INTERVAL_V * ((i - 3) + 1) + FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL + INTERVAL_H + titleHeight + FILE_PRE_PIC_Y_OFFSET); + buttonText[i] = lv_btn_create(scr, NULL); + //lv_obj_set_event_cb(buttonText[i], event_handler); + + lv_btn_set_style(buttonText[i], LV_BTN_STATE_PR, &tft_style_label_pre); + lv_btn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_label_rel); + + //lv_imgbtn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW); + lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF); + //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),NULL,0); + //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_REL, &bmp_pic_100x40); + //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_PR, &bmp_pic_100x40); + lv_obj_set_pos(buttonText[i], BTN_X_PIXEL * (i - 3) + INTERVAL_V * ((i - 3) + 1) + FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL + INTERVAL_H + titleHeight + FILE_PRE_PIC_Y_OFFSET + 100); + lv_obj_set_size(buttonText[i], 100, 40); + } + labelPageUp[i] = lv_label_create(buttonText[i], NULL); + lv_obj_set_style(labelPageUp[i], &tft_style_label_rel); + lv_label_set_text(labelPageUp[i], public_buf_m); + lv_obj_align(labelPageUp[i], buttonText[i], LV_ALIGN_IN_BOTTOM_MID, 0, 0); + } + else { + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), "bmp_file.bin", 0); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, &bmp_pic); + if (i < 3) + lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1), titleHeight); + else + lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * (i - 3) + INTERVAL_V * ((i - 3) + 1), BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + labelPageUp[i] = lv_label_create(buttonGcode[i], NULL); + lv_obj_set_style(labelPageUp[i], &tft_style_label_rel); + lv_label_set_text(labelPageUp[i], public_buf_m); + lv_obj_align(labelPageUp[i], buttonGcode[i], LV_ALIGN_IN_BOTTOM_MID, 0, -5); + } + } + #else // !TFT35 + #endif // !TFT35 + } +} + +void lv_open_gcode_file(char *path) { + #if ENABLED(SDSUPPORT) + uint32_t *ps4; + int pre_sread_cnt; + char *cur_name; + + cur_name = strrchr(path, '/'); + + card.openFileRead(cur_name); + card.read(public_buf, 512); + ps4 = (uint32_t *)strstr((char *)public_buf, ";simage:"); + // Ignore the beginning message of gcode file + if (ps4) { + pre_sread_cnt = (uint32_t)ps4 - (uint32_t)((uint32_t *)(&public_buf[0])); + card.setIndex(pre_sread_cnt); + } + #endif // SDSUPPORT +} + + +int ascii2dec_test(char *ascii) { + int result = 0; + if (ascii == 0) return 0; + + if (*(ascii) >= '0' && *(ascii) <= '9') + result = *(ascii) - '0'; + else if (*(ascii) >= 'a' && *(ascii) <= 'f') + result = *(ascii) - 'a' + 0x0a; + else if (*(ascii) >= 'A' && *(ascii) <= 'F') + result = *(ascii) - 'A' + 0x0a; + else + return 0; + + return result; +} + +void lv_gcode_file_read(uint8_t *data_buf) { + #if ENABLED(SDSUPPORT) + uint16_t i = 0, j = 0, k = 0; + uint16_t row_1 = 0; + bool ignore_start = true; + char temp_test[200]; + volatile uint16_t *p_index; + + memset(public_buf, 0, 200); + + while (card.isFileOpen()) { + if (ignore_start) card.read(temp_test, 8); // line start -> ignore + card.read(temp_test, 200); // data + // \r;;gimage: we got the bit img, so stop here + if (temp_test[1] == ';') { + card.closefile(); + break; + } + for (i = 0; i < 200;) { + public_buf[row_1 * 200 + 100 * k + j] = (char)(ascii2dec_test(&temp_test[i]) << 4 | ascii2dec_test(&temp_test[i + 1])); + j++; + i += 2; + } + + uint16_t c = card.get(); + // check if we have more data or finished the line (CR) + if (c == '\r') break; + card.setIndex(card.getIndex()); + k++; + j = 0; + ignore_start = false; + } + #if ENABLED(TFT_LVGL_UI_SPI) + for (i = 0; i < 200;) { + p_index = (uint16_t *)(&public_buf[i]); + + //Color = (*p_index >> 8); + //*p_index = Color | ((*p_index & 0xff) << 8); + i += 2; + if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; + } + #else + for (i = 0; i < 200;) { + p_index = (uint16_t *)(&public_buf[i]); + //Color = (*p_index >> 8); + //*p_index = Color | ((*p_index & 0xff) << 8); + i += 2; + if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; // 0x18C3; + } + #endif // TFT_LVGL_UI_SPI + memcpy(data_buf, public_buf, 200); + #endif // SDSUPPORT +} + +void lv_close_gcode_file() {TERN_(SDSUPPORT, card.closefile());} + +void cutFileName(char *path, int len, int bytePerLine, char *outStr) { + #if _LFN_UNICODE + TCHAR *tmpFile; + TCHAR *strIndex1 = 0, *strIndex2 = 0, *beginIndex; + TCHAR secSeg[10] = {0}; + TCHAR gFileTail[4] = {'~', '.', 'g', '\0'}; + #else + char *tmpFile; + char *strIndex1 = 0, *strIndex2 = 0, *beginIndex; + char secSeg[10] = {0}; + #endif + + if (path == 0 || len <= 3 || outStr == 0) return; + + tmpFile = path; + #if _LFN_UNICODE + strIndex1 = (WCHAR *)wcsstr((const WCHAR *)tmpFile, (const WCHAR *)'/'); + strIndex2 = (WCHAR *)wcsstr((const WCHAR *)tmpFile, (const WCHAR *)'.'); + #else + strIndex1 = (char *)strrchr(tmpFile, '/'); + strIndex2 = (char *)strrchr(tmpFile, '.'); + #endif + + beginIndex = (strIndex1 != 0 + //&& (strIndex2 != 0) && (strIndex1 < strIndex2) + ) ? strIndex1 + 1 : tmpFile; + + if (strIndex2 == 0 || (strIndex1 > strIndex2)) { // not gcode file + #if _LFN_UNICODE + if (wcslen(beginIndex) > len) + wcsncpy(outStr, beginIndex, len); + else + wcscpy(outStr, beginIndex); + #else + if ((int)strlen(beginIndex) > len) + strncpy(outStr, beginIndex, len); + else + strcpy(outStr, beginIndex); + #endif + } + else { // gcode file + if (strIndex2 - beginIndex > (len - 2)) { + #if _LFN_UNICODE + wcsncpy(outStr, (const WCHAR *)beginIndex, len - 3); + wcscat(outStr, (const WCHAR *)gFileTail); + #else + //strncpy(outStr, beginIndex, len - 3); + strncpy(outStr, beginIndex, len - 4); + strcat_P(outStr, PSTR("~.g")); + #endif + } + else { + #if _LFN_UNICODE + wcsncpy(outStr, (const WCHAR *)beginIndex, strIndex2 - beginIndex + 1); + wcscat(outStr, (const WCHAR *)&gFileTail[3]); + #else + strncpy(outStr, beginIndex, strIndex2 - beginIndex + 1); + strcat_P(outStr, PSTR("g")); + #endif + } + } + + #if _LFN_UNICODE + if (wcslen(outStr) > bytePerLine) { + wcscpy(secSeg, (const WCHAR *)&outStr[bytePerLine]); + outStr[bytePerLine] = '\n'; + outStr[bytePerLine + 1] = '\0'; + wcscat(outStr, (const WCHAR *)secSeg); + } + #else + if ((int)strlen(outStr) > bytePerLine) { + strcpy(secSeg, &outStr[bytePerLine]); + outStr[bytePerLine] = '\n'; + outStr[bytePerLine + 1] = '\0'; + strcat(outStr, secSeg); + } + else { + strcat_P(outStr, PSTR("\n")); + } + #endif +} + +void lv_clear_print_file() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h new file mode 100644 index 0000000000..987282c079 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h @@ -0,0 +1,65 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +typedef struct { + int cur_page_first_offset; + int cur_page_last_offset; + int curPage; +} DIR_OFFSET; +extern DIR_OFFSET dir_offset[10]; + +#define FILE_NUM 6 +#define SHORT_NEME_LEN 13 +#define NAME_CUT_LEN 23 + +#define MAX_DIR_LEVEL 10 + +typedef struct { + //char longName[FILE_NUM][LONG_FILENAME_LENGTH]; + char file_name[FILE_NUM][SHORT_NEME_LEN * MAX_DIR_LEVEL + 1]; + char curDirPath[SHORT_NEME_LEN * MAX_DIR_LEVEL + 1]; + char long_name[FILE_NUM][SHORT_NEME_LEN * 2 + 1]; + char IsFolder[FILE_NUM]; + char Sd_file_cnt; + char sd_file_index; + char Sd_file_offset; +} LIST_FILE; +extern LIST_FILE list_file; + +extern void disp_gcode_icon(uint8_t file_num); +extern void lv_draw_print_file(void); +extern void lv_open_gcode_file(char *path); +extern void lv_gcode_file_read(uint8_t *data_buf); +extern void lv_close_gcode_file(); +extern void cutFileName(char *path, int len, int bytePerLine, char *outStr); +extern int ascii2dec_test(char *ascii); +extern void lv_clear_print_file(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp new file mode 100644 index 0000000000..2079ed8245 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp @@ -0,0 +1,443 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" + +#include "../../../../MarlinCore.h" +#include "../../../../module/temperature.h" +#include "../../../../module/motion.h" +#include "../../../../sd/cardreader.h" +#include "../../../../gcode/queue.h" + +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../../../feature/powerloss.h" +#endif +#if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) + #include "../../../ultralcd.h" +#endif + +static lv_obj_t * scr; +static lv_obj_t * labelExt1, * labelExt2, * labelFan, * labelZpos, * labelTime; +static lv_obj_t * labelPause, * labelStop, * labelOperat; +static lv_obj_t * bar1; +static lv_obj_t * buttonPause, *buttonOperat, *buttonStop; + +#if HAS_HEATED_BED + static lv_obj_t* labelBed; +#endif + +#define ID_PAUSE 1 +#define ID_STOP 2 +#define ID_OPTION 3 + +lv_style_t lv_bar_style_indic; + +uint8_t once_flag = 0; +extern uint32_t To_pre_view; +extern uint8_t flash_preview_begin; +extern uint8_t default_preview_flg; +extern uint8_t gcode_preview_over; + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_PAUSE: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (gcode_preview_over != 1) { + if (uiCfg.print_state == WORKING) { + // #if ENABLED(PARK_HEAD_ON_PAUSE) + // queue.inject_P(PSTR("M25 P\nM24")); + #if ENABLED(SDSUPPORT) + // queue.inject_P(PSTR("M25\nG91\nG1 Z10\nG90")); + card.pauseSDPrint(); + stop_print_time(); + uiCfg.print_state = PAUSING; + #endif + lv_obj_set_event_cb_mks(buttonPause, event_handler, ID_PAUSE, "bmp_resume.bin", 0); + lv_label_set_text(labelPause, printing_menu.resume); + lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); + } + else if (uiCfg.print_state == PAUSED) { + uiCfg.print_state = RESUMING; + // if (IS_SD_PAUSED())queue.inject_P(PSTR("M24"));// queue.inject_P(M24_STR); + lv_obj_set_event_cb_mks(obj, event_handler, ID_PAUSE, "bmp_pause.bin", 0); + lv_label_set_text(labelPause, printing_menu.pause); + lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); + } + #if ENABLED(POWER_LOSS_RECOVERY) + else if (uiCfg.print_state == REPRINTING) { + uiCfg.print_state = REPRINTED; + lv_obj_set_event_cb_mks(obj, event_handler, ID_PAUSE, "bmp_pause.bin", 0); + lv_label_set_text(labelPause, printing_menu.pause); + lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); + // recovery.resume(); + print_time.minutes = recovery.info.print_job_elapsed / 60; + print_time.seconds = recovery.info.print_job_elapsed % 60; + print_time.hours = print_time.minutes / 60; + } + #endif + } + } + break; + + case ID_STOP: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (gcode_preview_over != 1) { + lv_obj_del(scr); + lv_draw_dialog(DIALOG_TYPE_STOP); + } + } + break; + case ID_OPTION: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + if (gcode_preview_over != 1) { + lv_obj_del(scr); + lv_draw_operation(); + } + } + break; + } +} + +void lv_draw_printing(void) { + lv_obj_t *buttonExt1, *buttonExt2, *buttonFanstate, *buttonZpos, *buttonTime; + TERN_(HAS_HEATED_BED, lv_obj_t * buttonBedstate); + + disp_state_stack._disp_index = 0; + ZERO(disp_state_stack._disp_state); + disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINTING_UI; + + disp_state = PRINTING_UI; + + scr = lv_obj_create(NULL, NULL); + + // static lv_style_t tool_style; + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic_150x80); + LV_IMG_DECLARE(bmp_pic_45x45); + + /*Create an Image button*/ + buttonExt1 = lv_imgbtn_create(scr, NULL); + if (EXTRUDERS == 2) + buttonExt2 = lv_imgbtn_create(scr, NULL); + + #if HAS_HEATED_BED + buttonBedstate = lv_imgbtn_create(scr, NULL); + #endif + + buttonFanstate = lv_imgbtn_create(scr, NULL); + buttonZpos = lv_imgbtn_create(scr, NULL); + buttonPause = lv_imgbtn_create(scr, NULL); + buttonStop = lv_imgbtn_create(scr, NULL); + buttonOperat = lv_imgbtn_create(scr, NULL); + buttonTime = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonExt1, event_handler, 0, "bmp_ext1_state.bin", 0); + lv_imgbtn_set_src(buttonExt1, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonExt1, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonExt1, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonExt1, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_clear_protect(buttonExt1, LV_PROTECT_FOLLOW); + #if 1 + if (EXTRUDERS == 2) { + lv_obj_set_event_cb_mks(buttonExt2, event_handler, 0, "bmp_ext2_state.bin", 0); + lv_imgbtn_set_src(buttonExt2, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonExt2, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonExt2, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonExt2, LV_BTN_STATE_REL, &tft_style_label_rel); + } + #if HAS_HEATED_BED + lv_obj_set_event_cb_mks(buttonBedstate, event_handler, 0, "bmp_bed_state.bin", 0); + lv_imgbtn_set_src(buttonBedstate, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonBedstate, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonBedstate, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBedstate, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif + + lv_obj_set_event_cb_mks(buttonFanstate, event_handler, 0, "bmp_fan_state.bin", 0); + lv_imgbtn_set_src(buttonFanstate, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonFanstate, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonFanstate, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonFanstate, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonTime, event_handler, 0, "bmp_time_state.bin", 0); + lv_imgbtn_set_src(buttonTime, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonTime, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonTime, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonTime, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonZpos, event_handler, 0, "bmp_zpos_state.bin", 0); + lv_imgbtn_set_src(buttonZpos, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonZpos, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonZpos, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonZpos, LV_BTN_STATE_REL, &tft_style_label_rel); + + if (uiCfg.print_state == WORKING) + lv_obj_set_event_cb_mks(buttonPause, event_handler, ID_PAUSE, "bmp_pause.bin", 0); + else + lv_obj_set_event_cb_mks(buttonPause, event_handler, ID_PAUSE, "bmp_resume.bin", 0); + + lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_REL, &bmp_pic_150x80); + lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_PR, &bmp_pic_150x80); + lv_imgbtn_set_style(buttonPause, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonPause, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonStop, event_handler, ID_STOP, "bmp_stop.bin", 0); + lv_imgbtn_set_src(buttonStop, LV_BTN_STATE_REL, &bmp_pic_150x80); + lv_imgbtn_set_src(buttonStop, LV_BTN_STATE_PR, &bmp_pic_150x80); + lv_imgbtn_set_style(buttonStop, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonStop, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonOperat, event_handler, ID_OPTION, "bmp_operate.bin", 0); + lv_imgbtn_set_src(buttonOperat, LV_BTN_STATE_REL, &bmp_pic_150x80); + lv_imgbtn_set_src(buttonOperat, LV_BTN_STATE_PR, &bmp_pic_150x80); + lv_imgbtn_set_style(buttonOperat, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonOperat, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif // if 1 + + lv_obj_set_pos(buttonExt1, 205, 136); + if (EXTRUDERS == 2) + lv_obj_set_pos(buttonExt2, 350, 136); + + #if HAS_HEATED_BED + lv_obj_set_pos(buttonBedstate, 205, 186); + #endif + + lv_obj_set_pos(buttonFanstate, 350, 186); + lv_obj_set_pos(buttonTime, 205, 86); + lv_obj_set_pos(buttonZpos, 350, 86); + lv_obj_set_pos(buttonPause, 5, 240); + lv_obj_set_pos(buttonStop, 165, 240); + lv_obj_set_pos(buttonOperat, 325, 240); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonExt1, LV_LAYOUT_OFF); + if (EXTRUDERS == 2) + lv_btn_set_layout(buttonExt2, LV_LAYOUT_OFF); + + #if HAS_HEATED_BED + lv_btn_set_layout(buttonBedstate, LV_LAYOUT_OFF); + #endif + + lv_btn_set_layout(buttonFanstate, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonZpos, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPause, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonStop, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonOperat, LV_LAYOUT_OFF); + + labelExt1 = lv_label_create(scr, NULL); + lv_obj_set_style(labelExt1, &tft_style_label_rel); + lv_obj_set_pos(labelExt1, 250, 146); + + if (EXTRUDERS == 2) { + labelExt2 = lv_label_create(scr, NULL); + lv_obj_set_style(labelExt2, &tft_style_label_rel); + lv_obj_set_pos(labelExt2, 395, 146); + } + + #if HAS_HEATED_BED + labelBed = lv_label_create(scr, NULL); + lv_obj_set_style(labelBed, &tft_style_label_rel); + lv_obj_set_pos(labelBed, 250, 196); + #endif + + labelFan = lv_label_create(scr, NULL); + lv_obj_set_style(labelFan, &tft_style_label_rel); + lv_obj_set_pos(labelFan, 395, 196); + + labelZpos = lv_label_create(scr, NULL); + lv_obj_set_style(labelZpos, &tft_style_label_rel); + lv_obj_set_pos(labelZpos, 395, 96); + + labelTime = lv_label_create(scr, NULL); + lv_obj_set_style(labelTime, &tft_style_label_rel); + lv_obj_set_pos(labelTime, 250, 96); + + labelPause = lv_label_create(buttonPause, NULL); + labelStop = lv_label_create(buttonStop, NULL); + labelOperat = lv_label_create(buttonOperat, NULL); + + if (gCfgItems.multiple_language != 0) { + if (uiCfg.print_state == WORKING) + lv_label_set_text(labelPause, printing_menu.pause); + else + lv_label_set_text(labelPause, printing_menu.resume); + lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 20, 0); + + lv_label_set_text(labelStop, printing_menu.stop); + lv_obj_align(labelStop, buttonStop, LV_ALIGN_CENTER, 20, 0); + + lv_label_set_text(labelOperat, printing_menu.option); + lv_obj_align(labelOperat, buttonOperat, LV_ALIGN_CENTER, 20, 0); + } + + lv_style_copy(&lv_bar_style_indic, &lv_style_pretty_color); + lv_bar_style_indic.text.color = lv_color_hex3(0xADF); + lv_bar_style_indic.image.color = lv_color_hex3(0xADF); + lv_bar_style_indic.line.color = lv_color_hex3(0xADF); + lv_bar_style_indic.body.main_color = lv_color_hex3(0xADF); + lv_bar_style_indic.body.grad_color = lv_color_hex3(0xADF); + lv_bar_style_indic.body.border.color = lv_color_hex3(0xADF); + + bar1 = lv_bar_create(scr, NULL); + lv_obj_set_pos(bar1, 205, 36); + lv_obj_set_size(bar1, 270, 40); + lv_bar_set_style(bar1, LV_BAR_STYLE_INDIC, &lv_bar_style_indic); + lv_bar_set_anim_time(bar1, 1000); + lv_bar_set_value(bar1, 0, LV_ANIM_ON); + + disp_ext_temp(); + disp_bed_temp(); + disp_fan_speed(); + disp_print_time(); + disp_fan_Zpos(); +} + +void disp_ext_temp() { + ZERO(public_buf_l); + sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target); + lv_label_set_text(labelExt1, public_buf_l); + + if (EXTRUDERS == 2) { + ZERO(public_buf_l); + sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[1].celsius, (int)thermalManager.temp_hotend[1].target); + lv_label_set_text(labelExt2, public_buf_l); + } +} + +void disp_bed_temp() { + #if HAS_HEATED_BED + ZERO(public_buf_l); + sprintf(public_buf_l, printing_menu.bed_temp, (int)thermalManager.temp_bed.celsius, (int)thermalManager.temp_bed.target); + lv_label_set_text(labelBed, public_buf_l); + #endif +} + +void disp_fan_speed() { + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%3d"), thermalManager.fan_speed[0]); + lv_label_set_text(labelFan, public_buf_l); +} + +void disp_print_time() { + ZERO(public_buf_l); + #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) + const uint32_t r = ui.get_remaining_time(); + sprintf_P(public_buf_l, PSTR("%02d:%02d R"), r / 3600, (r % 3600) / 60); + #else + sprintf_P(public_buf_l, PSTR("%d%d:%d%d:%d%d"), print_time.hours / 10, print_time.hours % 10, print_time.minutes / 10, print_time.minutes % 10, print_time.seconds / 10, print_time.seconds % 10); + #endif + lv_label_set_text(labelTime, public_buf_l); +} + +void disp_fan_Zpos() { + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.3f"), current_position[Z_AXIS]); + lv_label_set_text(labelZpos, public_buf_l); +} + +void reset_print_time() { + // print_time.days = 0; + print_time.hours = 0; + print_time.minutes = 0; + print_time.seconds = 0; + print_time.ms_10 = 0; + // print_time.start = 1; +} + +void start_print_time() { print_time.start = 1; } + +void stop_print_time() { print_time.start = 0; } + +void setProBarRate() { + int rate; + volatile long long rate_tmp_r; + + if (gCfgItems.from_flash_pic != 1) { + #if ENABLED(SDSUPPORT) + rate_tmp_r = (long long)card.getIndex() * 100; + #endif + rate = rate_tmp_r / gCfgItems.curFilesize; + } + else { + #if ENABLED(SDSUPPORT) + rate_tmp_r = (long long)card.getIndex(); + #endif + rate = (rate_tmp_r - (PREVIEW_SIZE + To_pre_view)) * 100 / (gCfgItems.curFilesize - (PREVIEW_SIZE + To_pre_view)); + } + // gCurFileState.totalSend = rate; + + if (rate <= 0) return; + + if (disp_state == PRINTING_UI) { + lv_bar_set_value(bar1, rate, LV_ANIM_ON); + + if (marlin_state == MF_SD_COMPLETE) { + if (once_flag == 0) { + stop_print_time(); + + flash_preview_begin = 0; + default_preview_flg = 0; + lv_clear_printing(); + lv_draw_dialog(DIALOG_TYPE_FINISH_PRINT); + + once_flag = 1; + + #if HAS_SUICIDE + if (gCfgItems.finish_power_off == 1) + suicide(); + #endif + } + } + } +} + +void lv_clear_printing() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h new file mode 100644 index 0000000000..1f7d9f909d --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h @@ -0,0 +1,52 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +#define IDLE 0 +#define WORKING 1 +#define PAUSING 2 +#define PAUSED 3 +#define REPRINTING 4 +#define REPRINTED 5 +#define RESUMING 6 +#define STOP 7 + +extern void lv_draw_printing(void); +extern void lv_clear_printing(); +extern void disp_ext_temp(); +extern void disp_bed_temp(); +extern void disp_fan_speed(); +extern void disp_print_time(); +extern void disp_fan_Zpos(); +extern void reset_print_time(); +extern void start_print_time(); +extern void stop_print_time(); +extern void setProBarRate(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp new file mode 100644 index 0000000000..c987ddb084 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp @@ -0,0 +1,336 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "draw_ready_print.h" +#include "draw_tool.h" +#include "lv_conf.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +#include "tft_lvgl_configuration.h" +#include "mks_hardware_test.h" +#include "draw_ui.h" + +#include + +#include "../../../../MarlinCore.h" +#include "../../../../module/temperature.h" + +#include + +//static lv_obj_t *buttonPrint,*buttonTool,*buttonSet; +static lv_obj_t * scr; +#if ENABLED(MKS_TEST) + uint8_t curent_disp_ui = 0; +#endif + +#define ID_TOOL 1 +#define ID_SET 2 +#define ID_PRINT 3 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_TOOL: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + + lv_obj_del(scr); + lv_draw_tool(); + } + break; + case ID_SET: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_set(); + } + break; + case ID_PRINT: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_print_file(); + } + break; + } +} + +lv_obj_t *limit_info, *det_info; +lv_style_t limit_style, det_style; +void disp_Limit_ok() { + limit_style.text.color.full = 0xFFFF; + lv_obj_set_style(limit_info, &limit_style); + lv_label_set_text(limit_info, "Limit:ok"); +} +void disp_Limit_error() { + limit_style.text.color.full = 0xF800; + lv_obj_set_style(limit_info, &limit_style); + lv_label_set_text(limit_info, "Limit:error"); +} + +void disp_det_ok() { + det_style.text.color.full = 0xFFFF; + lv_obj_set_style(det_info, &det_style); + lv_label_set_text(det_info, "det:ok"); +} +void disp_det_error() { + det_style.text.color.full = 0xF800; + lv_obj_set_style(det_info, &det_style); + lv_label_set_text(det_info, "det:error"); +} + +lv_obj_t *e1, *e2, *e3, *bed; +void mks_disp_test() { + char buf[30] = {0}; + //lv_obj_t * label_tool2 = lv_label_create(scr, NULL); + //lv_obj_set_pos(label_tool,20,50); + ZERO(buf); + sprintf_P(buf, PSTR("e1:%d"), (int)thermalManager.temp_hotend[0].celsius); + lv_label_set_text(e1, buf); + #if HAS_MULTI_HOTEND + ZERO(buf); + sprintf_P(buf, PSTR("e2:%d"), (int)thermalManager.temp_hotend[1].celsius); + lv_label_set_text(e2, buf); + #endif + + //ZERO(buf); + //sprintf_P(buf, PSTR("e3:%d"), (int)thermalManager.temp_hotend[2].celsius); + //lv_label_set_text(e3, buf); + #if HAS_HEATED_BED + ZERO(buf); + sprintf_P(buf, PSTR("bed:%d"), (int)thermalManager.temp_bed.celsius); + lv_label_set_text(bed, buf); + #endif +} + +extern unsigned char bmp_public_buf[17 * 1024]; +void lv_draw_ready_print(void) { + char buf[30] = {0}; + lv_obj_t *buttonPrint, *buttonTool, *buttonSet; + + disp_state_stack._disp_index = 0; + ZERO(disp_state_stack._disp_state); + disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINT_READY_UI; + + disp_state = PRINT_READY_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + //lv_obj_set_hidden(scr,true); + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + if (mks_test_flag == 0x1e) { + //lv_obj_t * title = lv_label_create(scr, NULL); + //lv_obj_set_style(title, &tft_style_label_rel); + //lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + //lv_label_set_text(title, creat_title_text()); + + /*Create an Image button*/ + //buttonPrint = lv_imgbtn_create(scr, NULL); + buttonTool = lv_imgbtn_create(scr, NULL); + //buttonSet = lv_imgbtn_create(scr, NULL); + + //lv_obj_set_event_cb_mks(buttonPrint, event_handler,ID_PRINT,"bmp_printing.bin",0); + //lv_imgbtn_set_src_mks(buttonPrint, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_printing.bin"); + //lv_imgbtn_set_src(buttonPrint, LV_BTN_STATE_REL, &bmp_pic); + //lv_imgbtn_set_src(buttonPrint, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_style(buttonPrint, LV_BTN_STATE_PR, &tft_style_label_pre); + //lv_imgbtn_set_style(buttonPrint, LV_BTN_STATE_REL, &tft_style_label_rel); + //lv_obj_clear_protect(buttonPrint, LV_PROTECT_FOLLOW); + + #if 1 + //lv_obj_set_event_cb_mks(buttonSet, event_handler,ID_SET,"bmp_set.bin",0); + //lv_imgbtn_set_src_mks(buttonSet, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_set.bin"); + //lv_imgbtn_set_src(buttonSet, LV_BTN_STATE_REL, &bmp_pic); + //lv_imgbtn_set_src(buttonSet, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_style(buttonSet, LV_BTN_STATE_PR, &tft_style_label_pre); + //lv_imgbtn_set_style(buttonSet, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonTool, event_handler, ID_TOOL, "bmp_tool.bin", 0); + //lv_imgbtn_set_src_mks(buttonTool, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_tool.bin"); + lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif + + lv_obj_set_pos(buttonTool, 360, 180); + //lv_obj_set_pos(buttonSet,180,90); + //lv_obj_set_pos(buttonPrint,340,90); + + //lv_obj_set_pos(buttonTool,SIMPLE_FIRST_PAGE_GRAP+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); + //lv_obj_set_pos(buttonSet,BTN_X_PIXEL+SIMPLE_FIRST_PAGE_GRAP*2+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); + //lv_obj_set_pos(buttonPrint,BTN_X_PIXEL*2+SIMPLE_FIRST_PAGE_GRAP*3+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); + + /*Create a label on the Image button*/ + //lv_btn_set_layout(buttonPrint, LV_LAYOUT_OFF); + //lv_btn_set_layout(buttonSet, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonTool, LV_LAYOUT_OFF); + + //lv_obj_t * label_print = lv_label_create(buttonPrint, NULL); + //lv_obj_t * label_set = lv_label_create(buttonSet, NULL); + lv_obj_t * label_tool = lv_label_create(buttonTool, NULL); + if (gCfgItems.multiple_language != 0) { + //lv_label_set_text(label_print, main_menu.print); + //lv_obj_align(label_print, buttonPrint, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + //lv_label_set_text(label_set, main_menu.set); + //lv_obj_align(label_set, buttonSet, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + //lv_label_set_style(label_tool,LV_BTN_STATE_PR,&tft_style_label_pre); + //lv_label_set_style(label_tool,LV_BTN_STATE_REL,&tft_style_label_rel); + lv_label_set_text(label_tool, main_menu.tool); + lv_obj_align(label_tool, buttonTool, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + + #if 1 + e1 = lv_label_create(scr, NULL); + lv_obj_set_pos(e1, 20, 20); + sprintf_P(buf, PSTR("e1: %d"), (int)thermalManager.temp_hotend[0].celsius); + lv_label_set_text(e1, buf); + #if HAS_MULTI_HOTEND + e2 = lv_label_create(scr, NULL); + lv_obj_set_pos(e2, 20, 45); + sprintf_P(buf, PSTR("e1: %d"), (int)thermalManager.temp_hotend[1].celsius); + lv_label_set_text(e2, buf); + #endif + + //e3 = lv_label_create(scr, NULL); + //lv_obj_set_pos(e3,20,70); + //sprintf_P(buf, PSTR("e1: %d"), (int)thermalManager.temp_hotend[2].celsius); + //lv_label_set_text(e3, buf); + + #if HAS_HEATED_BED + bed = lv_label_create(scr, NULL); + lv_obj_set_pos(bed, 20, 95); + sprintf_P(buf, PSTR("bed: %d"), (int)thermalManager.temp_bed.celsius); + lv_label_set_text(bed, buf); + #endif + + limit_info = lv_label_create(scr, NULL); + + lv_style_copy(&limit_style, &lv_style_scr); + limit_style.body.main_color.full = 0X0000; + limit_style.body.grad_color.full = 0X0000; + limit_style.text.color.full = 0Xffff; + lv_obj_set_style(limit_info, &limit_style); + + lv_obj_set_pos(limit_info, 20, 120); + lv_label_set_text(limit_info, " "); + + det_info = lv_label_create(scr, NULL); + + lv_style_copy(&det_style, &lv_style_scr); + det_style.body.main_color.full = 0X0000; + det_style.body.grad_color.full = 0X0000; + det_style.text.color.full = 0Xffff; + lv_obj_set_style(det_info, &det_style); + + lv_obj_set_pos(det_info, 20, 145); + lv_label_set_text(det_info, " "); + #endif // if 1 + + } + else { + //lv_obj_t * title = lv_label_create(scr, NULL); + //lv_obj_set_style(title, &tft_style_label_rel); + //lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + //lv_label_set_text(title, creat_title_text()); + + /*Create an Image button*/ + buttonPrint = lv_imgbtn_create(scr, NULL); + buttonTool = lv_imgbtn_create(scr, NULL); + buttonSet = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonPrint, event_handler, ID_PRINT, "bmp_printing.bin", 0); + //lv_imgbtn_set_src_mks(buttonPrint, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_printing.bin"); + lv_imgbtn_set_src(buttonPrint, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPrint, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPrint, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonPrint, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_clear_protect(buttonPrint, LV_PROTECT_FOLLOW); + + #if 1 + lv_obj_set_event_cb_mks(buttonSet, event_handler, ID_SET, "bmp_set.bin", 0); + //lv_imgbtn_set_src_mks(buttonSet, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_set.bin"); + lv_imgbtn_set_src(buttonSet, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonSet, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonSet, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonSet, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonTool, event_handler, ID_TOOL, "bmp_tool.bin", 0); + //lv_imgbtn_set_src_mks(buttonTool, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_tool.bin"); + lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif + + lv_obj_set_pos(buttonTool, 20, 90); + lv_obj_set_pos(buttonSet, 180, 90); + lv_obj_set_pos(buttonPrint, 340, 90); + + //lv_obj_set_pos(buttonTool,SIMPLE_FIRST_PAGE_GRAP+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); + //lv_obj_set_pos(buttonSet,BTN_X_PIXEL+SIMPLE_FIRST_PAGE_GRAP*2+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); + //lv_obj_set_pos(buttonPrint,BTN_X_PIXEL*2+SIMPLE_FIRST_PAGE_GRAP*3+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonPrint, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonSet, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonTool, LV_LAYOUT_OFF); + + lv_obj_t * label_print = lv_label_create(buttonPrint, NULL); + lv_obj_t * label_set = lv_label_create(buttonSet, NULL); + lv_obj_t * label_tool = lv_label_create(buttonTool, NULL); + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(label_print, main_menu.print); + lv_obj_align(label_print, buttonPrint, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_set, main_menu.set); + lv_obj_align(label_set, buttonSet, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + //lv_label_set_style(label_tool,LV_BTN_STATE_PR,&tft_style_label_pre); + //lv_label_set_style(label_tool,LV_BTN_STATE_REL,&tft_style_label_rel); + lv_label_set_text(label_tool, main_menu.tool); + lv_obj_align(label_tool, buttonTool, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + } +} + +void lv_clear_ready_print() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h new file mode 100644 index 0000000000..9951beaa41 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h @@ -0,0 +1,39 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_ready_print(void); +extern void mks_disp_test(); +extern void disp_Limit_ok(); +extern void disp_Limit_error(); +extern void disp_det_error(); +extern void disp_det_ok(); +extern void lv_clear_ready_print(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp new file mode 100644 index 0000000000..eebb9fcf1c --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp @@ -0,0 +1,318 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "../../../../MarlinCore.h" +#include "draw_ready_print.h" +#include "draw_set.h" +#include "lv_conf.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +#include "draw_ui.h" +#include "../../../../gcode/queue.h" +#include "pic_manager.h" + +static lv_obj_t * scr; + +#define ID_S_WIFI 1 +#define ID_S_FAN 2 +#define ID_S_ABOUT 3 +#define ID_S_CONTINUE 4 +#define ID_S_MOTOR_OFF 5 +#define ID_S_LANGUAGE 6 +#define ID_S_MACHINE_PARA 7 +#define ID_S_EEPROM_SET 8 +#define ID_S_RETURN 9 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_S_WIFI: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + } + break; + case ID_S_FAN: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_fan(); + } + break; + case ID_S_ABOUT: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_about(); + } + break; + case ID_S_CONTINUE: + + break; + case ID_S_MOTOR_OFF: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + #if HAS_SUICIDE + suicide(); + #else + queue.enqueue_now_P(PSTR("M84")); + #endif + } + break; + case ID_S_LANGUAGE: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_language(); + } + break; + case ID_S_MACHINE_PARA: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_machine_para(); + } + break; + case ID_S_EEPROM_SET: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_eeprom_settings(); + } + break; + case ID_S_RETURN: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_ready_print(); + } + break; + + } +} + +void lv_draw_set(void) { + lv_obj_t *buttonFan, *buttonAbout; + lv_obj_t *buMotorOff, *buttonBack; + #if HAS_LANG_SELECT_SCREEN + lv_obj_t *buttonLanguage; + #endif + lv_obj_t *buttonMachinePara; + lv_obj_t *buttonEepromSet; + + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != SET_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = SET_UI; + } + disp_state = SET_UI; + + scr = lv_obj_create(NULL, NULL); + + //static lv_style_t tool_style; + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + //buttonWifi = lv_imgbtn_create(scr, NULL); + buttonFan = lv_imgbtn_create(scr, NULL); + buttonAbout = lv_imgbtn_create(scr, NULL); + //buttonContinue = lv_imgbtn_create(scr, NULL); + buMotorOff = lv_imgbtn_create(scr, NULL); + #if HAS_LANG_SELECT_SCREEN + buttonLanguage = lv_imgbtn_create(scr, NULL); + #endif + buttonMachinePara = lv_imgbtn_create(scr, NULL); + buttonEepromSet = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + + //lv_obj_set_event_cb_mks(buttonWifi, event_handler,ID_S_WIFI,"bmp_Wifi.bin",0); + //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_REL, &bmp_pic); + //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_PR, &tft_style_label_pre); + //lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_REL, &tft_style_label_rel); + //lv_obj_clear_protect(buttonWifi, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonFan, event_handler, ID_S_FAN, "bmp_fan.bin", 0); + lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonAbout, event_handler, ID_S_ABOUT, "bmp_about.bin", 0); + lv_imgbtn_set_src(buttonAbout, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonAbout, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonAbout, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonAbout, LV_BTN_STATE_REL, &tft_style_label_rel); + + //lv_obj_set_event_cb_mks(buttonContinue, event_handler,ID_S_CONTINUE,"bmp_Breakpoint.bin",0); + //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_REL, &bmp_pic); + //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_PR, &tft_style_label_pre); + //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_REL, &tft_style_label_rel); + #if HAS_SUICIDE + lv_obj_set_event_cb_mks(buMotorOff, event_handler, ID_S_MOTOR_OFF, "bmp_Mamual.bin", 0); + #else + lv_obj_set_event_cb_mks(buMotorOff, event_handler, ID_S_MOTOR_OFF, "bmp_function1.bin", 0); + #endif + lv_imgbtn_set_src(buMotorOff, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buMotorOff, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buMotorOff, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buMotorOff, LV_BTN_STATE_REL, &tft_style_label_rel); + + #if HAS_LANG_SELECT_SCREEN + lv_obj_set_event_cb_mks(buttonLanguage, event_handler, ID_S_LANGUAGE, "bmp_language.bin", 0); + lv_imgbtn_set_src(buttonLanguage, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonLanguage, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonLanguage, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonLanguage, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif + lv_obj_set_event_cb_mks(buttonMachinePara, event_handler, ID_S_MACHINE_PARA, "bmp_machine_para.bin", 0); + lv_imgbtn_set_src(buttonMachinePara, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonMachinePara, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonMachinePara, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonMachinePara, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonEepromSet, event_handler, ID_S_EEPROM_SET, "bmp_eeprom_settings.bin", 0); + lv_imgbtn_set_src(buttonEepromSet, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonEepromSet, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonEepromSet, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonEepromSet, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_S_RETURN, "bmp_return.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif // if 1 + + /*lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonFan,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); + lv_obj_set_pos(buttonAbout,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); + lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buMotorOff,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonLanguage,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight);*/ + + //lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonFan, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); + lv_obj_set_pos(buttonAbout, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); + //lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buMotorOff, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + #if HAS_LANG_SELECT_SCREEN + lv_obj_set_pos(buttonLanguage, INTERVAL_V, titleHeight); + #endif + lv_obj_set_pos(buttonMachinePara, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonEepromSet, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + //lv_btn_set_layout(buttonWifi, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonFan, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonAbout, LV_LAYOUT_OFF); + //lv_btn_set_layout(buttonContinue, LV_LAYOUT_OFF); + lv_btn_set_layout(buMotorOff, LV_LAYOUT_OFF); + #if HAS_LANG_SELECT_SCREEN + lv_btn_set_layout(buttonLanguage, LV_LAYOUT_OFF); + #endif + lv_btn_set_layout(buttonMachinePara, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonEepromSet, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + //lv_obj_t * labelWifi= lv_label_create(buttonWifi, NULL); + lv_obj_t * labelFan = lv_label_create(buttonFan, NULL); + lv_obj_t * label_About = lv_label_create(buttonAbout, NULL); + //lv_obj_t * label_Continue = lv_label_create(buttonContinue, NULL); + lv_obj_t * label_MotorOff = lv_label_create(buMotorOff, NULL); + #if HAS_LANG_SELECT_SCREEN + lv_obj_t * label_Language = lv_label_create(buttonLanguage, NULL); + #endif + lv_obj_t * label_MachinePara = lv_label_create(buttonMachinePara, NULL); + lv_obj_t * label_EepromSet = lv_label_create(buttonEepromSet, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + //lv_label_set_text(labelWifi, set_menu.wifi); + //lv_obj_align(labelWifi, buttonWifi, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelFan, set_menu.fan); + lv_obj_align(labelFan, buttonFan, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_About, set_menu.about); + lv_obj_align(label_About, buttonAbout, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + //lv_label_set_text(label_Continue, set_menu.breakpoint); + //lv_obj_align(label_Continue, buttonContinue, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + #if HAS_SUICIDE + lv_label_set_text(label_MotorOff, set_menu.shutdown); + #else + lv_label_set_text(label_MotorOff, set_menu.motoroff); + #endif + lv_obj_align(label_MotorOff, buMotorOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + #if HAS_LANG_SELECT_SCREEN + lv_label_set_text(label_Language, set_menu.language); + lv_obj_align(label_Language, buttonLanguage, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + #endif + lv_label_set_text(label_MachinePara, set_menu.machine_para); + lv_obj_align(label_MachinePara, buttonMachinePara, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_EepromSet, set_menu.eepromSet); + lv_obj_align(label_EepromSet, buttonEepromSet, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } +} + +void lv_clear_set() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h new file mode 100644 index 0000000000..1cb60b5681 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_set(void); +extern void lv_clear_set(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp new file mode 100644 index 0000000000..434c2f8579 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp @@ -0,0 +1,358 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" + +#include "../../../../MarlinCore.h" +#include "../../../../module/planner.h" + +static lv_obj_t * scr; + +#define ID_STEP_RETURN 1 +#define ID_STEP_X 2 +#define ID_STEP_Y 3 +#define ID_STEP_Z 4 +#define ID_STEP_E0 5 +#define ID_STEP_E1 6 +#define ID_STEP_DOWN 7 +#define ID_STEP_UP 8 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_STEP_RETURN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + uiCfg.para_ui_page = 0; + lv_clear_step_settings(); + draw_return_ui(); + } + break; + case ID_STEP_X: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = Xstep; + lv_clear_step_settings(); + lv_draw_number_key(); + } + break; + case ID_STEP_Y: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = Ystep; + lv_clear_step_settings(); + lv_draw_number_key(); + } + break; + case ID_STEP_Z: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = Zstep; + lv_clear_step_settings(); + lv_draw_number_key(); + } + break; + case ID_STEP_E0: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = E0step; + lv_clear_step_settings(); + lv_draw_number_key(); + } + break; + case ID_STEP_E1: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = E1step; + lv_clear_step_settings(); + lv_draw_number_key(); + } + break; + case ID_STEP_UP: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + uiCfg.para_ui_page = 0; + lv_clear_step_settings(); + lv_draw_step_settings(); + } + break; + case ID_STEP_DOWN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + uiCfg.para_ui_page = 1; + lv_clear_step_settings(); + lv_draw_step_settings(); + } + break; + } +} + +void lv_draw_step_settings(void) { + lv_obj_t *buttonBack = NULL, *label_Back = NULL, *buttonTurnPage = NULL, *labelTurnPage = NULL; + lv_obj_t *buttonXText = NULL, *labelXText = NULL, *buttonXValue = NULL, *labelXValue = NULL; + lv_obj_t *buttonYText = NULL, *labelYText = NULL, *buttonYValue = NULL, *labelYValue = NULL; + lv_obj_t *buttonZText = NULL, *labelZText = NULL, *buttonZValue = NULL, *labelZValue = NULL; + lv_obj_t *buttonE0Text = NULL, *labelE0Text = NULL, *buttonE0Value = NULL, *labelE0Value = NULL; + lv_obj_t *buttonE1Text = NULL, *labelE1Text = NULL, *buttonE1Value = NULL, *labelE1Value = NULL; + lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != STEPS_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = STEPS_UI; + } + disp_state = STEPS_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, machine_menu.StepsConfTitle); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_para_back); + // LV_IMG_DECLARE(bmp_para_arrow); + LV_IMG_DECLARE(bmp_para_bank); + + if (uiCfg.para_ui_page != 1) { + buttonXText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonXText, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonXText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonXText, event_handler); + lv_btn_set_style(buttonXText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonXText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonXText, LV_LAYOUT_OFF); + labelXText = lv_label_create(buttonXText, NULL); /*Add a label to the button*/ + + buttonXValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonXValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonXValue, event_handler, ID_STEP_X, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonXValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonXValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonXValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonXValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonXValue, LV_LAYOUT_OFF); + labelXValue = lv_label_create(buttonXValue, NULL); + + line1 = lv_line_create(scr, NULL); + lv_ex_line(line1, line_points[0]); + + buttonYText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonYText, PARA_UI_POS_X, PARA_UI_POS_Y * 2); /*Set its position*/ + lv_obj_set_size(buttonYText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonYText, event_handler); + lv_btn_set_style(buttonYText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonYText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonYText, LV_LAYOUT_OFF); + labelYText = lv_label_create(buttonYText, NULL); /*Add a label to the button*/ + + buttonYValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonYValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonYValue, event_handler, ID_STEP_Y, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonYValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonYValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonYValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonYValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonYValue, LV_LAYOUT_OFF); + labelYValue = lv_label_create(buttonYValue, NULL); + + line2 = lv_line_create(scr, NULL); + lv_ex_line(line2, line_points[1]); + + buttonZText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonZText, PARA_UI_POS_X, PARA_UI_POS_Y * 3); /*Set its position*/ + lv_obj_set_size(buttonZText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonZText, event_handler); + lv_btn_set_style(buttonZText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonZText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonZText, LV_LAYOUT_OFF); + labelZText = lv_label_create(buttonZText, NULL); /*Add a label to the button*/ + + buttonZValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonZValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonZValue, event_handler, ID_STEP_Z, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonZValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonZValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonZValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonZValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonZValue, LV_LAYOUT_OFF); + labelZValue = lv_label_create(buttonZValue, NULL); + + line3 = lv_line_create(scr, NULL); + lv_ex_line(line3, line_points[2]); + + buttonE0Text = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonE0Text, PARA_UI_POS_X, PARA_UI_POS_Y * 4); /*Set its position*/ + lv_obj_set_size(buttonE0Text, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonE0Text, event_handler); + lv_btn_set_style(buttonE0Text, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonE0Text, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonE0Text, LV_LAYOUT_OFF); + labelE0Text = lv_label_create(buttonE0Text, NULL); /*Add a label to the button*/ + + buttonE0Value = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonE0Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonE0Value, event_handler, ID_STEP_E0, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonE0Value, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonE0Value, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonE0Value, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonE0Value, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonE0Value, LV_LAYOUT_OFF); + labelE0Value = lv_label_create(buttonE0Value, NULL); + + line4 = lv_line_create(scr, NULL); + lv_ex_line(line4, line_points[3]); + + buttonTurnPage = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_STEP_DOWN, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_REL, &tft_style_label_rel); + } + else { + buttonE1Text = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonE1Text, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonE1Text, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonE1Text, event_handler); + lv_btn_set_style(buttonE1Text, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonE1Text, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonE1Text, LV_LAYOUT_OFF); + labelE1Text = lv_label_create(buttonE1Text, NULL); /*Add a label to the button*/ + + buttonE1Value = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonE1Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonE1Value, event_handler, ID_STEP_E1, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonE1Value, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonE1Value, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonE1Value, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonE1Value, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonE1Value, LV_LAYOUT_OFF); + labelE1Value = lv_label_create(buttonE1Value, NULL); + + line1 = lv_line_create(scr, NULL); + lv_ex_line(line1, line_points[0]); + + buttonTurnPage = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_STEP_UP, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_REL, &tft_style_label_rel); + } + + lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); + lv_btn_set_layout(buttonTurnPage, LV_LAYOUT_OFF); + labelTurnPage = lv_label_create(buttonTurnPage, NULL); + + buttonBack = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_STEP_RETURN, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + if (uiCfg.para_ui_page != 1) { + lv_label_set_text(labelXText, machine_menu.X_Steps); + lv_obj_align(labelXText, buttonXText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelYText, machine_menu.Y_Steps); + lv_obj_align(labelYText, buttonYText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelZText, machine_menu.Z_Steps); + lv_obj_align(labelZText, buttonZText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelE0Text, machine_menu.E0_Steps); + lv_obj_align(labelE0Text, buttonE0Text, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelTurnPage, machine_menu.next); + lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[X_AXIS]); + lv_label_set_text(labelXValue, public_buf_l); + lv_obj_align(labelXValue, buttonXValue, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[Y_AXIS]); + lv_label_set_text(labelYValue, public_buf_l); + lv_obj_align(labelYValue, buttonYValue, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[Z_AXIS]); + lv_label_set_text(labelZValue, public_buf_l); + lv_obj_align(labelZValue, buttonZValue, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[E_AXIS]); + lv_label_set_text(labelE0Value, public_buf_l); + lv_obj_align(labelE0Value, buttonE0Value, LV_ALIGN_CENTER, 0, 0); + } + else { + lv_label_set_text(labelE1Text, machine_menu.E1_Steps); + lv_obj_align(labelE1Text, buttonE1Text, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelTurnPage, machine_menu.previous); + lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); + + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[E_AXIS_N(1)]); + lv_label_set_text(labelE1Value, public_buf_l); + lv_obj_align(labelE1Value, buttonE1Value, LV_ALIGN_CENTER, 0, 0); + } + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); + } +} + +void lv_clear_step_settings() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.h new file mode 100644 index 0000000000..1a5efda408 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.h @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_step_settings(void); +extern void lv_clear_step_settings(); + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp new file mode 100644 index 0000000000..f1559e0f55 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp @@ -0,0 +1,385 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 BOTH(HAS_TFT_LVGL_UI, HAS_TRINAMIC_CONFIG) + +#include "lv_conf.h" +#include "draw_ui.h" +#include "../../../../MarlinCore.h" +#include "../../../../module/planner.h" +#include "../../../../module/stepper/indirection.h" +#include "../../../../feature/tmc_util.h" + +static lv_obj_t * scr; + +#define ID_TMC_CURRENT_RETURN 1 +#define ID_TMC_CURRENT_X 2 +#define ID_TMC_CURRENT_Y 3 +#define ID_TMC_CURRENT_Z 4 +#define ID_TMC_CURRENT_E0 5 +#define ID_TMC_CURRENT_E1 6 +#define ID_TMC_CURRENT_DOWN 7 +#define ID_TMC_CURRENT_UP 8 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_TMC_CURRENT_RETURN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + uiCfg.para_ui_page = 0; + lv_clear_tmc_current_settings(); + draw_return_ui(); + } + break; + case ID_TMC_CURRENT_X: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = Xcurrent; + lv_clear_tmc_current_settings(); + lv_draw_number_key(); + } + break; + case ID_TMC_CURRENT_Y: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = Ycurrent; + lv_clear_tmc_current_settings(); + lv_draw_number_key(); + } + break; + case ID_TMC_CURRENT_Z: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = Zcurrent; + lv_clear_tmc_current_settings(); + lv_draw_number_key(); + } + break; + case ID_TMC_CURRENT_E0: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = E0current; + lv_clear_tmc_current_settings(); + lv_draw_number_key(); + } + break; + #if AXIS_IS_TMC(E1) + case ID_TMC_CURRENT_E1: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + value = E1current; + lv_clear_tmc_current_settings(); + lv_draw_number_key(); + } + break; + + case ID_TMC_CURRENT_UP: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + uiCfg.para_ui_page = 0; + lv_clear_tmc_current_settings(); + lv_draw_tmc_current_settings(); + } + break; + case ID_TMC_CURRENT_DOWN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + uiCfg.para_ui_page = 1; + lv_clear_tmc_current_settings(); + lv_draw_tmc_current_settings(); + } + break; + #endif + } +} + +void lv_draw_tmc_current_settings(void) { + lv_obj_t *buttonBack = NULL, *label_Back = NULL; + lv_obj_t *buttonXText = NULL, *labelXText = NULL, *buttonXValue = NULL, *labelXValue = NULL; + lv_obj_t *buttonYText = NULL, *labelYText = NULL, *buttonYValue = NULL, *labelYValue = NULL; + lv_obj_t *buttonZText = NULL, *labelZText = NULL, *buttonZValue = NULL, *labelZValue = NULL; + lv_obj_t *buttonE0Text = NULL, *labelE0Text = NULL, *buttonE0Value = NULL, *labelE0Value = NULL; + + lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL; + #if AXIS_IS_TMC(E1) + lv_obj_t *buttonTurnPage = NULL, *labelTurnPage = NULL; + lv_obj_t *buttonE1Text = NULL, *labelE1Text = NULL, *buttonE1Value = NULL, *labelE1Value = NULL; + #endif + float milliamps; + + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != TMC_CURRENT_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = TMC_CURRENT_UI; + } + disp_state = TMC_CURRENT_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, machine_menu.TmcCurrentConfTitle); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_para_back); + // LV_IMG_DECLARE(bmp_para_arrow); + LV_IMG_DECLARE(bmp_para_bank); + + if (uiCfg.para_ui_page != 1) { + buttonXText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonXText, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonXText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonXText, event_handler); + lv_btn_set_style(buttonXText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonXText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonXText, LV_LAYOUT_OFF); + labelXText = lv_label_create(buttonXText, NULL); /*Add a label to the button*/ + + buttonXValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonXValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonXValue, event_handler, ID_TMC_CURRENT_X, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonXValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonXValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonXValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonXValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonXValue, LV_LAYOUT_OFF); + labelXValue = lv_label_create(buttonXValue, NULL); + + line1 = lv_line_create(scr, NULL); + lv_ex_line(line1, line_points[0]); + + buttonYText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonYText, PARA_UI_POS_X, PARA_UI_POS_Y * 2); /*Set its position*/ + lv_obj_set_size(buttonYText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonYText, event_handler); + lv_btn_set_style(buttonYText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonYText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonYText, LV_LAYOUT_OFF); + labelYText = lv_label_create(buttonYText, NULL); /*Add a label to the button*/ + + buttonYValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonYValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonYValue, event_handler, ID_TMC_CURRENT_Y, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonYValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonYValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonYValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonYValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonYValue, LV_LAYOUT_OFF); + labelYValue = lv_label_create(buttonYValue, NULL); + + line2 = lv_line_create(scr, NULL); + lv_ex_line(line2, line_points[1]); + + buttonZText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonZText, PARA_UI_POS_X, PARA_UI_POS_Y * 3); /*Set its position*/ + lv_obj_set_size(buttonZText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonZText, event_handler); + lv_btn_set_style(buttonZText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonZText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonZText, LV_LAYOUT_OFF); + labelZText = lv_label_create(buttonZText, NULL); /*Add a label to the button*/ + + buttonZValue = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonZValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonZValue, event_handler, ID_TMC_CURRENT_Z, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonZValue, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonZValue, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonZValue, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonZValue, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonZValue, LV_LAYOUT_OFF); + labelZValue = lv_label_create(buttonZValue, NULL); + + line3 = lv_line_create(scr, NULL); + lv_ex_line(line3, line_points[2]); + + buttonE0Text = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonE0Text, PARA_UI_POS_X, PARA_UI_POS_Y * 4); /*Set its position*/ + lv_obj_set_size(buttonE0Text, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonE0Text, event_handler); + lv_btn_set_style(buttonE0Text, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonE0Text, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonE0Text, LV_LAYOUT_OFF); + labelE0Text = lv_label_create(buttonE0Text, NULL); /*Add a label to the button*/ + + buttonE0Value = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonE0Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonE0Value, event_handler, ID_TMC_CURRENT_E0, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonE0Value, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonE0Value, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonE0Value, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonE0Value, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonE0Value, LV_LAYOUT_OFF); + labelE0Value = lv_label_create(buttonE0Value, NULL); + + line4 = lv_line_create(scr, NULL); + lv_ex_line(line4, line_points[3]); + + #if AXIS_IS_TMC(E1) + buttonTurnPage = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_TMC_CURRENT_DOWN, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif + } + else { + #if AXIS_IS_TMC(E1) + buttonE1Text = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonE1Text, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonE1Text, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonE1Text, event_handler); + lv_btn_set_style(buttonE1Text, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonE1Text, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonE1Text, LV_LAYOUT_OFF); + labelE1Text = lv_label_create(buttonE1Text, NULL); /*Add a label to the button*/ + + buttonE1Value = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonE1Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonE1Value, event_handler, ID_TMC_CURRENT_E1, "bmp_value_blank.bin", 0); + lv_imgbtn_set_src(buttonE1Value, LV_BTN_STATE_REL, &bmp_para_bank); + lv_imgbtn_set_src(buttonE1Value, LV_BTN_STATE_PR, &bmp_para_bank); + lv_imgbtn_set_style(buttonE1Value, LV_BTN_STATE_PR, &style_para_value_pre); + lv_imgbtn_set_style(buttonE1Value, LV_BTN_STATE_REL, &style_para_value_rel); + lv_btn_set_layout(buttonE1Value, LV_LAYOUT_OFF); + labelE1Value = lv_label_create(buttonE1Value, NULL); + + line1 = lv_line_create(scr, NULL); + lv_ex_line(line1, line_points[0]); + + buttonTurnPage = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_TMC_CURRENT_UP, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif + } + #if AXIS_IS_TMC(E1) + lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); + lv_btn_set_layout(buttonTurnPage, LV_LAYOUT_OFF); + labelTurnPage = lv_label_create(buttonTurnPage, NULL); + #endif + + buttonBack = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_TMC_CURRENT_RETURN, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + if (uiCfg.para_ui_page != 1) { + lv_label_set_text(labelXText, machine_menu.X_Current); + lv_obj_align(labelXText, buttonXText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelYText, machine_menu.Y_Current); + lv_obj_align(labelYText, buttonYText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelZText, machine_menu.Z_Current); + lv_obj_align(labelZText, buttonZText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelE0Text, machine_menu.E0_Current); + lv_obj_align(labelE0Text, buttonE0Text, LV_ALIGN_IN_LEFT_MID, 0, 0); + #if AXIS_IS_TMC(E1) + lv_label_set_text(labelTurnPage, machine_menu.next); + lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); + #endif + #if AXIS_IS_TMC(X) + milliamps = stepperX.getMilliamps(); + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); + lv_label_set_text(labelXValue, public_buf_l); + lv_obj_align(labelXValue, buttonXValue, LV_ALIGN_CENTER, 0, 0); + #endif + #if AXIS_IS_TMC(Y) + milliamps = stepperY.getMilliamps(); + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); + lv_label_set_text(labelYValue, public_buf_l); + lv_obj_align(labelYValue, buttonYValue, LV_ALIGN_CENTER, 0, 0); + #endif + #if AXIS_IS_TMC(Z) + milliamps = stepperZ.getMilliamps(); + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); + lv_label_set_text(labelZValue, public_buf_l); + lv_obj_align(labelZValue, buttonZValue, LV_ALIGN_CENTER, 0, 0); + #endif + #if AXIS_IS_TMC(E0) + milliamps = stepperE0.getMilliamps(); + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); + lv_label_set_text(labelE0Value, public_buf_l); + lv_obj_align(labelE0Value, buttonE0Value, LV_ALIGN_CENTER, 0, 0); + #endif + } + else { + #if AXIS_IS_TMC(E1) + lv_label_set_text(labelE1Text, machine_menu.E1_Current); + lv_obj_align(labelE1Text, buttonE1Text, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelTurnPage, machine_menu.previous); + lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); + + milliamps = stepperE1.getMilliamps(); + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); + lv_label_set_text(labelE1Value, public_buf_l); + lv_obj_align(labelE1Value, buttonE1Value, LV_ALIGN_CENTER, 0, 0); + #endif + } + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); + } +} + +void lv_clear_tmc_current_settings() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI && HAS_TRINAMIC_CONFIG diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.h new file mode 100644 index 0000000000..46463dd3c6 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_tmc_current_settings(void); +extern void lv_clear_tmc_current_settings(); + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp new file mode 100644 index 0000000000..b0d40fde28 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp @@ -0,0 +1,478 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 BOTH(HAS_TFT_LVGL_UI, HAS_STEALTHCHOP) + +#include "lv_conf.h" +#include "draw_ui.h" + +#include "../../../../MarlinCore.h" +#include "../../../../module/planner.h" +#include "../../../../module/stepper/indirection.h" +#include "../../../../feature/tmc_util.h" +#include "../../../../gcode/gcode.h" +#include "../../../../module/planner.h" + +static lv_obj_t * scr; + +#define ID_TMC_MODE_RETURN 1 +#define ID_TMC_MODE_X 2 +#define ID_TMC_MODE_Y 3 +#define ID_TMC_MODE_Z 4 +#define ID_TMC_MODE_E0 5 +#define ID_TMC_MODE_E1 6 +#define ID_TMC_MODE_DOWN 7 +#define ID_TMC_MODE_UP 8 + +static lv_obj_t *labelXState = NULL, *labelYState = NULL, *labelZState = NULL, *labelE0State = NULL; +static lv_obj_t *buttonXState = NULL, *buttonYState = NULL, *buttonZState = NULL, *buttonE0State = NULL; + +#if AXIS_HAS_STEALTHCHOP(E1) + static lv_obj_t *labelE1State = NULL, *buttonE1State = NULL; +#endif + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_TMC_MODE_RETURN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + uiCfg.para_ui_page = 0; + lv_clear_tmc_step_mode_settings(); + draw_return_ui(); + } + break; + case ID_TMC_MODE_X: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (stepperX.stored.stealthChop_enabled == true) { + stepperX.stored.stealthChop_enabled = false; + stepperX.refresh_stepping_mode(); + lv_obj_set_event_cb_mks(buttonXState, event_handler, ID_TMC_MODE_X, "bmp_disable.bin", 0); + lv_label_set_text(labelXState, machine_menu.disable); + //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); + // gcode.process_subcommands_now_P(PSTR("M500")); + } + else { + stepperX.stored.stealthChop_enabled = true; + stepperX.refresh_stepping_mode(); + lv_obj_set_event_cb_mks(buttonXState, event_handler, ID_TMC_MODE_X, "bmp_enable.bin", 0); + lv_label_set_text(labelXState, machine_menu.enable); + // gcode.process_subcommands_now_P(PSTR("M500")); + } + gcode.process_subcommands_now_P(PSTR("M500")); + } + break; + case ID_TMC_MODE_Y: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (stepperY.stored.stealthChop_enabled == true) { + stepperY.stored.stealthChop_enabled = false; + stepperY.refresh_stepping_mode(); + lv_obj_set_event_cb_mks(buttonYState, event_handler, ID_TMC_MODE_Y, "bmp_disable.bin", 0); + lv_label_set_text(labelYState, machine_menu.disable); + //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); + } + else { + stepperY.stored.stealthChop_enabled = true; + stepperY.refresh_stepping_mode(); + lv_obj_set_event_cb_mks(buttonYState, event_handler, ID_TMC_MODE_Y, "bmp_enable.bin", 0); + lv_label_set_text(labelYState, machine_menu.enable); + } + gcode.process_subcommands_now_P(PSTR("M500")); + } + break; + case ID_TMC_MODE_Z: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (stepperZ.stored.stealthChop_enabled == true) { + stepperZ.stored.stealthChop_enabled = false; + stepperZ.refresh_stepping_mode(); + lv_obj_set_event_cb_mks(buttonZState, event_handler, ID_TMC_MODE_Z, "bmp_disable.bin", 0); + lv_label_set_text(labelZState, machine_menu.disable); + //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); + } + else { + stepperZ.stored.stealthChop_enabled = true; + stepperZ.refresh_stepping_mode(); + lv_obj_set_event_cb_mks(buttonZState, event_handler, ID_TMC_MODE_Z, "bmp_enable.bin", 0); + lv_label_set_text(labelZState, machine_menu.enable); + } + gcode.process_subcommands_now_P(PSTR("M500")); + } + break; + case ID_TMC_MODE_E0: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (stepperE0.stored.stealthChop_enabled == true) { + stepperE0.stored.stealthChop_enabled = false; + stepperE0.refresh_stepping_mode(); + lv_obj_set_event_cb_mks(buttonE0State, event_handler, ID_TMC_MODE_E0, "bmp_disable.bin", 0); + lv_label_set_text(labelE0State, machine_menu.disable); + //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); + } + else { + stepperE0.stored.stealthChop_enabled = true; + stepperE0.refresh_stepping_mode(); + lv_obj_set_event_cb_mks(buttonE0State, event_handler, ID_TMC_MODE_E0, "bmp_enable.bin", 0); + lv_label_set_text(labelE0State, machine_menu.enable); + } + gcode.process_subcommands_now_P(PSTR("M500")); + } + break; + #if AXIS_HAS_STEALTHCHOP(E1) + case ID_TMC_MODE_E1: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (stepperE1.stored.stealthChop_enabled == true) { + stepperE1.stored.stealthChop_enabled = false; + stepperE1.refresh_stepping_mode(); + lv_obj_set_event_cb_mks(buttonE1State, event_handler, ID_TMC_MODE_E1, "bmp_disable.bin", 0); + lv_label_set_text(labelE1State, machine_menu.disable); + //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); + } + else { + stepperE1.stored.stealthChop_enabled = true; + stepperE1.refresh_stepping_mode(); + lv_obj_set_event_cb_mks(buttonE1State, event_handler, ID_TMC_MODE_E1, "bmp_enable.bin", 0); + lv_label_set_text(labelE1State, machine_menu.enable); + } + gcode.process_subcommands_now_P(PSTR("M500")); + } + break; + + case ID_TMC_MODE_UP: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + uiCfg.para_ui_page = 0; + lv_clear_tmc_step_mode_settings(); + lv_draw_tmc_step_mode_settings(); + } + break; + case ID_TMC_MODE_DOWN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + uiCfg.para_ui_page = 1; + lv_clear_tmc_step_mode_settings(); + lv_draw_tmc_step_mode_settings(); + } + break; + #endif // if AXIS_HAS_STEALTHCHOP(E1) + } +} + +void lv_draw_tmc_step_mode_settings(void) { + lv_obj_t *buttonBack = NULL, *label_Back = NULL; + lv_obj_t *buttonXText = NULL, *labelXText = NULL; + lv_obj_t *buttonYText = NULL, *labelYText = NULL; + lv_obj_t *buttonZText = NULL, *labelZText = NULL; + lv_obj_t *buttonE0Text = NULL, *labelE0Text = NULL; + + lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL; + #if AXIS_HAS_STEALTHCHOP(E1) + lv_obj_t *buttonTurnPage = NULL, *labelTurnPage = NULL; + lv_obj_t *buttonE1Text = NULL, *labelE1Text = NULL; + #endif + + + labelXState = NULL; + buttonXState = NULL; + labelYState = NULL; + buttonYState = NULL; + labelZState = NULL; + buttonZState = NULL; + labelE0State = NULL; + buttonE0State = NULL; + #if AXIS_HAS_STEALTHCHOP(E1) + labelE1State = NULL; + buttonE1State = NULL; + #endif + + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != TMC_MODE_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = TMC_MODE_UI; + } + disp_state = TMC_MODE_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, machine_menu.TmcStepModeConfTitle); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_para_back); + LV_IMG_DECLARE(bmp_para_state); + // LV_IMG_DECLARE(bmp_para_bank); + + if (uiCfg.para_ui_page != 1) { + buttonXText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonXText, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonXText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonXText, event_handler); + lv_btn_set_style(buttonXText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonXText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonXText, LV_LAYOUT_OFF); + labelXText = lv_label_create(buttonXText, NULL); /*Add a label to the button*/ + + buttonXState = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonXState, PARA_UI_STATE_POS_X, PARA_UI_POS_Y + PARA_UI_STATE_V); + if (stepperX.get_stealthChop_status()) + lv_obj_set_event_cb_mks(buttonXState, event_handler, ID_TMC_MODE_X, "bmp_enable.bin", 0); + else + lv_obj_set_event_cb_mks(buttonXState, event_handler, ID_TMC_MODE_X, "bmp_disable.bin", 0); + lv_imgbtn_set_src(buttonXState, LV_BTN_STATE_REL, &bmp_para_state); + lv_imgbtn_set_src(buttonXState, LV_BTN_STATE_PR, &bmp_para_state); + lv_imgbtn_set_style(buttonXState, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonXState, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonXState, LV_LAYOUT_OFF); + labelXState = lv_label_create(buttonXState, NULL); + + line1 = lv_line_create(scr, NULL); + lv_ex_line(line1, line_points[0]); + + buttonYText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonYText, PARA_UI_POS_X, PARA_UI_POS_Y * 2); /*Set its position*/ + lv_obj_set_size(buttonYText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonYText, event_handler); + lv_btn_set_style(buttonYText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonYText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonYText, LV_LAYOUT_OFF); + labelYText = lv_label_create(buttonYText, NULL); /*Add a label to the button*/ + + buttonYState = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonYState, PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_STATE_V); + if (stepperY.get_stealthChop_status()) + lv_obj_set_event_cb_mks(buttonYState, event_handler, ID_TMC_MODE_Y, "bmp_enable.bin", 0); + else + lv_obj_set_event_cb_mks(buttonYState, event_handler, ID_TMC_MODE_Y, "bmp_disable.bin", 0); + lv_imgbtn_set_src(buttonYState, LV_BTN_STATE_REL, &bmp_para_state); + lv_imgbtn_set_src(buttonYState, LV_BTN_STATE_PR, &bmp_para_state); + lv_imgbtn_set_style(buttonYState, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonYState, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonYState, LV_LAYOUT_OFF); + labelYState = lv_label_create(buttonYState, NULL); + + line2 = lv_line_create(scr, NULL); + lv_ex_line(line2, line_points[1]); + + buttonZText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonZText, PARA_UI_POS_X, PARA_UI_POS_Y * 3); /*Set its position*/ + lv_obj_set_size(buttonZText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonZText, event_handler); + lv_btn_set_style(buttonZText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonZText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonZText, LV_LAYOUT_OFF); + labelZText = lv_label_create(buttonZText, NULL); /*Add a label to the button*/ + + buttonZState = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonZState, PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_STATE_V); + if (stepperZ.get_stealthChop_status()) + lv_obj_set_event_cb_mks(buttonZState, event_handler, ID_TMC_MODE_Z, "bmp_enable.bin", 0); + else + lv_obj_set_event_cb_mks(buttonZState, event_handler, ID_TMC_MODE_Z, "bmp_disable.bin", 0); + lv_imgbtn_set_src(buttonZState, LV_BTN_STATE_REL, &bmp_para_state); + lv_imgbtn_set_src(buttonZState, LV_BTN_STATE_PR, &bmp_para_state); + lv_imgbtn_set_style(buttonZState, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonZState, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonZState, LV_LAYOUT_OFF); + labelZState = lv_label_create(buttonZState, NULL); + + line3 = lv_line_create(scr, NULL); + lv_ex_line(line3, line_points[2]); + + buttonE0Text = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonE0Text, PARA_UI_POS_X, PARA_UI_POS_Y * 4); /*Set its position*/ + lv_obj_set_size(buttonE0Text, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonE0Text, event_handler); + lv_btn_set_style(buttonE0Text, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonE0Text, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonE0Text, LV_LAYOUT_OFF); + labelE0Text = lv_label_create(buttonE0Text, NULL); /*Add a label to the button*/ + + buttonE0State = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonE0State, PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_STATE_V); + if (stepperE0.get_stealthChop_status()) + lv_obj_set_event_cb_mks(buttonE0State, event_handler, ID_TMC_MODE_E0, "bmp_enable.bin", 0); + else + lv_obj_set_event_cb_mks(buttonE0State, event_handler, ID_TMC_MODE_E0, "bmp_disable.bin", 0); + lv_imgbtn_set_src(buttonE0State, LV_BTN_STATE_REL, &bmp_para_state); + lv_imgbtn_set_src(buttonE0State, LV_BTN_STATE_PR, &bmp_para_state); + lv_imgbtn_set_style(buttonE0State, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonE0State, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonE0State, LV_LAYOUT_OFF); + labelE0State = lv_label_create(buttonE0State, NULL); + + line4 = lv_line_create(scr, NULL); + lv_ex_line(line4, line_points[3]); + + #if AXIS_HAS_STEALTHCHOP(E1) + buttonTurnPage = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_TMC_MODE_DOWN, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif + } + else { + #if AXIS_HAS_STEALTHCHOP(E1) + buttonE1Text = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonE1Text, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ + lv_obj_set_size(buttonE1Text, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + lv_obj_set_event_cb(buttonE1Text, event_handler); + lv_btn_set_style(buttonE1Text, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ + lv_btn_set_style(buttonE1Text, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_set_layout(buttonE1Text, LV_LAYOUT_OFF); + labelE1Text = lv_label_create(buttonE1Text, NULL); /*Add a label to the button*/ + + buttonE1State = lv_imgbtn_create(scr, NULL); + lv_obj_set_pos(buttonE1State, PARA_UI_STATE_POS_X, PARA_UI_POS_Y + PARA_UI_STATE_V); + if (stepperE1.get_stealthChop_status()) + lv_obj_set_event_cb_mks(buttonE1State, event_handler, ID_TMC_MODE_E1, "bmp_enable.bin", 0); + else + lv_obj_set_event_cb_mks(buttonE1State, event_handler, ID_TMC_MODE_E1, "bmp_disable.bin", 0); + lv_imgbtn_set_src(buttonE1State, LV_BTN_STATE_REL, &bmp_para_state); + lv_imgbtn_set_src(buttonE1State, LV_BTN_STATE_PR, &bmp_para_state); + lv_imgbtn_set_style(buttonE1State, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonE1State, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_set_layout(buttonE1State, LV_LAYOUT_OFF); + labelE1State = lv_label_create(buttonE1State, NULL); + + line1 = lv_line_create(scr, NULL); + lv_ex_line(line1, line_points[0]); + + buttonTurnPage = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_TMC_MODE_UP, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif + } + #if AXIS_HAS_STEALTHCHOP(E1) + lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); + lv_btn_set_layout(buttonTurnPage, LV_LAYOUT_OFF); + labelTurnPage = lv_label_create(buttonTurnPage, NULL); + #endif + + buttonBack = lv_imgbtn_create(scr, NULL); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_TMC_MODE_RETURN, "bmp_back70x40.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_para_back); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_para_back); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + if (uiCfg.para_ui_page != 1) { + lv_label_set_text(labelXText, machine_menu.X_StepMode); + lv_obj_align(labelXText, buttonXText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelYText, machine_menu.Y_StepMode); + lv_obj_align(labelYText, buttonYText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelZText, machine_menu.Z_StepMode); + lv_obj_align(labelZText, buttonZText, LV_ALIGN_IN_LEFT_MID, 0, 0); + + lv_label_set_text(labelE0Text, machine_menu.E0_StepMode); + lv_obj_align(labelE0Text, buttonE0Text, LV_ALIGN_IN_LEFT_MID, 0, 0); + + if (stepperX.get_stealthChop_status()) + lv_label_set_text(labelXState, machine_menu.enable); + else + lv_label_set_text(labelXState, machine_menu.disable); + lv_obj_align(labelXState, buttonXState, LV_ALIGN_CENTER, 0, 0); + + if (stepperY.get_stealthChop_status()) + lv_label_set_text(labelYState, machine_menu.enable); + else + lv_label_set_text(labelYState, machine_menu.disable); + lv_obj_align(labelYState, buttonYState, LV_ALIGN_CENTER, 0, 0); + + if (stepperZ.get_stealthChop_status()) + lv_label_set_text(labelZState, machine_menu.enable); + else + lv_label_set_text(labelZState, machine_menu.disable); + lv_obj_align(labelZState, buttonZState, LV_ALIGN_CENTER, 0, 0); + + if (stepperE0.get_stealthChop_status()) + lv_label_set_text(labelE0State, machine_menu.enable); + else + lv_label_set_text(labelE0State, machine_menu.disable); + lv_obj_align(labelE0State, buttonE0State, LV_ALIGN_CENTER, 0, 0); + + #if AXIS_HAS_STEALTHCHOP(E1) + lv_label_set_text(labelTurnPage, machine_menu.next); + lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); + #endif + } + else { + #if AXIS_HAS_STEALTHCHOP(E1) + lv_label_set_text(labelE1Text, machine_menu.E1_StepMode); + lv_obj_align(labelE1Text, buttonE1Text, LV_ALIGN_IN_LEFT_MID, 0, 0); + + if (stepperE1.get_stealthChop_status()) + lv_label_set_text(labelE1State, machine_menu.enable); + else + lv_label_set_text(labelE1State, machine_menu.disable); + lv_obj_align(labelE1State, buttonE1State, LV_ALIGN_CENTER, 0, 0); + + lv_label_set_text(labelTurnPage, machine_menu.previous); + lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); + + #endif + } + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); + } +} + +void lv_clear_tmc_step_mode_settings() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI && HAS_STEALTHCHOP diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.h new file mode 100644 index 0000000000..93085b7ca1 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.h @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_tmc_step_mode_settings(void); +extern void lv_clear_tmc_step_mode_settings(); + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp new file mode 100644 index 0000000000..91dd2f36ab --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp @@ -0,0 +1,267 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "lv_conf.h" +#include "draw_ui.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" + +#include "../../../../MarlinCore.h" +#include "../../../../gcode/queue.h" + +// static lv_obj_t *buttonMoveZ,*buttonTest,*buttonZ0,*buttonStop,*buttonReturn; +static lv_obj_t * scr; + +#define ID_T_PRE_HEAT 1 +#define ID_T_EXTRUCT 2 +#define ID_T_MOV 3 +#define ID_T_HOME 4 +#define ID_T_LEVELING 5 +#define ID_T_FILAMENT 6 +#define ID_T_MORE 7 +#define ID_T_RETURN 8 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_T_PRE_HEAT: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_tool(); + lv_draw_preHeat(); + } + break; + case ID_T_EXTRUCT: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_tool(); + lv_draw_extrusion(); + } + break; + case ID_T_MOV: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_tool(); + lv_draw_move_motor(); + } + break; + case ID_T_HOME: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_tool(); + lv_draw_home(); + } + break; + case ID_T_LEVELING: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + queue.enqueue_one_P(PSTR("G28")); + queue.enqueue_one_P(PSTR("G29")); + #else + uiCfg.leveling_first_time = 1; + lv_clear_tool(); + lv_draw_manualLevel(); + #endif + } + break; + case ID_T_FILAMENT: break; + case ID_T_MORE: break; + case ID_T_RETURN: + if (event == LV_EVENT_CLICKED) { + // nothing to do + } + else if (event == LV_EVENT_RELEASED) { + TERN_(MKS_TEST, curent_disp_ui = 1); + lv_obj_del(scr); + lv_draw_ready_print(); + } + break; + } +} + +void lv_draw_tool(void) { + lv_obj_t *buttonPreHeat, *buttonExtrusion, *buttonMove, *buttonHome, *buttonLevel; + lv_obj_t *buttonBack; + + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != TOOL_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = TOOL_UI; + } + disp_state = TOOL_UI; + + scr = lv_obj_create(NULL, NULL); + + //static lv_style_t tool_style; + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_label_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonPreHeat = lv_imgbtn_create(scr, NULL); + buttonExtrusion = lv_imgbtn_create(scr, NULL); + buttonMove = lv_imgbtn_create(scr, NULL); + buttonHome = lv_imgbtn_create(scr, NULL); + buttonLevel = lv_imgbtn_create(scr, NULL); + // buttonFilament = lv_imgbtn_create(scr, NULL); + // buttonMore = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonPreHeat, event_handler, ID_T_PRE_HEAT, "bmp_preHeat.bin", 0); + lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_clear_protect(buttonPreHeat, LV_PROTECT_FOLLOW); + + #if 1 + lv_obj_set_event_cb_mks(buttonExtrusion, event_handler, ID_T_EXTRUCT, "bmp_extruct.bin", 0); + lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonMove, event_handler, ID_T_MOV, "bmp_mov.bin", 0); + lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonHome, event_handler, ID_T_HOME, "bmp_zero.bin", 0); + lv_imgbtn_set_src(buttonHome, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonHome, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonHome, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonHome, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonLevel, event_handler, ID_T_LEVELING, "bmp_leveling.bin", 0); + lv_imgbtn_set_src(buttonLevel, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonLevel, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_REL, &tft_style_label_rel); + + //lv_obj_set_event_cb_mks(buttonFilament, event_handler,ID_T_FILAMENT,"bmp_Filamentchange.bin",0); + //lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_REL, &bmp_pic); + //lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_PR, &tft_style_label_pre); + //lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_REL, &tft_style_label_rel); + + //lv_obj_set_event_cb_mks(buttonMore, event_handler,ID_T_MORE,"bmp_More.bin",0); + //lv_imgbtn_set_src(buttonMore, LV_BTN_STATE_REL, &bmp_pic); + //lv_imgbtn_set_src(buttonMore, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_style(buttonMore, LV_BTN_STATE_PR, &tft_style_label_pre); + //lv_imgbtn_set_style(buttonMore, LV_BTN_STATE_REL, &tft_style_label_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_T_RETURN, "bmp_return.bin", 0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif // if 1 + + lv_obj_set_pos(buttonPreHeat, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonExtrusion, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); + lv_obj_set_pos(buttonMove, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); + lv_obj_set_pos(buttonHome, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttonLevel, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + //lv_obj_set_pos(buttonFilament,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + //lv_obj_set_pos(buttonMore,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonPreHeat, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonExtrusion, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonMove, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHome, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonLevel, LV_LAYOUT_OFF); + //lv_btn_set_layout(buttonFilament, LV_LAYOUT_OFF); + //lv_btn_set_layout(buttonMore, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * labelPreHeat = lv_label_create(buttonPreHeat, NULL); + lv_obj_t * labelExtrusion = lv_label_create(buttonExtrusion, NULL); + lv_obj_t * label_Move = lv_label_create(buttonMove, NULL); + lv_obj_t * label_Home = lv_label_create(buttonHome, NULL); + lv_obj_t * label_Level = lv_label_create(buttonLevel, NULL); + //lv_obj_t * label_Filament = lv_label_create(buttonFilament, NULL); + //lv_obj_t * label_More = lv_label_create(buttonMore, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelPreHeat, tool_menu.preheat); + lv_obj_align(labelPreHeat, buttonPreHeat, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelExtrusion, tool_menu.extrude); + lv_obj_align(labelExtrusion, buttonExtrusion, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Move, tool_menu.move); + lv_obj_align(label_Move, buttonMove, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Home, tool_menu.home); + lv_obj_align(label_Home, buttonHome, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + /* + if (gCfgItems.leveling_mode != 2) { + lv_label_set_text(label_Level, gCfgItems.leveling_mode == 1 ? tool_menu.autoleveling : tool_menu.leveling); + lv_obj_align(label_Level, buttonLevel, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + */ + lv_label_set_text(label_Level, tool_menu.TERN(AUTO_BED_LEVELING_BILINEAR, autoleveling, leveling)); + lv_obj_align(label_Level, buttonLevel, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + //lv_label_set_text(label_Filament, tool_menu.filament); + //lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + //lv_label_set_text(label_More, tool_menu.more); + //lv_obj_align(label_More, buttonMore, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } +} + +void lv_clear_tool() { lv_obj_del(scr); } + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h new file mode 100644 index 0000000000..14be3bce4f --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_tool(void); +extern void lv_clear_tool(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp new file mode 100644 index 0000000000..e8899b9ad1 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -0,0 +1,1521 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#if ENABLED(TFT_LVGL_UI_SPI) + #include "SPI_TFT.h" +#endif + +#include "W25Qxx.h" +#include "tft_lvgl_configuration.h" + +#include "pic_manager.h" + +#include "draw_ui.h" +#include "mks_hardware_test.h" + +#include + +#include "../../../../MarlinCore.h" +#include "../../../../sd/cardreader.h" +#include "../../../../module/motion.h" +#include "../../../../module/planner.h" + +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../../../feature/powerloss.h" +#endif + +#if ENABLED(PARK_HEAD_ON_PAUSE) + #include "../../../../feature/pause.h" +#endif + +CFG_ITMES gCfgItems; +UI_CFG uiCfg; +DISP_STATE_STACK disp_state_stack; +DISP_STATE disp_state = MAIN_UI; +DISP_STATE last_disp_state; +PRINT_TIME print_time; +value_state value; + +uint32_t To_pre_view; +uint8_t gcode_preview_over; +uint8_t flash_preview_begin; +uint8_t default_preview_flg; +uint32_t size = 809; +uint16_t row; +uint8_t temperature_change_frequency; +uint8_t printing_rate_update_flag; + +extern uint8_t once_flag; +extern uint8_t sel_id; +extern uint8_t public_buf[512]; +extern uint8_t bmp_public_buf[17 * 1024]; + +extern void LCD_IO_WriteData(uint16_t RegValue); + +lv_point_t line_points[4][2] = { + {{PARA_UI_POS_X, PARA_UI_POS_Y + PARA_UI_SIZE_Y}, {TFT_WIDTH, PARA_UI_POS_Y + PARA_UI_SIZE_Y}}, + {{PARA_UI_POS_X, PARA_UI_POS_Y*2 + PARA_UI_SIZE_Y}, {TFT_WIDTH, PARA_UI_POS_Y*2 + PARA_UI_SIZE_Y}}, + {{PARA_UI_POS_X, PARA_UI_POS_Y*3 + PARA_UI_SIZE_Y}, {TFT_WIDTH, PARA_UI_POS_Y*3 + PARA_UI_SIZE_Y}}, + {{PARA_UI_POS_X, PARA_UI_POS_Y*4 + PARA_UI_SIZE_Y}, {TFT_WIDTH, PARA_UI_POS_Y*4 + PARA_UI_SIZE_Y}} +}; +void gCfgItems_init() { + gCfgItems.multiple_language = MULTI_LANGUAGE_ENABLE; + #if 1 // LCD_LANGUAGE == en + gCfgItems.language = LANG_ENGLISH; + #elif LCD_LANGUAGE == zh_CN + gCfgItems.language = LANG_SIMPLE_CHINESE; + #elif LCD_LANGUAGE == zh_TW + gCfgItems.language = LANG_COMPLEX_CHINESE; + #elif LCD_LANGUAGE == jp_kana + gCfgItems.language = LANG_JAPAN; + #elif LCD_LANGUAGE == de + gCfgItems.language = LANG_GERMAN; + #elif LCD_LANGUAGE == fr + gCfgItems.language = LANG_FRENCH; + #elif LCD_LANGUAGE == ru + gCfgItems.language = LANG_RUSSIAN; + #elif LCD_LANGUAGE == ko_KR + gCfgItems.language = LANG_KOREAN; + #elif LCD_LANGUAGE == tr + gCfgItems.language = LANG_TURKISH; + #elif LCD_LANGUAGE == es + gCfgItems.language = LANG_SPANISH; + #elif LCD_LANGUAGE == el + gCfgItems.language = LANG_GREEK; + #elif LCD_LANGUAGE == it + gCfgItems.language = LANG_ITALY; + #elif LCD_LANGUAGE == pt + gCfgItems.language = LANG_PORTUGUESE; + #endif + gCfgItems.leveling_mode = 0; + gCfgItems.from_flash_pic = 0; + gCfgItems.curFilesize = 0; + gCfgItems.finish_power_off = 0; + gCfgItems.pause_reprint = 0; + gCfgItems.pausePosX = -1; + gCfgItems.pausePosY = -1; + gCfgItems.pausePosZ = 5; + W25QXX.SPI_FLASH_BufferRead((uint8_t *)&gCfgItems.spi_flash_flag, VAR_INF_ADDR, sizeof(gCfgItems.spi_flash_flag)); + if (gCfgItems.spi_flash_flag == GCFG_FLAG_VALUE) { + W25QXX.SPI_FLASH_BufferRead((uint8_t *)&gCfgItems, VAR_INF_ADDR, sizeof(gCfgItems)); + } + else { + gCfgItems.spi_flash_flag = GCFG_FLAG_VALUE; + W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); + W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems, VAR_INF_ADDR, sizeof(gCfgItems)); + } + + uiCfg.F[0] = 'N'; + uiCfg.F[1] = 'A'; + uiCfg.F[2] = 'N'; + uiCfg.F[3] = 'O'; + W25QXX.SPI_FLASH_BlockErase(REFLSHE_FLGA_ADD + 32 - 64*1024); + W25QXX.SPI_FLASH_BufferWrite(uiCfg.F,REFLSHE_FLGA_ADD,4); +} + +void gCfg_to_spiFlah() { + W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); + W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems, VAR_INF_ADDR, sizeof(gCfgItems)); +} + +void ui_cfg_init() { + uiCfg.curTempType = 0; + uiCfg.curSprayerChoose = 0; + uiCfg.stepHeat = 10; + uiCfg.leveling_first_time = 0; + uiCfg.para_ui_page = 0; + uiCfg.extruStep = 5; + uiCfg.extruSpeed = 10; + uiCfg.move_dist = 1; + uiCfg.moveSpeed = 3000; + uiCfg.stepPrintSpeed = 10; +} + +void update_spi_flash() { + W25QXX.init(SPI_QUARTER_SPEED); + W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); + W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems, VAR_INF_ADDR, sizeof(gCfgItems)); +} + +lv_style_t tft_style_scr; +lv_style_t tft_style_label_pre; +lv_style_t tft_style_label_rel; +lv_style_t style_line; +lv_style_t style_para_value_pre; +lv_style_t style_para_value_rel; + +lv_style_t style_num_key_pre; +lv_style_t style_num_key_rel; + +lv_style_t style_num_text; +void tft_style_init() { + lv_style_copy(&tft_style_scr, &lv_style_scr); + tft_style_scr.body.main_color = LV_COLOR_BACKGROUND; + tft_style_scr.body.grad_color = LV_COLOR_BACKGROUND; + tft_style_scr.text.color = LV_COLOR_TEXT; + tft_style_scr.text.sel_color = LV_COLOR_TEXT; + tft_style_scr.line.width = 0; + tft_style_scr.text.letter_space = 0; + tft_style_scr.text.line_space = 0; + + lv_style_copy(&tft_style_label_pre, &lv_style_scr); + lv_style_copy(&tft_style_label_rel, &lv_style_scr); + tft_style_label_pre.body.main_color = LV_COLOR_BACKGROUND; + tft_style_label_pre.body.grad_color = LV_COLOR_BACKGROUND; + tft_style_label_pre.text.color = LV_COLOR_TEXT; + tft_style_label_pre.text.sel_color = LV_COLOR_TEXT; + tft_style_label_rel.body.main_color = LV_COLOR_BACKGROUND; + tft_style_label_rel.body.grad_color = LV_COLOR_BACKGROUND; + tft_style_label_rel.text.color = LV_COLOR_TEXT; + tft_style_label_rel.text.sel_color = LV_COLOR_TEXT; + tft_style_label_pre.text.font = TERN(HAS_SPI_FLASH_FONT, &gb2312_puhui32, LV_FONT_DEFAULT); + tft_style_label_rel.text.font = TERN(HAS_SPI_FLASH_FONT, &gb2312_puhui32, LV_FONT_DEFAULT); + tft_style_label_pre.line.width = 0; + tft_style_label_rel.line.width = 0; + tft_style_label_pre.text.letter_space = 0; + tft_style_label_rel.text.letter_space = 0; + tft_style_label_pre.text.line_space = -5; + tft_style_label_rel.text.line_space = -5; + lv_style_copy(&style_para_value_pre, &lv_style_scr); + lv_style_copy(&style_para_value_rel, &lv_style_scr); + style_para_value_pre.body.main_color = LV_COLOR_BACKGROUND; + style_para_value_pre.body.grad_color = LV_COLOR_BACKGROUND; + style_para_value_pre.text.color = LV_COLOR_BLACK; + style_para_value_pre.text.sel_color = LV_COLOR_BLACK; + style_para_value_rel.body.main_color = LV_COLOR_BACKGROUND; + style_para_value_rel.body.grad_color = LV_COLOR_BACKGROUND; + style_para_value_rel.text.color = LV_COLOR_BLACK; + style_para_value_rel.text.sel_color = LV_COLOR_BLACK; + style_para_value_pre.text.font = TERN(HAS_SPI_FLASH_FONT, &gb2312_puhui32, LV_FONT_DEFAULT); + style_para_value_rel.text.font = TERN(HAS_SPI_FLASH_FONT, &gb2312_puhui32, LV_FONT_DEFAULT); + style_para_value_pre.line.width = 0; + style_para_value_rel.line.width = 0; + style_para_value_pre.text.letter_space = 0; + style_para_value_rel.text.letter_space = 0; + style_para_value_pre.text.line_space = -5; + style_para_value_rel.text.line_space = -5; + lv_style_copy(&style_num_key_pre, &lv_style_scr); + lv_style_copy(&style_num_key_rel, &lv_style_scr); + style_num_key_pre.body.main_color = LV_COLOR_KEY_BACKGROUND; + style_num_key_pre.body.grad_color = LV_COLOR_KEY_BACKGROUND; + style_num_key_pre.text.color = LV_COLOR_TEXT; + style_num_key_pre.text.sel_color = LV_COLOR_TEXT; + style_num_key_rel.body.main_color = LV_COLOR_KEY_BACKGROUND; + style_num_key_rel.body.grad_color = LV_COLOR_KEY_BACKGROUND; + style_num_key_rel.text.color = LV_COLOR_TEXT; + style_num_key_rel.text.sel_color = LV_COLOR_TEXT; + #if HAS_SPI_FLASH_FONT + style_num_key_pre.text.font = &gb2312_puhui32; + style_num_key_rel.text.font = &gb2312_puhui32; + #else + style_num_key_pre.text.font = LV_FONT_DEFAULT; + style_num_key_rel.text.font = LV_FONT_DEFAULT; + #endif + + style_num_key_pre.line.width = 0; + style_num_key_rel.line.width = 0; + style_num_key_pre.text.letter_space = 0; + style_num_key_rel.text.letter_space = 0; + style_num_key_pre.text.line_space = -5; + style_num_key_rel.text.line_space = -5; + lv_style_copy(&style_num_text, &lv_style_scr); + + style_num_text.body.main_color = LV_COLOR_WHITE; + style_num_text.body.grad_color = LV_COLOR_WHITE; + style_num_text.text.color = LV_COLOR_BLACK; + style_num_text.text.sel_color = LV_COLOR_BLACK; + style_num_text.text.font = TERN(HAS_SPI_FLASH_FONT, &gb2312_puhui32, LV_FONT_DEFAULT); + style_num_text.line.width = 0; + style_num_text.text.letter_space = 0; + style_num_text.text.line_space = -5; + + lv_style_copy(&style_line, &lv_style_plain); + style_line.line.color = LV_COLOR_MAKE(0x49, 0x54, 0xff); + style_line.line.width = 1; + style_line.line.rounded = 1; +} + +#define MAX_TITLE_LEN 28 + +char public_buf_m[100] = {0}; +char public_buf_l[30]; + +void titleText_cat(char *str, int strSize, char *addPart) { + if (str == 0 || addPart == 0) return; + if ((int)(strlen(str) + strlen(addPart)) >= strSize) return; + strcat(str, addPart); +} + +char *getDispText(int index) { + + ZERO(public_buf_l); + + switch (disp_state_stack._disp_state[index]) { + case PRINT_READY_UI: + strcpy(public_buf_l, main_menu.title); + break; + case PRINT_FILE_UI: + strcpy(public_buf_l, file_menu.title); + break; + case PRINTING_UI: + if (disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI + #ifndef TFT35 + || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI + #endif + ) strcpy(public_buf_l, common_menu.print_special_title); + else strcpy(public_buf_l, printing_menu.title); + break; + case MOVE_MOTOR_UI: + strcpy(public_buf_l, move_menu.title); + break; + case OPERATE_UI: + if (disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI + #ifndef TFT35 + || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI + #endif + ) strcpy(public_buf_l, common_menu.operate_special_title); + else strcpy(public_buf_l, operation_menu.title); + break; + + case PAUSE_UI: + if (disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI + ) strcpy(public_buf_l, common_menu.pause_special_title); + else strcpy(public_buf_l, pause_menu.title); + break; + + case EXTRUSION_UI: + strcpy(public_buf_l, extrude_menu.title); + break; + case CHANGE_SPEED_UI: + strcpy(public_buf_l, speed_menu.title); + break; + case FAN_UI: + strcpy(public_buf_l, fan_menu.title); + break; + case PRE_HEAT_UI: + if ((disp_state_stack._disp_state[disp_state_stack._disp_index - 1] == OPERATE_UI)) + strcpy(public_buf_l, preheat_menu.adjust_title); + else strcpy(public_buf_l, preheat_menu.title); + break; + case SET_UI: + strcpy(public_buf_l, set_menu.title); + break; + case ZERO_UI: + strcpy(public_buf_l, home_menu.title); + break; + case SPRAYER_UI: break; + case MACHINE_UI: break; + case LANGUAGE_UI: + strcpy(public_buf_l, language_menu.title); + break; + case ABOUT_UI: + strcpy(public_buf_l, about_menu.title); + break; + case LOG_UI: break; + case DISK_UI: + strcpy(public_buf_l, filesys_menu.title); + break; + case DIALOG_UI: + strcpy(public_buf_l, common_menu.dialog_confirm_title); + break; + case WIFI_UI: + strcpy(public_buf_l, wifi_menu.title); + break; + case MORE_UI: + case PRINT_MORE_UI: + strcpy(public_buf_l, more_menu.title); + break; + case FILAMENTCHANGE_UI: + strcpy(public_buf_l, filament_menu.title); + break; + case LEVELING_UI: + case MESHLEVELING_UI: + strcpy(public_buf_l, leveling_menu.title); + break; + case BIND_UI: + strcpy(public_buf_l, cloud_menu.title); + break; + case ZOFFSET_UI: + strcpy(public_buf_l, zoffset_menu.title); + break; + case TOOL_UI: + strcpy(public_buf_l, tool_menu.title); + break; + case WIFI_LIST_UI: + //strcpy(public_buf_l, list_menu.title); + break; + case MACHINE_PARA_UI: + strcpy(public_buf_l, MachinePara_menu.title); + break; + case BABY_STEP_UI: + strcpy(public_buf_l, operation_menu.babystep); + break; + case EEPROM_SETTINGS_UI: + strcpy(public_buf_l, eeprom_menu.title); + break; + default: break; + } + + return public_buf_l; +} + +char *creat_title_text() { + int index = 0; + char *tmpText = 0; + char tmpCurFileStr[20]; + + ZERO(tmpCurFileStr); + + #if _LFN_UNICODE + //cutFileName((TCHAR *)curFileName, 16, 16, (TCHAR *)tmpCurFileStr); + #else + cutFileName(list_file.long_name[sel_id], 16, 16, tmpCurFileStr); + #endif + + ZERO(public_buf_m); + + while (index <= disp_state_stack._disp_index) { + tmpText = getDispText(index); + if ((*tmpText == 0) || (tmpText == 0)) { + index++; + continue; + } + + titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); + if (index < disp_state_stack._disp_index) titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)">"); + + index++; + } + + if (disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI + /*|| disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI*/ + ) { + titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)":"); + titleText_cat(public_buf_m, sizeof(public_buf_m), tmpCurFileStr); + } + + if (strlen(public_buf_m) > MAX_TITLE_LEN) { + ZERO(public_buf_m); + tmpText = getDispText(0); + if (*tmpText != 0) { + titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); + titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)">...>"); + tmpText = getDispText(disp_state_stack._disp_index); + if (*tmpText != 0) titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); + } + } + + return public_buf_m; +} + +#if HAS_GCODE_PREVIEW + + uint32_t gPicturePreviewStart = 0; + + void preview_gcode_prehandle(char *path) { + #if ENABLED(SDSUPPORT) + //uint8_t re; + //uint32_t read; + uint32_t pre_read_cnt = 0; + uint32_t *p1; + char *cur_name; + + gPicturePreviewStart = 0; + cur_name = strrchr(path, '/'); + card.openFileRead(cur_name); + card.read(public_buf, 512); + p1 = (uint32_t *)strstr((char *)public_buf, ";simage:"); + + if (p1) { + pre_read_cnt = (uint32_t)p1 - (uint32_t)((uint32_t *)(&public_buf[0])); + + To_pre_view = pre_read_cnt; + gcode_preview_over = 1; + gCfgItems.from_flash_pic = 1; + update_spi_flash(); + } + else { + gcode_preview_over = 0; + default_preview_flg = 1; + gCfgItems.from_flash_pic = 0; + update_spi_flash(); + } + card.closefile(); + #endif + } + + #if 1 + + void gcode_preview(char *path, int xpos_pixel, int ypos_pixel) { + #if ENABLED(SDSUPPORT) + //uint8_t ress; + //uint32_t write; + volatile uint32_t i, j; + volatile uint16_t *p_index; + //int res; + char *cur_name; + + cur_name = strrchr(path, '/'); + card.openFileRead(cur_name); + + if (gPicturePreviewStart <= 0) { + while (1) { + uint32_t br = card.read(public_buf, 400); + uint32_t* p1 = (uint32_t *)strstr((char *)public_buf, ";gimage:"); + if (p1) { + gPicturePreviewStart += (uint32_t)p1 - (uint32_t)((uint32_t *)(&public_buf[0])); + break; + } + else { + gPicturePreviewStart += br; + } + if (br < 400) break; + } + } + + //SERIAL_ECHOLNPAIR("gPicturePreviewStart: ", gPicturePreviewStart, " PREVIEW_LITTLE_PIC_SIZE: ", PREVIEW_LITTLE_PIC_SIZE); + + card.setIndex((gPicturePreviewStart + To_pre_view) + size * row + 8); + #if ENABLED(TFT_LVGL_UI_SPI) + SPI_TFT.spi_init(SPI_FULL_SPEED); + //SPI_TFT.SetCursor(0,0); + SPI_TFT.SetWindows(xpos_pixel, ypos_pixel + row, 200, 1); + SPI_TFT.LCD_WriteRAM_Prepare(); + #else + ili9320_SetWindows(xpos_pixel, ypos_pixel + row, 200, 1); + LCD_WriteRAM_Prepare(); + #endif + + j = i = 0; + + while (1) { + card.read(public_buf, 400); + for (i = 0; i < 400;) { + bmp_public_buf[j] = ascii2dec_test((char*)&public_buf[i]) << 4 | ascii2dec_test((char*)&public_buf[i + 1]); + i += 2; + j++; + } + if (j >= 400) break; + } + #if ENABLED(TFT_LVGL_UI_SPI) + uint16_t Color, SpiColor; + SpiColor = (LV_COLOR_BACKGROUND.full >> 8) | ((LV_COLOR_BACKGROUND.full & 0xFF) << 8); + for (i = 0; i < 400;) { + p_index = (uint16_t *)(&bmp_public_buf[i]); + Color = (*p_index >> 8); + *p_index = Color | ((*p_index & 0xFF) << 8); + i += 2; + if (*p_index == 0x0000) *p_index = SpiColor; + } + SPI_TFT_CS_L; + SPI_TFT_DC_H; + SPI.dmaSend(bmp_public_buf, 400, true); + SPI_TFT_CS_H; + #else + for (i = 0; i < 400;) { + p_index = (uint16_t *)(&bmp_public_buf[i]); + if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; //gCfgItems.preview_bk_color; + LCD_IO_WriteData(*p_index); + i += 2; + } + #endif + #if HAS_BAK_VIEW_IN_FLASH + W25QXX.init(SPI_QUARTER_SPEED); + if (row < 20) W25QXX.SPI_FLASH_SectorErase(BAK_VIEW_ADDR_TFT35 + row * 4096); + W25QXX.SPI_FLASH_BufferWrite(bmp_public_buf, BAK_VIEW_ADDR_TFT35 + row * 400, 400); + #endif + row++; + if (row >= 200) { + size = 809; + row = 0; + + gcode_preview_over = 0; + //flash_preview_begin = 1; + + card.closefile(); + + /* + if (gCurFileState.file_open_flag != 0xaa) { + reset_file_info(); + res = f_open(file, curFileName, FA_OPEN_EXISTING | FA_READ); + if (res == FR_OK) { + f_lseek(file,PREVIEW_SIZE+To_pre_view); + gCurFileState.file_open_flag = 0xaa; + //bakup_file_path((uint8_t *)curFileName, strlen(curFileName)); + srcfp = file; + mksReprint.mks_printer_state = MKS_WORKING; + once_flag = 0; + } + } + */ + char *cur_name; + + cur_name = strrchr(list_file.file_name[sel_id], '/'); + + SdFile file; + SdFile *curDir; + card.endFilePrint(); + const char * const fname = card.diveToFile(true, curDir, cur_name); + if (!fname) return; + if (file.open(curDir, fname, O_READ)) { + gCfgItems.curFilesize = file.fileSize(); + file.close(); + update_spi_flash(); + } + + card.openFileRead(cur_name); + if (card.isFileOpen()) { + feedrate_percentage = 100; + //saved_feedrate_percentage = feedrate_percentage; + planner.flow_percentage[0] = 100; + planner.e_factor[0] = planner.flow_percentage[0] * 0.01; + if (EXTRUDERS == 2) { + planner.flow_percentage[1] = 100; + planner.e_factor[1] = planner.flow_percentage[1] * 0.01; + } + card.startFileprint(); + TERN_(POWER_LOSS_RECOVERY, recovery.prepare()); + once_flag = 0; + } + return; + } + card.closefile(); + #endif // SDSUPPORT + } + + #else // if 1 + + void gcode_preview(char *path, int xpos_pixel, int ypos_pixel) { + #if ENABLED(SDSUPPORT) + //uint8_t ress; + //uint32_t write; + volatile uint32_t i, j; + volatile uint16_t *p_index; + //int res; + char *cur_name; + uint16_t Color; + + cur_name = strrchr(path, '/'); + card.openFileRead(cur_name); + + card.setIndex((PREVIEW_LITTLE_PIC_SIZE + To_pre_view) + size * row + 8); + #if ENABLED(TFT_LVGL_UI_SPI) + SPI_TFT.spi_init(SPI_FULL_SPEED); + //SPI_TFT.SetCursor(0,0); + SPI_TFT.SetWindows(xpos_pixel, ypos_pixel + row, 200, 1); + SPI_TFT.LCD_WriteRAM_Prepare(); + #else + ili9320_SetWindows(xpos_pixel, ypos_pixel + row, 200, 1); + LCD_WriteRAM_Prepare(); + #endif + + j = 0; + i = 0; + + while (1) { + card.read(public_buf, 400); + for (i = 0; i < 400;) { + bmp_public_buf[j] = ascii2dec_test((char*)&public_buf[i]) << 4 | ascii2dec_test((char*)&public_buf[i + 1]); + i += 2; + j++; + } + + //if (i > 800) break; + //#ifdef TFT70 + // if (j > 400) { + // f_read(file, buff_pic, 1, &read); + // break; + // } + //#elif defined(TFT35) + if (j >= 400) + //f_read(file, buff_pic, 1, &read); + break; + //#endif + + } + #if ENABLED(TFT_LVGL_UI_SPI) + for (i = 0; i < 400;) { + p_index = (uint16_t *)(&bmp_public_buf[i]); + + Color = (*p_index >> 8); + *p_index = Color | ((*p_index & 0xff) << 8); + i += 2; + if (*p_index == 0x0000) *p_index = 0xC318; + } + SPI_TFT_CS_L; + SPI_TFT_DC_H; + SPI.dmaSend(bmp_public_buf, 400, true); + SPI_TFT_CS_H; + + #else + for (i = 0; i < 400;) { + p_index = (uint16_t *)(&bmp_public_buf[i]); + if (*p_index == 0x0000) *p_index = 0x18C3; + LCD_IO_WriteData(*p_index); + i = i + 2; + } + #endif + W25QXX.init(SPI_QUARTER_SPEED); + if (row < 20) + W25QXX.SPI_FLASH_SectorErase(BAK_VIEW_ADDR_TFT35 + row * 4096); + W25QXX.SPI_FLASH_BufferWrite(bmp_public_buf, BAK_VIEW_ADDR_TFT35 + row * 400, 400); + row++; + if (row >= 200) { + size = 809; + row = 0; + + gcode_preview_over = 0; + //flash_preview_begin = 1; + + card.closefile(); + + /* + if (gCurFileState.file_open_flag != 0xaa) { + reset_file_info(); + res = f_open(file, curFileName, FA_OPEN_EXISTING | FA_READ); + if (res == FR_OK) { + f_lseek(file,PREVIEW_SIZE+To_pre_view); + gCurFileState.file_open_flag = 0xaa; + //bakup_file_path((uint8_t *)curFileName, strlen(curFileName)); + srcfp = file; + mksReprint.mks_printer_state = MKS_WORKING; + once_flag = 0; + } + } + */ + char *cur_name; + + cur_name = strrchr(list_file.file_name[sel_id], '/'); + + SdFile file; + SdFile *curDir; + card.endFilePrint(); + const char * const fname = card.diveToFile(true, curDir, cur_name); + if (!fname) return; + if (file.open(curDir, fname, O_READ)) { + gCfgItems.curFilesize = file.fileSize(); + file.close(); + update_spi_flash(); + } + + card.openFileRead(cur_name); + if (card.isFileOpen()) { + feedrate_percentage = 100; + //saved_feedrate_percentage = feedrate_percentage; + planner.flow_percentage[0] = 100; + planner.e_factor[0] = planner.flow_percentage[0] * 0.01; + if (EXTRUDERS == 2) { + planner.flow_percentage[1] = 100; + planner.e_factor[1] = planner.flow_percentage[1] * 0.01; + } + card.startFileprint(); + TERN_(POWER_LOSS_RECOVERY, recovery.prepare()); + once_flag = 0; + } + return; + } + card.closefile(); + #endif // SDSUPPORT + } + + #endif // if 1 + + void Draw_default_preview(int xpos_pixel, int ypos_pixel, uint8_t sel) { + int index; + int y_off = 0; + int _y; + uint16_t *p_index; + int i; + + for (index = 0; index < 10; index++) { // 200*200 + #if HAS_BAK_VIEW_IN_FLASH + if (sel == 1) { + flash_view_Read(bmp_public_buf, 8000); // 20k + } + else { + default_view_Read(bmp_public_buf, DEFAULT_VIEW_MAX_SIZE / 10); // 20k + #if ENABLED(TFT_LVGL_UI_SPI) + uint16_t Color; + for (i = 0; i < (DEFAULT_VIEW_MAX_SIZE / 10);) { + p_index = (uint16_t *)(&bmp_public_buf[i]); + Color = (*p_index >> 8); + *p_index = Color | ((*p_index & 0xff) << 8); + i += 2; + } + #endif + } + #else + default_view_Read(bmp_public_buf, DEFAULT_VIEW_MAX_SIZE / 10); // 20k + #if ENABLED(TFT_LVGL_UI_SPI) + for (i = 0; i < (DEFAULT_VIEW_MAX_SIZE / 10);) { + p_index = (uint16_t *)(&bmp_public_buf[i]); + Color = (*p_index >> 8); + *p_index = Color | ((*p_index & 0xff) << 8); + i += 2; + } + #endif + #endif + + i = 0; + #if ENABLED(TFT_LVGL_UI_SPI) + + //SPI_TFT.spi_init(SPI_FULL_SPEED); + //SPI_TFT.SetWindows(xpos_pixel, y_off * 20+ypos_pixel, 200,20); //200*200 + //SPI_TFT.LCD_WriteRAM_Prepare(); + int j = 0; + for (_y = y_off * 20; _y < (y_off + 1) * 20; _y++) { + SPI_TFT.spi_init(SPI_FULL_SPEED); + SPI_TFT.SetWindows(xpos_pixel, y_off * 20 + ypos_pixel + j, 200, 1); // 200*200 + SPI_TFT.LCD_WriteRAM_Prepare(); + + j++; + //memcpy(public_buf,&bmp_public_buf[i],400); + SPI_TFT_CS_L; + SPI_TFT_DC_H; + SPI.dmaSend(&bmp_public_buf[i], 400, true); + SPI_TFT_CS_H; + + i += 400; + if (i >= 8000) break; + } + #else + int x_off = 0; + uint16_t temp_p; + ili9320_SetWindows(xpos_pixel, y_off * 20 + ypos_pixel, 200, 20); // 200*200 + + LCD_WriteRAM_Prepare(); + + for (_y = y_off * 20; _y < (y_off + 1) * 20; _y++) { + for (x_off = 0; x_off < 200; x_off++) { + if (sel == 1) { + temp_p = (uint16_t)(bmp_public_buf[i] | bmp_public_buf[i + 1] << 8); + p_index = &temp_p; + } + else { + p_index = (uint16_t *)(&bmp_public_buf[i]); + } + if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; //gCfgItems.preview_bk_color; + LCD_IO_WriteData(*p_index); + i += 2; + } + if (i >= 8000) break; + } + #endif // TFT_LVGL_UI_SPI + y_off++; + } + W25QXX.init(SPI_QUARTER_SPEED); + } + + void disp_pre_gcode(int xpos_pixel, int ypos_pixel) { + if (gcode_preview_over == 1) gcode_preview(list_file.file_name[sel_id], xpos_pixel, ypos_pixel); + #if HAS_BAK_VIEW_IN_FLASH + if (flash_preview_begin == 1) { + flash_preview_begin = 0; + Draw_default_preview(xpos_pixel, ypos_pixel, 1); + } + #endif + #if HAS_GCODE_DEFAULT_VIEW_IN_FLASH + if (default_preview_flg == 1) { + Draw_default_preview(xpos_pixel, ypos_pixel, 0); + default_preview_flg = 0; + } + #endif + } +#endif // HAS_GCODE_PREVIEW + +void print_time_run() { + static uint8_t lastSec = 0; + + if (print_time.seconds >= 60) { + print_time.seconds = 0; + print_time.minutes++; + if (print_time.minutes >= 60) { + print_time.minutes = 0; + print_time.hours++; + } + } + if (disp_state == PRINTING_UI) { + if (lastSec != print_time.seconds) disp_print_time(); + lastSec = print_time.seconds; + } +} + +void GUI_RefreshPage() { + if ((systick_uptime_millis % 1000) == 0) temperature_change_frequency = 1; + if ((systick_uptime_millis % 3000) == 0) printing_rate_update_flag = 1; + + switch (disp_state) { + case MAIN_UI: + //lv_draw_ready_print(); + break; + case EXTRUSION_UI: + if (temperature_change_frequency == 1) { + temperature_change_frequency = 0; + disp_hotend_temp(); + } + break; + case PRE_HEAT_UI: + if (temperature_change_frequency == 1) { + temperature_change_frequency = 0; + disp_desire_temp(); + } + break; + case PRINT_READY_UI: + /* + if (gCfgItems.display_style == 2) { + if (temperature_change_frequency) { + temperature_change_frequency = 0; + disp_restro_state(); + } + } + */ + break; + + case PRINT_FILE_UI: break; + + case PRINTING_UI: + if (temperature_change_frequency) { + temperature_change_frequency = 0; + disp_ext_temp(); + disp_bed_temp(); + disp_fan_speed(); + disp_print_time(); + disp_fan_Zpos(); + } + if (printing_rate_update_flag || marlin_state == MF_SD_COMPLETE) { + printing_rate_update_flag = 0; + if (gcode_preview_over == 0) setProBarRate(); + } + break; + + case OPERATE_UI: + /* + if (temperature_change_frequency == 1) { + temperature_change_frequency = 0; + disp_temp_operate(); + } + + setProBarRateOpera(); + */ + break; + + case PAUSE_UI: + /* + if (temperature_change_frequency == 1) { + temperature_change_frequency = 0; + disp_temp_pause(); + } + */ + break; + + case FAN_UI: + if (temperature_change_frequency == 1) { + temperature_change_frequency = 0; + disp_fan_value(); + } + break; + + case MOVE_MOTOR_UI: + /* + if (mksReprint.mks_printer_state == MKS_IDLE) { + if ((z_high_count==1)&&(temper_error_flg != 1)) { + z_high_count = 0; + { + memset((char *)gCfgItems.move_z_coordinate, ' ', sizeof(gCfgItems.move_z_coordinate)); + GUI_DispStringAt((const char *)gCfgItems.move_z_coordinate, 380, TITLE_YPOS); + sprintf_P((char *)gCfgItems.move_z_coordinate, PSTR("Z: %.3f"), current_position[Z_AXIS]); + GUI_DispStringAt((const char *)gCfgItems.move_z_coordinate, 380, TITLE_YPOS); + } + } + } + */ + break; + + case WIFI_UI: + /* + if (wifi_refresh_flg == 1) { + disp_wifi_state(); + wifi_refresh_flg = 0; + } + */ + break; + case BIND_UI: + /*refresh_bind_ui();*/ + break; + + case FILAMENTCHANGE_UI: + /* + if (temperature_change_frequency) { + temperature_change_frequency = 0; + disp_filament_sprayer_temp(); + } + */ + break; + case DIALOG_UI: + /*filament_dialog_handle(); + wifi_scan_handle();*/ + break; + case MESHLEVELING_UI: + /*disp_zpos();*/ + break; + case HARDWARE_TEST_UI: + break; + case WIFI_LIST_UI: + /* + if (wifi_refresh_flg == 1) { + disp_wifi_list(); + wifi_refresh_flg = 0; + } + */ + break; + case KEY_BOARD_UI: + /*update_password_disp(); + update_join_state_disp();*/ + break; + case TIPS_UI: + /* + switch (tips_type) { + case TIPS_TYPE_JOINING: + if (wifi_link_state == WIFI_CONNECTED && strcmp((const char *)wifi_list.wifiConnectedName, (const char *)wifi_list.wifiName[wifi_list.nameIndex]) == 0) { + tips_disp.timer = TIPS_TIMER_STOP; + tips_disp.timer_count = 0; + Clear_Tips(); + tips_type = TIPS_TYPE_WIFI_CONECTED; + draw_Tips(); + } + if (tips_disp.timer_count >= 30) { + tips_disp.timer = TIPS_TIMER_STOP; + tips_disp.timer_count = 0; + Clear_Tips(); + tips_type = TIPS_TYPE_TAILED_JOIN; + draw_Tips(); + } + break; + case TIPS_TYPE_TAILED_JOIN: + if (tips_disp.timer_count >= 3) { + tips_disp.timer = TIPS_TIMER_STOP; + tips_disp.timer_count = 0; + last_disp_state = TIPS_UI; + Clear_Tips(); + draw_Wifi_list(); + } + break; + case TIPS_TYPE_WIFI_CONECTED: + if (tips_disp.timer_count >= 3) { + tips_disp.timer = TIPS_TIMER_STOP; + tips_disp.timer_count = 0; + + last_disp_state = TIPS_UI; + Clear_Tips(); + draw_Wifi(); + } + break; + default: break; + } + */ + break; + case BABY_STEP_UI: + /* + if (temperature_change_frequency == 1) { + temperature_change_frequency = 0; + disp_z_offset_value(); + } + */ + break; + default: break; + } + + print_time_run(); +} + +void clear_cur_ui() { + last_disp_state = disp_state_stack._disp_state[disp_state_stack._disp_index]; + + switch (disp_state_stack._disp_state[disp_state_stack._disp_index]) { + case PRINT_READY_UI: + //Get_Temperature_Flg = 0; + lv_clear_ready_print(); + break; + case PRINT_FILE_UI: + lv_clear_print_file(); + break; + case PRINTING_UI: + lv_clear_printing(); + break; + case MOVE_MOTOR_UI: + lv_clear_move_motor(); + break; + case OPERATE_UI: + lv_clear_operation(); + break; + case PAUSE_UI: + //Clear_pause(); + break; + case EXTRUSION_UI: + lv_clear_extrusion(); + break; + case PRE_HEAT_UI: + lv_clear_preHeat(); + break; + case CHANGE_SPEED_UI: + lv_clear_change_speed(); + break; + case FAN_UI: + lv_clear_fan(); + break; + case SET_UI: + lv_clear_set(); + break; + case ZERO_UI: + lv_clear_home(); + break; + case SPRAYER_UI: + //Clear_Sprayer(); + break; + case MACHINE_UI: + //Clear_Machine(); + break; + case LANGUAGE_UI: + lv_clear_language(); + break; + case ABOUT_UI: + lv_clear_about(); + break; + case LOG_UI: + //Clear_Connect(); + break; + case DISK_UI: + //Clear_Disk(); + break; + case WIFI_UI: + //Clear_Wifi(); + break; + case MORE_UI: + //Clear_more(); + break; + case FILETRANSFER_UI: + //Clear_fileTransfer(); + break; + case DIALOG_UI: + lv_clear_dialog(); + break; + case FILETRANSFERSTATE_UI: + //Clear_WifiFileTransferdialog(); + break; + case PRINT_MORE_UI: + //Clear_Printmore(); + break; + case LEVELING_UI: + lv_clear_manualLevel(); + break; + case BIND_UI: + //Clear_Bind(); + break; + case ZOFFSET_UI: + //Clear_Zoffset(); + break; + case TOOL_UI: + lv_clear_tool(); + break; + case MESHLEVELING_UI: + //Clear_MeshLeveling(); + break; + case HARDWARE_TEST_UI: + //Clear_Hardwaretest(); + break; + case WIFI_LIST_UI: + //Clear_Wifi_list(); + break; + case KEY_BOARD_UI: + //Clear_Keyboard(); + break; + case TIPS_UI: + //Clear_Tips(); + break; + case MACHINE_PARA_UI: + lv_clear_machine_para(); + break; + case MACHINE_SETTINGS_UI: + lv_clear_machine_settings(); + break; + case TEMPERATURE_SETTINGS_UI: + //Clear_TemperatureSettings(); + break; + case MOTOR_SETTINGS_UI: + lv_clear_motor_settings(); + break; + case MACHINETYPE_UI: + //Clear_MachineType(); + break; + case STROKE_UI: + //Clear_Stroke(); + break; + case HOME_DIR_UI: + //Clear_HomeDir(); + break; + case ENDSTOP_TYPE_UI: + //Clear_EndstopType(); + break; + case FILAMENT_SETTINGS_UI: + //Clear_FilamentSettings(); + break; + case LEVELING_SETTIGNS_UI: + //Clear_LevelingSettings(); + break; + case LEVELING_PARA_UI: + //Clear_LevelingPara(); + break; + case DELTA_LEVELING_PARA_UI: + //Clear_DeltaLevelPara(); + break; + case XYZ_LEVELING_PARA_UI: + //Clear_XYZLevelPara(); + break; + case MAXFEEDRATE_UI: + lv_clear_max_feedrate_settings(); + break; + case STEPS_UI: + lv_clear_step_settings(); + break; + case ACCELERATION_UI: + lv_clear_acceleration_settings(); + break; + case JERK_UI: + #if HAS_CLASSIC_JERK + lv_clear_jerk_settings(); + #endif + break; + case MOTORDIR_UI: + //Clear_MotorDir(); + break; + case HOMESPEED_UI: + //Clear_HomeSpeed(); + break; + case NOZZLE_CONFIG_UI: + //Clear_NozzleConfig(); + break; + case HOTBED_CONFIG_UI: + //Clear_HotbedConfig(); + break; + case ADVANCED_UI: + lv_clear_advance_settings(); + break; + case DOUBLE_Z_UI: + //Clear_DoubleZ(); + break; + case ENABLE_INVERT_UI: + //Clear_EnableInvert(); + break; + case NUMBER_KEY_UI: + lv_clear_number_key(); + break; + case BABY_STEP_UI: + //Clear_babyStep(); + break; + case PAUSE_POS_UI: + lv_clear_pause_position(); + break; + #if HAS_TRINAMIC_CONFIG + case TMC_CURRENT_UI: + lv_clear_tmc_current_settings(); + break; + #endif + case EEPROM_SETTINGS_UI: + lv_clear_eeprom_settings(); + break; + #if HAS_STEALTHCHOP + case TMC_MODE_UI: + lv_clear_tmc_step_mode_settings(); + break; + #endif + default: + break; + } + //GUI_Clear(); +} + +void draw_return_ui() { + if (disp_state_stack._disp_index > 0) { + disp_state_stack._disp_index--; + + switch (disp_state_stack._disp_state[disp_state_stack._disp_index]) { + case PRINT_READY_UI: + lv_draw_ready_print(); + break; + case PRINT_FILE_UI: + lv_draw_print_file(); + break; + case PRINTING_UI: + if (gCfgItems.from_flash_pic == 1) flash_preview_begin = 1; + else default_preview_flg = 1; + lv_draw_printing(); + break; + case MOVE_MOTOR_UI: + lv_draw_move_motor(); + break; + case OPERATE_UI: + lv_draw_operation(); + break; + + #if 1 + case PAUSE_UI: + //draw_pause(); + break; + #endif + + case EXTRUSION_UI: + lv_draw_extrusion(); + break; + case PRE_HEAT_UI: + lv_draw_preHeat(); + break; + case CHANGE_SPEED_UI: + lv_draw_change_speed(); + break; + case FAN_UI: + lv_draw_fan(); + break; + case SET_UI: + lv_draw_set(); + break; + case ZERO_UI: + lv_draw_home(); + break; + case SPRAYER_UI: + //draw_Sprayer(); + break; + case MACHINE_UI: + //draw_Machine(); + break; + case LANGUAGE_UI: + lv_draw_language(); + break; + case ABOUT_UI: + lv_draw_about(); + break; + + #if tan_mask + case LOG_UI: + //draw_Connect(); + break; + #endif + + case CALIBRATE_UI: + //draw_calibrate(); + break; + case DISK_UI: + //draw_Disk(); + break; + case WIFI_UI: + //draw_Wifi(); + break; + case MORE_UI: + //draw_More(); + break; + case PRINT_MORE_UI: + //draw_printmore(); + break; + case FILAMENTCHANGE_UI: + //draw_FilamentChange(); + break; + case LEVELING_UI: + lv_draw_manualLevel(); + break; + case BIND_UI: + //draw_bind(); + break; + + #if tan_mask + case ZOFFSET_UI: + //draw_Zoffset(); + break; + #endif + + case TOOL_UI: + lv_draw_tool(); + break; + case MESHLEVELING_UI: + //draw_meshleveling(); + break; + case HARDWARE_TEST_UI: + //draw_Hardwaretest(); + break; + case WIFI_LIST_UI: + //draw_Wifi_list(); + break; + case KEY_BOARD_UI: + //draw_Keyboard(); + break; + case TIPS_UI: + //draw_Tips(); + break; + case MACHINE_PARA_UI: + lv_draw_machine_para(); + break; + case MACHINE_SETTINGS_UI: + lv_draw_machine_settings(); + break; + case TEMPERATURE_SETTINGS_UI: + //draw_TemperatureSettings(); + break; + case MOTOR_SETTINGS_UI: + lv_draw_motor_settings(); + break; + case MACHINETYPE_UI: + //draw_MachineType(); + break; + case STROKE_UI: + //draw_Stroke(); + break; + case HOME_DIR_UI: + //draw_HomeDir(); + break; + case ENDSTOP_TYPE_UI: + //draw_EndstopType(); + break; + case FILAMENT_SETTINGS_UI: + //draw_FilamentSettings(); + break; + case LEVELING_SETTIGNS_UI: + //draw_LevelingSettings(); + break; + case LEVELING_PARA_UI: + //draw_LevelingPara(); + break; + case DELTA_LEVELING_PARA_UI: + //draw_DeltaLevelPara(); + break; + case XYZ_LEVELING_PARA_UI: + //draw_XYZLevelPara(); + break; + case MAXFEEDRATE_UI: + lv_draw_max_feedrate_settings(); + break; + case STEPS_UI: + lv_draw_step_settings(); + break; + case ACCELERATION_UI: + lv_draw_acceleration_settings(); + break; + case JERK_UI: + #if HAS_CLASSIC_JERK + lv_draw_jerk_settings(); + #endif + break; + case MOTORDIR_UI: + //draw_MotorDir(); + break; + case HOMESPEED_UI: + //draw_HomeSpeed(); + break; + case NOZZLE_CONFIG_UI: + //draw_NozzleConfig(); + break; + case HOTBED_CONFIG_UI: + //draw_HotbedConfig(); + break; + case ADVANCED_UI: + lv_draw_advance_settings(); + break; + case DOUBLE_Z_UI: + //draw_DoubleZ(); + break; + case ENABLE_INVERT_UI: + //draw_EnableInvert(); + break; + case NUMBER_KEY_UI: + lv_draw_number_key(); + break; + case DIALOG_UI: + //draw_dialog(DialogType); + break; + case BABY_STEP_UI: + //draw_babyStep(); + break; + case PAUSE_POS_UI: + lv_draw_pause_position(); + break; + #if HAS_TRINAMIC_CONFIG + case TMC_CURRENT_UI: + lv_draw_tmc_current_settings(); + break; + #endif + case EEPROM_SETTINGS_UI: + lv_draw_eeprom_settings(); + break; + #if HAS_STEALTHCHOP + case TMC_MODE_UI: + lv_draw_tmc_step_mode_settings(); + break; + #endif + default: break; + } + } +} + +#if ENABLED(SDSUPPORT) + + void sd_detection() { + 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(); else card.release(); + } + } + +#endif + +void lv_ex_line(lv_obj_t * line, lv_point_t *points) { + /*Copy the previous line and apply the new style*/ + lv_line_set_points(line, points, 2); /*Set the points*/ + lv_line_set_style(line, LV_LINE_STYLE_MAIN, &style_line); + lv_obj_align(line, NULL, LV_ALIGN_IN_TOP_MID, 0, 0); +} + +extern volatile uint32_t systick_uptime_millis; + +void print_time_count() { + if ((systick_uptime_millis % 1000) == 0) + if (print_time.start == 1) print_time.seconds++; +} + +void LV_TASK_HANDLER() { + //lv_tick_inc(1); + lv_task_handler(); + if (mks_test_flag == 0x1e) mks_hardware_test(); + #if HAS_GCODE_PREVIEW + disp_pre_gcode(2, 36); + #endif + GUI_RefreshPage(); + //sd_detection(); +} + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h new file mode 100644 index 0000000000..595565e1c7 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h @@ -0,0 +1,332 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus + extern "C" { /* C-declarations for C++ */ +#endif + +#include + +#include +#include + +// the colors of the last MKS Ui +#undef LV_COLOR_BACKGROUND +#define LV_COLOR_BACKGROUND LV_COLOR_MAKE(0x1A, 0x1A, 0x1A) // LV_COLOR_MAKE(0x00, 0x00, 0x00) + +#include "tft_multi_language.h" +#include "draw_ready_print.h" +#include "draw_language.h" +#include "draw_set.h" +#include "draw_tool.h" +#include "draw_print_file.h" +#include "draw_dialog.h" +#include "draw_printing.h" +#include "draw_operation.h" +#include "draw_preHeat.h" +#include "draw_extrusion.h" +#include "draw_home.h" +#include "draw_move_motor.h" +#include "draw_fan.h" +#include "draw_about.h" +#include "draw_change_speed.h" +#include "draw_manuaLevel.h" +#include "draw_error_message.h" +#include "printer_operation.h" +#include "draw_machine_para.h" +#include "draw_machine_settings.h" +#include "draw_motor_settings.h" +#include "draw_advance_settings.h" +#include "draw_acceleration_settings.h" +#include "draw_number_key.h" +#include "draw_jerk_settings.h" +#include "draw_pause_position.h" +#include "draw_step_settings.h" +#include "draw_tmc_current_settings.h" +#include "draw_eeprom_settings.h" +#include "draw_max_feedrate_settings.h" +#include "draw_tmc_step_mode_settings.h" + +#include "../../inc/MarlinConfigPre.h" + +#define TFT35 + +#ifdef TFT35 + + #define TFT_WIDTH 480 + #define TFT_HEIGHT 320 + + #define titleHeight 36 // TFT_screen.title_high + #define INTERVAL_H 2 // TFT_screen.gap_h // 2 + #define INTERVAL_V 2 // TFT_screen.gap_v // 2 + #define BTN_X_PIXEL 117 // TFT_screen.btn_x_pixel + #define BTN_Y_PIXEL 140 // TFT_screen.btn_y_pixel + + #define SIMPLE_FIRST_PAGE_GRAP 30 + + #define BUTTON_TEXT_Y_OFFSET -20 + + #define TITLE_XPOS 3 // TFT_screen.title_xpos + #define TITLE_YPOS 5 // TFT_screen.title_ypos + + #define FILE_BTN_CNT 6 + + #define OTHER_BTN_XPIEL 117 + #define OTHER_BTN_YPIEL 92 + + #define FILE_PRE_PIC_X_OFFSET 8 + #define FILE_PRE_PIC_Y_OFFSET 0 + + #define PREVIEW_LITTLE_PIC_SIZE 40910 // 400*100+9*101+1 + #define PREVIEW_SIZE 202720 // (PREVIEW_LITTLE_PIC_SIZE+800*200+201*9+1) + + #define GCFG_FLAG_VALUE 0xEE + + // machine parameter ui + #define PARA_UI_POS_X 10 + #define PARA_UI_POS_Y 50 + + #define PARA_UI_SIZE_X 450 + #define PARA_UI_SIZE_Y 40 + + #define PARA_UI_ARROW_V 12 + + #define PARA_UI_BACL_POS_X 400 + #define PARA_UI_BACL_POS_Y 270 + + #define PARA_UI_TURN_PAGE_POS_X 320 + #define PARA_UI_TURN_PAGE_POS_Y 270 + + #define PARA_UI_VALUE_SIZE_X 370 + #define PARA_UI_VALUE_POS_X 400 + #define PARA_UI_VALUE_V 5 + + #define PARA_UI_STATE_POS_X 380 + #define PARA_UI_STATE_V 2 + +#else // ifdef TFT35 + + #define TFT_WIDTH 320 + #define TFT_HEIGHT 240 + +#endif // ifdef TFT35 + +extern char public_buf_m[100]; +extern char public_buf_l[30]; + +typedef struct { + uint8_t spi_flash_flag; + uint8_t multiple_language; + uint8_t language; + uint8_t leveling_mode; + uint8_t from_flash_pic; + uint8_t finish_power_off; + uint8_t pause_reprint; + float pausePosX; + float pausePosY; + float pausePosZ; + uint32_t curFilesize; +} CFG_ITMES; + +typedef struct { + uint8_t curTempType : 1, + curSprayerChoose : 3, + stepHeat : 4; + uint8_t leveling_first_time : 1, + para_ui_page : 1; + uint8_t extruStep; + uint8_t extruSpeed; + uint8_t print_state; + uint8_t stepPrintSpeed; + uint8_t waitEndMoves; + uint16_t moveSpeed; + float move_dist; + uint8_t F[4]; +} UI_CFG; + +typedef enum { + MAIN_UI, + PRINT_READY_UI, + PRINT_FILE_UI, + PRINTING_UI, + MOVE_MOTOR_UI, + OPERATE_UI, + PAUSE_UI, + EXTRUSION_UI, + FAN_UI, + PRE_HEAT_UI, + CHANGE_SPEED_UI, + TEMP_UI, + SET_UI, + ZERO_UI, + SPRAYER_UI, + MACHINE_UI, + LANGUAGE_UI, + ABOUT_UI, + LOG_UI, + DISK_UI, + CALIBRATE_UI, + DIALOG_UI, + WIFI_UI, + MORE_UI, + FILETRANSFER_UI, + FILETRANSFERSTATE_UI, + PRINT_MORE_UI, + FILAMENTCHANGE_UI, + LEVELING_UI, + MESHLEVELING_UI, + BIND_UI, + ZOFFSET_UI, + TOOL_UI, + HARDWARE_TEST_UI, + WIFI_LIST_UI, + KEY_BOARD_UI, + TIPS_UI, + MACHINE_PARA_UI, + MACHINE_SETTINGS_UI, + TEMPERATURE_SETTINGS_UI, + MOTOR_SETTINGS_UI, + MACHINETYPE_UI, + STROKE_UI, + HOME_DIR_UI, + ENDSTOP_TYPE_UI, + FILAMENT_SETTINGS_UI, + LEVELING_SETTIGNS_UI, + LEVELING_PARA_UI, + DELTA_LEVELING_PARA_UI, + XYZ_LEVELING_PARA_UI, + MAXFEEDRATE_UI, + STEPS_UI, + ACCELERATION_UI, + JERK_UI, + MOTORDIR_UI, + HOMESPEED_UI, + NOZZLE_CONFIG_UI, + HOTBED_CONFIG_UI, + ADVANCED_UI, + DOUBLE_Z_UI, + ENABLE_INVERT_UI, + NUMBER_KEY_UI, + BABY_STEP_UI, + ERROR_MESSAGE_UI, + PAUSE_POS_UI, + TMC_CURRENT_UI, + TMC_MODE_UI, + EEPROM_SETTINGS_UI +} DISP_STATE; + +typedef struct { + DISP_STATE _disp_state[100]; + int _disp_index; +} DISP_STATE_STACK; + +typedef struct { + int16_t days; + uint16_t hours; + uint8_t minutes; + volatile int8_t seconds; + int8_t ms_10; + int8_t start; +} PRINT_TIME; +extern PRINT_TIME print_time; + +typedef enum { + PrintAcceleration, + RetractAcceleration, + TravelAcceleration, + XAcceleration, + YAcceleration, + ZAcceleration, + E0Acceleration, + E1Acceleration, + + XMaxFeedRate, + YMaxFeedRate, + ZMaxFeedRate, + E0MaxFeedRate, + E1MaxFeedRate, + + XJerk, + YJerk, + ZJerk, + EJerk, + + Xstep, + Ystep, + Zstep, + E0step, + E1step, + + Xcurrent, + Ycurrent, + Zcurrent, + E0current, + E1current, + + pause_pos_x, + pause_pos_y, + pause_pos_z + +}value_state; +extern value_state value; + +extern CFG_ITMES gCfgItems; +extern UI_CFG uiCfg; +extern DISP_STATE disp_state; +extern DISP_STATE last_disp_state; +extern DISP_STATE_STACK disp_state_stack; + +extern lv_style_t tft_style_scr; +extern lv_style_t tft_style_label_pre; +extern lv_style_t tft_style_label_rel; +extern lv_style_t style_line; +extern lv_style_t style_para_value_pre; +extern lv_style_t style_para_value_rel; +extern lv_style_t style_num_key_pre; +extern lv_style_t style_num_key_rel; +extern lv_style_t style_num_text; + +extern lv_point_t line_points[4][2]; + +extern void gCfgItems_init(); +extern void ui_cfg_init(); +extern void tft_style_init(); +extern char *creat_title_text(void); +extern void preview_gcode_prehandle(char *path); +extern void update_spi_flash(); +#if HAS_GCODE_PREVIEW + extern void disp_pre_gcode(int xpos_pixel, int ypos_pixel); +#endif +extern void GUI_RefreshPage(); +extern void clear_cur_ui(); +extern void draw_return_ui(); +extern void sd_detection(); +extern void gCfg_to_spiFlah(); +extern void print_time_count(); + +extern void LV_TASK_HANDLER(); +extern void lv_ex_line(lv_obj_t * line, lv_point_t *points); + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp b/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp new file mode 100644 index 0000000000..856d645e9e --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp @@ -0,0 +1,115 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "pic_manager.h" +#include + +#include "../../../../inc/MarlinConfig.h" + +#if HAS_SPI_FLASH_FONT + +typedef struct { + uint16_t min; + uint16_t max; + uint8_t bpp; + uint8_t reserved[3]; +} x_header_t; + +typedef struct { + uint32_t pos; +} x_table_t; + +typedef struct { + uint8_t adv_w; + uint8_t box_w; +} glyph_dsc_t; + +static x_header_t __g_xbf_hd = { .min = 0, .max = 0, .bpp = 0 }; +static uint8_t __g_font_buf[63]; + +static uint8_t *__user_font_getdata(int offset, int size) { + //ZERO(__g_font_buf); + get_spi_flash_data((char *)__g_font_buf, offset, size); + return __g_font_buf; + //return &buf_test[offset]; +} + +static const uint8_t * __user_font_get_bitmap(const lv_font_t * font, uint32_t unicode_letter) { + if (__g_xbf_hd.max == 0) { + uint8_t *p = __user_font_getdata(0, sizeof(x_header_t)); + memcpy(&__g_xbf_hd, p, sizeof(x_header_t)); + } + if (unicode_letter > __g_xbf_hd.max || unicode_letter < __g_xbf_hd.min) + return NULL; + uint32_t unicode_offset = sizeof(x_header_t) + (unicode_letter - __g_xbf_hd.min) * 4; + uint32_t *p_pos = (uint32_t *)__user_font_getdata(unicode_offset, 4); + if (p_pos[0] != 0) { + uint32_t pos = p_pos[0]; + //glyph_dsc_t * gdsc = (glyph_dsc_t*)__user_font_getdata(pos, 2); + __user_font_getdata(pos, 2); + //return __user_font_getdata(pos+2, gdsc->box_w*__g_xbf_hd.bpp/8); + return __user_font_getdata(pos + 2, sizeof(__g_font_buf)); + } + return NULL; +} + +static bool __user_font_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { + if (__g_xbf_hd.max == 0) { + uint8_t *p = __user_font_getdata(0, sizeof(x_header_t)); + memcpy(&__g_xbf_hd, p, sizeof(x_header_t)); + } + if (unicode_letter > __g_xbf_hd.max || unicode_letter < __g_xbf_hd.min) + return NULL; + uint32_t unicode_offset = sizeof(x_header_t) + (unicode_letter - __g_xbf_hd.min) * 4; + uint32_t *p_pos = (uint32_t *)__user_font_getdata(unicode_offset, 4); + if (p_pos[0] != 0) { + glyph_dsc_t * gdsc = (glyph_dsc_t*)__user_font_getdata(p_pos[0], 2); + dsc_out->adv_w = gdsc->adv_w; + dsc_out->box_h = font->line_height; + dsc_out->box_w = gdsc->box_w; + dsc_out->ofs_x = 0; + dsc_out->ofs_y = 0; + dsc_out->bpp = __g_xbf_hd.bpp; + return true; + } + return false; +} + +/*lv_font_t gb2312_puhui32 = { +.get_glyph_bitmap = __user_font_get_bitmap, +.get_glyph_dsc = __user_font_get_glyph_dsc, +.line_height = 25, +.base_line = 0, +};*/ +lv_font_t gb2312_puhui32; +void init_gb2312_font() { + gb2312_puhui32.get_glyph_bitmap = __user_font_get_bitmap; + gb2312_puhui32.get_glyph_dsc = __user_font_get_glyph_dsc; + gb2312_puhui32.line_height = 21; + gb2312_puhui32.base_line = 0; +} + +#endif // HAS_SPI_FLASH_FONT +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp new file mode 100644 index 0000000000..b5b77c50b2 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp @@ -0,0 +1,627 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#if ENABLED(TFT_LVGL_UI_SPI) + #include "SPI_TFT.h" +#endif + +#include "tft_lvgl_configuration.h" +#include "draw_ready_print.h" +#include "W25Qxx.h" +#include "mks_hardware_test.h" +#include "draw_ui.h" +#include "pic_manager.h" +#include + +#include "../../../../MarlinCore.h" +#include "../../../../module/temperature.h" +#include "../../../../feature/touch/xpt2046.h" +#include "../../../../sd/cardreader.h" + +uint8_t pw_det_sta, pw_off_sta, mt_det_sta, mt_det2_sta, mt_det3_sta; +uint8_t endstopx1_sta, endstopx2_sta, endstopy1_sta, endstopy2_sta, endstopz1_sta, endstopz2_sta; +void test_gpio_readlevel_L() { + #if ENABLED(MKS_TEST) + volatile uint32_t itest; + WRITE(WIFI_IO0_PIN, HIGH); + itest = 10000; + while (itest--); + pw_det_sta = (READ(POWER_LOSS_PIN) == 0); + pw_off_sta = (READ(PS_ON_PIN) == 0); + mt_det_sta = (READ(MT_DET_1_PIN) == 0); + mt_det2_sta = (READ(MT_DET_2_PIN) == 0); + //mt_det3_sta = (READ(FIL_RUNOUT_3_PIN) == 0); + endstopx1_sta = (READ(X_MIN_PIN) == 0); + endstopx2_sta = (READ(X_MAX_PIN) == 0); + endstopy1_sta = (READ(Y_MIN_PIN) == 0); + endstopy2_sta = (READ(Y_MAX_PIN) == 0); + endstopz1_sta = (READ(Z_MIN_PIN) == 0); + endstopz2_sta = (READ(Z_MAX_PIN) == 0); + #endif +} + +void test_gpio_readlevel_H() { + #if ENABLED(MKS_TEST) + volatile uint32_t itest; + WRITE(WIFI_IO0_PIN, LOW); + itest = 10000; + while (itest--); + pw_det_sta = (READ(POWER_LOSS_PIN) == 1); + pw_off_sta = (READ(PS_ON_PIN) == 1); + mt_det_sta = (READ(MT_DET_1_PIN) == 1); + mt_det2_sta = (READ(MT_DET_2_PIN) == 1); + //mt_det3_sta = (READ(MT_DET_3_PIN) == 1); + endstopx1_sta = (READ(X_MIN_PIN) == 1); + endstopx2_sta = (READ(X_MAX_PIN) == 1); + endstopy1_sta = (READ(Y_MIN_PIN) == 1); + endstopy2_sta = (READ(Y_MAX_PIN) == 1); + endstopz1_sta = (READ(Z_MIN_PIN) == 1); + endstopz2_sta = (READ(Z_MAX_PIN) == 1); + #endif +} + +void init_test_gpio() { + #ifdef MKS_TEST + SET_INPUT_PULLUP(X_MIN_PIN); + SET_INPUT_PULLUP(X_MAX_PIN); + SET_INPUT_PULLUP(Y_MIN_PIN); + SET_INPUT_PULLUP(Y_MAX_PIN); + SET_INPUT_PULLUP(Z_MIN_PIN); + SET_INPUT_PULLUP(Z_MAX_PIN); + + SET_OUTPUT(WIFI_IO0_PIN); + + SET_INPUT_PULLUP(MT_DET_1_PIN); + SET_INPUT_PULLUP(MT_DET_2_PIN); + //SET_INPUT_PULLUP(MT_DET_3_PIN); + + SET_INPUT_PULLUP(POWER_LOSS_PIN); + SET_INPUT_PULLUP(PS_ON_PIN); + + SET_INPUT_PULLUP(SERVO0_PIN); + + SET_OUTPUT(X_ENABLE_PIN); + SET_OUTPUT(Y_ENABLE_PIN); + SET_OUTPUT(Z_ENABLE_PIN); + SET_OUTPUT(E0_ENABLE_PIN); + SET_OUTPUT(E1_ENABLE_PIN); + + WRITE(X_ENABLE_PIN, LOW); + WRITE(Y_ENABLE_PIN, LOW); + WRITE(Z_ENABLE_PIN, LOW); + WRITE(E0_ENABLE_PIN, LOW); + WRITE(E1_ENABLE_PIN, LOW); + //WRITE(E2_ENABLE_PIN, LOW); + #endif +} + +void mks_test_beeper() { + #ifdef MKS_TEST + WRITE(BEEPER_PIN, HIGH); + delay(100); + WRITE(BEEPER_PIN, LOW); + delay(100); + #endif +} + +void mks_gpio_test(){ + #if ENABLED(MKS_TEST) + init_test_gpio(); + + test_gpio_readlevel_L(); + test_gpio_readlevel_H(); + test_gpio_readlevel_L(); + if ((pw_det_sta == 1) && (mt_det_sta == 1) && (mt_det2_sta == 1)) // &&(mt_det3_sta == 1)) + disp_det_ok(); + else + disp_det_error(); + + if ( (endstopx1_sta == 1) + && (endstopx2_sta == 1) + && (endstopy1_sta == 1) + && (endstopy2_sta == 1) + && (endstopz1_sta == 1) + && (endstopz2_sta == 1) + ) + disp_Limit_ok(); + else + disp_Limit_error(); + #endif +} + +void mks_hardware_test(){ + #if ENABLED(MKS_TEST) + if (millis() % 2000 < 1000) { + WRITE(X_DIR_PIN, LOW); + WRITE(Y_DIR_PIN, LOW); + WRITE(Z_DIR_PIN, LOW); + WRITE(E0_DIR_PIN, LOW); + WRITE(E1_DIR_PIN, LOW); + //WRITE(E2_DIR_PIN, LOW); + thermalManager.fan_speed[0] = 255; + //WRITE(HEATER_2_PIN, HIGH); // HE2 + WRITE(HEATER_1_PIN, HIGH); // HE1 + WRITE(HEATER_0_PIN, HIGH); // HE0 + WRITE(HEATER_BED_PIN, HIGH); // HOT-BED + } + else { + WRITE(X_DIR_PIN, HIGH); + WRITE(Y_DIR_PIN, HIGH); + WRITE(Z_DIR_PIN, HIGH); + WRITE(E0_DIR_PIN, HIGH); + WRITE(E1_DIR_PIN, HIGH); + //WRITE(E2_DIR_PIN, HIGH); + thermalManager.fan_speed[0] = 0; + //WRITE(HEATER_2_PIN, LOW); // HE2 + WRITE(HEATER_1_PIN, LOW); // HE1 + WRITE(HEATER_0_PIN, LOW); // HE0 + WRITE(HEATER_BED_PIN, LOW); // HOT-BED + } + + if ( (endstopx1_sta == 1) && (endstopx2_sta == 1) + && (endstopy1_sta == 1) && (endstopy2_sta == 1) + && (endstopz1_sta == 1) && (endstopz2_sta == 1) + ) { + // nothing here + } + else { + //mks_test_beeper(); + } + + if (disp_state == PRINT_READY_UI) + mks_disp_test(); + + #endif +} + +static const uint16_t ASCII_Table_16x24[] PROGMEM = { + // Space ' ' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '!' + 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, 0x0000, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '"' + 0x0000, 0x0000, 0x00CC, 0x00CC, 0x00CC, 0x00CC, 0x00CC, 0x00CC, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '#' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0C60, 0x0C60, + 0x0C60, 0x0630, 0x0630, 0x1FFE, 0x1FFE, 0x0630, 0x0738, 0x0318, + 0x1FFE, 0x1FFE, 0x0318, 0x0318, 0x018C, 0x018C, 0x018C, 0x0000, + // '$' + 0x0000, 0x0080, 0x03E0, 0x0FF8, 0x0E9C, 0x1C8C, 0x188C, 0x008C, + 0x0098, 0x01F8, 0x07E0, 0x0E80, 0x1C80, 0x188C, 0x188C, 0x189C, + 0x0CB8, 0x0FF0, 0x03E0, 0x0080, 0x0080, 0x0000, 0x0000, 0x0000, + // '%' + 0x0000, 0x0000, 0x0000, 0x180E, 0x0C1B, 0x0C11, 0x0611, 0x0611, + 0x0311, 0x0311, 0x019B, 0x018E, 0x38C0, 0x6CC0, 0x4460, 0x4460, + 0x4430, 0x4430, 0x4418, 0x6C18, 0x380C, 0x0000, 0x0000, 0x0000, + // '&' + 0x0000, 0x01E0, 0x03F0, 0x0738, 0x0618, 0x0618, 0x0330, 0x01F0, + 0x00F0, 0x00F8, 0x319C, 0x330E, 0x1E06, 0x1C06, 0x1C06, 0x3F06, + 0x73FC, 0x21F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // "'" + 0x0000, 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '(' + 0x0000, 0x0200, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x0060, 0x0060, + 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0060, 0x0060, 0x00C0, 0x00C0, 0x0180, 0x0300, 0x0200, 0x0000, + // ')' + 0x0000, 0x0020, 0x0060, 0x00C0, 0x0180, 0x0180, 0x0300, 0x0300, + 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, + 0x0300, 0x0300, 0x0180, 0x0180, 0x00C0, 0x0060, 0x0020, 0x0000, + // '*' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, + 0x06D8, 0x07F8, 0x01E0, 0x0330, 0x0738, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '+' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x3FFC, 0x3FFC, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // ',' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0180, 0x0180, 0x0100, 0x0100, 0x0080, 0x0000, 0x0000, + // '-' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x07E0, 0x07E0, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '.' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '/' + 0x0000, 0x0C00, 0x0C00, 0x0600, 0x0600, 0x0600, 0x0300, 0x0300, + 0x0300, 0x0380, 0x0180, 0x0180, 0x0180, 0x00C0, 0x00C0, 0x00C0, + 0x0060, 0x0060, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '0' + 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C18, 0x180C, 0x180C, 0x180C, + 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x0C18, 0x0E38, + 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '1' + 0x0000, 0x0100, 0x0180, 0x01C0, 0x01F0, 0x0198, 0x0188, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '2' + 0x0000, 0x03E0, 0x0FF8, 0x0C18, 0x180C, 0x180C, 0x1800, 0x1800, + 0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, + 0x1FFC, 0x1FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '3' + 0x0000, 0x01E0, 0x07F8, 0x0E18, 0x0C0C, 0x0C0C, 0x0C00, 0x0600, + 0x03C0, 0x07C0, 0x0C00, 0x1800, 0x1800, 0x180C, 0x180C, 0x0C18, + 0x07F8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '4' + 0x0000, 0x0C00, 0x0E00, 0x0F00, 0x0F00, 0x0D80, 0x0CC0, 0x0C60, + 0x0C60, 0x0C30, 0x0C18, 0x0C0C, 0x3FFC, 0x3FFC, 0x0C00, 0x0C00, + 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '5' + 0x0000, 0x0FF8, 0x0FF8, 0x0018, 0x0018, 0x000C, 0x03EC, 0x07FC, + 0x0E1C, 0x1C00, 0x1800, 0x1800, 0x1800, 0x180C, 0x0C1C, 0x0E18, + 0x07F8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '6' + 0x0000, 0x07C0, 0x0FF0, 0x1C38, 0x1818, 0x0018, 0x000C, 0x03CC, + 0x0FEC, 0x0E3C, 0x1C1C, 0x180C, 0x180C, 0x180C, 0x1C18, 0x0E38, + 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '7' + 0x0000, 0x1FFC, 0x1FFC, 0x0C00, 0x0600, 0x0600, 0x0300, 0x0380, + 0x0180, 0x01C0, 0x00C0, 0x00E0, 0x0060, 0x0060, 0x0070, 0x0030, + 0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '8' + 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C18, 0x0C18, 0x0C18, 0x0638, + 0x07F0, 0x07F0, 0x0C18, 0x180C, 0x180C, 0x180C, 0x180C, 0x0C38, + 0x0FF8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '9' + 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C1C, 0x180C, 0x180C, 0x180C, + 0x1C1C, 0x1E38, 0x1BF8, 0x19E0, 0x1800, 0x0C00, 0x0C00, 0x0E1C, + 0x07F8, 0x01F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // ':' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // ';' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0180, 0x0180, 0x0100, 0x0100, 0x0080, 0x0000, 0x0000, 0x0000, + // '<' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1000, 0x1C00, 0x0F80, 0x03E0, 0x00F8, 0x0018, 0x00F8, 0x03E0, + 0x0F80, 0x1C00, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '=' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1FF8, 0x0000, 0x0000, 0x0000, 0x1FF8, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '>' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0008, 0x0038, 0x01F0, 0x07C0, 0x1F00, 0x1800, 0x1F00, 0x07C0, + 0x01F0, 0x0038, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '?' + 0x0000, 0x03E0, 0x0FF8, 0x0C18, 0x180C, 0x180C, 0x1800, 0x0C00, + 0x0600, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x00C0, 0x0000, 0x0000, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '@' + 0x0000, 0x0000, 0x07E0, 0x1818, 0x2004, 0x29C2, 0x4A22, 0x4411, + 0x4409, 0x4409, 0x4409, 0x2209, 0x1311, 0x0CE2, 0x4002, 0x2004, + 0x1818, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'A' + 0x0000, 0x0380, 0x0380, 0x06C0, 0x06C0, 0x06C0, 0x0C60, 0x0C60, + 0x1830, 0x1830, 0x1830, 0x3FF8, 0x3FF8, 0x701C, 0x600C, 0x600C, + 0xC006, 0xC006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'B' + 0x0000, 0x03FC, 0x0FFC, 0x0C0C, 0x180C, 0x180C, 0x180C, 0x0C0C, + 0x07FC, 0x0FFC, 0x180C, 0x300C, 0x300C, 0x300C, 0x300C, 0x180C, + 0x1FFC, 0x07FC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'C' + 0x0000, 0x07C0, 0x1FF0, 0x3838, 0x301C, 0x700C, 0x6006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x6006, 0x700C, 0x301C, + 0x1FF0, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'D' + 0x0000, 0x03FE, 0x0FFE, 0x0E06, 0x1806, 0x1806, 0x3006, 0x3006, + 0x3006, 0x3006, 0x3006, 0x3006, 0x3006, 0x1806, 0x1806, 0x0E06, + 0x0FFE, 0x03FE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'E' + 0x0000, 0x3FFC, 0x3FFC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x1FFC, 0x1FFC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x3FFC, 0x3FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'F' + 0x0000, 0x3FF8, 0x3FF8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x1FF8, 0x1FF8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x0018, 0x0018, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'G' + 0x0000, 0x0FE0, 0x3FF8, 0x783C, 0x600E, 0xE006, 0xC007, 0x0003, + 0x0003, 0xFE03, 0xFE03, 0xC003, 0xC007, 0xC006, 0xC00E, 0xF03C, + 0x3FF8, 0x0FE0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'H' + 0x0000, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x3FFC, 0x3FFC, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x300C, 0x300C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'I' + 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'J' + 0x0000, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, + 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0618, 0x0618, 0x0738, + 0x03F0, 0x01E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'K' + 0x0000, 0x3006, 0x1806, 0x0C06, 0x0606, 0x0306, 0x0186, 0x00C6, + 0x0066, 0x0076, 0x00DE, 0x018E, 0x0306, 0x0606, 0x0C06, 0x1806, + 0x3006, 0x6006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'L' + 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x1FF8, 0x1FF8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'M' + 0x0000, 0xE00E, 0xF01E, 0xF01E, 0xF01E, 0xD836, 0xD836, 0xD836, + 0xD836, 0xCC66, 0xCC66, 0xCC66, 0xC6C6, 0xC6C6, 0xC6C6, 0xC6C6, + 0xC386, 0xC386, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'N' + 0x0000, 0x300C, 0x301C, 0x303C, 0x303C, 0x306C, 0x306C, 0x30CC, + 0x30CC, 0x318C, 0x330C, 0x330C, 0x360C, 0x360C, 0x3C0C, 0x3C0C, + 0x380C, 0x300C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'O' + 0x0000, 0x07E0, 0x1FF8, 0x381C, 0x700E, 0x6006, 0xC003, 0xC003, + 0xC003, 0xC003, 0xC003, 0xC003, 0xC003, 0x6006, 0x700E, 0x381C, + 0x1FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'P' + 0x0000, 0x0FFC, 0x1FFC, 0x380C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x180C, 0x1FFC, 0x07FC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'Q' + 0x0000, 0x07E0, 0x1FF8, 0x381C, 0x700E, 0x6006, 0xE003, 0xC003, + 0xC003, 0xC003, 0xC003, 0xC003, 0xE007, 0x6306, 0x3F0E, 0x3C1C, + 0x3FF8, 0xF7E0, 0xC000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'R' + 0x0000, 0x0FFE, 0x1FFE, 0x3806, 0x3006, 0x3006, 0x3006, 0x3806, + 0x1FFE, 0x07FE, 0x0306, 0x0606, 0x0C06, 0x1806, 0x1806, 0x3006, + 0x3006, 0x6006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'S' + 0x0000, 0x03E0, 0x0FF8, 0x0C1C, 0x180C, 0x180C, 0x000C, 0x001C, + 0x03F8, 0x0FE0, 0x1E00, 0x3800, 0x3006, 0x3006, 0x300E, 0x1C1C, + 0x0FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'T' + 0x0000, 0x7FFE, 0x7FFE, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'U' + 0x0000, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x1818, + 0x1FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'V' + 0x0000, 0x6003, 0x3006, 0x3006, 0x3006, 0x180C, 0x180C, 0x180C, + 0x0C18, 0x0C18, 0x0E38, 0x0630, 0x0630, 0x0770, 0x0360, 0x0360, + 0x01C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'W' + 0x0000, 0x6003, 0x61C3, 0x61C3, 0x61C3, 0x3366, 0x3366, 0x3366, + 0x3366, 0x3366, 0x3366, 0x1B6C, 0x1B6C, 0x1B6C, 0x1A2C, 0x1E3C, + 0x0E38, 0x0E38, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'X' + 0x0000, 0xE00F, 0x700C, 0x3018, 0x1830, 0x0C70, 0x0E60, 0x07C0, + 0x0380, 0x0380, 0x03C0, 0x06E0, 0x0C70, 0x1C30, 0x1818, 0x300C, + 0x600E, 0xE007, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'Y' + 0x0000, 0xC003, 0x6006, 0x300C, 0x381C, 0x1838, 0x0C30, 0x0660, + 0x07E0, 0x03C0, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'Z' + 0x0000, 0x7FFC, 0x7FFC, 0x6000, 0x3000, 0x1800, 0x0C00, 0x0600, + 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, 0x000C, 0x0006, + 0x7FFE, 0x7FFE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '[' + 0x0000, 0x03E0, 0x03E0, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, + 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, + 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x03E0, 0x03E0, 0x0000, + // '\' + 0x0000, 0x0030, 0x0030, 0x0060, 0x0060, 0x0060, 0x00C0, 0x00C0, + 0x00C0, 0x01C0, 0x0180, 0x0180, 0x0180, 0x0300, 0x0300, 0x0300, + 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // ']' + 0x0000, 0x03E0, 0x03E0, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, + 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, + 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x03E0, 0x03E0, 0x0000, + // '^' + 0x0000, 0x0000, 0x01C0, 0x01C0, 0x0360, 0x0360, 0x0360, 0x0630, + 0x0630, 0x0C18, 0x0C18, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '_' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // ''' + 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'a' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03F0, 0x07F8, + 0x0C1C, 0x0C0C, 0x0F00, 0x0FF0, 0x0CF8, 0x0C0C, 0x0C0C, 0x0F1C, + 0x0FF8, 0x18F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'b' + 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x03D8, 0x0FF8, + 0x0C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C38, + 0x0FF8, 0x03D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'c' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x07F0, + 0x0E30, 0x0C18, 0x0018, 0x0018, 0x0018, 0x0018, 0x0C18, 0x0E30, + 0x07F0, 0x03C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'd' + 0x0000, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x1BC0, 0x1FF0, + 0x1C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C30, + 0x1FF0, 0x1BC0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'e' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x0FF0, + 0x0C30, 0x1818, 0x1FF8, 0x1FF8, 0x0018, 0x0018, 0x1838, 0x1C30, + 0x0FF0, 0x07C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'f' + 0x0000, 0x0F80, 0x0FC0, 0x00C0, 0x00C0, 0x00C0, 0x07F0, 0x07F0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'g' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0DE0, 0x0FF8, + 0x0E18, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0E18, + 0x0FF8, 0x0DE0, 0x0C00, 0x0C0C, 0x061C, 0x07F8, 0x01F0, 0x0000, + // 'h' + 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x07D8, 0x0FF8, + 0x1C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, + 0x1818, 0x1818, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'i' + 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'j' + 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00F8, 0x0078, 0x0000, + // 'k' + 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0C0C, 0x060C, + 0x030C, 0x018C, 0x00CC, 0x006C, 0x00FC, 0x019C, 0x038C, 0x030C, + 0x060C, 0x0C0C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'l' + 0x0000, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'm' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3C7C, 0x7EFF, + 0xE3C7, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, + 0xC183, 0xC183, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'n' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0798, 0x0FF8, + 0x1C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, + 0x1818, 0x1818, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'o' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x0FF0, + 0x0C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C30, + 0x0FF0, 0x03C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'p' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03D8, 0x0FF8, + 0x0C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C38, + 0x0FF8, 0x03D8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0000, + // 'q' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1BC0, 0x1FF0, + 0x1C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C30, + 0x1FF0, 0x1BC0, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x0000, + // 'r' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07B0, 0x03F0, + 0x0070, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 's' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03E0, 0x03F0, + 0x0E38, 0x0C18, 0x0038, 0x03F0, 0x07C0, 0x0C00, 0x0C18, 0x0E38, + 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 't' + 0x0000, 0x0000, 0x0080, 0x00C0, 0x00C0, 0x00C0, 0x07F0, 0x07F0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x07C0, 0x0780, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'u' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1818, 0x1818, + 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C38, + 0x1FF0, 0x19E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'v' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x180C, 0x0C18, + 0x0C18, 0x0C18, 0x0630, 0x0630, 0x0630, 0x0360, 0x0360, 0x0360, + 0x01C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'w' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x41C1, 0x41C1, + 0x61C3, 0x6363, 0x6363, 0x6363, 0x3636, 0x3636, 0x3636, 0x1C1C, + 0x1C1C, 0x1C1C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'x' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x381C, 0x1C38, + 0x0C30, 0x0660, 0x0360, 0x0360, 0x0360, 0x0360, 0x0660, 0x0C30, + 0x1C38, 0x381C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'y' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3018, 0x1830, + 0x1830, 0x1870, 0x0C60, 0x0C60, 0x0CE0, 0x06C0, 0x06C0, 0x0380, + 0x0380, 0x0380, 0x0180, 0x0180, 0x01C0, 0x00F0, 0x0070, 0x0000, + // 'z' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1FFC, 0x1FFC, + 0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, + 0x1FFC, 0x1FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '{' + 0x0000, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x0060, 0x0060, 0x0030, 0x0060, 0x0040, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x0180, 0x0300, 0x0000, 0x0000, + // '|' + 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, + // '}' + 0x0000, 0x0060, 0x00C0, 0x01C0, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0300, 0x0300, 0x0600, 0x0300, 0x0100, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x00C0, 0x0060, 0x0000, 0x0000, + // '~' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x10F0, 0x1FF8, 0x0F08, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +}; + +void disp_char_1624(uint16_t x, uint16_t y, uint8_t c, uint16_t charColor, uint16_t bkColor) { + for (uint16_t i = 0; i < 24; i++) { + const uint16_t tmp_char = pgm_read_word(&ASCII_Table_16x24[((c - 0x20) * 24) + i]); + for (uint16_t j = 0; j < 16; j++) { + TERN(TFT_LVGL_UI_SPI, SPI_TFT.SetPoint, tft_set_point) + (x + j, y + i, ((tmp_char >> j) & 0x01) ? charColor : bkColor); + } + } +} + +void disp_string(uint16_t x, uint16_t y, const char * string, uint16_t charColor, uint16_t bkColor) { + // Select TFT SPI so it can receive data + TERN_(TFT_LVGL_UI_SPI, SPI_TFT.spi_init(SPI_FULL_SPEED)); + while (*string != '\0') { + disp_char_1624(x, y, *string, charColor, bkColor); + string++; + x += 16; + } +} + +//static lv_obj_t * scr_test; +void disp_assets_update() { + TERN(TFT_LVGL_UI_SPI,, LCD_Clear(0x0000)); + disp_string(100, 140, "Assets Updating...", 0xFFFF, 0x0000); +} + +void disp_assets_update_progress(const char *msg) { + char buf[30]; + memset(buf, ' ', COUNT(buf)); + strncpy(buf, msg, strlen(msg)); + buf[COUNT(buf)-1] = '\0'; + disp_string(100, 165, buf, 0xFFFF, 0x0000); +} + +uint8_t mks_test_flag = 0; +const char *MKSTestPath = "MKS_TEST"; + +#if ENABLED(SDSUPPORT) + void mks_test_get() { + SdFile dir, root = card.getroot(); + if (dir.open(&root, MKSTestPath, O_RDONLY)) + mks_test_flag = 0x1e; + } +#endif + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.h b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.h new file mode 100644 index 0000000000..0e2d8096ba --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.h @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 mks_gpio_test(); +void disp_char_1624(uint16_t x, uint16_t y, uint8_t c, uint16_t charColor, uint16_t bkColor); +void disp_string(uint16_t x, uint16_t y, const char * string, uint16_t charColor, uint16_t bkColor); +void mks_hardware_test(); +void disp_assets_update(); +void disp_assets_update_progress(const char *msg); +void mks_test_get(); +extern uint8_t mks_test_flag; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp new file mode 100644 index 0000000000..2a16bcf1b3 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp @@ -0,0 +1,574 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "../../../../MarlinCore.h" + +#include "string.h" + +#include "pic_manager.h" +#include "W25Qxx.h" +#include "../../../../sd/cardreader.h" +#include "draw_ready_print.h" +#include "mks_hardware_test.h" + +extern uint16_t DeviceCode; +extern unsigned char bmp_public_buf[17 * 1024]; + +#if ENABLED(SDSUPPORT) + extern char *createFilename(char * const buffer, const dir_t &p); +#endif + +static char assets[][LONG_FILENAME_LENGTH] = { + //homing screen + "bmp_Zero.bin", + "bmp_zeroX.bin", + "bmp_zeroY.bin", + "bmp_zeroZ.bin", + "bmp_manual_off.bin", + + //tool screen + "bmp_PreHeat.bin", + "bmp_Extruct.bin", + "bmp_Mov.bin", + // "bmp_Zero.bin", + "bmp_Leveling.bin", + + //fan screen + "bmp_Add.bin", + "bmp_Dec.bin", + "bmp_Speed255.bin", + "bmp_Speed127.bin", + "bmp_Speed0.bin", + + //preheat screen + // "bmp_Add.bin", + // "bmp_Dec.bin", + "bmp_Speed0.bin", + // "bmp_Extru2.bin", + // "bmp_Extru1.bin", + "bmp_Bed.bin", + "bmp_Step1_degree.bin", + "bmp_Step5_degree.bin", + "bmp_Step10_degree.bin", + + //extrusion screen + "bmp_In.bin", + "bmp_Out.bin", + "bmp_Extru1.bin", + #if EXTRUDERS > 1 + "bmp_Extru2.bin", + #endif + "bmp_Speed_high.bin", + "bmp_Speed_slow.bin", + "bmp_Speed_normal.bin", + "bmp_Step1_mm.bin", + "bmp_Step5_mm.bin", + "bmp_Step10_mm.bin", + + //select file screen + "bmp_pageUp.bin", + "bmp_pageDown.bin", + "bmp_Back.bin", //TODO: why two back buttons? Why not just one? (return / back) + "bmp_Dir.bin", + "bmp_File.bin", + + //move motor screen + //TODO: 6 equal icons, just in diffenct rotation... it may be optimized too + "bmp_xAdd.bin", + "bmp_xDec.bin", + "bmp_yAdd.bin", + "bmp_yDec.bin", + "bmp_zAdd.bin", + "bmp_zDec.bin", + "bmp_Step_move0_1.bin", + "bmp_Step_move1.bin", + "bmp_Step_move10.bin", + + //operation screen + "bmp_auto_off.bin", + "bmp_Speed.bin", + //"bmp_Mamual.bin", //TODO: didn't find it.. changed to bmp_manual_off.bin + "bmp_Fan.bin", + //"bmp_PreHeat.bin", + //"bmp_Extruct.bin", + // "bmp_Mov.bin", + + //change speed screen + "bmp_Step1_percent.bin", + "bmp_Step5_percent.bin", + "bmp_Step10_percent.bin", + "bmp_extruct_sel.bin", + "bmp_mov_changespeed.bin", + // "bmp_extrude_opr.bin", equal to "bmp_Extruct.bin" + "bmp_mov_sel.bin", + + //printing screen + "bmp_Pause.bin", + "bmp_Resume.bin", + "bmp_Stop.bin", + "bmp_Ext1_state.bin", + #if EXTRUDERS > 1 + "bmp_Ext2_state.bin", + #endif + "bmp_Bed_state.bin", + "bmp_Fan_state.bin", + "bmp_Time_state.bin", + "bmp_Zpos_state.bin", + "bmp_Operate.bin", + + //manual leval screen (only if disabled auto level) + #if DISABLED(AUTO_BED_LEVELING_BILINEAR) + "bmp_Leveling1.bin", + "bmp_Leveling2.bin", + "bmp_Leveling3.bin", + "bmp_Leveling4.bin", + "bmp_Leveling5.bin", + #endif + + //lang select screen + #if HAS_LANG_SELECT_SCREEN + "bmp_Language.bin", + "bmp_simplified_cn.bin", + "bmp_simplified_cn_sel.bin", + "bmp_traditional_cn.bin", + "bmp_traditional_cn_sel.bin", + "bmp_English.bin", + "bmp_English_sel.bin", + "bmp_Russian.bin", + "bmp_Russian_sel.bin", + "bmp_Spanish.bin", + "bmp_Spanish_sel.bin", + "bmp_French.bin", + "bmp_French_sel.bin", + "bmp_Italy.bin", + "bmp_Italy_sel.bin", + #endif // HAS_LANG_SELECT_SCREEN + + // gcode preview + #if HAS_GCODE_DEFAULT_VIEW_IN_FLASH + "bmp_preview.bin", + #endif + + #if HAS_LOGO_IN_FLASH + "bmp_logo.bin", + #endif + + // settings screen + "bmp_About.bin", + //"bmp_Language.bin", + //"bmp_Fan.bin", + //"bmp_manual_off.bin", + + //start screen + "bmp_printing.bin", + "bmp_Set.bin", + "bmp_Tool.bin", + + #if ENABLED(HAS_STEALTHCHOP) + //"bmp_back70x40.bin", + "bmp_disable.bin", + "bmp_enable.bin", + #endif + + // settings screen + "bmp_eeprom_settings.bin", + "bmp_machine_para.bin", + "bmp_function1.bin", + + // base icons + "bmp_arrow.bin", + "bmp_back70x40.bin", + "bmp_value_blank.bin", + "bmp_Return.bin" +}; + +#if HAS_SPI_FLASH_FONT + static char fonts[][LONG_FILENAME_LENGTH] = { + "FontUNIGBK.bin", + }; +#endif + +uint32_t lv_get_pic_addr(uint8_t *Pname) { + uint8_t Pic_cnt; + uint8_t i, j; + PIC_MSG PIC; + uint32_t tmp_cnt = 0; + uint32_t addr = 0; + + #if ENABLED(MARLIN_DEV_MODE) + SERIAL_ECHOLNPAIR("Getting picture SPI Flash Address: ", (const char*)Pname); + #endif + + W25QXX.init(SPI_QUARTER_SPEED); + + W25QXX.SPI_FLASH_BufferRead(&Pic_cnt, PIC_COUNTER_ADDR, 1); + if (Pic_cnt == 0xFF) Pic_cnt = 0; + for (i = 0; i < Pic_cnt; i++) { + j = 0; + do { + W25QXX.SPI_FLASH_BufferRead(&PIC.name[j], PIC_NAME_ADDR + tmp_cnt, 1); + tmp_cnt++; + } while (PIC.name[j++] != '\0'); + + if ((strcasecmp((char*)Pname, (char*)PIC.name)) == 0) { + if ((DeviceCode == 0x9488) || (DeviceCode == 0x5761)) + addr = PIC_DATA_ADDR_TFT35 + i * PER_PIC_MAX_SPACE_TFT35; + else + addr = PIC_DATA_ADDR_TFT32 + i * PER_PIC_MAX_SPACE_TFT32; + return addr; + } + } + + return addr; +} + +const char *assetsPath = "assets"; +const char *bakPath = "_assets"; + +void spiFlashErase_PIC() { + volatile uint32_t pic_sectorcnt = 0; + W25QXX.init(SPI_QUARTER_SPEED); + for (pic_sectorcnt = 0; pic_sectorcnt < PIC_SIZE_xM * 1024 / 64; pic_sectorcnt++) + W25QXX.SPI_FLASH_BlockErase(PICINFOADDR + pic_sectorcnt * 64 * 1024); +} + +#if HAS_SPI_FLASH_FONT + void spiFlashErase_FONT() { + volatile uint32_t Font_sectorcnt = 0; + W25QXX.init(SPI_QUARTER_SPEED); + for (Font_sectorcnt = 0; Font_sectorcnt < 32-1; Font_sectorcnt++) + W25QXX.SPI_FLASH_BlockErase(FONTINFOADDR + Font_sectorcnt * 64 * 1024); + } +#endif + +uint32_t LogoWrite_Addroffset = 0; + +uint8_t Pic_Logo_Write(uint8_t *LogoName, uint8_t *Logo_Wbuff, uint32_t LogoWriteSize) { + if (LogoWriteSize <= 0) return 0; + + W25QXX.SPI_FLASH_BufferWrite(Logo_Wbuff, PIC_LOGO_ADDR + LogoWrite_Addroffset, LogoWriteSize); + + for (uint32_t i = 0; i < LogoWriteSize; i++) { + uint8_t temp1; + W25QXX.SPI_FLASH_BufferRead(&temp1, PIC_LOGO_ADDR + LogoWrite_Addroffset + i, 1); + if (*(Logo_Wbuff + i) != temp1) return 0; + } + LogoWrite_Addroffset += LogoWriteSize; + const uint32_t logo_maxsize = DeviceCode == 0x9488 || DeviceCode == 0x5761 ? LOGO_MAX_SIZE_TFT35 : LOGO_MAX_SIZE_TFT32; + if (LogoWrite_Addroffset >= logo_maxsize) LogoWrite_Addroffset = 0; + return 1; +} + +uint32_t TitleLogoWrite_Addroffset = 0; +uint8_t Pic_TitleLogo_Write(uint8_t *TitleLogoName, uint8_t *TitleLogo_Wbuff, uint32_t TitleLogoWriteSize) { + if (TitleLogoWriteSize <= 0) + return 0; + if ((DeviceCode == 0x9488) || (DeviceCode == 0x5761)) + W25QXX.SPI_FLASH_BufferWrite(TitleLogo_Wbuff, PIC_ICON_LOGO_ADDR_TFT35 + TitleLogoWrite_Addroffset, TitleLogoWriteSize); + else + W25QXX.SPI_FLASH_BufferWrite(TitleLogo_Wbuff, PIC_ICON_LOGO_ADDR_TFT32 + TitleLogoWrite_Addroffset, TitleLogoWriteSize); + TitleLogoWrite_Addroffset += TitleLogoWriteSize; + if (TitleLogoWrite_Addroffset >= TITLELOGO_MAX_SIZE) + TitleLogoWrite_Addroffset = 0; + return 1; +} + +uint32_t default_view_addroffset_r = 0; +void default_view_Write(uint8_t *default_view__Rbuff, uint32_t default_view_Writesize) { + W25QXX.SPI_FLASH_BufferWrite(default_view__Rbuff, DEFAULT_VIEW_ADDR_TFT35 + default_view_addroffset_r, default_view_Writesize); + default_view_addroffset_r += default_view_Writesize; + if (default_view_addroffset_r >= DEFAULT_VIEW_MAX_SIZE) + default_view_addroffset_r = 0; +} + +uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { + uint8_t pic_counter = 0; + uint32_t Pic_SaveAddr; + uint32_t Pic_SizeSaveAddr; + uint32_t Pic_NameSaveAddr; + uint8_t Pname_temp; + uint32_t i, j; + uint32_t name_len = 0; + uint32_t SaveName_len = 0; + union union32 size_tmp; + + W25QXX.SPI_FLASH_BufferRead(&pic_counter, PIC_COUNTER_ADDR, 1); + + if (pic_counter == 0xFF) + pic_counter = 0; + + if ((DeviceCode == 0x9488) || (DeviceCode == 0x5761)) + Pic_SaveAddr = PIC_DATA_ADDR_TFT35 + pic_counter * PER_PIC_MAX_SPACE_TFT35; + else + Pic_SaveAddr = PIC_DATA_ADDR_TFT32 + pic_counter * PER_PIC_MAX_SPACE_TFT32; + + for (j = 0; j < pic_counter; j++) { + do { + W25QXX.SPI_FLASH_BufferRead(&Pname_temp, PIC_NAME_ADDR + SaveName_len, 1); + SaveName_len++; + } while (Pname_temp != '\0'); + } + i = 0; + while ((*(P_name + i) != '\0')) { + i++; + name_len++; + } + + Pic_NameSaveAddr = PIC_NAME_ADDR + SaveName_len; + W25QXX.SPI_FLASH_BufferWrite(P_name, Pic_NameSaveAddr, name_len + 1); + Pic_SizeSaveAddr = PIC_SIZE_ADDR + 4 * pic_counter; + size_tmp.dwords = P_size; + W25QXX.SPI_FLASH_BufferWrite(size_tmp.bytes, Pic_SizeSaveAddr, 4); + + pic_counter++; + W25QXX.SPI_FLASH_SectorErase(PIC_COUNTER_ADDR); + W25QXX.SPI_FLASH_BufferWrite(&pic_counter, PIC_COUNTER_ADDR, 1); + + return Pic_SaveAddr; +} + +uint8_t public_buf[512]; + +#if ENABLED(SDSUPPORT) + + static void dosName2LongName(const char dosName[11], char* longName) { + uint8_t j = 0; + LOOP_L_N(i, 11) { + if (i == 8) longName[j++] = '.'; + if (dosName[i] == '\0' || dosName[i] == ' ') continue; + longName[j++] = dosName[i]; + } + longName[j] = '\0'; + } + + static int8_t arrayFindStr(const char arr[][LONG_FILENAME_LENGTH], uint8_t arraySize, const char* str) { + for (uint8_t a = 0; a < arraySize; a++) { + if (strcasecmp(arr[a], str) == 0) + return a; + } + return -1; + } + + #define ASSET_TYPE_ICON 0 + #define ASSET_TYPE_LOGO 1 + #define ASSET_TYPE_TITLE_LOGO 2 + #define ASSET_TYPE_G_PREVIEW 3 + #define ASSET_TYPE_FONT 4 + static void loadAsset(SdFile &dir, dir_t& entry, const char *fn, int8_t assetType) { + SdFile file; + char dosFilename[FILENAME_LENGTH]; + createFilename(dosFilename, entry); + if (!file.open(&dir, dosFilename, O_READ)) { + #if ENABLED(MARLIN_DEV_MODE) + SERIAL_ECHOLNPAIR("Error opening Asset: ", fn); + #endif + return; + } + + disp_assets_update_progress(fn); + + W25QXX.init(SPI_QUARTER_SPEED); + + uint16_t pbr; + uint32_t pfileSize; + uint32_t totalSizeLoaded = 0; + uint32_t Pic_Write_Addr; + pfileSize = file.fileSize(); + totalSizeLoaded += pfileSize; + if (assetType == ASSET_TYPE_LOGO) { + while (1) { + pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); + Pic_Logo_Write((uint8_t *)fn, public_buf, pbr); // + if (pbr < BMP_WRITE_BUF_LEN) break; + } + } + else if (assetType == ASSET_TYPE_TITLE_LOGO) { + while (1) { + pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); + Pic_TitleLogo_Write((uint8_t *)fn, public_buf, pbr); // + if (pbr < BMP_WRITE_BUF_LEN) break; + } + } + else if (assetType == ASSET_TYPE_G_PREVIEW) { + while (1) { + pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); + default_view_Write(public_buf, pbr); // + if (pbr < BMP_WRITE_BUF_LEN) break; + } + } + else if (assetType == ASSET_TYPE_ICON) { + Pic_Write_Addr = Pic_Info_Write((uint8_t *)fn, pfileSize); + while (1) { + pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); + W25QXX.SPI_FLASH_BufferWrite(public_buf, Pic_Write_Addr, pbr); + Pic_Write_Addr += pbr; + if (pbr < BMP_WRITE_BUF_LEN) break; + } + } + else if (assetType == ASSET_TYPE_FONT) { + Pic_Write_Addr = UNIGBK_FLASH_ADDR; + while (1) { + pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); + W25QXX.SPI_FLASH_BufferWrite(public_buf, Pic_Write_Addr, pbr); + Pic_Write_Addr += pbr; + if (pbr < BMP_WRITE_BUF_LEN) break; + } + } + + file.close(); + + #if ENABLED(MARLIN_DEV_MODE) + SERIAL_ECHOLNPAIR("Asset added: ", fn); + #endif + } + + void UpdateAssets() { + SdFile dir, root = card.getroot(); + if (dir.open(&root, assetsPath, O_RDONLY)) { + + disp_assets_update(); + disp_assets_update_progress("Erasing pics..."); + spiFlashErase_PIC(); + #if HAS_SPI_FLASH_FONT + disp_assets_update_progress("Erasing fonts..."); + spiFlashErase_FONT(); + #endif + + disp_assets_update_progress("Reading files..."); + dir_t d; + while (dir.readDir(&d, card.longFilename) > 0) { + // if we dont get a long name, but gets a short one, try it + if (card.longFilename[0] == 0 && d.name[0] != 0) + dosName2LongName((const char*)d.name, card.longFilename); + if (card.longFilename[0] == 0) continue; + if (card.longFilename[0] == '.') continue; + + uint8_t a = arrayFindStr(assets, COUNT(assets), card.longFilename); + if (a >= 0 && a < COUNT(assets)) { + uint8_t assetType = ASSET_TYPE_ICON; + if (strstr(assets[a], "_logo")) + assetType = ASSET_TYPE_LOGO; + else if (strstr(assets[a], "_titlelogo")) + assetType = ASSET_TYPE_TITLE_LOGO; + else if (strstr(assets[a], "_preview")) + assetType = ASSET_TYPE_G_PREVIEW; + + loadAsset(dir, d, assets[a], assetType); + + continue; + } + + #if HAS_SPI_FLASH_FONT + a = arrayFindStr(fonts, COUNT(fonts), card.longFilename); + if (a >= 0 && a < COUNT(fonts)) { + loadAsset(dir, d, fonts[a], ASSET_TYPE_FONT); + } + #endif + } + dir.rename(&root, bakPath); + } + dir.close(); + + #if ENABLED(MARLIN_DEV_MODE) + uint8_t pic_counter = 0; + W25QXX.SPI_FLASH_BufferRead(&pic_counter, PIC_COUNTER_ADDR, 1); + SERIAL_ECHOLNPAIR("Total assets loaded: ", pic_counter); + #endif + } + + #if HAS_SPI_FLASH_FONT + void spi_flash_read_test() { W25QXX.SPI_FLASH_BufferRead(public_buf, UNIGBK_FLASH_ADDR, BMP_WRITE_BUF_LEN); } + #endif // HAS_SPI_FLASH_FONT + +#endif // SDSUPPORT + +void Pic_Read(uint8_t *Pname, uint8_t *P_Rbuff) { + uint8_t i, j; + uint8_t Pic_cnt; + uint32_t tmp_cnt = 0; + PIC_MSG PIC; + + W25QXX.SPI_FLASH_BufferRead(&Pic_cnt, PIC_COUNTER_ADDR, 1); + if (Pic_cnt == 0xff) + Pic_cnt = 0; + + for (i = 0; i < Pic_cnt; i++) { + j = 0; + do { + W25QXX.SPI_FLASH_BufferRead(&PIC.name[j], PIC_NAME_ADDR + tmp_cnt, 1); + tmp_cnt++; + } while (PIC.name[j++] != '\0'); + //pic size + W25QXX.SPI_FLASH_BufferRead(PIC.size.bytes, PIC_SIZE_ADDR + i * 4, 4); + + if ((strcmp((char*)Pname, (char*)PIC.name)) == 0) { + W25QXX.SPI_FLASH_BufferRead((uint8_t *)P_Rbuff, PIC_DATA_ADDR_TFT35 + i * PER_PIC_MAX_SPACE_TFT35, PIC.size.dwords); + break; + } + } +} + +void lv_pic_test(uint8_t *P_Rbuff, uint32_t addr, uint32_t size) { + W25QXX.init(SPI_QUARTER_SPEED); + W25QXX.SPI_FLASH_BufferRead((uint8_t *)P_Rbuff, addr, size); +} + +#if HAS_SPI_FLASH_FONT + void get_spi_flash_data(const char *rec_buf, int addr, int size) { + W25QXX.init(SPI_QUARTER_SPEED); + W25QXX.SPI_FLASH_BufferRead((uint8_t *)rec_buf, UNIGBK_FLASH_ADDR + addr, size); + } +#endif + +uint32_t logo_addroffset = 0; +void Pic_Logo_Read(uint8_t *LogoName, uint8_t *Logo_Rbuff, uint32_t LogoReadsize) { + W25QXX.init(SPI_QUARTER_SPEED); + W25QXX.SPI_FLASH_BufferRead(Logo_Rbuff, PIC_LOGO_ADDR + logo_addroffset, LogoReadsize); + logo_addroffset += LogoReadsize; + if (logo_addroffset >= LOGO_MAX_SIZE_TFT35) + logo_addroffset = 0; +} + +uint32_t default_view_addroffset = 0; +void default_view_Read(uint8_t *default_view_Rbuff, uint32_t default_view_Readsize) { + W25QXX.init(SPI_QUARTER_SPEED); + W25QXX.SPI_FLASH_BufferRead(default_view_Rbuff, DEFAULT_VIEW_ADDR_TFT35 + default_view_addroffset, default_view_Readsize); + default_view_addroffset += default_view_Readsize; + if (default_view_addroffset >= DEFAULT_VIEW_MAX_SIZE) + default_view_addroffset = 0; +} + +#if HAS_BAK_VIEW_IN_FLASH + uint32_t flash_view_addroffset = 0; + void flash_view_Read(uint8_t *flash_view_Rbuff, uint32_t flash_view_Readsize) { + W25QXX.init(SPI_QUARTER_SPEED); + W25QXX.SPI_FLASH_BufferRead(flash_view_Rbuff, BAK_VIEW_ADDR_TFT35 + flash_view_addroffset, flash_view_Readsize); + flash_view_addroffset += flash_view_Readsize; + if (flash_view_addroffset >= FLASH_VIEW_MAX_SIZE) + flash_view_addroffset = 0; + } +#endif + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h new file mode 100644 index 0000000000..3ef4ee4f86 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h @@ -0,0 +1,159 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +#include "../../inc/MarlinConfigPre.h" + +#include + +#include +#include + +#ifndef HAS_SPI_FLASH_FONT + #define HAS_SPI_FLASH_FONT 1 // Disabled until fix the font load code +#endif +#ifndef HAS_GCODE_PREVIEW + #define HAS_GCODE_PREVIEW 1 +#endif +#ifndef HAS_LANG_SELECT_SCREEN + #define HAS_LANG_SELECT_SCREEN 1 +#endif +#ifndef HAS_BAK_VIEW_IN_FLASH + #define HAS_BAK_VIEW_IN_FLASH 1 +#endif +#ifndef HAS_GCODE_DEFAULT_VIEW_IN_FLASH + #define HAS_GCODE_DEFAULT_VIEW_IN_FLASH 1 +#endif +#ifndef HAS_LOGO_IN_FLASH + #define HAS_LOGO_IN_FLASH 1 +#endif +#ifndef SPI_FLASH_SIZE + #define SPI_FLASH_SIZE 0x1000000 // 16MB +#endif + +#define PIC_MAX_CN 100 // Maximum number of pictures +#define PIC_NAME_MAX_LEN 50 // Picture name maximum length + +#define LOGO_MAX_SIZE_TFT35 (300*1024) +#define LOGO_MAX_SIZE_TFT32 (150*1024) +#define TITLELOGO_MAX_SIZE (150*1024) // Little logo maximum +#define DEFAULT_VIEW_MAX_SIZE (200*200*2) +#define FLASH_VIEW_MAX_SIZE (200*200*2) + +#define PER_PIC_MAX_SPACE_TFT35 (32*1024) +#define PER_PIC_MAX_SPACE_TFT32 (16*1024) +#define PER_FONT_MAX_SPACE (16*1024) + +#if SPI_FLASH_SIZE == 0x200000 + //pic + //Robin_pro pic addr + #define PIC_NAME_ADDR 0x001000 // Pic information addr + #define PIC_SIZE_ADDR 0x001800 // Pic size information addr + #define PIC_COUNTER_ADDR 0x002000 // Pic total number + #define PER_PIC_SAVE_ADDR 0x000000 // Storage address of each picture + #define PIC_LOGO_ADDR 0x000000 // Logo addr + #define PIC_DATA_ADDR 0x003000 // + + // TFT35 + #define DEFAULT_VIEW_ADDR_TFT35 0x1ea070 + #define BAK_VIEW_ADDR_TFT35 (DEFAULT_VIEW_ADDR_TFT35+90*1024) + #define PIC_ICON_LOGO_ADDR_TFT35 (BAK_VIEW_ADDR_TFT35+80*1024) + #define PIC_DATA_ADDR_TFT35 0x003000 // (PIC_ICON_LOGO_ADDR_TFT35+350*1024) //0xC5800 + + #define PIC_DATA_ADDR_TFT32 0x00F000 + #define PIC_ICON_LOGO_ADDR_TFT32 0x5D8000 + #define PIC_OTHER_SIZE_ADDR_TFT32 0x5EE000 + + // font + #define FONTINFOADDR 0x183000 // 6M -- font addr + #define UNIGBK_FLASH_ADDR (FONTINFOADDR+4096) // 4*1024 + +#else + //pic + //Robin_pro pic addr + #define PIC_NAME_ADDR 0x003000 // Pic information addr + #define PIC_SIZE_ADDR 0x007000 // Pic size information addr + #define PIC_COUNTER_ADDR 0x008000 // Pic total number + //#define PER_PIC_SAVE_ADDR 0x009000 // Storage address of each picture + #define PIC_LOGO_ADDR 0x009000 // Logo addr + //#define PIC_DATA_ADDR 0x02F000 // + + // TFT35 + #define DEFAULT_VIEW_ADDR_TFT35 0xC5800 + #define BAK_VIEW_ADDR_TFT35 (DEFAULT_VIEW_ADDR_TFT35+90*1024) + #define PIC_ICON_LOGO_ADDR_TFT35 (BAK_VIEW_ADDR_TFT35+80*1024) + #define PIC_DATA_ADDR_TFT35 (PIC_ICON_LOGO_ADDR_TFT35+350*1024) //0xC5800 + + // TFT32 + #define PIC_DATA_ADDR_TFT32 0x02F000 + #define PIC_ICON_LOGO_ADDR_TFT32 0x5D8000 + #define PIC_OTHER_SIZE_ADDR_TFT32 0x5EE000 + + // font + #define FONTINFOADDR 0x600000 // 6M -- font addr + #define UNIGBK_FLASH_ADDR (FONTINFOADDR+4096) // 4*1024 + #define GBK_FLASH_ADDR (UNIGBK_FLASH_ADDR+180224) // 176*1024 + +#endif + +// Flash flag +#define REFLSHE_FLGA_ADD (0X800000-32) +#define FLASH_INF_VALID_FLAG 0xAA558761 +// SD card information first addr +#define VAR_INF_ADDR 0x000000 + +union union32 { + uint8_t bytes[4]; + uint32_t dwords; +}; + +// pic information +struct pic_msg { + uint8_t name[PIC_NAME_MAX_LEN]; + union union32 size; +}; + +typedef struct pic_msg PIC_MSG; + +#define BMP_WRITE_BUF_LEN 512 + +#define PICINFOADDR 0x1000 + +#define PIC_SIZE_xM 6 +#define FONT_SIZE_xM 2 + +extern void Pic_Read(uint8_t *Pname, uint8_t *P_Rbuff); +extern void Pic_Logo_Read(uint8_t *LogoName,uint8_t *Logo_Rbuff,uint32_t LogoReadsize); +extern void lv_pic_test(uint8_t *P_Rbuff, uint32_t addr, uint32_t size); +extern uint32_t lv_get_pic_addr(uint8_t *Pname); +extern void get_spi_flash_data(const char *rec_buf, int offset, int size); +extern void spi_flash_read_test(); +extern void default_view_Read(uint8_t *default_view_Rbuff, uint32_t default_view_Readsize); +extern void flash_view_Read(uint8_t *flash_view_Rbuff, uint32_t flash_view_Readsize); + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp b/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp new file mode 100644 index 0000000000..138168b12f --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp @@ -0,0 +1,217 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "../../../../MarlinCore.h" + +#include "lv_conf.h" +#include "draw_ui.h" +#include "../../../../module/temperature.h" +#include "../../../../module/motion.h" +#include "../../../../sd/cardreader.h" +#include "../../../../gcode/queue.h" + +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../../../feature/powerloss.h" +#endif + +#include "../../../../gcode/gcode.h" +#include "../../../../module/planner.h" + +extern uint32_t To_pre_view; +extern uint8_t flash_preview_begin, default_preview_flg, gcode_preview_over; + +void printer_state_polling() { + if (uiCfg.print_state == PAUSING) { + #if ENABLED(SDSUPPORT) + if (!planner.has_blocks_queued() && card.getIndex() > MIN_FILE_PRINTED) + uiCfg.waitEndMoves++; + + if (uiCfg.waitEndMoves > 20) { + uiCfg.waitEndMoves = 0; + planner.synchronize(); + gcode.process_subcommands_now_P(PSTR("M25")); + if (gCfgItems.pausePosZ != (float)-1) { + gcode.process_subcommands_now_P(PSTR("G91")); + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("G1 Z%.1f"), gCfgItems.pausePosZ); + gcode.process_subcommands_now(public_buf_l); + gcode.process_subcommands_now_P(PSTR("G90")); + } + if (gCfgItems.pausePosX != (float)-1 && gCfgItems.pausePosY != (float)-1) { + ZERO(public_buf_l); + sprintf_P(public_buf_l, PSTR("G1 X%.1f Y%.1f"), gCfgItems.pausePosX, gCfgItems.pausePosY); + gcode.process_subcommands_now(public_buf_l); + } + uiCfg.print_state = PAUSED; + + // #if ENABLED(POWER_LOSS_RECOVERY) + // if (recovery.enabled) recovery.save(true); + // #endif + gCfgItems.pause_reprint = 1; + update_spi_flash(); + } + #endif + } + else + uiCfg.waitEndMoves = 0; + + if (uiCfg.print_state == PAUSED) { + } + + if (uiCfg.print_state == RESUMING) { + if (IS_SD_PAUSED()) { + gcode.process_subcommands_now_P(PSTR("M24\nG91\nG1 Z-5\nG90")); + uiCfg.print_state = WORKING; + start_print_time(); + + gCfgItems.pause_reprint = 0; + update_spi_flash(); + } + } + #if ENABLED(POWER_LOSS_RECOVERY) + if (uiCfg.print_state == REPRINTED) { + ZERO(public_buf_m); + #if HAS_HOTEND + HOTEND_LOOP() { + const int16_t et = recovery.info.target_temperature[e]; + if (et) { + #if HAS_MULTI_HOTEND + sprintf_P(public_buf_m, PSTR("T%i"), e); + gcode.process_subcommands_now(public_buf_m); + #endif + sprintf_P(public_buf_m, PSTR("M109 S%i"), et); + gcode.process_subcommands_now(public_buf_m); + } + } + #endif + + if (gCfgItems.pause_reprint == 1) { + gcode.process_subcommands_now_P(PSTR("G91\nG1 Z-5\nG90")); + } + recovery.resume(); + + uiCfg.print_state = WORKING; + start_print_time(); + + gCfgItems.pause_reprint = 0; + update_spi_flash(); + } + #endif + + if (uiCfg.print_state == WORKING) + filament_check(); +} + +void filament_pin_setup() { + #if PIN_EXISTS(MT_DET_1) + pinMode(MT_DET_1_PIN, INPUT_PULLUP); + #endif + #if PIN_EXISTS(MT_DET_2) + pinMode(MT_DET_2_PIN, INPUT_PULLUP); + #endif + #if PIN_EXISTS(MT_DET_3) + pinMode(MT_DET_3_PIN, INPUT_PULLUP); + #endif +} + +void filament_check() { + const int FIL_DELAY = 20; + #if PIN_EXISTS(MT_DET_1) + static int fil_det_count_1 = 0; + if (!READ(MT_DET_1_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_1++; + else if (READ(MT_DET_1_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_1++; + else if (fil_det_count_1 > 0) + fil_det_count_1--; + + if (!READ(MT_DET_1_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_1++; + else if (READ(MT_DET_1_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_1++; + else if (fil_det_count_1 > 0) + fil_det_count_1--; + #endif + + #if PIN_EXISTS(MT_DET_2) + static int fil_det_count_2 = 0; + if (!READ(MT_DET_2_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_2++; + else if (READ(MT_DET_2_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_2++; + else if (fil_det_count_2 > 0) + fil_det_count_2--; + + if (!READ(MT_DET_2_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_2++; + else if (READ(MT_DET_2_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_2++; + else if (fil_det_count_2 > 0) + fil_det_count_2--; + #endif + + #if PIN_EXISTS(MT_DET_3) + static int fil_det_count_3 = 0; + if (!READ(MT_DET_3_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_3++; + else if (READ(MT_DET_3_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_3++; + else if (fil_det_count_3 > 0) + fil_det_count_3--; + + if (!READ(MT_DET_3_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_3++; + else if (READ(MT_DET_3_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_3++; + else if (fil_det_count_3 > 0) + fil_det_count_3--; + #endif + + if (false + #if PIN_EXISTS(MT_DET_1) + || fil_det_count_1 >= FIL_DELAY + #endif + #if PIN_EXISTS(MT_DET_2) + || fil_det_count_2 >= FIL_DELAY + #endif + #if PIN_EXISTS(MT_DET_3) + || fil_det_count_3 >= FIL_DELAY + #endif + ) { + clear_cur_ui(); + card.pauseSDPrint(); + stop_print_time(); + uiCfg.print_state = PAUSING; + + if (gCfgItems.from_flash_pic == 1) + flash_preview_begin = 1; + else + default_preview_flg = 1; + + lv_draw_printing(); + } +} + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.h b/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.h new file mode 100644 index 0000000000..9605d65085 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.h @@ -0,0 +1,36 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +#define MIN_FILE_PRINTED 100 //5000 + +extern void printer_state_polling(); +extern void filament_pin_setup(); +extern void filament_check(); + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h new file mode 100644 index 0000000000..54e06f5826 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h @@ -0,0 +1,748 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 MACHINE_CONFIG_EN "Config" + +#define NEXT_EN "Next" +#define PREVIOUS_EN "Previous" +#define DEFAULT_EN "Default" +#define KEY_BACK_EN "Del" +#define KEY_REST_EN "Reset" +#define KEY_CONFIRM_EN "Confirm" + +#define KEYBOARD_KEY0_EN "0" +#define KEYBOARD_KEY1_EN "1" +#define KEYBOARD_KEY2_EN "2" +#define KEYBOARD_KEY3_EN "3" +#define KEYBOARD_KEY4_EN "4" +#define KEYBOARD_KEY5_EN "5" +#define KEYBOARD_KEY6_EN "6" +#define KEYBOARD_KEY7_EN "7" +#define KEYBOARD_KEY8_EN "8" +#define KEYBOARD_KEY9_EN "9" +#define KEYBOARD_KEY_POINT_EN "." +#define KEYBOARD_KEY_NEGATIVE_EN "-" + +#define MACHINE_PARA_TITLE_EN "Config" +#define MACHINE_TYPE_CNOFIG_EN "Machine settings" +#define TEMPERATURE_CONFIG_EN "Temperature settings" +#define MOTOR_CONFIG_EN "Motor settings" +#define ADVANCE_CONFIG_EN "Adavance settings" + +#define MACHINE_CONFIG_TITLE_EN "Machine Settings" +#define MACHINE_TYPE_EN "Machine type" +#define MACHINE_STROKE_EN "Machine Size" +#define MACHINE_HOMEDIR_EN "Home direction" +#define MACHINE_ENDSTOP_TYPE_EN "Endstop type" +#define MACHINE_FILAMENT_CONFIG_EN "Filament settings" +#define MACHINE_LEVELING_CONFIG_EN "Leveling settings" + +#define MACHINE_TYPE_CONFIG_TITLE_EN "Machine Settings>Machine type" +#define MACHINE_TYPE_XYZ_EN "XYZ Machine" +#define MACHINE_TYPE_DELTA_EN "Delta Machine" +#define MACHINE_TYPE_COREXY_EN "Corexy Machine" + +#define MACHINE_STROKE_CONF_TITLE_EN "Machine Settings>Machine Size" +#define X_MAX_LENGTH_EN "X-axis maximum stroke" +#define Y_MAX_LENGTH_EN "Y-axis maximum stroke" +#define Z_MAX_LENGTH_EN "Z-axis maximum stroke" + +#define X_MIN_LENGTH_EN "X-axis minimum stroke" +#define Y_MIN_LENGTH_EN "Y-axis minimum stroke" +#define Z_MIN_LENGTH_EN "Z-axis minimum stroke" + +#define HOME_DIR_CONF_TITLE_EN "Machine Settings>Home direction" +#define HOME_DIR_X_EN "X-axis home direction" +#define HOME_DIR_Y_EN "Y-axis home direction" +#define HOME_DIR_Z_EN "Z-axis home direction" +#define HOME_MIN_EN "MIN" +#define HOME_MAX_EN "MAX" + +#define ENDSTOP_CONF_TITLE_EN "Machine Settings>Endstop type" +#define MIN_ENDSTOP_X_EN "X-axis minimum Endstop" +#define MIN_ENDSTOP_Y_EN "Y-axis minimum Endstop" +#define MIN_ENDSTOP_Z_EN "Z-axis minimum Endstop" +#define MAX_ENDSTOP_X_EN "X axis maximum Endstop" +#define MAX_ENDSTOP_Y_EN "Y axis maximum Endstop" +#define MAX_ENDSTOP_Z_EN "Z axis maximum Endstop" +#define ENDSTOP_FIL_EN "Filament sensor" +#define ENDSTOP_LEVEL_EN "Leveling sensor" +#define ENDSTOP_OPENED_EN "Open" +#define ENDSTOP_CLOSED_EN "Close" + +#define FILAMENT_CONF_TITLE_EN "Filament settings" +#define FILAMENT_IN_TEMPERATURE_EN "Load temperature" +#define FILAMENT_IN_LENGTH_EN "Load length" +#define FILAMENT_IN_SPEED_EN "Load speed" +#define FILAMENT_OUT_TEMPERATURE_EN "Unload temperature" +#define FILAMENT_OUT_LENGTH_EN "Unload length" +#define FILAMENT_OUT_SPEED_EN "Unload speed" + +#define LEVELING_CONF_TITLE_EN "Leveling settings" +#define LEVELING_PARA_CONF_EN "Leveling settings" +#define LEVELING_DELTA_EN "delta machine leveling" +#define LEVELING_XYZ_EN "Manual leveling coordinate settings" + +#define LEVELING_PARA_CONF_TITLE_EN "leveling setting" +#define AUTO_LEVELING_ENABLE_EN "Enable auto leveling" +#define BLTOUCH_LEVELING_ENABLE_EN "Enable BLtouch" +#define PROBE_PORT_EN "Probe connector" +#define PROBE_X_OFFSET_EN "Probe x axis offset" +#define PROBE_Y_OFFSET_EN "Probe y axis offset" +#define PROBE_Z_OFFSET_EN "Probe z axis offset" +#define PROBE_XY_SPEED_EN "Probe xy axis speed" +#define PROBE_Z_SPEED_EN "Probe z axis speed" +#define ENABLE_EN "YES" +#define DISABLE_EN "NO" +#define Z_MIN_EN "ZMin" +#define Z_MAX_EN "ZMax" + +#define DELTA_LEVEL_CONF_TITLE_EN "Delta Machine settings" +#define DELTA_LEVEL_CONF_EN "Delta Machine Leveling" +#define DELTA_MACHINE_RADIUS_EN "Machine Radius" +#define DELTA_DIAGONAL_ROD_EN "Machine rod length" +#define DELTA_PRINT_RADIUS_EN "Print radius" +#define DELTA_HEIGHT_EN "Print height" +#define SMOOTH_ROD_OFFSET_EN "Slider offset" +#define EFFECTOR_OFFSET_EN "Effector offset" +#define CALIBRATION_RADIUS_EN "Leveling radius" + +#define XYZ_LEVEL_CONF_TITLE_EN "Cartesian Machine Settings" +#define PROBE_REACH_MAX_LEFT_EN "Probe reaches leftmost position" +#define PROBE_REACH_MAX_RIGHT_EN "Probe reaches rightmost position" +#define PROBE_REACH_MAX_FRONT_EN "Probe reaches front position" +#define PROBE_REACH_MAX_BACK_EN "Probe reaches final position" + +#define TEMPERATURE_CONF_TITLE_EN "Machine Settings>Temperature settings" +#define NOZZLE_CONF_EN "Nozzle settings" +#define HOTBED_CONF_EN "Hotbed settings" +#define PREHEAT_TEMPER_EN "Preset temperature" + +#define NOZZLE_CONF_TITLE_EN "Machine Settings>Nozzle settings" +#define NOZZLECNT_EN "Number of nozzles" +#define NOZZLE_TYPE_EN "E0 Temperature type" +#define NOZZLE_ADJUST_TYPE_EN "PID thermostat" +#define NOZZLE_MIN_TEMPERATURE_EN "lowest temperature" +#define NOZZLE_MAX_TEMPERATURE_EN "Maximum temperature" +#define EXTRUD_MIN_TEMPER_EN "Minimum extrusion temperature" + +#define HOTBED_CONF_TITLE_EN "Machine Settings>Hotbed settings" +#define HOTBED_ADJUST_EN "PID thermostat" +#define HOTBED_MIN_TEMPERATURE_EN "lowest temperature" +#define HOTBED_MAX_TEMPERATURE_EN "Maximum temperature" + +#define MOTOR_CONF_TITLE_EN "Machine Settings>Motor settings" +#define MAXFEEDRATE_CONF_EN "Maximum speed settings" +#define ACCELERATION_CONF_EN "Acceleration settings" +#define JERKCONF_EN "Jerk settings" +#define STEPSCONF_EN "Steps settings" +#define TMC_CURRENT_EN "TMC Current settings" +#define TMC_STEP_MODE_EN "TMC Step mode settings" +#define MOTORDIRCONF_EN "Motor direction settings" +#define HOMEFEEDRATECONF_EN "Home speed setting" + +#define MAXFEEDRATE_CONF_TITLE_EN "Machine Settings>Maximum speed" +#define X_MAXFEEDRATE_EN "X axis maximum speed" +#define Y_MAXFEEDRATE_EN "Y axis maximum speed" +#define Z_MAXFEEDRATE_EN "Z axis maximum speed" +#define E0_MAXFEEDRATE_EN "E0 axis maximum speed" +#define E1_MAXFEEDRATE_EN "E1 axis maximum speed" + +#define ACCELERATION_CONF_TITLE_EN "Machine Settings>Acceleration" +#define PRINT_ACCELERATION_EN "Print acceleration" +#define RETRACT_ACCELERATION_EN "Retraction acceleration" +#define TRAVEL_ACCELERATION_EN "Travel acceleration" +#define X_ACCELERATION_EN "X-axis acceleration" +#define Y_ACCELERATION_EN "Y-axis acceleration" +#define Z_ACCELERATION_EN "Z-axis acceleration" +#define E0_ACCELERATION_EN "E0-axis acceleration" +#define E1_ACCELERATION_EN "E1-axis acceleration" + +#define JERK_CONF_TITLE_EN "Machine Settings>Jerk speed" +#define X_JERK_EN "X-axis jerk speed" +#define Y_JERK_EN "Y-axis jerk speed" +#define Z_JERK_EN "J-axis jerk speed" +#define E_JERK_EN "E-axis jerk speed" + +#define STEPS_CONF_TITLE_EN "Machine Settings>Steps settings" +#define X_STEPS_EN "X-axis steps" +#define Y_STEPS_EN "Y-axis stepS" +#define Z_STEPS_EN "Z-axis stepS" +#define E0_STEPS_EN "E0-axis steps" +#define E1_STEPS_EN "E1-axis steps" + +#define TMC_CURRENT_CONF_TITLE_EN "Machine Settings>TMC current settings" +#define X_TMC_CURRENT_EN "X axis current (mA)" +#define Y_TMC_CURRENT_EN "Y axis current (mA)" +#define Z_TMC_CURRENT_EN "Z axis current (mA)" +#define E0_TMC_CURRENT_EN "E0 axis current (mA)" +#define E1_TMC_CURRENT_EN "E1 axis current (mA)" + +#define TMC_MODE_CONF_TITLE_EN "Machine Settings>TMC step mode settings" +#define X_TMC_MODE_EN "Whether X axis enable stealthChop modes" +#define Y_TMC_MODE_EN "Whether Y axis enable stealthChop modes" +#define Z_TMC_MODE_EN "Whether Z axis enable stealthChop modes" +#define E0_TMC_MODE_EN "Whether E0 axis enable stealthChop modes" +#define E1_TMC_MODE_EN "Whether E1 axis enable stealthChop modes" + +#define MOTORDIR_CONF_TITLE_EN "Machine Settings>Motor direction" +#define X_MOTORDIR_EN "X-axis motor direction invert" +#define Y_MOTORDIR_EN "Y-axis motor direction invert" +#define Z_MOTORDIR_EN "Z-axis motor direction invert" +#define E0_MOTORDIR_EN "E0-axis motor direction invert" +#define E1_MOTORDIR_EN "E1-axis motor direction invert" +#define INVERT_P_EN "YES" +#define INVERT_N_EN "NO" + +#define HOMEFEEDRATE_CONF_TITLE_EN "Machine Settings>Home speed" +#define X_HOMESPEED_EN "XY-axis Home speed" +#define Y_HOMESPEED_EN "Y-axis Home speed" +#define Z_HOMESPEED_EN "Z-axis Home speed" + +#define ADVANCED_CONF_TITLE_EN "Machine Settings>Advance" +#define PWROFF_DECTION_EN "power off dection module" +#define PWROFF_AFTER_PRINT_EN "Auto Shutdown after print" +#define HAVE_UPS_EN "Has UPS power supply" +#define Z2_AND_Z2ENDSTOP_CONF_EN "Z2 Settings" +#define ENABLE_PINS_CONF_EN "Enable pins level settings" + +#define Z2_AND_Z2ENDSTOP_CONF_TITLE_EN "Z2 Settings" +#define Z2_ENABLE_EN "Z2 Enable" +#define Z2_ENDSTOP_EN "Z2_EndStop Enable" +#define Z2_PORT_EN "Z2 Connector" + +#define ENABLE_PINS_CONF_TITLE_EN "ENABLE_PINS_LEVEL" +#define X_ENABLE_PINS_INVERT_EN "X_ENABLE_PIN_INVERT" +#define Y_ENABLE_PINS_INVERT_EN "Y_ENABLE_PIN_INVERT" +#define Z_ENABLE_PINS_INVERT_EN "Z_ENABLE_PIN_INVERT" +#define E_ENABLE_PINS_INVERT_EN "E_ENABLE_PIN_INVERT" + +#define PAUSE_POSITION_EN "Printing pause position settings" +#define PAUSE_POSITION_X_EN "X axis position (Absolute position,-1 invalid)" +#define PAUSE_POSITION_Y_EN "Y axis position (Absolute position,-1 invalid)" +#define PAUSE_POSITION_Z_EN "Z axis position (Relative position,-1 invalid)" + +#define TOOL_TEXT_EN "Tool" +#define PREHEAT_TEXT_EN "Preheat" +#define MOVE_TEXT_EN "Move" +#define HOME_TEXT_EN "Home" +#define PRINT_TEXT_EN "Printing" +#define EXTRUDE_TEXT_EN "Extrusion" +#define LEVELING_TEXT_EN "Leveling" +#define AUTO_LEVELING_TEXT_EN "AutoLevel" +#define SET_TEXT_EN "Settings" +#define MORE_TEXT_EN "More" + +#define ADD_TEXT_EN "Add" +#define DEC_TEXT_EN "Dec" +#define EXTRUDER_1_TEXT_EN "Extrusion1" +#define EXTRUDER_2_TEXT_EN "Extrusion2" +#define HEATBED_TEXT_EN "HeatBed" +#define TEXT_1C_EN "1℃" +#define TEXT_5C_EN "5℃" +#define TEXT_10C_EN "10℃" +#define CLOSE_TEXT_EN "Close" + +#define BACK_TEXT_EN "Back" + +#define TOOL_PREHEAT_EN "Preheat" +#define TOOL_EXTRUDE_EN "Extrusion" +#define TOOL_MOVE_EN "Move" +#define TOOL_HOME_EN "Home" +#define TOOL_LEVELING_EN "Leveling" +#define TOOL_AUTO_LEVELING_EN "AutoLevel" +#define TOOL_FILAMENT_EN "Filament" +#define TOOL_MORE_EN "More" + +#define AXIS_X_ADD_TEXT_EN "X+" +#define AXIS_X_DEC_TEXT_EN "X-" +#define AXIS_Y_ADD_TEXT_EN "Y+" +#define AXIS_Y_DEC_TEXT_EN "Y-" +#define AXIS_Z_ADD_TEXT_EN "Z+" +#define AXIS_Z_DEC_TEXT_EN "Z-" +#define TEXT_01MM_EN "0.1mm" +#define TEXT_1MM_EN "1mm" +#define TEXT_10MM_EN "10mm" + +#define HOME_X_TEXT_EN "X" +#define HOME_Y_TEXT_EN "Y" +#define HOME_Z_TEXT_EN "Z" +#define HOME_ALL_TEXT_EN "Home" +#define HOME_STOPMOVE_EN "Quickstop" + +#define PAGE_UP_TEXT_EN "Page up" +#define PAGE_DOWN_TEXT_EN "Page down" + +#define EXTRUDER_IN_TEXT_EN "In" +#define EXTRUDER_OUT_TEXT_EN "Out" +#define EXTRUDE_1MM_TEXT_EN "1mm" +#define EXTRUDE_5MM_TEXT_EN "5mm" +#define EXTRUDE_10MM_TEXT_EN "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_EN "Low" +#define EXTRUDE_MEDIUM_SPEED_TEXT_EN "Normal" +#define EXTRUDE_HIGH_SPEED_TEXT_EN "High" + +#define LEVELING_POINT1_TEXT_EN "Point1" +#define LEVELING_POINT2_TEXT_EN "Point2" +#define LEVELING_POINT3_TEXT_EN "Point3" +#define LEVELING_POINT4_TEXT_EN "Point4" +#define LEVELING_POINT5_TEXT_EN "Point5" + +#define FILESYS_TEXT_EN "FileSys" +#define WIFI_TEXT_EN "WiFi" +#define FAN_TEXT_EN "Fan" +#define ABOUT_TEXT_EN "About" +#define BREAK_POINT_TEXT_EN "Continue" +#define FILAMENT_TEXT_EN "Filament" +#define LANGUAGE_TEXT_EN "Language" +#define MOTOR_OFF_TEXT_EN "Motor-off" +#define MOTOR_OFF_XY_TEXT_EN "Off-XY" +#define SHUTDOWN_TEXT_EN "Shutdown" +#define MACHINE_PARA_EN "Config" +#define EEPROM_SETTINGS_EN "Eeprom Set" + +#define U_DISK_TEXT_EN "USB" +#define SD_CARD_TEXT_EN "SD" +#define WIFI_NAME_TEXT_EN "WiFi: " +#define WIFI_KEY_TEXT_EN "Key: " +#define WIFI_IP_TEXT_EN "IP: " +#define WIFI_AP_TEXT_EN "State: AP" +#define WIFI_STA_TEXT_EN "State: STA" +#define WIFI_CONNECTED_TEXT_EN "Connected" +#define WIFI_DISCONNECTED_TEXT_EN "Disconnected" +#define WIFI_EXCEPTION_TEXT_EN "Exception" +#define WIFI_RECONNECT_TEXT_EN "Reconnect" +#define CLOUD_TEXT_EN "Cloud" +#define CLOUD_BIND_EN "Bind" +#define CLOUD_UNBIND_EN "Unbind" +#define CLOUD_UNBINDING_EN "Unbinding" +#define CLOUD_DISCONNECTED_EN "Disconnected" +#define CLOUD_UNBINDED_EN "Unbinded" +#define CLOUD_BINDED_EN "Binded" +#define CLOUD_DISABLE_EN "Disable" + +#define FAN_ADD_TEXT_EN "Add" +#define FAN_DEC_TEXT_EN "Dec" +#define FAN_OPEN_TEXT_EN "100%" +#define FAN_HALF_TEXT_EN "50%" +#define FAN_CLOSE_TEXT_EN "Close" +#define FAN_TIPS1_TEXT_EN "FAN" +#define FAN_TIPS2_TEXT_EN "FAN\nClose" + +#define FILAMENT_IN_TEXT_EN "Load" +#define FILAMENT_OUT_TEXT_EN "Unload" +#define FILAMENT_EXT0_TEXT_EN "Extrusion1" +#define FILAMENT_EXT1_TEXT_EN "Extrusion2" +#define FILAMENT_HEAT_TEXT_EN "Preheat" +#define FILAMENT_STOP_TEXT_EN "Stop" +//#define FILAMENT_CHANGE_TEXT_EN "Filament replace" +#define FILAMENT_TIPS2_TEXT_EN "T:" +#define FILAMENT_TIPS3_TEXT_EN "Loading..." +#define FILAMENT_TIPS4_TEXT_EN "Unloading..." +#define FILAMENT_TIPS5_TEXT_EN "Temp is too low to go,please heat" +#define FILAMENT_TIPS6_TEXT_EN "Completed" + +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_EN "Please click or \nto replace filament!" + #define FILAMENT_CHANGE_TEXT_EN "Please click or ,\nAfter pinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN "Heat completed,please load filament to extruder,and click for start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_EN "Please load filament to extruder,and click for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN "Heat completed,please click for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_EN "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_EN "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN "Load filament completed,click for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN "Unload filament completed,click for return!" +#endif + + +#define FILAMENT_CHANGE_TEXT_EN "Please click \nor ,After \npinter pause." +#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN "Heating up the nozzle,\nplease wait..." +#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN "Heating up the nozzle,\nplease wait..." +#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN "Heat completed,please load filament \nto extruder,and click \nfor start loading." +#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_EN "Please load filament to extruder,\nand click for start loading." +#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN "Heat completed,please \nclick for start unloading.!" +#define FILAMENT_DIALOG_LOADING_TIPS_EN "Is loading ,please wait!" +#define FILAMENT_DIALOG_UNLOADING_TIPS_EN "Is unloading,please wait!" +#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN "Load filament completed,\nclick for return!" +#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN "Unload filament completed,\nclick for return!" + + +#define PRE_HEAT_EXT_TEXT_EN "E" +#define PRE_HEAT_BED_TEXT_EN "Bed" + +#define FILE_LOADING_EN "Loading......" +#if 0 + #define NO_FILE_AND_CHECK_EN "No files found!Please insert SD card or U disk!" +#else + #define NO_FILE_AND_CHECK_EN " No files found!\n Check the file system configuration!" +#endif + +#define NO_FILE_EN "No files found!" + +#define EXTRUDER_TEMP_TEXT_EN "Temper" +#define EXTRUDER_E_LENGTH1_TEXT_EN "Extrusion1" +#define EXTRUDER_E_LENGTH2_TEXT_EN "Extrusion2" +#define EXTRUDER_E_LENGTH3_TEXT_EN "Extrusion3" + +#define ABOUT_TYPE_TEXT_EN "Type: " +#define ABOUT_VERSION_TEXT_EN "Firmware: " +#define ABOUT_WIFI_TEXT_EN "WiFi: " + +#define PRINTING_OPERATION_EN "Option" +#define PRINTING_PAUSE_EN "Pause" +#define PRINTING_TEMP_EN "Temp." +#define PRINTING_CHANGESPEED_EN "Speed" +#define PRINTING_RESUME_EN "Resume" +#define PRINTING_STOP_EN "Stop" +#define PRINTING_MORE_EN "More" +#define PRINTING_EXTRUDER_EN "Extrusion" +#define PRINTING_MOVE_EN "Move" + +#define EXTRUDER_SPEED_EN "Extrusion" +#define MOVE_SPEED_EN "Move" +#define EXTRUDER_SPEED_STATE_EN "Extrude Speed" +#define MOVE_SPEED_STATE_EN "Move Speed" +#define STEP_1PERCENT_EN "1%" +#define STEP_5PERCENT_EN "5%" +#define STEP_10PERCENT_EN "10%" + +#define ZOFFSET_EN "Z Offset" +#define ZOFFSET_INC_EN "Add" +#define ZOFFSET_DEC_EN "Dec" + +#define TITLE_READYPRINT_EN "ReadyPrint" +#define TITLE_PREHEAT_EN "Preheat" +#define TITLE_MOVE_EN "Move" +#define TITLE_HOME_EN "Home" +#define TITLE_EXTRUDE_EN "Extrusion" +#define TITLE_LEVELING_EN "Leveling" +#define TITLE_SET_EN "Settings" +#define TITLE_MORE_EN "More" +#define TITLE_CHOOSEFILE_EN "ChooseFile" +#define TITLE_PRINTING_EN "Printing" +#define TITLE_OPERATION_EN "Operation" +#define TITLE_ADJUST_EN "Adjust" +#define TITLE_WIRELESS_EN "Wireless" +#define TITLE_FILAMENT_EN "Filament" +#define TITLE_ABOUT_EN "About" +#define TITLE_FAN_EN "Fan" +#define TITLE_LANGUAGE_EN "Language" +#define TITLE_PAUSE_EN "Pause" +#define TITLE_CHANGESPEED_EN "Speed" +#define TITLE_CLOUD_TEXT_EN "Cloud" +#define TITLE_DIALOG_CONFIRM_EN "Confirm" +#define TITLE_FILESYS_EN "FileSys" +#define TITLE_ZOFFSET_EN "Z Offset" + +#define AUTO_SHUTDOWN_EN "Auto" +#define MANUAL_SHUTDOWN_EN "Manual" + +#define DIALOG_CONFIRM_EN "Confirm" +#define DIALOG_CANCLE_EN "Cancel" +#define DIALOG_OK_EN "OK" +#define DIALOG_RESET_EN "Reset" +#define DIALOG_RETRY_EN "Retry" +#define DIALOG_DISABLE_EN "Disable" +#define DIALOG_PRINT_MODEL_EN "Print this model?" +#define DIALOG_CANCEL_PRINT_EN "Stop print?" +#define DIALOG_RETRY_EN "Retry" +#define DIALOG_STOP_EN "Stop" +#define DIALOG_REPRINT_FROM_BREAKPOINT_EN "Reprint from breakpoint?" +//#define DIALOG_UNBIND_PRINTER_EN "Unbind the printer?" +#define DIALOG_ERROR_TIPS1_EN "Error:no file,please check it again." +#define DIALOG_ERROR_TIPS2_EN "Error:transaction failed.please check display baudrate \nwhether as the same as mainboard!" +#define DIALOG_ERROR_TIPS3_EN "Error:file name or path is too long!" +#define DIALOG_CLOSE_MACHINE_EN "Closing machine......" +#define DIALOG_UNBIND_PRINTER_EN "Unbind the printer?" +#define DIALOG_FILAMENT_NO_PRESS_EN "Filament detection switch is not pressed" +#define DIALOG_PRINT_FINISH_EN "Done print!" +#define DIALOG_PRINT_TIME_EN "Print time: " +#define DIALOG_REPRINT_EN "Print again" +#define DIALOG_WIFI_ENABLE_TIPS_EN "The wifi module is being configured\nplease wait a moment....." + +#define HOTBED_ENABLE_EN "Enable heatbed" +#define MOTOR_EN_HIGH_LEVEL_EN "High" +#define MOTOR_EN_LOW_LEVEL_EN "Low" + +#define TEXT_WIFI_MENU_TITLE_EN "WI-FI" +#define TEXT_WIFI_SAPCE_EN "space" +#define TEXT_WIFI_LETTER_EN "abc" +#define TEXT_WIFI_DIGITAL_EN "123" +#define TEXT_WIFI_SYMBOL_EN "#+=" +#define TEXT_WIFI_PASSWORD_EN "Password" + +#define TEXT_WIFI_POINT_BOLD_EN "`" + +#define TEXT_WIFI_JOINING_EN "Joining\nNetwork..." +#define TEXT_WIFI_FAILED_JOIN_EN "Failed to\nJoin Wi-Fi" +#define TEXT_WIFI_WIFI_CONECTED_EN "Wi-Fi\nConnected" + +#define TEXT_BUTTON_DISCONECTED_EN "Disconnect" +#define TEXT_WIFI_FORGET_EN "Forget Network" +#define TEXT_DISCONECTED_EN "Wi-Fi Connected" + +//wifi-list +#define MAIN_BUILT_EN "Build" +#define MAIN_FILAMENT_EN "Filament" +#define MAIN_SETUP_EN "Setup" +#define MAIN_ABOUT_EN "About" +#define MAIN_MENU_EN "Menu" +#define FILE_MENU_BUILD_EN "Build" +#define FILE_MENU_MENU_EN " < Menu" + +//about +#define ABOUT_TITLE_EN "About" +#define ABOUT_BUILT_MACHINES_EN "Built Machines" +#define ABOUT_SPARK_EN "Spark" +#define ABOUT_VERSION_EN "Version 1.1.0" +#define ABOUT_SERIAL_NUMBER_EN "Serial Number:" +#define ABOUT_S_NUMBER_EN "DCPLX02KFC6P" + +//set +#define SETUP_TITLE_EN "Setup" +#define SETUP_WIFI_EN "Wi-Fi" +#define SETUP_MANUAL_IP_EN "Manual IP" +#define SETUP_WIFI_NOT_CONNECTED_EN "Not Connected" +#define SETUP_WIFI_NETWORK_EN "WiFi_Network" + +//build +#define BUILD_TITLE_EN "Build" +#define BUILD_SD_CARD_EN "SD Card" +#define BUILD_USB_DRIVE_EN "USB Drive" + +//SD card +#define SD_CARD_TITLE_EN "SD Card" +#define SD_CARD_BACK_EN "< Back" +//USB Drive +#define USB_DRIVE_TITLE_EN "USB Drive" +#define USB_DRIVE_BACK_EN "< Back" +#define FILE_PAGES_EN "%d/%d" +#define FILE_NEXT_PAGE_EN "Next Page" + +//BUILD PLATE +#define PLATE_TITLE_EN "Build Plate" +#define PLATE_BACK_EN "< Back" +#define PLATE_CONFIRM_EN "Confirm >" +#define PLATE_TIPS_EN "Confirm that there is a Clear\nBuild Plate installed in the\nmachine." + +//build model +#define MODEL_TITLE_EN "Build Model" +#define MODEL_START_BUILD_EN "Start Build" +#define MODEL_BACK_EN "< Back" + +//building +#define BUILDING_TITLE_EN "Building" +#define BUILDING_MENU_EN "Build Menu" +#define BUILDING_COMPLETED "Build\nComplete" + +//building menu +#define BUILDING_MENU_TITLE_EN "Build Menu" +#define BUILDING_MENU_SETTINGS_EN "Build Settings" +#define BUILDING_MENU_PAUSE_EN "Pause Build" +#define BUILDING_MENU_CANCEL_EN "Cancel Build" +#define BUILDING_MENU_BACK_EN "< Back" + +//build settings +#define SETTINGS_TITLE_EN "Build Settings" +#define SETTINGS_NOZZLE_TEMPER_EN "Nozzle Temp:" +#define SETTINGS_NOZZLE_VALUE_EN "%d" +#define SETTINGS_BED_TEMPER_EN "Bed Temp:" +#define SETTINGS_BED_VALUE_EN "%d" +#define SETTINGS_BUILD_SPEED_EN "Build Speed:" +#define SETTINGS_SPEED_VALUE_EN "Standard" +#define SETTINGS_BACK_EN "< Back" + +//build paused +#define PAUSED_TITLE_EN "Build Paused" +#define PAUSED_RESUME_EN "Resume Build" +#define PAUSED_CANCEL_EN "Cancel Build" +#define PAUSED_BACK_EN "< Back" + +//build cancel +#define CANCEL_TITLE_EN "Cancel Build" +#define CANCEL_BUILD_EN "Cancel Build" +#define CANCEL_TIPS_EN "Are you sure you want to\ncancel this build? The model\nwill be deleted from this\nmachine. It will need to be\nresent from your computer\nbefore it can be built in the\nfuture." +#define CANCEL_BACK_EN "< Back" +#define CANCEL_BUILD_DISPLAY_EN "Build\nCanceled" +#define CANCEL_OVER_PLATE_TIPS_EN "Confirm that the Build Plate\nhas been removed from the\nmachine." + +//filament model enter +#define FILAMENT_MODEL_ENTER_TITLE_EN "Model-PLA" +#define FILAMENT_MODEL_ENTER_BACK_EN "< Back" +#define FILAMENT_MODEL_ENTER_BEGIN_EN "Begin >" +#define FILAMENT_MODEL_ENTER_TIPS_EN "The Model Filament spool\ncompartment is located on\nthe right side of the machine." + +//filament model PLA +#define FILAMENT_MODEL_PLA_TITLE_EN "Model-PLA" +#define FILAMENT_PLA_LOAD_TITLE_EN "Load Filament" +#define FILAMENT_PLA_UNLOAD_TITLE_EN "Unload Filament" +#define FILAMENT_MODEL_PLA_LOAD_EN "Load Filament" +#define FILAMENT_MODEL_PLA_UNLOAD_EN "Unload Filament" +//filament support enter +#define FILAMENT_SUPPORT_ENTER_TITLE_EN "Support-PVA" +#define FILAMENT_SUPPORT_ENTER_BACK_EN "< Back" +#define FILAMENT_SUPPORT_ENTER_BEGIN_EN "Begin >" +#define FILAMENT_SUPPORT_ENTER_TIPS_EN "The Support Filament spool\ncompartment is located on\nthe left side of the machine." +//filament heating +#define FILAMENT_HEATING_LOAD_TITLE_EN "Load Filament" +#define FILAMENT_HEATING_UNLOAD_TITLE_EN "Unload Filament" +#define FILAMENT_HEATING_CANCEL_EN "< Cancel" +#define FILAMENT_HEATING_MATERIAL_EN "Material:" +#define FILAMENT_HEATING_PLA_EN "Model-PLA" +#define FILAMENT_HEATING_TIPS_EN "Print head is heating..." +//rotate left +#define ROTATE_LEFT_LOAD_TITLE_EN "Load Filament" +#define ROTATE_LEFT_UNLOAD_TITLE_EN "Unload Filament" +#define ROTATE_LEFT_CANCEL_EN "< Cancel" +#define ROTATE_LEFT_MATERIAL_EN "Material:" +#define ROTATE_LEFT_PLA_EN "Model-PLA" +#define ROTATE_LEFT_NEXT_EN "Next >" +#define ROTATE_LEFT_TIPS_EN "Rotate extruder selection\ndial to the left." + +//hang spool +#define HANG_SPOOL_TITLE_EN "Load Filament" +#define HANG_SPOOL_PREVIOUS_EN "< Previous" +#define HANG_SPOOL_MATERIAL_EN "Material:" +#define HANG_SPOOL_PLA_EN "Model-PLA" +#define HANG_SPOOL_NEXT_EN "Next >" +#define HANG_SPOOL_TIPS_EN "Hang the spool in the spool\ncompartment as shown." + +//feed filament +#define FEED_FILAMENT_TITLE_EN "Load Filament" +#define FEED_FILAMENT_PREVIOUS_EN "< Previous" +#define FEED_FILAMENT_MATERIAL_EN "Material:" +#define FEED_FILAMENT_PLA_EN "Model-PLA" +#define FEED_FILAMENT_NEXT_EN "Next >" +#define FEED_FILAMENT_TIPS_EN "Feed filament into extruder\nup beyond the gears." + +//feed filament +#define ROTATE_UP_TITLE_EN "Load Filament" +#define ROTATE_UP_PREVIOUS_EN "< Previous" +#define ROTATE_UP_MATERIAL_EN "Material:" +#define ROTATE_UP_PLA_EN "Model-PLA" +#define ROTATE_UP_NEXT_EN "Next >" +#define ROTATE_UP_TIPS_EN "Rotate extruder selection\ndial up." + +//filament begin +#define FEED_BEGIN_TITLE_EN "Load Filament" +#define FEED_BEGIN_MATERIAL_EN "Material:" +#define FEED_BEGIN_PLA_EN "Model-PLA" +#define FEED_BEGIN_NEXT_EN "Next >" +#define FEED_BEGIN_TIPS_EN "Press Next when filament\nbegins to extrude." + +//filament finish +#define FEED_FINISH_TITLE_EN "Load Filament" +#define FEED_FINISH_MATERIAL_EN "Material:" +#define FEED_FINISH_PLA_EN "Model-PLA" +#define FEED_FINISH_NEXT_EN "Finish >" +#define FEED_FINISH_TIPS_EN "Remove filament from the\nnozzle and discard." +//fiament remove +#define REMOVE_SPOOL_TITLE_EN "Unload Filament" +#define REMOVE_SPOOL_PREVIOUS_EN "< Previous" +#define REMOVE_SPOOL_FINISH_EN "Finish >" +#define REMOVE_SPOOL_MATERIAL_EN "Material:" +#define REMOVE_SPOOL_PLA_EN "Model-PLA" +#define REMOVE_SPOOL_TIPS_EN "Remove the spool and pull\nfilament out of the machine." + +#define FILAMENT_SUPPORT_PVA_EN "Support-PVA" +#define LOAD_FINISH_EN "Load\nFilament\nComplete" +#define UNLOAD_FINISH_EN "Unload\nFilament\nComplete" + +//manual ip +#define MANUAL_IP_TITLE_EN "Manual IP" +#define MANUAL_IP_CANCEL_EN "< Cancel" +#define MANUAL_IP_APPLY_EN "Join >" +#define MANUAL_IP_ADDRESS_EN "IP Address" +#define MANUAL_IP_MASK_EN "Subnet Mask" +#define MANUAL_IP_GATEWAY_EN "Default Gateway" +#define MANUAL_IP_SERVER_EN "Name Server" +#define MANUAL_IP_INIT_DATA_EN "0.0.0.0" +#define MANUAL_TEXT_POINT_EN "." +#define MANUAL_TEXT_ENTER_EN "enter" + +//Wifi name +//#define TEXT_WIFI_MENU_TITLE_EN "WI-FI" +//#define TEXT_WIFI_SAPCE_EN "space" +//#define TEXT_WIFI_LETTER_EN "abc" +//#define TEXT_WIFI_DIGITAL_EN "123" +//#define TEXT_WIFI_SYMBOL_EN "#+=" +//#define TEXT_WIFI_PASSWORD_EN "Password" + +//#define TEXT_WIFI_POINT_BOLD_EN "`" + +//#define TEXT_WIFI_JOINING_EN "Joining\nNetwork..." +//#define TEXT_WIFI_FAILED_JOIN_EN "Failed to\nJoin Wi-Fi" +//#define TEXT_WIFI_WIFI_CONECTED_EN "Wi-Fi\nConnected" + +//#define TEXT_BUTTON_DISCONECTED_EN "Disconnect" +//#define TEXT_WIFI_FORGET_EN "Forget Network" +//#define TEXT_DISCONECTED_EN "Wi-Fi Connected" + +#define TEXT_FORGET_TIPS_TITLE_EN "Forget Network" +#define TEXT_FORGET_NETWORK_TIPS1_EN "Are you sure you want to\nforget this network?" +#define TEXT_FORGET_NETWORK_TIPS2_EN "This machine will no longer\njoin this Wi-Fi Network." + +#define TEXT_IPADDRESS_EN "IP Address: " + +#define TEXT_BUILD_FROM_CURA_CANCEL_TIPS1_EN "Are you sure you want to\ncancel this build?" +#define TEXT_BUILD_FROM_CURA_CANCEL_TIPS2_EN "The model will be deleted\nfrom this machine.It will\nneed to be resent from your\ncomputer before it can be\nbuilt in the future." + +#define DIALOG_CONFIRM_EN2 "Confirm" + +#define HEATING_TITLE_EN "Heating" +#define LEVELING_TITLE_EN "Leveling" + +#define ABOUT_SPARK_ADD_EN "Spark+" + +#define TEXT_RECEIVING_DATA_EN "Receiving Data" + +#define TEXT_BABY_STEP_EN "Babystep" + +#define PRINTING_OTHER_LANGUGE "Printing" +#define PRINTING_OPERATION_OTHER_LANGUGE "Operation" +#define PRINTING_PAUSE_OTHER_LANGUGE "Pause" + +#define MESSAGE_PAUSING_EN "Parking..." +#define MESSAGE_CHANGING_EN "Wait for filament change to start" +#define MESSAGE_UNLOAD_EN "Wait for filament unload" +#define MESSAGE_WAITING_EN "Press Button to resume print" +#define MESSAGE_INSERT_EN "Insert filament and press button to continue" +#define MESSAGE_LOAD_EN "Wait for filament load" +#define MESSAGE_PURGE_EN "Wait for filament purge" +#define MESSAGE_RESUME_EN "Wait for print to resume..." +#define MESSAGE_HEAT_EN "Press button to heat nozzle" +#define MESSAGE_HEATING_EN "Nozzle heating Please wait..." +#define MESSAGE_OPTION_EN "Purge more or continue print?" +#define MESSAGE_PURGE_MORE_EN "Purge" +#define MESSAGE_CONTINUE_PRINT_EN "Print" +#define EEPROM_SETTINGS_TITLE_EN "EEPROM Settings" +#define EEPROM_SETTINGS_STORE_EN "Store settings to EEPROM" +#define EEPROM_SETTINGS_READ_EN "Read settings from EEPROM" +#define EEPROM_SETTINGS_REVERT_EN "Revert settings to factory defaults" + +#define EEPROM_STORE_TIPS_EN "Store settings to EEPROM?" +#define EEPROM_READ_TIPS_EN "Read settings from EEPROM?" +#define EEPROM_REVERT_TIPS_EN "Revert settings to factory defaults?" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h new file mode 100644 index 0000000000..3fe95654b1 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h @@ -0,0 +1,286 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 TOOL_TEXT_FR "prêt" +#define PREHEAT_TEXT_FR "Préchauffe" +#define MOVE_TEXT_FR "Déplace" +#define HOME_TEXT_FR "Acceuil" +#define PRINT_TEXT_FR "Impression" +#define EXTRUDE_TEXT_FR "Extruder" +#define LEVELING_TEXT_FR "Leveling" +#define AUTO_LEVELING_TEXT_FR "AutoLevel" +#define SET_TEXT_FR "Config" +#define MORE_TEXT_FR "Plus" + +#define ADD_TEXT_FR "Ajouter" +#define DEC_TEXT_FR "Réduire" +#define EXTRUDER_1_TEXT_FR "Extr1" +#define EXTRUDER_2_TEXT_FR "Extr2" +#define HEATBED_TEXT_FR "Hotlit" +#define TEXT_1C_FR "1℃" +#define TEXT_5C_FR "5℃" +#define TEXT_10C_FR "10℃" +#define CLOSE_TEXT_FR "Off" + +#define BACK_TEXT_FR "Arrière" + +#define TOOL_PREHEAT_FR "Préchauffe" +#define TOOL_EXTRUDE_FR "Extruder" +#define TOOL_MOVE_FR "Déplace" +#define TOOL_HOME_FR "Acceuil" +#define TOOL_LEVELING_FR "Leveling" +#define TOOL_AUTO_LEVELING_FR "AutoLevel" +#define TOOL_FILAMENT_FR "Filament" +#define TOOL_MORE_FR "Plus" + +#define AXIS_X_ADD_TEXT_FR "X+" +#define AXIS_X_DEC_TEXT_FR "X-" +#define AXIS_Y_ADD_TEXT_FR "Y+" +#define AXIS_Y_DEC_TEXT_FR "Y-" +#define AXIS_Z_ADD_TEXT_FR "Z+" +#define AXIS_Z_DEC_TEXT_FR "Z-" +#define TEXT_01MM_FR "0.1mm" +#define TEXT_1MM_FR "1mm" +#define TEXT_10MM_FR "10mm" + +#define HOME_X_TEXT_FR "X" +#define HOME_Y_TEXT_FR "Y" +#define HOME_Z_TEXT_FR "Z" +#define HOME_ALL_TEXT_FR "ALL" +#define HOME_STOPMOVE_FR "Quickstop" + +#define PAGE_UP_TEXT_FR "En haut" +#define PAGE_DOWN_TEXT_FR "En bas" + +#define EXTRUDER_IN_TEXT_FR "Insérer" +#define EXTRUDER_OUT_TEXT_FR "éjecter" +#define EXTRUDE_1MM_TEXT_FR "1mm" +#define EXTRUDE_5MM_TEXT_FR "5mm" +#define EXTRUDE_10MM_TEXT_FR "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_FR "Lente" +#define EXTRUDE_MEDIUM_SPEED_TEXT_FR "Moyen" +#define EXTRUDE_HIGH_SPEED_TEXT_FR "Rapide" + +#define LEVELING_POINT1_TEXT_FR "Premier" +#define LEVELING_POINT2_TEXT_FR "Seconde" +#define LEVELING_POINT3_TEXT_FR "Troisième" +#define LEVELING_POINT4_TEXT_FR "Quatrième" +#define LEVELING_POINT5_TEXT_FR "Cinquième" + +#define FILESYS_TEXT_FR "Fichier" +#define WIFI_TEXT_FR "WiFi" +#define FAN_TEXT_FR "Fan" +#define ABOUT_TEXT_FR "A propos" +#define BREAK_POINT_TEXT_FR "Continuer" +#define FILAMENT_TEXT_FR "Remplacer" +#define LANGUAGE_TEXT_FR "Langue" +#define MOTOR_OFF_TEXT_FR "M-hors" +#define MOTOR_OFF_XY_TEXT_FR "M-hors-XY" +#define SHUTDOWN_TEXT_FR "Eteindre" +#define MACHINE_PARA_FR "Config" +#define EEPROM_SETTINGS_FR "Eeprom Set" + +#define U_DISK_TEXT_FR "Clé usb" +#define SD_CARD_TEXT_FR "Carte SD" +#define WIFI_NAME_TEXT_FR "WiFi: " +#define WIFI_KEY_TEXT_FR "Key: " +#define WIFI_IP_TEXT_FR "IP: " +#define WIFI_AP_TEXT_FR "Etat: AP" +#define WIFI_STA_TEXT_FR "Etat: STA" +#define WIFI_CONNECTED_TEXT_FR "Connecté" +#define WIFI_DISCONNECTED_TEXT_FR "Déconnecté" +#define WIFI_EXCEPTION_TEXT_FR "Exception" +#define WIFI_RECONNECT_TEXT_FR "Reconnect" +#define CLOUD_TEXT_FR "Cloud" +#define CLOUD_BIND_FR "Lié" +#define CLOUD_UNBIND_FR "Délier" +#define CLOUD_UNBINDING_FR "Délier" +#define CLOUD_DISCONNECTED_FR "Déconnecté" +#define CLOUD_UNBINDED_FR "Délier" +#define CLOUD_BINDED_FR "Lié" +#define CLOUD_DISABLE_FR "Désactiver" + +#define FAN_ADD_TEXT_FR "Ajouter" +#define FAN_DEC_TEXT_FR "Réduire" +#define FAN_OPEN_TEXT_FR "100%" +#define FAN_HALF_TEXT_FR "50%" +#define FAN_CLOSE_TEXT_FR "0%" +#define FAN_TIPS1_TEXT_FR "ventilateur" +#define FAN_TIPS2_TEXT_FR "ventilateur\n0" + +#define FILAMENT_IN_TEXT_FR "Insérer" +#define FILAMENT_OUT_TEXT_FR "éjecter" +#define FILAMENT_EXT0_TEXT_FR "Extr1" +#define FILAMENT_EXT1_TEXT_FR "Extr2" +#define FILAMENT_HEAT_TEXT_FR "Preheat" +#define FILAMENT_STOP_TEXT_FR "Arrêter" +//#define FILAMENT_CHANGE_TEXT_FR "Filament remplacer" +#define FILAMENT_TIPS2_TEXT_FR "T:" +#define FILAMENT_TIPS3_TEXT_FR "Insérer le filament..." +#define FILAMENT_TIPS4_TEXT_FR "éjecter le filament..." +#define FILAMENT_TIPS5_TEXT_FR "Température trop basse pour démarrer, chauffez svp" +#define FILAMENT_TIPS6_TEXT_FR "Terminé" + +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_FR "Please click or <éjecter> \nto replace filament!" + #define FILAMENT_CHANGE_TEXT_FR "Please click or <éjecter>,\nAfter pinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR "Heat completed,please load filament to extruder,and click for start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_FR "Please load filament to extruder,and click for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR "Heat completed,please click for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_FR "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_FR "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR "Load filament completed,click for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR "Unload filament completed,click for return!" +#endif +#define FILAMENT_CHANGE_TEXT_FR "Please click \nor ,After \npinter pause." +#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR "Heating up the nozzle,\nplease wait..." +#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR "Heating up the nozzle,\nplease wait..." +#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR "Heat completed,please load filament \nto extruder,and click \nfor start loading." +#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_FR "Please load filament to extruder,\nand click for start loading." +#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR "Heat completed,please \nclick for start unloading.!" +#define FILAMENT_DIALOG_LOADING_TIPS_FR "Is loading ,please wait!" +#define FILAMENT_DIALOG_UNLOADING_TIPS_FR "Is unloading,please wait!" +#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR "Load filament completed,\nclick for return!" +#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR "Unload filament completed,\nclick for return!" + + +#define PRE_HEAT_EXT_TEXT_FR "E" +#define PRE_HEAT_BED_TEXT_FR "Bed" + +#define FILE_LOADING_FR "Chargement......" +#if 0 + #define NO_FILE_AND_CHECK_FR "Aucun fichier trouvé! Insérez une carte SD ou un disque U!" +#else + #define NO_FILE_AND_CHECK_FR "Aucun fichier,vérifiez à nouveau!" +#endif + +#define NO_FILE_FR "Pas de fichier!" + + + +#define EXTRUDER_TEMP_TEXT_FR "Temper" +#define EXTRUDER_E_LENGTH1_TEXT_FR "Extruder1" +#define EXTRUDER_E_LENGTH2_TEXT_FR "Extruder2" +#define EXTRUDER_E_LENGTH3_TEXT_FR "Extruder3" + +#define ABOUT_TYPE_TEXT_FR "Type: " +#define ABOUT_VERSION_TEXT_FR "Firmware: " +#define ABOUT_WIFI_TEXT_FR "Wifi: " + +#define PRINTING_OPERATION_FR "Option" +#define PRINTING_PAUSE_FR "Pause" +#define PRINTING_TEMP_FR "Temp." +#define PRINTING_CHANGESPEED_FR "Speed" +#define PRINTING_RESUME_FR "Reprendre" +#define PRINTING_STOP_FR "Stop" +#define PRINTING_MORE_FR "Plus" +#define PRINTING_EXTRUDER_FR "Extruder" +#define PRINTING_MOVE_FR "Déplace" + +#define EXTRUDER_SPEED_FR "Extruder" +#define MOVE_SPEED_FR "Déplace" +#define EXTRUDER_SPEED_STATE_FR "Vitesse d'extrusion" +#define MOVE_SPEED_STATE_FR "vitesse de déplacement" +#define STEP_1PERCENT_FR "1%" +#define STEP_5PERCENT_FR "5%" +#define STEP_10PERCENT_FR "10%" + +#define ZOFFSET_FR "Z Offset" +#define ZOFFSET_INC_FR "Ajouter" +#define ZOFFSET_DEC_FR "Réduire" + +#define TITLE_READYPRINT_FR "Prête" +#define TITLE_PREHEAT_FR "Préchauffe" +#define TITLE_MOVE_FR "Déplace" +#define TITLE_HOME_FR "Acceuil" +#define TITLE_EXTRUDE_FR "Extruder" +#define TITLE_LEVELING_FR "Leveling" +#define TITLE_SET_FR "Paramètres" +#define TITLE_MORE_FR "Plus" +#define TITLE_CHOOSEFILE_FR "Fichier" +#define TITLE_PRINTING_FR "Pimpression" +#define TITLE_OPERATION_FR "Option" +#define TITLE_ADJUST_FR "Réglage" +#define TITLE_WIRELESS_FR "Sans fil" +#define TITLE_FILAMENT_FR "Remplacer" +#define TITLE_ABOUT_FR "A propos" +#define TITLE_FAN_FR "Ventilateur" +#define TITLE_LANGUAGE_FR "Langue" +#define TITLE_PAUSE_FR "Pause" +#define TITLE_CHANGESPEED_FR "Speed" +#define TITLE_CLOUD_TEXT_FR "Cloud" +#define TITLE_DIALOG_CONFIRM_FR "Confirm" +#define TITLE_FILESYS_FR "FileSys" +#define TITLE_ZOFFSET_FR "Z Offset" + +#define DIALOG_CLOSE_MACHINE_FR "Closing machine......" + +#define AUTO_SHUTDOWN_FR "Auto" +#define MANUAL_SHUTDOWN_FR "Manuel" + +#define DIALOG_CONFIRM_FR "Confirmer" +#define DIALOG_CANCLE_FR "Annuler" +#define DIALOG_OK_FR "OK" +#define DIALOG_RESET_FR "Réinitialiser" +#define DIALOG_RETRY_FR "Recommencez" +#define DIALOG_DISABLE_FR "Disable" +#define DIALOG_PRINT_MODEL_FR "Imprimer le fichier?" +#define DIALOG_CANCEL_PRINT_FR "Arrêter?" + +#define DIALOG_STOP_FR "Arrêter" +#define DIALOG_REPRINT_FROM_BREAKPOINT_FR "Continuer?" +//#define DIALOG_UNBIND_PRINTER_FR "Non lié?" +#define DIALOG_ERROR_TIPS1_FR "Erreur:error:Aucun fichier, \nvérifiez à nouveau." +#define DIALOG_ERROR_TIPS2_FR "Erreur:La opération a échoué. \nVerifiez que le baudrate de l'écran et de \nla carte mère soient identique!" +#define DIALOG_ERROR_TIPS3_FR "Erreur: le nom du fichier ou le \nchemin d'accès est trop long." +#define DIALOG_UNBIND_PRINTER_FR "Unbind the printer?" +#define DIALOG_FILAMENT_NO_PRESS_FR "Filament detection switch is not pressed" +#define DIALOG_PRINT_FINISH_FR "L'impression est terminée!" +#define DIALOG_PRINT_TIME_FR "Temps d'impression: " +#define DIALOG_REPRINT_FR "Print again" +#define DIALOG_WIFI_ENABLE_TIPS_FR "The wifi module is being configured,\nplease wait a moment....." + +#define MESSAGE_PAUSING_FR "Parking..." +#define MESSAGE_CHANGING_FR "Attente filament pour démarrer" +#define MESSAGE_UNLOAD_FR "Attente retrait du filament" +#define MESSAGE_WAITING_FR "Presser bouton,pour reprendre" +#define MESSAGE_INSERT_FR "Insérer filament et app. bouton pour continuer..." +#define MESSAGE_LOAD_FR "Attente chargement filament" +#define MESSAGE_PURGE_FR "Attente Purge filament" +#define MESSAGE_RESUME_FR "Attente reprise impression" +#define MESSAGE_HEAT_FR "Presser le bouton pour chauffer..." +#define MESSAGE_HEATING_FR "Buse en chauffe Patienter SVP..." +#define MESSAGE_OPTION_FR "Purger davantage ou continuer l'impression?" +#define MESSAGE_PURGE_MORE_FR "Purge" +#define MESSAGE_CONTINUE_PRINT_FR "Impression" +#define EEPROM_SETTINGS_TITLE_FR "Paramètres EEPROM" +#define EEPROM_SETTINGS_STORE_FR "Stocker les paramètres dans l'EEPROM" +#define EEPROM_SETTINGS_READ_FR "Lire les paramètres de l'EEPROM" +#define EEPROM_SETTINGS_REVERT_FR "Rétablir les paramètres par défaut d'usine" + +#define EEPROM_STORE_TIPS_FR "Stocker les paramètres dans l'EEPROM?" +#define EEPROM_READ_TIPS_FR "Lire les paramètres de l'EEPROM?" +#define EEPROM_REVERT_TIPS_FR "Rétablir les paramètres par défaut d'usine?" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h new file mode 100644 index 0000000000..aef6cfaf96 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h @@ -0,0 +1,281 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 TOOL_TEXT_IT "Strumento" +#define PREHEAT_TEXT_IT "Prerisc" +#define MOVE_TEXT_IT "Muovi" +#define HOME_TEXT_IT "Home" +#define PRINT_TEXT_IT "Stampa" +#define EXTRUDE_TEXT_IT "Estrude" +#define LEVELING_TEXT_IT "Leveling" +#define AUTO_LEVELING_TEXT_IT "AutoLevel" +#define SET_TEXT_IT "Imposta" +#define MORE_TEXT_IT "Di più" + +#define ADD_TEXT_IT "Aumentare" +#define DEC_TEXT_IT "Ridurre" +#define EXTRUDER_1_TEXT_IT "Estrude1" +#define EXTRUDER_2_TEXT_IT "Estrude2" +#define HEATBED_TEXT_IT "Piano" +#define TEXT_1C_IT "1℃" +#define TEXT_5C_IT "5℃" +#define TEXT_10C_IT "10℃" +#define CLOSE_TEXT_IT "Spento" + +#define BACK_TEXT_IT "Indietro" + +#define TOOL_PREHEAT_IT "Prerisc" +#define TOOL_EXTRUDE_IT "Estrude" +#define TOOL_MOVE_IT "Muovi" +#define TOOL_HOME_IT "Home" +#define TOOL_LEVELING_IT "Leveling" +#define TOOL_AUTO_LEVELING_IT "Autolevel" +#define TOOL_FILAMENT_IT "Filamento" +#define TOOL_MORE_IT "Di più" + +#define AXIS_X_ADD_TEXT_IT "X+" +#define AXIS_X_DEC_TEXT_IT "X-" +#define AXIS_Y_ADD_TEXT_IT "Y+" +#define AXIS_Y_DEC_TEXT_IT "Y-" +#define AXIS_Z_ADD_TEXT_IT "Z+" +#define AXIS_Z_DEC_TEXT_IT "Z-" +#define TEXT_01MM_IT "0.1mm" +#define TEXT_1MM_IT "1mm" +#define TEXT_10MM_IT "10mm" + +#define HOME_X_TEXT_IT "X" +#define HOME_Y_TEXT_IT "Y" +#define HOME_Z_TEXT_IT "Z" +#define HOME_ALL_TEXT_IT "All" +#define HOME_STOPMOVE_IT "Quickstop" + +#define PAGE_UP_TEXT_IT "Pagina su" +#define PAGE_DOWN_TEXT_IT "Pagina giù" + +#define EXTRUDER_IN_TEXT_IT "Estru" +#define EXTRUDER_OUT_TEXT_IT "Ritra" +#define EXTRUDE_1MM_TEXT_IT "1mm" +#define EXTRUDE_5MM_TEXT_IT "5mm" +#define EXTRUDE_10MM_TEXT_IT "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_IT "Bassa" +#define EXTRUDE_MEDIUM_SPEED_TEXT_IT "Media" +#define EXTRUDE_HIGH_SPEED_TEXT_IT "Alta" + +#define LEVELING_POINT1_TEXT_IT "Primo" +#define LEVELING_POINT2_TEXT_IT "Secondo" +#define LEVELING_POINT3_TEXT_IT "Terzo" +#define LEVELING_POINT4_TEXT_IT "Quarto" +#define LEVELING_POINT5_TEXT_IT "Quinto" + +#define FILESYS_TEXT_IT "FileSys" +#define WIFI_TEXT_IT "WIFI" +#define FAN_TEXT_IT "Ventola" +#define ABOUT_TEXT_IT "Circa" +#define BREAK_POINT_TEXT_IT "Continua" +#define FILAMENT_TEXT_IT "Filamento" +#define LANGUAGE_TEXT_IT "Lingua" +#define MOTOR_OFF_TEXT_IT "Motor off" +#define MOTOR_OFF_XY_TEXT_IT "Off-XY" +#define SHUTDOWN_TEXT_IT "Spento" +#define MACHINE_PARA_IT "Config" +#define EEPROM_SETTINGS_IT "Eeprom Set" + +#define U_DISK_TEXT_IT "USB" +#define SD_CARD_TEXT_IT "SD" +#define WIFI_NAME_TEXT_IT "WIFI: " +#define WIFI_KEY_TEXT_IT "KEY: " +#define WIFI_IP_TEXT_IT "IP: " +#define WIFI_AP_TEXT_IT "Stato: AP" +#define WIFI_STA_TEXT_IT "Stato: STA" +#define WIFI_CONNECTED_TEXT_IT "Connesso" +#define WIFI_DISCONNECTED_TEXT_IT "Disconnesso" +#define WIFI_EXCEPTION_TEXT_IT "Eccezione" +#define WIFI_RECONNECT_TEXT_IT "Reconnect" +#define CLOUD_TEXT_IT "Cloud" +#define CLOUD_BIND_IT "Legato" +#define CLOUD_UNBIND_IT "Libero" +#define CLOUD_DISCONNECTED_IT "Disconnesso" +#define CLOUD_UNBINDING_IT "Libero" +#define CLOUD_UNBINDED_IT "Sciolto" +#define CLOUD_BINDED_IT "Legato" +#define CLOUD_DISABLE_IT "Disable" + +#define FAN_ADD_TEXT_IT "Aumentare" +#define FAN_DEC_TEXT_IT "Ridurre" +#define FAN_OPEN_TEXT_IT "100%" +#define FAN_HALF_TEXT_IT "50%" +#define FAN_CLOSE_TEXT_IT "Spento" +#define FAN_TIPS1_TEXT_IT "Ventola" +#define FAN_TIPS2_TEXT_IT "Ventola\n0" + +#define FILAMENT_IN_TEXT_IT "Inser" +#define FILAMENT_OUT_TEXT_IT "Estra" +#define FILAMENT_EXT0_TEXT_IT "Estrude1" +#define FILAMENT_EXT1_TEXT_IT "Estrude2" +#define FILAMENT_HEAT_TEXT_IT "Preriscaldamento" +#define FILAMENT_STOP_TEXT_IT "Stop" +//#define FILAMENT_CHANGE_TEXT_IT "Filamento" +#define FILAMENT_TIPS2_TEXT_IT "T:" +#define FILAMENT_TIPS3_TEXT_IT "Inserimento del filamento..." +#define FILAMENT_TIPS4_TEXT_IT "Estrazione del filamento..." +#define FILAMENT_TIPS5_TEXT_IT "Temp is too low to go,please heat" +#define FILAMENT_TIPS6_TEXT_IT "Completato" + +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_IT "Please click or \nto replace filament!" + #define FILAMENT_CHANGE_TEXT_IT "Please click or ,\nAfter pinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_IT "Heat completed,please load filament to extruder,and click for start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_IT "Please load filament to extruder,and click for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_IT "Heat completed,please click for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_IT "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_IT "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_IT "Load filament completed,click for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT "Unload filament completed,click for return!" +#endif +#define FILAMENT_CHANGE_TEXT_IT "Please click \nor ,After \npinter pause." +#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." +#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." +#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_IT "Heat completed,please load filament \nto extruder,and click \nfor start loading." +#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_IT "Please load filament to extruder,\nand click for start loading." +#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_IT "Heat completed,please \nclick for start unloading.!" +#define FILAMENT_DIALOG_LOADING_TIPS_IT "Is loading ,please wait!" +#define FILAMENT_DIALOG_UNLOADING_TIPS_IT "Is unloading,please wait!" +#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_IT "Load filament completed,\nclick for return!" +#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT "Unload filament completed,\nclick for return!" + + +#define PRE_HEAT_EXT_TEXT_IT "E" +#define PRE_HEAT_BED_TEXT_IT "Piano" + +#define FILE_LOADING_IT "Caricamento......" +#if 0 + #define NO_FILE_AND_CHECK_IT "Nessun file trovato! Inserisci la scheda SD o il disco U!" +#endif +#define NO_FILE_AND_CHECK_IT "Nessun file,\n per favore controllare di nuovo!" + +#define NO_FILE_IT "Nessun file!" + +#define EXTRUDER_TEMP_TEXT_IT "Temper" +#define EXTRUDER_E_LENGTH1_TEXT_IT "Estrude1" +#define EXTRUDER_E_LENGTH2_TEXT_IT "Estrude2" +#define EXTRUDER_E_LENGTH3_TEXT_IT "Estrude3" + +#define ABOUT_TYPE_TEXT_IT "Type: " +#define ABOUT_VERSION_TEXT_IT "Firmware: " +#define ABOUT_WIFI_TEXT_IT "WiFi: " + +#define PRINTING_OPERATION_IT "Opzioni" +#define PRINTING_PAUSE_IT "Pause" +#define PRINTING_TEMP_IT "Temp." +#define PRINTING_CHANGESPEED_IT "Velocità" +#define PRINTING_RESUME_IT "Recupero" +#define PRINTING_STOP_IT "Stop" +#define PRINTING_MORE_IT "Di più" +#define PRINTING_EXTRUDER_IT "Estrude" +#define PRINTING_MOVE_IT "Muovi" + +#define EXTRUDER_SPEED_IT "Estrude" +#define MOVE_SPEED_IT "Muovi" +#define EXTRUDER_SPEED_STATE_IT "Estrusione" +#define MOVE_SPEED_STATE_IT "Movimento" +#define STEP_1PERCENT_IT "1%" +#define STEP_5PERCENT_IT "5%" +#define STEP_10PERCENT_IT "10%" + +#define ZOFFSET_IT "Z Offset" +#define ZOFFSET_INC_IT "Add" +#define ZOFFSET_DEC_IT "Dec" + +#define TITLE_READYPRINT_IT "Pronto" +#define TITLE_PREHEAT_IT "Preris" +#define TITLE_MOVE_IT "Muovi" +#define TITLE_HOME_IT "Home" +#define TITLE_EXTRUDE_IT "Estrude" +#define TITLE_LEVELING_IT "Livella" +#define TITLE_SET_IT "Impostare" +#define TITLE_MORE_IT "Di più" +#define TITLE_CHOOSEFILE_IT "File" +#define TITLE_PRINTING_IT "Stampa" +#define TITLE_OPERATION_IT "Opzioni" +#define TITLE_ADJUST_IT "Regolare" +#define TITLE_WIRELESS_IT "Wireless" +#define TITLE_FILAMENT_IT "Filamento" +#define TITLE_ABOUT_IT "Circa" +#define TITLE_FAN_IT "Ventola" +#define TITLE_LANGUAGE_IT "Lingua" +#define TITLE_PAUSE_IT "Pausa" +#define TITLE_CHANGESPEED_IT "Velocità" +#define TITLE_CLOUD_TEXT_IT "Cloud" +#define TITLE_DIALOG_CONFIRM_IT "Confirm" +#define TITLE_FILESYS_IT "FileSys" +#define TITLE_ZOFFSET_IT "Z Offset" + +#define AUTO_SHUTDOWN_IT "Auto" +#define MANUAL_SHUTDOWN_IT "Manuale" + +#define DIALOG_CONFIRM_IT "Conferma" +#define DIALOG_CANCLE_IT "Cancella" +#define DIALOG_OK_IT "OK" +#define DIALOG_RESET_IT "Resettare" +#define DIALOG_RETRY_IT "Riprovare" +#define DIALOG_DISABLE_IT "Disable" +#define DIALOG_PRINT_MODEL_IT "Gcode stampa?" +#define DIALOG_CANCEL_PRINT_IT "Stop stampa?" +#define DIALOG_STOP_IT "Stop" +#define DIALOG_REPRINT_FROM_BREAKPOINT_IT "Continua a stampare dal \npunto di interruzione?" +//#define DIALOG_UNBIND_PRINTER_IT "Libero?" +#define DIALOG_ERROR_TIPS1_IT "Errore: nessun file, \nper favore controllare di nuovo." +#define DIALOG_ERROR_TIPS2_IT "Errore: operazione non riuscita, \nsi prega di controllare se il baudrate del \ndisplay è lo stesso scheda madre" +#define DIALOG_ERROR_TIPS3_IT "Errore: il nome del file o il \npercorso è troppo lungo!" +#define DIALOG_CLOSE_MACHINE_IT "Closing machine......" +#define DIALOG_UNBIND_PRINTER_IT "Unbind the printer?" +#define DIALOG_FILAMENT_NO_PRESS_IT "Filament detection switch is not pressed" +#define DIALOG_PRINT_FINISH_IT "La stampa è completa!" +#define DIALOG_PRINT_TIME_IT "Tempo di stampa: " +#define DIALOG_REPRINT_IT "Print again" +#define DIALOG_WIFI_ENABLE_TIPS_IT "The wifi module is being configured,\nplease wait a moment....." + +#define MESSAGE_PAUSING_IT "Parcheggiando..." +#define MESSAGE_CHANGING_IT "Attendere avvio del cambio di filamento" +#define MESSAGE_UNLOAD_IT "Attendere l'espulsione del filamento" +#define MESSAGE_WAITING_IT "Premi per riprendere la stampa" +#define MESSAGE_INSERT_IT "Inserisci il filamento e premi per continuare" +#define MESSAGE_LOAD_IT "Attendere il caricamento del filamento" +#define MESSAGE_PURGE_IT "Attendere lo spurgo del filamento" +#define MESSAGE_RESUME_IT "Attendere la ripresa della stampa..." +#define MESSAGE_HEAT_IT "Premi per riscaldare ugello" +#define MESSAGE_HEATING_IT "Riscaldam. ugello Attendere prego..." +#define MESSAGE_OPTION_IT "Eliminare di più o continuare a stampare?" +#define MESSAGE_PURGE_MORE_IT "Epurazione" +#define MESSAGE_CONTINUE_PRINT_IT "Stampa" +#define EEPROM_SETTINGS_TITLE_IT "Impostazioni EEPROM" +#define EEPROM_SETTINGS_STORE_IT "Memorizzare le impostazioni su EEPROM" +#define EEPROM_SETTINGS_READ_IT "Leggi le impostazioni dalla EEPROM" +#define EEPROM_SETTINGS_REVERT_IT "Ripristina le impostazioni predefinite di fabbrica" + +#define EEPROM_STORE_TIPS_IT "Memorizzare le impostazioni su EEPROM?" +#define EEPROM_READ_TIPS_IT "Leggi le impostazioni dalla EEPROM?" +#define EEPROM_REVERT_TIPS_IT "Ripristinare le impostazioni predefinite?" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h new file mode 100644 index 0000000000..2ec39ab016 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h @@ -0,0 +1,282 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 TOOL_TEXT_RU "инструмент" +#define PREHEAT_TEXT_RU " нагрев" +#define MOVE_TEXT_RU "движение" +#define HOME_TEXT_RU "домой" +#define PRINT_TEXT_RU " печать" +#define EXTRUDE_TEXT_RU "экструзия" +#define LEVELING_TEXT_RU "уровень" +#define AUTO_LEVELING_TEXT_RU "aвто" +#define SET_TEXT_RU "настройки" +#define MORE_TEXT_RU "больше" + +#define ADD_TEXT_RU "добавить" +#define DEC_TEXT_RU "уменьшить" +#define EXTRUDER_1_TEXT_RU "экструдер1" +#define EXTRUDER_2_TEXT_RU "экструдер2" +#define HEATBED_TEXT_RU "стол" +#define TEXT_1C_RU "1℃" +#define TEXT_5C_RU "5℃" +#define TEXT_10C_RU "10℃" +#define CLOSE_TEXT_RU "выкл" + +#define BACK_TEXT_RU "назад" + +#define TOOL_PREHEAT_RU "нагрев" +#define TOOL_EXTRUDE_RU "экструзия" +#define TOOL_MOVE_RU "движение" +#define TOOL_HOME_RU "домой" +#define TOOL_LEVELING_RU "уровень" +#define TOOL_AUTO_LEVELING_RU "aвто" +#define TOOL_FILAMENT_RU "замена" +#define TOOL_MORE_RU "больше" + +#define AXIS_X_ADD_TEXT_RU "X+" +#define AXIS_X_DEC_TEXT_RU "X-" +#define AXIS_Y_ADD_TEXT_RU "Y+" +#define AXIS_Y_DEC_TEXT_RU "Y-" +#define AXIS_Z_ADD_TEXT_RU "Z+" +#define AXIS_Z_DEC_TEXT_RU "Z-" +#define TEXT_01MM_RU "0.1mm" +#define TEXT_1MM_RU "1mm" +#define TEXT_10MM_RU "10mm" + +#define HOME_X_TEXT_RU "X" +#define HOME_Y_TEXT_RU "Y" +#define HOME_Z_TEXT_RU "Z" +#define HOME_ALL_TEXT_RU "Home" +#define HOME_STOPMOVE_RU "Quickstop" + +#define PAGE_UP_TEXT_RU "вверх" +#define PAGE_DOWN_TEXT_RU "вниз" + +#define EXTRUDER_IN_TEXT_RU "втянуть" +#define EXTRUDER_OUT_TEXT_RU "выдавить" +#define EXTRUDE_1MM_TEXT_RU "1mm" +#define EXTRUDE_5MM_TEXT_RU "5mm" +#define EXTRUDE_10MM_TEXT_RU "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_RU "мин" +#define EXTRUDE_MEDIUM_SPEED_TEXT_RU "сред" +#define EXTRUDE_HIGH_SPEED_TEXT_RU "выс" + +#define LEVELING_POINT1_TEXT_RU "1точка" +#define LEVELING_POINT2_TEXT_RU "2точка" +#define LEVELING_POINT3_TEXT_RU "3точка" +#define LEVELING_POINT4_TEXT_RU "4точка" +#define LEVELING_POINT5_TEXT_RU "5точка" + +#define FILESYS_TEXT_RU "система" +#define WIFI_TEXT_RU "WiFi" +#define FAN_TEXT_RU "вентилятор" +#define ABOUT_TEXT_RU "инфо" +#define BREAK_POINT_TEXT_RU "продолжить" +#define FILAMENT_TEXT_RU "замена" +#define LANGUAGE_TEXT_RU "язык" +#define MOTOR_OFF_TEXT_RU "отклмотор" +#define MOTOR_OFF_XY_TEXT_RU "Off-XY" +#define SHUTDOWN_TEXT_RU "выключение" +#define MACHINE_PARA_RU "конфиг" +#define EEPROM_SETTINGS_RU "Eeprom Set" + +#define U_DISK_TEXT_RU "U диск" +#define SD_CARD_TEXT_RU "SD диск" +#define WIFI_NAME_TEXT_RU "WiFi: " +#define WIFI_KEY_TEXT_RU "пароль: " +#define WIFI_IP_TEXT_RU "IP: " +#define WIFI_AP_TEXT_RU "режим: AP" +#define WIFI_STA_TEXT_RU "режим: STA" +#define WIFI_CONNECTED_TEXT_RU "подключен" +#define WIFI_DISCONNECTED_TEXT_RU "не подключен" +#define WIFI_EXCEPTION_TEXT_RU "исключение" +#define WIFI_RECONNECT_TEXT_RU "Reconnect" +#define CLOUD_TEXT_RU "облако" +#define CLOUD_BIND_RU "соединён" +#define CLOUD_UNBIND_RU "не соединён" +#define CLOUD_UNBINDING_RU "Unbinding" +#define CLOUD_DISCONNECTED_RU "Disconnected" +#define CLOUD_UNBINDED_RU "Unbinded" +#define CLOUD_BINDED_RU "Binded" +#define CLOUD_DISABLE_RU "Disable" + +#define FAN_ADD_TEXT_RU "добавить" +#define FAN_DEC_TEXT_RU "уменьшить" +#define FAN_OPEN_TEXT_RU "100%" +#define FAN_HALF_TEXT_RU "50%" +#define FAN_CLOSE_TEXT_RU "откл" +#define FAN_TIPS1_TEXT_RU "вентилятор" +#define FAN_TIPS2_TEXT_RU "вентилятор\nоткл" + +#define FILAMENT_IN_TEXT_RU "втянуть" +#define FILAMENT_OUT_TEXT_RU "выдавить" +#define FILAMENT_EXT0_TEXT_RU "экструдер1" +#define FILAMENT_EXT1_TEXT_RU "экструдер2" +#define FILAMENT_HEAT_TEXT_RU "нагрев" +#define FILAMENT_STOP_TEXT_RU "стоп" +//#define FILAMENT_CHANGE_TEXT_RU "замена" +#define FILAMENT_TIPS2_TEXT_RU "T:" +#define FILAMENT_TIPS3_TEXT_RU "втянуть..." +#define FILAMENT_TIPS4_TEXT_RU "вядавить..." +#define FILAMENT_TIPS5_TEXT_RU "Низкая температура, \nнеобходим нагрев" +#define FILAMENT_TIPS6_TEXT_RU "завершено" + +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_RU "Please click <втянуть> or <выдавить> \nto replace filament!" + #define FILAMENT_CHANGE_TEXT_RU "Please click <втянуть> or <выдавить>,\nAfter pinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU "Heat completed,please load filament to extruder,and click <да> for start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_RU "Please load filament to extruder,and click <да> for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU "Heat completed,please click <да> for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_RU "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_RU "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU "Load filament completed,click <да> for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU "Unload filament completed,click <да> for return!" +#endif +#define FILAMENT_CHANGE_TEXT_RU "Please click \nor ,After \npinter pause." +#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU "Heating up the nozzle,\nplease wait..." +#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU "Heating up the nozzle,\nplease wait..." +#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU "Heat completed,please load filament \nto extruder,and click \nfor start loading." +#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_RU "Please load filament to extruder,\nand click for start loading." +#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU "Heat completed,please \nclick for start unloading.!" +#define FILAMENT_DIALOG_LOADING_TIPS_RU "Is loading ,please wait!" +#define FILAMENT_DIALOG_UNLOADING_TIPS_RU "Is unloading,please wait!" +#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU "Load filament completed,\nclick for return!" +#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU "Unload filament completed,\nclick for return!" + + +#define PRE_HEAT_EXT_TEXT_RU "E" +#define PRE_HEAT_BED_TEXT_RU "стол" + +#define FILE_LOADING_RU "загрузка......" +#if 0 + #define NO_FILE_AND_CHECK_RU "Файлы не найдены! Вставьте SD-карту или диск U!" +#endif +#define NO_FILE_AND_CHECK_RU "нет файла,попробуйте ещё раз!" + +#define NO_FILE_RU "нет файла!" + +#define EXTRUDER_TEMP_TEXT_RU "температура" +#define EXTRUDER_E_LENGTH1_TEXT_RU "экструзия1" +#define EXTRUDER_E_LENGTH2_TEXT_RU "экструзия2" +#define EXTRUDER_E_LENGTH3_TEXT_RU "экструзия3" + +#define ABOUT_TYPE_TEXT_RU "Type: " +#define ABOUT_VERSION_TEXT_RU "Firmware: " +#define ABOUT_WIFI_TEXT_RU "WiFi: " + +#define PRINTING_OPERATION_RU "управление" +#define PRINTING_PAUSE_RU "пауза" +#define PRINTING_TEMP_RU "темп" +#define PRINTING_CHANGESPEED_RU "скорости" +#define PRINTING_RESUME_RU "возобновить" +#define PRINTING_STOP_RU "стоп" +#define PRINTING_MORE_RU "больше" +#define PRINTING_EXTRUDER_RU "экстр" +#define PRINTING_MOVE_RU "движение" + +#define EXTRUDER_SPEED_RU "экстр" +#define MOVE_SPEED_RU "движ" +#define EXTRUDER_SPEED_STATE_RU "скорость экстр" +#define MOVE_SPEED_STATE_RU "скорость движ" +#define STEP_1PERCENT_RU "1%" +#define STEP_5PERCENT_RU "5%" +#define STEP_10PERCENT_RU "10%" + +#define ZOFFSET_RU "Z Offset" +#define ZOFFSET_INC_RU "добавить" +#define ZOFFSET_DEC_RU "уменьшить" + +#define TITLE_READYPRINT_RU "готов к" +#define TITLE_PREHEAT_RU "движение" +#define TITLE_MOVE_RU "движение" +#define TITLE_HOME_RU "Home" +#define TITLE_EXTRUDE_RU "экструзия" +#define TITLE_LEVELING_RU "уровень" +#define TITLE_SET_RU "настройки" +#define TITLE_MORE_RU "больше" +#define TITLE_CHOOSEFILE_RU "файла" +#define TITLE_PRINTING_RU "печать" +#define TITLE_OPERATION_RU "управление" +#define TITLE_ADJUST_RU "регулировать" +#define TITLE_WIRELESS_RU "Wireless" +#define TITLE_FILAMENT_RU "замена" +#define TITLE_ABOUT_RU "инфо" +#define TITLE_FAN_RU "вентилятор" +#define TITLE_LANGUAGE_RU "язык" +#define TITLE_PAUSE_RU "пауза" +#define TITLE_CHANGESPEED_RU "скорости" +#define TILE_TOOL_RU "инструмент" +#define TITLE_CLOUD_TEXT_RU "Cloud" +#define TITLE_DIALOG_CONFIRM_RU "Confirm" +#define TITLE_FILESYS_RU "FileSys" +#define TITLE_ZOFFSET_RU "Z Offset" + +#define AUTO_SHUTDOWN_RU "авто-откл" +#define MANUAL_SHUTDOWN_RU "ручн-откл" + +#define DIALOG_CONFIRM_RU "да"//"подтвердить" +#define DIALOG_CANCLE_RU "отмена" +#define DIALOG_OK_RU "да" +#define DIALOG_RESET_RU "сброс" +#define DIALOG_RETRY_RU "повтор" +#define DIALOG_DISABLE_RU "запретить" +#define DIALOG_PRINT_MODEL_RU "печать модели?" +#define DIALOG_CANCEL_PRINT_RU "стоп?" +#define DIALOG_STOP_RU "стоп" +#define DIALOG_REPRINT_FROM_BREAKPOINT_RU "продолжить?" +//#define DIALOG_UNBIND_PRINTER_RU "разрыв?" +#define DIALOG_ERROR_TIPS1_RU "ошибка:нет файла, попробуйте ещё раз." +#define DIALOG_ERROR_TIPS2_RU "ошибка:сбой передачи. установите скорость \nпередачи данных как на плате управления!" +#define DIALOG_ERROR_TIPS3_RU "ошибка: имя файла слишком длинное!" +#define DIALOG_CLOSE_MACHINE_RU "Closing machine......" +#define DIALOG_UNBIND_PRINTER_RU "Unbind the printer?" +#define DIALOG_FILAMENT_NO_PRESS_RU "Filament detection switch is not pressed" +#define DIALOG_PRINT_FINISH_RU "Печать завершена!" +#define DIALOG_PRINT_TIME_RU "Время печати: " +#define DIALOG_REPRINT_RU "Print again" +#define DIALOG_WIFI_ENABLE_TIPS_RU "The wifi module is being configured,\nplease wait a moment....." + +#define MESSAGE_PAUSING_RU "Стоянка..." +#define MESSAGE_CHANGING_RU "Подождите, пока начнется смена филамента" +#define MESSAGE_UNLOAD_RU "Дождитесь выгрузки нити" +#define MESSAGE_WAITING_RU "Нажмите кнопку,чтобы возобновить печать" +#define MESSAGE_INSERT_RU "Вставьте нить и нажмите кнопку,чтобы продолжить" +#define MESSAGE_LOAD_RU "Дождитесь загрузки нити" +#define MESSAGE_PURGE_RU "Дождитесь чистки нити" +#define MESSAGE_RESUME_RU "Подождите,пока печать возобновится ..." +#define MESSAGE_HEAT_RU "Нажмите кнопку, чтобы нагреть форсунку" +#define MESSAGE_HEATING_RU "Подогрев форсунки Пожалуйста, подождите ..." +#define MESSAGE_OPTION_RU "Очистить больше или продолжить печать?" +#define MESSAGE_PURGE_MORE_RU "чистка" +#define MESSAGE_CONTINUE_PRINT_RU "Распечатать" +#define EEPROM_SETTINGS_TITLE_RU "Настройки EEPROM" +#define EEPROM_SETTINGS_STORE_RU "Сохранение настроек в EEPROM" +#define EEPROM_SETTINGS_READ_RU "Чтение настроек из EEPROM" +#define EEPROM_SETTINGS_REVERT_RU "Восстановить заводские настройки по умолчанию" + +#define EEPROM_STORE_TIPS_RU "Сохранить настройки в EEPROM?" +#define EEPROM_READ_TIPS_RU "Читать настройки из EEPROM?" +#define EEPROM_REVERT_TIPS_RU "Revert settings to factory defaults?" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_s_cn.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_s_cn.h new file mode 100644 index 0000000000..ea481c89a2 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_s_cn.h @@ -0,0 +1,479 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 NEXT_CN "下一页" +#define PREVIOUS_CN "上一页" +#define DEFAULT_CN "默认值" +#define KEY_BACK_CN "退格" +#define KEY_REST_CN "重置" +#define KEY_CONFIRM_CN "确定" + +#define MACHINE_PARA_TITLE_CN "机器参数" +#define MACHINE_TYPE_CNOFIG_CN "机器设置" +#define TEMPERATURE_CONFIG_CN "温度设置" +#define MOTOR_CONFIG_CN "电机设置" +#define ADVANCE_CONFIG_CN "高级设置" + +#define MACHINE_CONFIG_TITLE_CN "机器参数>机器配置" +#define MACHINE_TYPE_CN "机型选择" +#define MACHINE_STROKE_CN "行程设置" +#define MACHINE_HOMEDIR_CN "归零方向" +#define MACHINE_ENDSTOP_TYPE_CN "限位开关类型" +#define MACHINE_FILAMENT_CONFIG_CN "换料设置" +#define MACHINE_LEVELING_CONFIG_CN "调平设置" + +#define MACHINE_TYPE_CONFIG_TITLE_CN "机器参数>机型选择" +#define MACHINE_TYPE_XYZ_CN "XYZ机型" +#define MACHINE_TYPE_DELTA_CN "Delta机型" +#define MACHINE_TYPE_COREXY_CN "Corexy机型" + +#define MACHINE_STROKE_CONF_TITLE_CN "机器参数>机器行程" +#define X_MAX_LENGTH_CN "X轴最大行程" +#define Y_MAX_LENGTH_CN "Y轴最大行程" +#define Z_MAX_LENGTH_CN "Z轴最大行程" + +#define X_MIN_LENGTH_CN "X轴最小行程" +#define Y_MIN_LENGTH_CN "Y轴最小行程" +#define Z_MIN_LENGTH_CN "Z轴最小行程" + +#define HOME_DIR_CONF_TITLE_CN "机器参数>归零方向" +#define HOME_DIR_X_CN "X轴归零方向" +#define HOME_DIR_Y_CN "Y轴归零方向" +#define HOME_DIR_Z_CN "Z轴归零方向" +#define HOME_MIN_CN "MIN" +#define HOME_MAX_CN "MAX" + +#define ENDSTOP_CONF_TITLE_CN "机器参数>限位开关" +#define MIN_ENDSTOP_X_CN "X轴最小限位" +#define MIN_ENDSTOP_Y_CN "Y轴最小限位" +#define MIN_ENDSTOP_Z_CN "Z轴最小限位" +#define MAX_ENDSTOP_X_CN "X轴最大限位" +#define MAX_ENDSTOP_Y_CN "Y轴最大限位" +#define MAX_ENDSTOP_Z_CN "Z轴最大限位" +#define ENDSTOP_FIL_CN "断料开关类型" +#define ENDSTOP_LEVEL_CN "调平开关类型" +#define ENDSTOP_OPENED_CN "常开" +#define ENDSTOP_CLOSED_CN "常闭" + +#define FILAMENT_CONF_TITLE_CN "换料设置" +#define FILAMENT_IN_TEMPERATURE_CN "进料温度" +#define FILAMENT_IN_LENGTH_CN "进料长度" +#define FILAMENT_IN_SPEED_CN "进料速度" +#define FILAMENT_OUT_TEMPERATURE_CN "退料温度" +#define FILAMENT_OUT_LENGTH_CN "退料长度" +#define FILAMENT_OUT_SPEED_CN "退料速度" + +#define LEVELING_CONF_TITLE_CN "调平设置" +#define LEVELING_PARA_CONF_CN "调平设置" +#define LEVELING_DELTA_CN "delta机型设置" +#define LEVELING_XYZ_CN "手动调平坐标设置" + +#define LEVELING_PARA_CONF_TITLE_CN "调平参数" +#define AUTO_LEVELING_ENABLE_CN "自动调平" +#define BLTOUCH_LEVELING_ENABLE_CN "启动BLtouch" +#define PROBE_PORT_CN "调平探针接口" +#define PROBE_X_OFFSET_CN "探针X方向偏移" +#define PROBE_Y_OFFSET_CN "探针Y方向偏移" +#define PROBE_Z_OFFSET_CN "探针Z方向偏移" +#define PROBE_XY_SPEED_CN "探针XY方向移动速度" +#define PROBE_Z_SPEED_CN "探针Z方向移动速度" +#define ENABLE_CN "是" +#define DISABLE_CN "否" +#define Z_MIN_CN "ZMin" +#define Z_MAX_CN "ZMax" + +#define DELTA_LEVEL_CONF_TITLE_CN "Delta机器参数" +#define DELTA_LEVEL_CONF_CN "Delta机器调平" +#define DELTA_MACHINE_RADIUS_CN "机器半径" +#define DELTA_DIAGONAL_ROD_CN "机器杆长" +#define DELTA_PRINT_RADIUS_CN "打印半径" +#define DELTA_HEIGHT_CN "打印高度" +#define SMOOTH_ROD_OFFSET_CN "滑块偏移" +#define EFFECTOR_OFFSET_CN "效应器偏移" +#define CALIBRATION_RADIUS_CN "调平半径" + +#define XYZ_LEVEL_CONF_TITLE_CN "XYZ机器参数" +#define PROBE_REACH_MAX_LEFT_CN "探针达到最左位置" +#define PROBE_REACH_MAX_RIGHT_CN "探针达到最右位置" +#define PROBE_REACH_MAX_FRONT_CN "探针达到最前位置" +#define PROBE_REACH_MAX_BACK_CN "探针达到最后位置" + +#define TEMPERATURE_CONF_TITLE_CN "机器参数>温度设置" +#define NOZZLE_CONF_CN "喷头设置" +#define HOTBED_CONF_CN "热床设置" +#define PREHEAT_TEMPER_CN "预设温度" + +#define NOZZLE_CONF_TITLE_CN "机器参数>喷头设置" +#define NOZZLECNT_CN "喷头数量" +#define NOZZLE_TYPE_CN "E0温感类型" +#define NOZZLE_ADJUST_TYPE_CN "PID调温" +#define NOZZLE_MIN_TEMPERATURE_CN "最低温度" +#define NOZZLE_MAX_TEMPERATURE_CN "最高温度" +#define EXTRUD_MIN_TEMPER_CN "最低挤出温度" + +#define HOTBED_CONF_TITLE_CN "机器参数>热床设置" +#define HOTBED_ADJUST_CN "PID调温" +#define HOTBED_MIN_TEMPERATURE_CN "最低温度" +#define HOTBED_MAX_TEMPERATURE_CN "最高温度" + +#define MOTOR_CONF_TITLE_CN "机器参数>电机设置" +#define MAXFEEDRATE_CONF_CN "最大速度设置" +#define ACCELERATION_CONF_CN "加速度设置" +#define JERKCONF_CN "突变速度设置" +#define STEPSCONF_CN "脉冲设置" +#define TMC_CURRENT_CN "TMC 驱动电流设置" +#define TMC_STEP_MODE_CN "TMC 驱动模式设置" +#define MOTORDIRCONF_CN "电机方向设置" +#define HOMEFEEDRATECONF_CN "归零速度设置" + +#define MAXFEEDRATE_CONF_TITLE_CN "机器参数>最大速度" +#define X_MAXFEEDRATE_CN "X轴最大速度" +#define Y_MAXFEEDRATE_CN "Y轴最大速度" +#define Z_MAXFEEDRATE_CN "Z轴最大速度" +#define E0_MAXFEEDRATE_CN "E0轴最大速度" +#define E1_MAXFEEDRATE_CN "E1轴最大速度" + +#define ACCELERATION_CONF_TITLE_CN "机器参数>加速度" +#define PRINT_ACCELERATION_CN "打印加速度" +#define RETRACT_ACCELERATION_CN "回抽加速度" +#define TRAVEL_ACCELERATION_CN "空载加速度" +#define X_ACCELERATION_CN "X轴加速度" +#define Y_ACCELERATION_CN "Y轴加速度" +#define Z_ACCELERATION_CN "Z轴加速度" +#define E0_ACCELERATION_CN "E0轴加速度" +#define E1_ACCELERATION_CN "E1轴加速度" + +#define JERK_CONF_TITLE_CN "机器参数>突变速度" +#define X_JERK_CN "X轴突变速度" +#define Y_JERK_CN "Y轴突变速度" +#define Z_JERK_CN "Z轴突变速度" +#define E_JERK_CN "E轴突变速度" + +#define STEPS_CONF_TITLE_CN "机器参数>脉冲设置" +#define X_STEPS_CN "X轴脉冲" +#define Y_STEPS_CN "Y轴脉冲" +#define Z_STEPS_CN "Z轴脉冲" +#define E0_STEPS_CN "E0轴脉冲" +#define E1_STEPS_CN "E1轴脉冲" + +#define TMC_CURRENT_CONF_TITLE_CN "机器参数>TMC电流设置" +#define X_TMC_CURRENT_CN "X轴电流(毫安)" +#define Y_TMC_CURRENT_CN "Y轴电流(毫安)" +#define Z_TMC_CURRENT_CN "Z轴电流(毫安)" +#define E0_TMC_CURRENT_CN "E0轴电流(毫安)" +#define E1_TMC_CURRENT_CN "E1轴电流(毫安)" + +#define TMC_MODE_CONF_TITLE_CN "机器参数>TMC模式设置" +#define X_TMC_MODE_CN "X轴是否使能静音模式" +#define Y_TMC_MODE_CN "Y轴是否使能静音模式" +#define Z_TMC_MODE_CN "Z轴是否使能静音模式" +#define E0_TMC_MODE_CN "E0轴是否使能静音模式" +#define E1_TMC_MODE_CN "E1轴是否使能静音模式" + +#define MOTORDIR_CONF_TITLE_CN "机器参数>电机方向" +#define X_MOTORDIR_CN "X轴电机方向" +#define Y_MOTORDIR_CN "Y轴电机方向" +#define Z_MOTORDIR_CN "Z轴电机方向" +#define E0_MOTORDIR_CN "E0轴电机方向" +#define E1_MOTORDIR_CN "E1轴电机方向" +#define INVERT_P_CN "正向" +#define INVERT_N_CN "反向" + +#define HOMEFEEDRATE_CONF_TITLE_CN "机器参数>归零速度" +#define X_HOMESPEED_CN "XY轴归零速度" +#define Y_HOMESPEED_CN "Y轴归零速度" +#define Z_HOMESPEED_CN "Z轴归零速度" + +#define ADVANCED_CONF_TITLE_CN "机器参数>高级设置" +#define PWROFF_DECTION_CN "断电检测模块" +#define PWROFF_AFTER_PRINT_CN "启动打完关机功能" +#define HAVE_UPS_CN "机器配备UPS电源" +#define Z2_AND_Z2ENDSTOP_CONF_CN "双Z轴双限位功能设置" +#define ENABLE_PINS_CONF_CN "电机使能脚电平设置" + +#define Z2_AND_Z2ENDSTOP_CONF_TITLE_CN "双z双限位设置" +#define Z2_ENABLE_CN "启用Z2轴" +#define Z2_ENDSTOP_CN "启用Z2限位" +#define Z2_PORT_CN "Z2限位接口" + +#define ENABLE_PINS_CONF_TITLE_CN "电机使能脚电平" +#define X_ENABLE_PINS_INVERT_CN "X轴电机使能电平" +#define Y_ENABLE_PINS_INVERT_CN "Y轴电机使能电平" +#define Z_ENABLE_PINS_INVERT_CN "Z轴电机使能电平" +#define E_ENABLE_PINS_INVERT_CN "E轴电机使能电平" + +#define PAUSE_POSITION_CN "打印暂停位置设置" +#define PAUSE_POSITION_X_CN "X轴暂停位置(绝对位置,-1无效)" +#define PAUSE_POSITION_Y_CN "Y轴暂停位置(绝对位置,-1无效)" +#define PAUSE_POSITION_Z_CN "Z轴暂停位置(相对位置,-1无效)" +#define TOOL_TEXT_CN "工具" +#define PREHEAT_TEXT_CN "预热" +#define MOVE_TEXT_CN "移动" +#define HOME_TEXT_CN "回零" +#define PRINT_TEXT_CN "打印" +#define EXTRUDE_TEXT_CN "挤出" +#define LEVELING_TEXT_CN "调平" +#define AUTO_LEVELING_TEXT_CN "自动调平" +#define SET_TEXT_CN "设置" +#define MORE_TEXT_CN "更多" + +#define ADD_TEXT_CN "增加" +#define DEC_TEXT_CN "减少" +#define EXTRUDER_1_TEXT_CN "喷头1" +#define EXTRUDER_2_TEXT_CN "喷头2" +#define HEATBED_TEXT_CN "热床" +#define TEXT_1C_CN "1℃" +#define TEXT_5C_CN "5℃" +#define TEXT_10C_CN "10℃" +#define CLOSE_TEXT_CN "关闭" + +#define BACK_TEXT_CN "返回" + +#define TOOL_PREHEAT_CN "预热" +#define TOOL_EXTRUDE_CN "挤出" +#define TOOL_MOVE_CN "移动" +#define TOOL_HOME_CN "回零" +#define TOOL_LEVELING_CN "调平" +#define TOOL_AUTO_LEVELING_CN "自动调平" +#define TOOL_FILAMENT_CN "换料" +#define TOOL_MORE_CN "更多" + +#define AXIS_X_ADD_TEXT_CN "X+" +#define AXIS_X_DEC_TEXT_CN "X-" +#define AXIS_Y_ADD_TEXT_CN "Y+" +#define AXIS_Y_DEC_TEXT_CN "Y-" +#define AXIS_Z_ADD_TEXT_CN "Z+" +#define AXIS_Z_DEC_TEXT_CN "Z-" +#define TEXT_01MM_CN "0.1mm" +#define TEXT_1MM_CN "1mm" +#define TEXT_10MM_CN "10mm" + +#define HOME_X_TEXT_CN "X" +#define HOME_Y_TEXT_CN "Y" +#define HOME_Z_TEXT_CN "Z" +#define HOME_ALL_TEXT_CN "回零" +#define HOME_STOPMOVE_CN "急停" + +#define PAGE_UP_TEXT_CN "上一页" +#define PAGE_DOWN_TEXT_CN "下一页" + +#define EXTRUDER_IN_TEXT_CN "进料" +#define EXTRUDER_OUT_TEXT_CN "退料" +#define EXTRUDE_1MM_TEXT_CN "1mm" +#define EXTRUDE_5MM_TEXT_CN "5mm" +#define EXTRUDE_10MM_TEXT_CN "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_CN "低速" +#define EXTRUDE_MEDIUM_SPEED_TEXT_CN "常速" +#define EXTRUDE_HIGH_SPEED_TEXT_CN "高速" + +#define LEVELING_POINT1_TEXT_CN "第一点" +#define LEVELING_POINT2_TEXT_CN "第二点" +#define LEVELING_POINT3_TEXT_CN "第三点" +#define LEVELING_POINT4_TEXT_CN "第四点" +#define LEVELING_POINT5_TEXT_CN "第五点" + +#define FILESYS_TEXT_CN "文件系统" +#define WIFI_TEXT_CN "WIFI" +#define FAN_TEXT_CN "风扇" +#define ABOUT_TEXT_CN "关于" +#define BREAK_POINT_TEXT_CN "断点续打" +#define FILAMENT_TEXT_CN "换料" +#define LANGUAGE_TEXT_CN "语言" +#define MOTOR_OFF_TEXT_CN "关闭电机" +#define MOTOR_OFF_XY_TEXT_CN "关闭XY" +#define SHUTDOWN_TEXT_CN "关机" +#define MACHINE_PARA_CN "机器参数" +#define EEPROM_SETTINGS_CN "Eeprom设置" + +#define U_DISK_TEXT_CN "U盘" +#define SD_CARD_TEXT_CN "SD卡" +#define WIFI_NAME_TEXT_CN "无线网络:" +#define WIFI_KEY_TEXT_CN "密码: " +#define WIFI_IP_TEXT_CN "IP: " +#define WIFI_AP_TEXT_CN "状态: AP" +#define WIFI_STA_TEXT_CN "状态: STA" +#define WIFI_CONNECTED_TEXT_CN "已连接" +#define WIFI_DISCONNECTED_TEXT_CN "未连接" +#define WIFI_EXCEPTION_TEXT_CN "模块异常" +#define CLOUD_TEXT_CN "云服务" +#define CLOUD_BIND_CN "已绑定" +#define CLOUD_UNBIND_CN "解绑" +#define CLOUD_UNBINDING_CN "解绑中" +#define CLOUD_DISCONNECTED_CN "未连接" +#define CLOUD_UNBINDED_CN "未绑定" +#define CLOUD_BINDED_CN "已绑定" +#define CLOUD_DISABLE_CN "已禁用" + +#define FAN_ADD_TEXT_CN "增加" +#define FAN_DEC_TEXT_CN "减少" +#define FAN_OPEN_TEXT_CN "100%" +#define FAN_HALF_TEXT_CN "50%" +#define FAN_CLOSE_TEXT_CN "关闭" +#define FAN_TIPS1_TEXT_CN "风扇" +#define FAN_TIPS2_TEXT_CN "FAN\nClose" + +#define FILAMENT_IN_TEXT_CN "进料" +#define FILAMENT_OUT_TEXT_CN "退料" +#define FILAMENT_EXT0_TEXT_CN "喷头1" +#define FILAMENT_EXT1_TEXT_CN "喷头2" +#define FILAMENT_HEAT_TEXT_CN "预热" +#define FILAMENT_STOP_TEXT_CN "停止" +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_CN "请按<进料>或<退料>进行换料!" + #define FILAMENT_CHANGE_TEXT_CN "待打印机暂停后,请按<进料>或<退料>进行换料!" +#else + #define FILAMENT_CHANGE_TEXT_CN "待打印机暂停后,\n请按<进料>或<退料>" +#endif + +#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_CN "准备进料,正在加热,请稍等!" +#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_CN "准备退料,正在加热,请稍等!" +#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_CN "加热完成,请装载耗材后,按<确定>开始进料!" +#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_CN "请装载耗材,按<确定>开始进料!" +#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_CN "加热完成,请按<确定>开始退料!" +#define FILAMENT_DIALOG_LOADING_TIPS_CN "正在进料,请等待耗材加载完成!" +#define FILAMENT_DIALOG_UNLOADING_TIPS_CN "正在退料,请等待耗材卸载完成!" +#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_CN "进料完成,请按<确定>返回" +#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_CN "退料完成,请按<确定>返回" + +#define FILAMENT_TIPS3_TEXT_CN "正在进料" +#define FILAMENT_TIPS4_TEXT_CN "正在退料" +#define FILAMENT_TIPS5_TEXT_CN "温度太低,请先预热" +#define FILAMENT_TIPS6_TEXT_CN "换料完成" + +#define PRE_HEAT_EXT_TEXT_CN "喷头" +#define PRE_HEAT_BED_TEXT_CN "热床" + +#define FILE_LOADING_CN "正在载入......" +#define NO_FILE_AND_CHECK_CN "无文件!请插入sd卡或u盘!" +#define NO_FILE_CN "无文件!" + +#define EXTRUDER_TEMP_TEXT_CN "温度" +#define EXTRUDER_E_LENGTH1_TEXT_CN "喷头" +#define EXTRUDER_E_LENGTH2_TEXT_CN "喷头" +#define EXTRUDER_E_LENGTH3_TEXT_CN "喷头" + +#define ABOUT_TYPE_TEXT_CN "Type: " +#define ABOUT_VERSION_TEXT_CN "Firmware: " +#define ABOUT_WIFI_TEXT_CN "Wifi: " + +#define PRINTING_OPERATION_CN "操作" +#define PRINTING_PAUSE_CN "暂停" +#define PRINTING_TEMP_CN "温度" +#define PRINTING_CHANGESPEED_CN "变速" +#define PRINTING_RESUME_CN "恢复" +#define PRINTING_STOP_CN "停止" +#define PRINTING_MORE_CN "更多" +#define PRINTING_EXTRUDER_CN "挤出" +#define PRINTING_MOVE_CN "移动" + +#define EXTRUDER_SPEED_CN "挤出" +#define MOVE_SPEED_CN "移动" +#define EXTRUDER_SPEED_STATE_CN "挤出速度" +#define MOVE_SPEED_STATE_CN "移动速度" +#define STEP_1PERCENT_CN "1%" +#define STEP_5PERCENT_CN "5%" +#define STEP_10PERCENT_CN "10%" + +#define ZOFFSET_CN "Z Offset" +#define ZOFFSET_INC_CN "增加" +#define ZOFFSET_DEC_CN "减少" + +#define TITLE_READYPRINT_CN "准备打印" +#define TITLE_PREHEAT_CN "预热" +#define TITLE_MOVE_CN "移动" +#define TITLE_HOME_CN "回零" +#define TITLE_EXTRUDE_CN "挤出" +#define TITLE_LEVELING_CN "调平" +#define TITLE_SET_CN "设置" +#define TITLE_MORE_CN "更多" +#define TITLE_CHOOSEFILE_CN "选择文件" +#define TITLE_PRINTING_CN "正在打印" +#define TITLE_OPERATION_CN "操作" +#define TITLE_ADJUST_CN "调整" +#define TITLE_WIRELESS_CN "无线网络" +#define TITLE_FILAMENT_CN "换料" +#define TITLE_ABOUT_CN "关于" +#define TITLE_FAN_CN "风扇" +#define TITLE_LANGUAGE_CN "语言" +#define TITLE_PAUSE_CN "暂停" +#define TITLE_CHANGESPEED_CN "变速" +#define TITLE_CLOUD_TEXT_CN "云服务" +#define TITLE_DIALOG_CONFIRM_CN "确认" +#define TITLE_FILESYS_CN "文件系统" +#define TITLE_ZOFFSET_CN "Z Offset" + +#define AUTO_SHUTDOWN_CN "自动关机" +#define MANUAL_SHUTDOWN_CN "手动关机" + +#define DIALOG_CONFIRM_CN "确定" +#define DIALOG_CANCLE_CN "取消" +#define DIALOG_OK_CN "确认" +#define DIALOG_RESET_CN "重置" +#define DIALOG_DISABLE_CN "禁用" +#define DIALOG_PRINT_MODEL_CN "打印模型?" +#define DIALOG_CANCEL_PRINT_CN "停止打印?" +#define DIALOG_RETRY_CN "重试" +#define DIALOG_STOP_CN "停止" +#define DIALOG_REPRINT_FROM_BREAKPOINT_CN "从断点续打?" +//#define DIALOG_UNBIND_PRINTER_CN "解除绑定 ?" +#define DIALOG_ERROR_TIPS1_CN "错误:找不到文件,请插入sd卡/u盘!" +#define DIALOG_ERROR_TIPS2_CN "错误:通信失败,请检查波特率或主板硬件!" +#define DIALOG_ERROR_TIPS3_CN "错误:文件名或文件路径太长 !" +#define DIALOG_CLOSE_MACHINE_CN "正在关机......" +#define DIALOG_UNBIND_PRINTER_CN "解除绑定?" +#define DIALOG_FILAMENT_NO_PRESS_CN "请先装载耗材!" +#define DIALOG_PRINT_FINISH_CN "打印完成!" +#define DIALOG_PRINT_TIME_CN "打印时间: " +#define DIALOG_REPRINT_CN "再打印一次" +#define DIALOG_WIFI_ENABLE_TIPS_CN "wifi模块正在配置中,请稍等......" + +#define TEXT_VALUE_CN "%d℃/%d℃" +#define EXTRUDE_TEXT_VALUE_T_CN ": %d℃" +#define WIFI_RECONNECT_TEXT_CN "重新连接" + +#define PRINTING_GBK "正在打印" +#define PRINTING_OPERATION_GBK "操作" +#define PRINTING_PAUSE_GBK "暂停" + +#define MESSAGE_PAUSING_CN "暂停中..." +#define MESSAGE_CHANGING_CN "等待换料开始..." +#define MESSAGE_UNLOAD_CN "退料中,请稍等..." +#define MESSAGE_WAITING_CN "点击按钮恢复打印" +#define MESSAGE_INSERT_CN "装载耗材后,点击按钮开始打印" +#define MESSAGE_LOAD_CN "进料中,请稍等..." +#define MESSAGE_PURGE_CN "等待挤出..." +#define MESSAGE_RESUME_CN "等待恢复打印..." +#define MESSAGE_HEAT_CN "按下按钮,加热喷头" +#define MESSAGE_HEATING_CN "喷头加热中,请等待..." +#define MESSAGE_OPTION_CN "挤出更多还是继续打印?" +#define MESSAGE_PURGE_MORE_CN "挤出" +#define MESSAGE_CONTINUE_PRINT_CN "打印" +#define EEPROM_SETTINGS_TITLE_CN "EEPROM 设置" +#define EEPROM_SETTINGS_STORE_CN "保存参数至EEPROM" +#define EEPROM_SETTINGS_READ_CN "读取EEPROM参数" +#define EEPROM_SETTINGS_REVERT_CN "恢复默认参数" + +#define EEPROM_STORE_TIPS_CN "是否保存参数到EEPROM?" +#define EEPROM_READ_TIPS_CN "是否使用EEPROM参数?" +#define EEPROM_REVERT_TIPS_CN "是否恢复默认参数?" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h new file mode 100644 index 0000000000..289874c6ba --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h @@ -0,0 +1,289 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 TOOL_TEXT_SP "Ajustes" +#define PREHEAT_TEXT_SP "Precalentar"//"precalent\nar" +#define MOVE_TEXT_SP "Mover" +#define HOME_TEXT_SP "Origen" +#define PRINT_TEXT_SP "Imprimir" +#define EXTRUDE_TEXT_SP "Extrusor" +#define LEVELING_TEXT_SP "Leveling"//"nivelac\nión" +#define AUTO_LEVELING_TEXT_SP "Autolevel"//"auto\nnivelación" +#define SET_TEXT_SP "Config" +#define MORE_TEXT_SP "Más" + +#define ADD_TEXT_SP "Más" +#define DEC_TEXT_SP "Menos" +#define EXTRUDER_1_TEXT_SP "Extrusor1: " +#define EXTRUDER_2_TEXT_SP "Extrusor2: " +#define HEATBED_TEXT_SP "Cama: " +#define TEXT_1C_SP "1℃" +#define TEXT_5C_SP "5℃" +#define TEXT_10C_SP "10℃" +#define CLOSE_TEXT_SP "Apagar" + +#define BACK_TEXT_SP "Atrás" + +#define TOOL_PREHEAT_SP "Precalentar" +#define TOOL_EXTRUDE_SP "Extrusor" +#define TOOL_MOVE_SP "Mover" +#define TOOL_HOME_SP "Origen" +#define TOOL_LEVELING_SP "Leveling" +#define TOOL_AUTO_LEVELING_SP "Autolevel" +#define TOOL_FILAMENT_SP "Filamento" +#define TOOL_MORE_SP "Más" + +#define AXIS_X_ADD_TEXT_SP "X+" +#define AXIS_X_DEC_TEXT_SP "X-" +#define AXIS_Y_ADD_TEXT_SP "Y+" +#define AXIS_Y_DEC_TEXT_SP "Y-" +#define AXIS_Z_ADD_TEXT_SP "Z+" +#define AXIS_Z_DEC_TEXT_SP "Z-" +#define TEXT_01MM_SP "0.1mm" +#define TEXT_1MM_SP "1mm" +#define TEXT_10MM_SP "10mm" + +#define HOME_X_TEXT_SP "EJE X" +#define HOME_Y_TEXT_SP "EJE Y" +#define HOME_Z_TEXT_SP "EJE Z" +#define HOME_ALL_TEXT_SP "TODOS" +#define HOME_STOPMOVE_SP "Quickstop" + +#define PAGE_UP_TEXT_SP "Arriba" +#define PAGE_DOWN_TEXT_SP "Abajo" + +#define EXTRUDER_IN_TEXT_SP "Dentro" +#define EXTRUDER_OUT_TEXT_SP "Fuera" +#define EXTRUDE_1MM_TEXT_SP "1mm" +#define EXTRUDE_5MM_TEXT_SP "5mm" +#define EXTRUDE_10MM_TEXT_SP "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_SP "Baja" +#define EXTRUDE_MEDIUM_SPEED_TEXT_SP "Media" +#define EXTRUDE_HIGH_SPEED_TEXT_SP "Alta" + +#define LEVELING_POINT1_TEXT_SP "Primero" +#define LEVELING_POINT2_TEXT_SP "Segundo" +#define LEVELING_POINT3_TEXT_SP "Tercero" +#define LEVELING_POINT4_TEXT_SP "Cuarto" +#define LEVELING_POINT5_TEXT_SP "Quinto" + +#define FILESYS_TEXT_SP "Puerto" +#define WIFI_TEXT_SP "WiFi" +#define FAN_TEXT_SP "Ventilador" +#define ABOUT_TEXT_SP "Acerca" +#define BREAK_POINT_TEXT_SP "Continuar" +#define FILAMENT_TEXT_SP "Filamento" +#define LANGUAGE_TEXT_SP "Language" +#define MOTOR_OFF_TEXT_SP "Apagar motor" +#define MOTOR_OFF_XY_TEXT_SP "Off-XY" +#define SHUTDOWN_TEXT_SP "Apagar" +#define MACHINE_PARA_SP "Config" +#define EEPROM_SETTINGS_SP "Eeprom Set" + +#define U_DISK_TEXT_SP "PENDRIVE" +#define SD_CARD_TEXT_SP "SD" +#define WIFI_NAME_TEXT_SP "WIFI: " +#define WIFI_KEY_TEXT_SP "Contraseña: " +#define WIFI_IP_TEXT_SP "IP: " +#define WIFI_AP_TEXT_SP "Estado: AP" +#define WIFI_STA_TEXT_SP "Estado: STA" +#define WIFI_CONNECTED_TEXT_SP "Conectado" +#define WIFI_DISCONNECTED_TEXT_SP "Desconectado" +#define WIFI_EXCEPTION_TEXT_SP "Excepción" +#define WIFI_RECONNECT_TEXT_SP "Reconnect" +#define CLOUD_TEXT_SP "Nube" +#define CLOUD_BIND_SP "Atado" +#define CLOUD_UNBIND_SP "Sin atar" +#define CLOUD_UNBINDING_SP "Unbinding" +#define CLOUD_DISCONNECTED_SP "Disconnected" +#define CLOUD_UNBINDED_SP "Unbinded" +#define CLOUD_BINDED_SP "Binded" +#define CLOUD_DISABLE_SP "Disable" + +#define FAN_ADD_TEXT_SP "Más" +#define FAN_DEC_TEXT_SP "Menos" +#define FAN_OPEN_TEXT_SP "100%" +#define FAN_HALF_TEXT_SP "50%" +#define FAN_CLOSE_TEXT_SP "0%" +#define FAN_TIPS1_TEXT_SP "ventilador" +#define FAN_TIPS2_TEXT_SP "ventilador\n0" + +#define FILAMENT_IN_TEXT_SP "Dentro" +#define FILAMENT_OUT_TEXT_SP "Fuera" +#define FILAMENT_EXT0_TEXT_SP "Extrusor1" +#define FILAMENT_EXT1_TEXT_SP "Extrusor2" +#define FILAMENT_HEAT_TEXT_SP "Precalentar" +#define FILAMENT_STOP_TEXT_SP "Parar" +//#define FILAMENT_CHANGE_TEXT_SP "Filamento" +#define FILAMENT_TIPS2_TEXT_SP "T:" +#define FILAMENT_TIPS3_TEXT_SP "Dentro..." +#define FILAMENT_TIPS4_TEXT_SP "Fuera..." +#define FILAMENT_TIPS5_TEXT_SP "Temperatura demasiado baja, por favor calentar" +#define FILAMENT_TIPS6_TEXT_SP "Completado" +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_SP "Please click or \nto replace filament!" + #define FILAMENT_CHANGE_TEXT_SP "Please click or ,\nAfter pinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP "Calentando el extrusor, por favor espere..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP "Calentando el extrusor, por favor espere..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP "Temperatura alcanzada.Inserte el filamento y luego presione\"Confirmar\"para comenzar la carga." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_SP "Inserte el filamento y luego presione\"Confirmar\"para comenzar la carga." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP "Temperatura alcanzada.Presione\"Confirmar\"para retirar el filamento." + #define FILAMENT_DIALOG_LOADING_TIPS_SP "Cargando filamento,por favor espere." + #define FILAMENT_DIALOG_UNLOADING_TIPS_SP "Retirando filamento,por favor espere." + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP "Filamento cargado,presione\"Confirmar\"." + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP "Filamento retirado,presione\"Confirmar\"." +#else + #define FILAMENT_CHANGE_TEXT_SP "Please click \nor ,After \npinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP "Calentando el extrusor,\npor favor espere..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP "Calentando el extrusor,\npor favor espere..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP "Temperatura alcanzada.Inserte el \nfilamento y luego presione\"Confirmar\"\npara comenzar la carga." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_SP "Inserte el filamento y \nluego presione\"Confirmar\"para \ncomenzar la carga." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP "Temperatura alcanzada.\nPresione\"Confirmar\"para retirar \nel filamento." + #define FILAMENT_DIALOG_LOADING_TIPS_SP "Cargando filamento,\npor favor espere." + #define FILAMENT_DIALOG_UNLOADING_TIPS_SP "Retirando filamento,\npor favor espere." + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP "Filamento cargado,\npresione\"Confirmar\"." + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP "Filamento retirado,\npresione\"Confirmar\"." +#endif + +#define PRE_HEAT_EXT_TEXT_SP "Extrusor" +#define PRE_HEAT_BED_TEXT_SP "cama" + +#define FILE_LOADING_SP "Cargando......" +#if 0 + #define NO_FILE_AND_CHECK_SP "No se encontraron archivos! Por favor, inserte la tarjeta SD o el disco U!" +#endif +#define NO_FILE_AND_CHECK_SP "Archivo no encontrado,\n por favor insertar SD o disco USB!" + +#define NO_FILE_SP "Sin archivo!" + + + +#define EXTRUDER_TEMP_TEXT_SP "Temper" +#define EXTRUDER_E_LENGTH1_TEXT_SP "Extrusor1" +#define EXTRUDER_E_LENGTH2_TEXT_SP "Extrusor2" +#define EXTRUDER_E_LENGTH3_TEXT_SP "Extrusor3" + +#define ABOUT_TYPE_TEXT_SP "Pantalla: " +#define ABOUT_VERSION_TEXT_SP "Firmware: " +#define ABOUT_WIFI_TEXT_SP "WiFi: " + +#define PRINTING_OPERATION_SP "Ajustes" +#define PRINTING_PAUSE_SP "Pausar" +#define PRINTING_TEMP_SP "Temp." +#define PRINTING_CHANGESPEED_SP "Velocidad" +#define PRINTING_RESUME_SP "Resumir" +#define PRINTING_STOP_SP "Detener" +#define PRINTING_MORE_SP "Más" +#define PRINTING_EXTRUDER_SP "Extrusor" +#define PRINTING_MOVE_SP "Mover" + +#define EXTRUDER_SPEED_SP "Extrusor" +#define MOVE_SPEED_SP "Mover" +#define EXTRUDER_SPEED_STATE_SP "Extrusión" +#define MOVE_SPEED_STATE_SP "Movimiento" +#define STEP_1PERCENT_SP "1%" +#define STEP_5PERCENT_SP "5%" +#define STEP_10PERCENT_SP "10%" + +#define ZOFFSET_SP "Z Offset" +#define ZOFFSET_INC_SP "Más" +#define ZOFFSET_DEC_SP "Menos" + +#define TITLE_READYPRINT_SP "Inicio" +#define TITLE_PREHEAT_SP "Precalentar" +#define TITLE_MOVE_SP "Mover" +#define TITLE_HOME_SP "Origen" +#define TITLE_EXTRUDE_SP "Extrusor" +#define TITLE_LEVELING_SP "Leveling" +#define TITLE_SET_SP "Config" +#define TITLE_MORE_SP "Más" +#define TITLE_CHOOSEFILE_SP "Imprimir" +#define TITLE_PRINTING_SP "Imprimir" +#define TITLE_OPERATION_SP "Ajustes" +#define TITLE_ADJUST_SP "Temp." +#define TITLE_WIRELESS_SP "Wireless" +#define TITLE_FILAMENT_SP "Filamento" +#define TITLE_ABOUT_SP "Acerca" +#define TITLE_FAN_SP "Ventilador" +#define TITLE_LANGUAGE_SP "Language" +#define TITLE_PAUSE_SP "Pausar" +#define TITLE_CHANGESPEED_SP "Velocidad" +#define TILE_TOOL_SP "Ajustes" +#define TITLE_CLOUD_TEXT_SP "Cloud" +#define TITLE_DIALOG_CONFIRM_SP "Confirmar" +#define TITLE_FILESYS_SP "Puerto" +#define TITLE_ZOFFSET_SP "Z Offset" + +#define AUTO_SHUTDOWN_SP "Auto" +#define MANUAL_SHUTDOWN_SP "manual" + +#define DIALOG_CONFIRM_SP "Confirmar" +#define DIALOG_CANCLE_SP "Cancelar" +#define DIALOG_OK_SP "OK" +#define DIALOG_RESET_SP "Resetear" +#define DIALOG_RETRY_SP "Reintentar" +#define DIALOG_DISABLE_SP "Desactivar" +#define DIALOG_PRINT_MODEL_SP "¿Está seguro?" +#define DIALOG_CANCEL_PRINT_SP "¿Está seguro que desea detener la impresión?" + +#define DIALOG_RETRY_SP "Reintentar" +#define DIALOG_STOP_SP "Stop" +#define DIALOG_REPRINT_FROM_BREAKPOINT_SP "Reprint from breakpoint?" +//#define DIALOG_UNBIND_PRINTER_SP "Unbind the printer?" +#define DIALOG_ERROR_TIPS1_SP "Error:archivo no encontrado, \npor favor insertar SD o disco USB." +#define DIALOG_ERROR_TIPS2_SP "error:transacción fallida, \nconfigurar baudrate del \ndisplay para la placa base!" +#define DIALOG_ERROR_TIPS3_SP "Error : nombre de archivo o \nruta demasiado largo!" +#define DIALOG_CLOSE_MACHINE_SP "Closing machine......" +#define DIALOG_UNBIND_PRINTER_SP "Unbind the printer?" +#define DIALOG_FILAMENT_NO_PRESS_SP "Filament detection switch is not pressed" +#define DIALOG_PRINT_FINISH_SP "¡La impresión está completa!" +#define DIALOG_PRINT_TIME_SP "Tiempo de impresión: " +#define DIALOG_REPRINT_SP "Print again" +#define DIALOG_WIFI_ENABLE_TIPS_SP "The wifi module is being configured,\nplease wait a moment....." + +#define PRINTING_SP "Imprimiendo" +#define PRINTING_AJUSTES_SP "Ajustes" +#define PRINTING_PAUSAR_SP "Pausar" + +#define MESSAGE_PAUSING_SP "Aparcando..." +#define MESSAGE_CHANGING_SP "Esperando para iniciar el cambio de filamento" +#define MESSAGE_UNLOAD_SP "Espere para liberar el filamento" +#define MESSAGE_WAITING_SP "Pulsar el botón para reanudar impresión" +#define MESSAGE_INSERT_SP "Inserte el filamento y pulse el botón para continuar..." +#define MESSAGE_LOAD_SP "Espere para purgar el filamento" +#define MESSAGE_PURGE_SP "Espere para purgar el filamento" +#define MESSAGE_RESUME_SP "Esperando impresora para reanudar..." +#define MESSAGE_HEAT_SP "Pulse el botón para calentar la boquilla" +#define MESSAGE_HEATING_SP "Calentando boquilla Espere por favor..." +#define MESSAGE_OPTION_SP "¿Purgar más o continuar con la impresión?" +#define MESSAGE_PURGE_MORE_SP "Purga" +#define MESSAGE_CONTINUE_PRINT_SP "Impresión" +#define EEPROM_SETTINGS_TITLE_SP "Configuraciones EEPROM" +#define EEPROM_SETTINGS_STORE_SP "Guardar configuración en EEPROM" +#define EEPROM_SETTINGS_READ_SP "Leer la configuración de EEPROM" +#define EEPROM_SETTINGS_REVERT_SP "Revert settings to factory defaults" + +#define EEPROM_STORE_TIPS_SP "¿Guardar ajustes en EEPROM?" +#define EEPROM_READ_TIPS_SP "Leer la configuración de EEPROM?" +#define EEPROM_REVERT_TIPS_SP "Revert settings to factory defaults?" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h new file mode 100644 index 0000000000..19bd511d9a --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h @@ -0,0 +1,480 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 NEXT_T_CN "下一頁" +#define PREVIOUS_T_CN "上一頁" +#define DEFAULT_T_CN "默認值" +#define KEY_BACK_T_CN "退格" +#define KEY_REST_T_CN "重置" +#define KEY_CONFIRM_T_CN "確定" + +#define MACHINE_PARA_TITLE_T_CN "機器參數" +#define MACHINE_TYPE_CNOFIG_T_CN "機器設置" +#define TEMPERATURE_CONFIG_T_CN "溫度設置" +#define MOTOR_CONFIG_T_CN "電機設置" +#define ADVANCE_CONFIG_T_CN "高級設置" + +#define MACHINE_CONFIG_TITLE_T_CN "機器參數>機器配置" +#define MACHINE_TYPE_T_CN "機型選擇" +#define MACHINE_STROKE_T_CN "行程設置" +#define MACHINE_HOMEDIR_T_CN "歸零方向" +#define MACHINE_ENDSTOP_TYPE_T_CN "限位開關類型" +#define MACHINE_FILAMENT_CONFIG_T_CN "換料設置" +#define MACHINE_LEVELING_CONFIG_T_CN "調平設置" + +#define MACHINE_TYPE_CONFIG_TITLE_T_CN "機器參數>機型選擇" +#define MACHINE_TYPE_XYZ_T_CN "XYZ機型" +#define MACHINE_TYPE_DELTA_T_CN "Delta機型" +#define MACHINE_TYPE_COREXY_T_CN "Corexy機型" + +#define MACHINE_STROKE_CONF_TITLE_T_CN "機器參數>機器行程" +#define X_MAX_LENGTH_T_CN "X軸最大行程" +#define Y_MAX_LENGTH_T_CN "Y軸最大行程" +#define Z_MAX_LENGTH_T_CN "Z軸最大行程" + +#define X_MIN_LENGTH_T_CN "X軸最小行程" +#define Y_MIN_LENGTH_T_CN "Y軸最小行程" +#define Z_MIN_LENGTH_T_CN "Z軸最小行程" + +#define HOME_DIR_CONF_TITLE_T_CN "機器參數>歸零方向" +#define HOME_DIR_X_T_CN "X軸歸零方向" +#define HOME_DIR_Y_T_CN "Y軸歸零方向" +#define HOME_DIR_Z_T_CN "Z軸歸零方向" +#define HOME_MIN_T_CN "MIN" +#define HOME_MAX_T_CN "MAX" + +#define ENDSTOP_CONF_TITLE_T_CN "機器參數>限位開關" +#define MIN_ENDSTOP_X_T_CN "X軸最小限位" +#define MIN_ENDSTOP_Y_T_CN "Y軸最小限位" +#define MIN_ENDSTOP_Z_T_CN "Z軸最小限位" +#define MAX_ENDSTOP_X_T_CN "X軸最大限位" +#define MAX_ENDSTOP_Y_T_CN "Y軸最大限位" +#define MAX_ENDSTOP_Z_T_CN "Z軸最大限位" +#define ENDSTOP_FIL_T_CN "斷料開關類型" +#define ENDSTOP_LEVEL_T_CN "調平開關類型" +#define ENDSTOP_OPENED_T_CN "常開" +#define ENDSTOP_CLOSED_T_CN "常閉" + +#define FILAMENT_CONF_TITLE_T_CN "換料設置" +#define FILAMENT_IN_TEMPERATURE_T_CN "進料溫度" +#define FILAMENT_IN_LENGTH_T_CN "進料長度" +#define FILAMENT_IN_SPEED_T_CN "進料速度" +#define FILAMENT_OUT_TEMPERATURE_T_CN "退料溫度" +#define FILAMENT_OUT_LENGTH_T_CN "退料長度" +#define FILAMENT_OUT_SPEED_T_CN "退料速度" + +#define LEVELING_CONF_TITLE_T_CN "調平設置" +#define LEVELING_PARA_CONF_T_CN "調平設置" +#define LEVELING_DELTA_T_CN "delta機型設置" +#define LEVELING_XYZ_T_CN "手動調平坐標設置" + +#define LEVELING_PARA_CONF_TITLE_T_CN "調平參數" +#define AUTO_LEVELING_ENABLE_T_CN "自動調平" +#define BLTOUCH_LEVELING_ENABLE_T_CN "啟動BLtouch" +#define PROBE_PORT_T_CN "調平探針接口" +#define PROBE_X_OFFSET_T_CN "探針X方向偏移" +#define PROBE_Y_OFFSET_T_CN "探针Y方向偏移" +#define PROBE_Z_OFFSET_T_CN "探针Z方向偏移" +#define PROBE_XY_SPEED_T_CN "探针XY方向移動速度" +#define PROBE_Z_SPEED_T_CN "探针Z方向移動速度" +#define ENABLE_T_CN "是" +#define DISABLE_T_CN "否" +#define Z_MIN_T_CN "ZMin" +#define Z_MAX_T_CN "ZMax" + +#define DELTA_LEVEL_CONF_TITLE_T_CN "Delta機器參數" +#define DELTA_LEVEL_CONF_T_CN "Delta機器調平" +#define DELTA_MACHINE_RADIUS_T_CN "機器半徑" +#define DELTA_DIAGONAL_ROD_T_CN "機器桿長" +#define DELTA_PRINT_RADIUS_T_CN "打印半徑" +#define DELTA_HEIGHT_T_CN "打印高度" +#define SMOOTH_ROD_OFFSET_T_CN "滑塊偏移" +#define EFFECTOR_OFFSET_T_CN "效應器偏移" +#define CALIBRATION_RADIUS_T_CN "調平半徑" + +#define XYZ_LEVEL_CONF_TITLE_T_CN "XYZ機器參數" +#define PROBE_REACH_MAX_LEFT_T_CN "探针達到最左位置" +#define PROBE_REACH_MAX_RIGHT_T_CN "探针達到最右位置" +#define PROBE_REACH_MAX_FRONT_T_CN "探针達到最前位置" +#define PROBE_REACH_MAX_BACK_T_CN "探针達到最後位置" + +#define TEMPERATURE_CONF_TITLE_T_CN "機器參數>溫度設置" +#define NOZZLE_CONF_T_CN "噴頭設置" +#define HOTBED_CONF_T_CN "熱床設置" +#define PREHEAT_TEMPER_T_CN "預設溫度" + +#define NOZZLE_CONF_TITLE_T_CN "機器參數>噴頭設置" +#define NOZZLECNT_T_CN "噴頭數量" +#define NOZZLE_TYPE_T_CN "E0溫感類型" +#define NOZZLE_ADJUST_TYPE_T_CN "PID調溫" +#define NOZZLE_MIN_TEMPERATURE_T_CN "最低溫度" +#define NOZZLE_MAX_TEMPERATURE_T_CN "最高溫度" +#define EXTRUD_MIN_TEMPER_T_CN "最低擠出溫度" + +#define HOTBED_CONF_TITLE_T_CN "機器參數>熱床設置" +#define HOTBED_ADJUST_T_CN "PID調溫" +#define HOTBED_MIN_TEMPERATURE_T_CN "最低溫度" +#define HOTBED_MAX_TEMPERATURE_T_CN "最高溫度" + +#define MOTOR_CONF_TITLE_T_CN "機器參數>電機設置" +#define MAXFEEDRATE_CONF_T_CN "最大速度設置" +#define ACCELERATION_CONF_T_CN "加速度設置" +#define JERKCONF_T_CN "突變速度設置" +#define STEPSCONF_T_CN "脈沖設置" +#define TMC_CURRENT_T_CN "TMC 驅動電流設置" +#define TMC_STEP_MODE_T_CN "TMC 驅動模式設置" +#define MOTORDIRCONF_T_CN "電機方向設置" +#define HOMEFEEDRATECONF_T_CN "歸零速度設置" + +#define MAXFEEDRATE_CONF_TITLE_T_CN "機器參數>最大速度" +#define X_MAXFEEDRATE_T_CN "X軸最大速度" +#define Y_MAXFEEDRATE_T_CN "Y軸最大速度" +#define Z_MAXFEEDRATE_T_CN "Z軸最大速度" +#define E0_MAXFEEDRATE_T_CN "E0軸最大速度" +#define E1_MAXFEEDRATE_T_CN "E1軸最大速度" + +#define ACCELERATION_CONF_TITLE_T_CN "機器參數>加速度" +#define PRINT_ACCELERATION_T_CN "打印加速度" +#define RETRACT_ACCELERATION_T_CN "回抽加速度" +#define TRAVEL_ACCELERATION_T_CN "空載加速度" +#define X_ACCELERATION_T_CN "X軸加速度" +#define Y_ACCELERATION_T_CN "Y軸加速度" +#define Z_ACCELERATION_T_CN "Z軸加速度" +#define E0_ACCELERATION_T_CN "E0軸加速度" +#define E1_ACCELERATION_T_CN "E1軸加速度" + +#define JERK_CONF_TITLE_T_CN "機器參數>突變速度" +#define X_JERK_T_CN "X軸突變速度" +#define Y_JERK_T_CN "Y軸突變速度" +#define Z_JERK_T_CN "Z軸突變速度" +#define E_JERK_T_CN "E軸突變速度" + +#define STEPS_CONF_TITLE_T_CN "機器參數>脈衝設置" +#define X_STEPS_T_CN "X軸脈沖" +#define Y_STEPS_T_CN "Y軸脈沖" +#define Z_STEPS_T_CN "Z軸脈沖" +#define E0_STEPS_T_CN "E0軸脈沖" +#define E1_STEPS_T_CN "E1軸脈沖" + +#define TMC_CURRENT_CONF_TITLE_T_CN "機器參數>TMC電流設置" +#define X_TMC_CURRENT_T_CN "X軸電流(毫安)" +#define Y_TMC_CURRENT_T_CN "Y軸電流(毫安)" +#define Z_TMC_CURRENT_T_CN "Z軸電流(毫安)" +#define E0_TMC_CURRENT_T_CN "E0軸電流(毫安)" +#define E1_TMC_CURRENT_T_CN "E1軸電流(毫安)" + +#define TMC_MODE_CONF_TITLE_T_CN "機器參數>TMC模式設置" +#define X_TMC_MODE_T_CN "X軸是否使能靜音模式" +#define Y_TMC_MODE_T_CN "Y軸是否使能靜音模式" +#define Z_TMC_MODE_T_CN "Z軸是否使能靜音模式" +#define E0_TMC_MODE_T_CN "E0軸是否使能靜音模式" +#define E1_TMC_MODE_T_CN "E1軸是否使能靜音模式" + +#define MOTORDIR_CONF_TITLE_T_CN "機器參數>電機方向" +#define X_MOTORDIR_T_CN "X軸電機方向" +#define Y_MOTORDIR_T_CN "Y軸電機方向" +#define Z_MOTORDIR_T_CN "Z軸電機方向" +#define E0_MOTORDIR_T_CN "E0軸電機方向" +#define E1_MOTORDIR_T_CN "E1軸電機方向" +#define INVERT_P_T_CN "正向" +#define INVERT_N_T_CN "反向" + +#define HOMEFEEDRATE_CONF_TITLE_T_CN "機器參數>歸零速度" +#define X_HOMESPEED_T_CN "XY軸歸零速度" +#define Y_HOMESPEED_T_CN "Y軸歸零速度" +#define Z_HOMESPEED_T_CN "Z軸歸零速度" + +#define ADVANCED_CONF_TITLE_T_CN "機器參數>高級設置" +#define PWROFF_DECTION_T_CN "斷電檢測模塊" +#define PWROFF_AFTER_PRINT_T_CN "啟動打完關機功能" +#define HAVE_UPS_T_CN "機器配備UPS電壓" +#define Z2_AND_Z2ENDSTOP_CONF_T_CN "雙z軸雙限位功能設置" +#define ENABLE_PINS_CONF_T_CN "電機使能腳電平設置" + +#define Z2_AND_Z2ENDSTOP_CONF_TITLE_T_CN "雙z軸雙限位設置" +#define Z2_ENABLE_T_CN "啟用Z2軸" +#define Z2_ENDSTOP_T_CN "啟用Z2限位" +#define Z2_PORT_T_CN "Z2限位接口" + +#define ENABLE_PINS_CONF_TITLE_T_CN "電機使能腳電平" +#define X_ENABLE_PINS_INVERT_T_CN "X軸電機使能電平" +#define Y_ENABLE_PINS_INVERT_T_CN "Y軸電機使能電平" +#define Z_ENABLE_PINS_INVERT_T_CN "Z軸電機使能電平" +#define E_ENABLE_PINS_INVERT_T_CN "E軸電機使能電平" + +#define PAUSE_POSITION_T_CN "打印暫停位置設置" +#define PAUSE_POSITION_X_T_CN "X軸暫停位置(絕對位置,-1無效)" +#define PAUSE_POSITION_Y_T_CN "Y軸暫停位置(絕對位置,-1無效)" +#define PAUSE_POSITION_Z_T_CN "Z軸暫停位置(相對位置,-1無效)" + +#define TOOL_TEXT_T_CN "工具" +#define PREHEAT_TEXT_T_CN "預熱" +#define MOVE_TEXT_T_CN "移動" +#define HOME_TEXT_T_CN "回零" +#define PRINT_TEXT_T_CN "打印" +#define EXTRUDE_TEXT_T_CN "擠出" +#define LEVELING_TEXT_T_CN "調平" +#define AUTO_LEVELING_TEXT_T_CN "自動調平" +#define SET_TEXT_T_CN "設置" +#define MORE_TEXT_T_CN "更多" + +#define ADD_TEXT_T_CN "增加" +#define DEC_TEXT_T_CN "減少" +#define EXTRUDER_1_TEXT_T_CN "噴頭1" +#define EXTRUDER_2_TEXT_T_CN "噴頭2" +#define HEATBED_TEXT_T_CN "熱床" +#define TEXT_1C_T_CN "1℃" +#define TEXT_5C_T_CN "5℃" +#define TEXT_10C_T_CN "10℃" +#define CLOSE_TEXT_T_CN "關閉" + +#define BACK_TEXT_T_CN "返回" + +#define TOOL_PREHEAT_T_CN "預熱" +#define TOOL_EXTRUDE_T_CN "擠出" +#define TOOL_MOVE_T_CN "移動" +#define TOOL_HOME_T_CN "回零" +#define TOOL_LEVELING_T_CN "調平" +#define TOOL_AUTO_LEVELING_T_CN "自動調平" +#define TOOL_FILAMENT_T_CN "換料" +#define TOOL_MORE_T_CN "更多" + +#define AXIS_X_ADD_TEXT_T_CN "X+" +#define AXIS_X_DEC_TEXT_T_CN "X-" +#define AXIS_Y_ADD_TEXT_T_CN "Y+" +#define AXIS_Y_DEC_TEXT_T_CN "Y-" +#define AXIS_Z_ADD_TEXT_T_CN "Z+" +#define AXIS_Z_DEC_TEXT_T_CN "Z-" +#define TEXT_01MM_T_CN "0.1mm" +#define TEXT_1MM_T_CN "1mm" +#define TEXT_10MM_T_CN "10mm" + +#define HOME_X_TEXT_T_CN "X" +#define HOME_Y_TEXT_T_CN "Y" +#define HOME_Z_TEXT_T_CN "Z" +#define HOME_ALL_TEXT_T_CN "回零" +#define HOME_STOPMOVE_T_CN "急停" + +#define PAGE_UP_TEXT_T_CN "上一頁" +#define PAGE_DOWN_TEXT_T_CN "下一頁" + +#define EXTRUDER_IN_TEXT_T_CN "進料" +#define EXTRUDER_OUT_TEXT_T_CN "退料" +#define EXTRUDE_1MM_TEXT_T_CN "1mm" +#define EXTRUDE_5MM_TEXT_T_CN "5mm" +#define EXTRUDE_10MM_TEXT_T_CN "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_T_CN "低速" +#define EXTRUDE_MEDIUM_SPEED_TEXT_T_CN "常速" +#define EXTRUDE_HIGH_SPEED_TEXT_T_CN "高速" + +#define LEVELING_POINT1_TEXT_T_CN "第一點" +#define LEVELING_POINT2_TEXT_T_CN "第二點" +#define LEVELING_POINT3_TEXT_T_CN "第三點" +#define LEVELING_POINT4_TEXT_T_CN "第四點" +#define LEVELING_POINT5_TEXT_T_CN "第五點" + +#define FILESYS_TEXT_T_CN "文件系統" +#define WIFI_TEXT_T_CN "WIFI" +#define FAN_TEXT_T_CN "風扇" +#define ABOUT_TEXT_T_CN "關於" +#define BREAK_POINT_TEXT_T_CN "斷點續打" +#define FILAMENT_TEXT_T_CN "換料" +#define LANGUAGE_TEXT_T_CN "語言" +#define MOTOR_OFF_TEXT_T_CN "關閉電機" +#define MOTOR_OFF_XY_TEXT_T_CN "關閉XY" +#define SHUTDOWN_TEXT_T_CN "關機" +#define MACHINE_PARA_T_CN "機器參數" +#define EEPROM_SETTINGS_T_CN "Eeprom設置" + +#define U_DISK_TEXT_T_CN "U盤" +#define SD_CARD_TEXT_T_CN "SD卡" +#define WIFI_NAME_TEXT_T_CN "無線網絡:" +#define WIFI_KEY_TEXT_T_CN "密碼: " +#define WIFI_IP_TEXT_T_CN "IP: " +#define WIFI_AP_TEXT_T_CN "狀態: AP" +#define WIFI_STA_TEXT_T_CN "狀態: STA" +#define WIFI_CONNECTED_TEXT_T_CN "已連接" +#define WIFI_DISCONNECTED_TEXT_T_CN "未連接" +#define WIFI_EXCEPTION_TEXT_T_CN "模塊異常" +#define CLOUD_TEXT_T_CN "雲服務" +#define CLOUD_BIND_T_CN "已綁定" +#define CLOUD_UNBIND_T_CN "解綁" +#define CLOUD_UNBINDING_T_CN "解绑中" +#define CLOUD_DISCONNECTED_T_CN "未連接" +#define CLOUD_UNBINDED_T_CN "未綁定" +#define CLOUD_BINDED_T_CN "已綁定" +#define CLOUD_DISABLE_T_CN "已禁用" + +#define FAN_ADD_TEXT_T_CN "增加" +#define FAN_DEC_TEXT_T_CN "減少" +#define FAN_OPEN_TEXT_T_CN "100%" +#define FAN_HALF_TEXT_T_CN "50%" +#define FAN_CLOSE_TEXT_T_CN "關閉" +#define FAN_TIPS1_TEXT_T_CN "風扇" +#define FAN_TIPS2_TEXT_T_CN "FAN\nClose" + +#define FILAMENT_IN_TEXT_T_CN "進料" +#define FILAMENT_OUT_TEXT_T_CN "退料" +#define FILAMENT_EXT0_TEXT_T_CN "噴頭1" +#define FILAMENT_EXT1_TEXT_T_CN "噴頭2" +#define FILAMENT_HEAT_TEXT_T_CN "預熱" +#define FILAMENT_STOP_TEXT_T_CN "停止" +//#define FILAMENT_CHANGE_TEXT_T_CN "準備換料" +#define FILAMENT_TIPS2_TEXT_T_CN "T:" +#define FILAMENT_TIPS3_TEXT_T_CN "正在進料" +#define FILAMENT_TIPS4_TEXT_T_CN "正在退料" +#define FILAMENT_TIPS5_TEXT_T_CN "溫度太低,請先預熱" +#define FILAMENT_TIPS6_TEXT_T_CN "換料完成" + +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_T_CN "請按<進料>或<退料>進行換料!" + #define FILAMENT_CHANGE_TEXT_T_CN "待打印機暫停后,請按<進料>或<退料>進行換料!" +#endif + + #define FILAMENT_CHANGE_TEXT_T_CN "待打印機暫停后,\n請按<進料>或<退料>" + +#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_T_CN "準備進料,正在加熱,請稍等" +#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_T_CN "準備退料,正在加熱,請稍等" +#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_T_CN "加熱完成,請裝載耗材后,按<確定>開始進料" +#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_T_CN "請裝載耗,按<確定>開始進料!" +#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_T_CN "加熱完成,请按<確定>開始退料!" +#define FILAMENT_DIALOG_LOADING_TIPS_T_CN "正在進料,请等待耗材加載完成!" +#define FILAMENT_DIALOG_UNLOADING_TIPS_T_CN "正在退料,请等待耗材卸載完成!" +#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_T_CN "進料完成,请按<確定>返回" +#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_T_CN "退料完成,请按<確定>返回" + +#define PRE_HEAT_EXT_TEXT_T_CN "噴頭" +#define PRE_HEAT_BED_TEXT_T_CN "熱床" + +#define FILE_LOADING_T_CN "正在載入......" +#define NO_FILE_AND_CHECK_T_CN "無文件!請插入sd卡/u盤!" +#define NO_FILE_T_CN "無文件!" + +#define EXTRUDER_TEMP_TEXT_T_CN "溫度" +#define EXTRUDER_E_LENGTH1_TEXT_T_CN "噴頭" +#define EXTRUDER_E_LENGTH2_TEXT_T_CN "噴頭" +#define EXTRUDER_E_LENGTH3_TEXT_T_CN "噴頭" + +#define ABOUT_TYPE_TEXT_T_CN "Type: " +#define ABOUT_VERSION_TEXT_T_CN "Firmware: " +#define ABOUT_WIFI_TEXT_T_CN "Wifi: " + +#define PRINTING_OPERATION_T_CN "操作" +#define PRINTING_PAUSE_T_CN "暫停" +#define PRINTING_TEMP_T_CN "溫度" +#define PRINTING_CHANGESPEED_T_CN "變速" +#define PRINTING_RESUME_T_CN "恢復" +#define PRINTING_STOP_T_CN "停止" +#define PRINTING_MORE_T_CN "更多" +#define PRINTING_EXTRUDER_T_CN "擠出" +#define PRINTING_MOVE_T_CN "移動" + +#define EXTRUDER_SPEED_T_CN "擠出" +#define MOVE_SPEED_T_CN "移動" +#define EXTRUDER_SPEED_STATE_T_CN "擠出速度" +#define MOVE_SPEED_STATE_T_CN "移動速度" +#define STEP_1PERCENT_T_CN "1%%" +#define STEP_5PERCENT_T_CN "5%%" +#define STEP_10PERCENT_T_CN "10%%" + +#define ZOFFSET_T_CN "Z Offset" +#define ZOFFSET_INC_T_CN "增加" +#define ZOFFSET_DEC_T_CN "減少" + +#define TITLE_READYPRINT_T_CN "準備打印" +#define TITLE_PREHEAT_T_CN "預熱" +#define TITLE_MOVE_T_CN "移動" +#define TITLE_HOME_T_CN "回零" +#define TITLE_EXTRUDE_T_CN "擠出" +#define TITLE_LEVELING_T_CN "調平" +#define TITLE_SET_T_CN "設置" +#define TITLE_MORE_T_CN "更多" +#define TITLE_CHOOSEFILE_T_CN "選擇文件" +#define TITLE_PRINTING_T_CN "正在打印" +#define TITLE_OPERATION_T_CN "操作" +#define TITLE_ADJUST_T_CN "調整" +#define TITLE_WIRELESS_T_CN "無線網絡" +#define TITLE_FILAMENT_T_CN "換料" +#define TITLE_ABOUT_T_CN "關於" +#define TITLE_FAN_T_CN "風扇" +#define TITLE_LANGUAGE_T_CN "語言" +#define TITLE_PAUSE_T_CN "暫停" +#define TITLE_CHANGESPEED_T_CN "變速" +#define TITLE_CLOUD_TEXT_T_CN "雲服務" +#define TITLE_DIALOG_CONFIRM_T_CN "確認" +#define TITLE_FILESYS_T_CN "文件系統" +#define TITLE_ZOFFSET_T_CN "Z Offset" + +#define AUTO_SHUTDOWN_T_CN "自動關機" +#define MANUAL_SHUTDOWN_T_CN "手動關機" + +#define DIALOG_CONFIRM_T_CN "確定" +#define DIALOG_CANCLE_T_CN "取消" +#define DIALOG_OK_T_CN "確認" +#define DIALOG_RESET_T_CN "重設" +#define DIALOG_RETRY_T_CN "重試" +#define DIALOG_DISABLE_T_CN "禁用" +#define DIALOG_PRINT_MODEL_T_CN "打印模型?" +#define DIALOG_CANCEL_PRINT_T_CN "停止打印?" +#define DIALOG_RETRY_T_CN "重試" +#define DIALOG_STOP_T_CN "停止" +#define DIALOG_REPRINT_FROM_BREAKPOINT_T_CN "從斷點續打?" +//#define DIALOG_UNBIND_PRINTER_T_CN "解除綁定?" +#define DIALOG_ERROR_TIPS1_T_CN "錯誤:找不到文件,請插入sd卡/u盤!" +#define DIALOG_ERROR_TIPS2_T_CN "錯誤:通信失敗,請檢查波特率或主板硬件!" +#define DIALOG_ERROR_TIPS3_T_CN "錯誤:文件名或文件路徑太長!" +#define DIALOG_CLOSE_MACHINE_T_CN "正在關機......" +#define DIALOG_UNBIND_PRINTER_T_CN "解除綁定?" +#define DIALOG_FILAMENT_NO_PRESS_T_CN "請先裝載耗材!" +#define DIALOG_PRINT_FINISH_T_CN "打印完成!" +#define DIALOG_PRINT_TIME_T_CN "打印時間: " +#define DIALOG_REPRINT_T_CN "再打印壹次" +#define DIALOG_WIFI_ENABLE_TIPS_T_CN "wifi模塊正在配置中,請稍等......" + +#define TEXT_VALUE_T_CN "%d℃/%d℃" +#define EXTRUDE_TEXT_VALUE_T_T_CN ": %d℃" +#define WIFI_RECONNECT_TEXT_T_CN "重新連接" + +#define MESSAGE_PAUSING_T_CN "暫停中..." +#define MESSAGE_CHANGING_T_CN "等待換料開始..." +#define MESSAGE_UNLOAD_T_CN "退料中,請稍等..." +#define MESSAGE_WAITING_T_CN "點擊按鈕恢復打印" +#define MESSAGE_INSERT_T_CN "裝載耗材後,點擊按鈕開始打印" +#define MESSAGE_LOAD_T_CN "進料中,請稍等..." +#define MESSAGE_PURGE_T_CN "等待擠出..." +#define MESSAGE_RESUME_T_CN "等待恢復打印..." +#define MESSAGE_HEAT_T_CN "按下按鈕,加熱噴頭" +#define MESSAGE_HEATING_T_CN "噴頭加熱中,請等待..." +#define MESSAGE_OPTION_T_CN "擠出更多還是繼續打印" +#define MESSAGE_PURGE_MORE_T_CN "擠出" +#define MESSAGE_CONTINUE_PRINT_T_CN "打印" + +#define EEPROM_SETTINGS_TITLE_T_CN "EEPROM 設置" +#define EEPROM_SETTINGS_STORE_T_CN "保存參數至EEPROM" +#define EEPROM_SETTINGS_READ_T_CN "讀取EEPROM參數" +#define EEPROM_SETTINGS_REVERT_T_CN "恢復默認參數" + +#define EEPROM_STORE_TIPS_T_CN "是否保存參數到EEPROM?" +#define EEPROM_READ_TIPS_T_CN "是否使用EEPROM參數?" +#define EEPROM_REVERT_TIPS_T_CN "是否恢復默認參數?" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.cpp new file mode 100644 index 0000000000..e8ac3f3519 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.cpp @@ -0,0 +1,273 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + + #if defined(ARDUINO_ARCH_STM32F1) && PIN_EXISTS(FSMC_CS) // FSMC on 100/144 pins SoCs + + #include + #include + #include + #include + +/* 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); + uint16_t LCD_IO_ReadData(uint16_t RegValue); + uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize); + uint16_t ILI9488_ReadRAM(); + #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 + +/** + * 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(); + } + + uint16_t LCD_IO_ReadData(uint16_t RegValue) { + LCD->REG = RegValue; + __DSB(); + + return LCD->RAM; + } + + uint16_t ILI9488_ReadRAM() { + uint16_t data; + data = LCD->RAM; + return data; + } + + 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); + } + + #ifdef 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 // ARDUINO_ARCH_STM32F1 && FSMC_CS_PIN +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h new file mode 100644 index 0000000000..f7b0e0d310 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h @@ -0,0 +1,30 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 __cplusplus +extern "C" { /* C-declarations for C++ */ +#endif + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp new file mode 100644 index 0000000000..f24f08e98e --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -0,0 +1,761 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 tft_lvgl_configuration.cpp + * @date 2020-02-21 + */ + +#include "../../../../inc/MarlinConfigPre.h" + +#if HAS_TFT_LVGL_UI + +#if ENABLED(TFT_LVGL_UI_SPI) + #include "SPI_TFT.h" +#endif + +#include "tft_lvgl_configuration.h" +#include "draw_ready_print.h" +#include "W25Qxx.h" +#include "pic_manager.h" +#include "mks_hardware_test.h" +#include "draw_ui.h" +#include + +#include "../../../../MarlinCore.h" +#include "../../../../feature/touch/xpt2046.h" + +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../../../feature/powerloss.h" +#endif + +#include + +#if HAS_SPI_FLASH_FONT + extern void init_gb2312_font(); +#endif + +static lv_disp_buf_t disp_buf; +#if ENABLED(SDSUPPORT) + extern void UpdateAssets(); +#endif +uint16_t DeviceCode = 0x9488; +extern uint8_t sel_id; + +#define SetCs +#define ClrCs + +#define HDP 799 // Horizontal Display Period +#define HT 1000 // Horizontal Total +#define HPS 51 // LLINE Pulse Start Position +#define LPS 3 // Horizontal Display Period Start Position +#define HPW 8 // LLINE Pulse Width + +#define VDP 479 // Vertical Display Period +#define VT 530 // Vertical Total +#define VPS 24 // LFRAME Pulse Start Position +#define FPS 23 // Vertical Display Period Start Positio +#define VPW 3 // LFRAME Pulse Width + +#define MAX_HZ_POSX HDP+1 +#define MAX_HZ_POSY VDP+1 + +extern uint8_t gcode_preview_over, flash_preview_begin, default_preview_flg; + +void SysTick_Callback() { + lv_tick_inc(1); + print_time_count(); +} + +#if DISABLED(TFT_LVGL_UI_SPI) + +extern void LCD_IO_Init(uint8_t cs, uint8_t rs); +extern void LCD_IO_WriteData(uint16_t RegValue); +extern void LCD_IO_WriteReg(uint16_t Reg); + +extern void LCD_IO_WriteMultiple(uint16_t color, uint32_t count); +void tft_set_cursor(uint16_t x, uint16_t y) { + LCD_IO_WriteReg(0x002A); + LCD_IO_WriteData(x >> 8); + LCD_IO_WriteData(x & 0x00FF); + LCD_IO_WriteData(x >> 8); + LCD_IO_WriteData(x & 0x00FF); + //ILI9488_WriteData(0x01); + //ILI9488_WriteData(0xDF); + LCD_IO_WriteReg(0x002B); + LCD_IO_WriteData(y >> 8); + LCD_IO_WriteData(y & 0x00FF); + LCD_IO_WriteData(y >> 8); + LCD_IO_WriteData(y & 0x00FF); + //ILI9488_WriteData(0x01); + //ILI9488_WriteData(0x3F); +} + +void LCD_WriteRAM_Prepare(void) { + #if 0 + if ((DeviceCode == 0x9325) || (DeviceCode == 0x9328) || (DeviceCode == 0x8989)) { + ClrCs + LCD->LCD_REG = R34; + SetCs + } + else { + LCD_WrtReg(0x002C); + } + #else + LCD_IO_WriteReg(0x002C); + #endif +} + +void tft_set_point(uint16_t x, uint16_t y, uint16_t point) { + //if (DeviceCode == 0x9488) { + if ((x > 480) || (y > 320)) return; + //} + //**if ( (x>320)||(y>240) ) return; + tft_set_cursor(x, y); + + LCD_WriteRAM_Prepare(); + //LCD_WriteRAM(point); + LCD_IO_WriteData(point); +} + +void LCD_WriteReg(uint16_t LCD_Reg, uint16_t LCD_RegValue) { + /* Write 16-bit Index, then Write Reg */ + ClrCs + LCD_IO_WriteReg(LCD_Reg); + /* Write 16-bit Reg */ + LCD_IO_WriteData(LCD_RegValue); + SetCs +} + +void ili9320_SetWindows(uint16_t StartX, uint16_t StartY, uint16_t width, uint16_t heigh) { + uint16_t s_h, s_l, e_h, e_l; + uint16_t xEnd, yEnd; + xEnd = StartX + width; + yEnd = StartY + heigh - 1; + if (DeviceCode == 0x8989) { + /*LCD_WriteReg(0x0044, (StartX & 0xFF) | (xEnd << 8)); + LCD_WriteReg(0x0045, StartY); + LCD_WriteReg(0x0046, yEnd);*/ + LCD_WriteReg(0x0044, (StartY & 0xFF) | (yEnd << 8)); + LCD_WriteReg(0x0045, StartX); + LCD_WriteReg(0x0046, xEnd); + } + else if (DeviceCode == 0x9488) { + s_h = (StartX >> 8) & 0x00ff; + s_l = StartX & 0x00ff; + e_h = ((StartX + width - 1) >> 8) & 0x00ff; + e_l = (StartX + width - 1) & 0x00ff; + + LCD_IO_WriteReg(0x002A); + LCD_IO_WriteData(s_h); + LCD_IO_WriteData(s_l); + LCD_IO_WriteData(e_h); + LCD_IO_WriteData(e_l); + + s_h = (StartY >> 8) & 0x00ff; + s_l = StartY & 0x00ff; + e_h = ((StartY + heigh - 1) >> 8) & 0x00ff; + e_l = (StartY + heigh - 1) & 0x00ff; + + LCD_IO_WriteReg(0x002B); + LCD_IO_WriteData(s_h); + LCD_IO_WriteData(s_l); + LCD_IO_WriteData(e_h); + LCD_IO_WriteData(e_l); + } + else if ((DeviceCode == 0x9325) || (DeviceCode == 0x9328) || (DeviceCode == 0x1505)) { + /* LCD_WriteReg(0x0050, StartX); + LCD_WriteReg(0x0052, StartY); + LCD_WriteReg(0x0051, xEnd); + LCD_WriteReg(0x0053, yEnd);*/ + LCD_WriteReg(0x0050, StartY); //Specify the start/end positions of the window address in the horizontal direction by an address unit + LCD_WriteReg(0x0051, yEnd); //Specify the start positions of the window address in the vertical direction by an address unit + LCD_WriteReg(0x0052, 320 - xEnd); + LCD_WriteReg(0x0053, 320 - StartX - 1); //Specify the end positions of the window address in the vertical direction by an address unit + + } + else { + s_h = (StartX >> 8) & 0xFF; + s_l = StartX & 0xFF; + e_h = ((StartX + width - 1) >> 8) & 0xFF; + e_l = (StartX + width - 1) & 0xFF; + + LCD_IO_WriteReg(0x2A); + LCD_IO_WriteData(s_h); + LCD_IO_WriteData(s_l); + LCD_IO_WriteData(e_h); + LCD_IO_WriteData(e_l); + + s_h = (StartY >> 8) & 0xFF; + s_l = StartY & 0xFF; + e_h = ((StartY + heigh - 1) >> 8) & 0xFF; + e_l = (StartY + heigh - 1) & 0xFF; + + LCD_IO_WriteReg(0x2B); + LCD_IO_WriteData(s_h); + LCD_IO_WriteData(s_l); + LCD_IO_WriteData(e_h); + LCD_IO_WriteData(e_l); + } +} + +void LCD_Clear(uint16_t Color) { + uint32_t index = 0; + unsigned int count; + + if (DeviceCode == 0x9488) { + tft_set_cursor(0, 0); + ili9320_SetWindows(0, 0, 480, 320); + LCD_WriteRAM_Prepare(); + #ifdef LCD_USE_DMA_FSMC + LCD_IO_WriteMultiple(Color, LCD_FULL_PIXEL_WIDTH * LCD_FULL_PIXEL_HEIGHT); + #else + //index = (160*480); + for (index = 0; index < 320 * 480; index++) + LCD_IO_WriteData(Color); + #endif + //LCD_IO_WriteMultiple(Color, (480*320)); + //while(index --) LCD_IO_WriteData(Color); + } + else if (DeviceCode == 0x5761) { + LCD_IO_WriteReg(0x002a); + LCD_IO_WriteData(0); + LCD_IO_WriteData(0); + LCD_IO_WriteData(HDP >> 8); + LCD_IO_WriteData(HDP & 0x00ff); + LCD_IO_WriteReg(0x002b); + LCD_IO_WriteData(0); + LCD_IO_WriteData(0); + LCD_IO_WriteData(VDP >> 8); + LCD_IO_WriteData(VDP & 0x00ff); + LCD_IO_WriteReg(0x002c); + LCD_IO_WriteReg(0x002c); + for (count = 0; count < (HDP + 1) * (VDP + 1); count++) + LCD_IO_WriteData(Color); + } + else { + tft_set_cursor(0, 0); + LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */ + for (index = 0; index < 76800; index++) + LCD_IO_WriteData(Color); + } +} + +extern uint16_t ILI9488_ReadRAM(); + + +void init_tft() { + uint16_t i; + //************* Start Initial Sequence **********// + + //start lcd pins and dma + #if PIN_EXISTS(LCD_BACKLIGHT) + OUT_WRITE(LCD_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); // Illuminate after reset or right away + #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); + #endif + + #if PIN_EXISTS(LCD_BACKLIGHT) && ENABLED(DELAYED_BACKLIGHT_INIT) + WRITE(LCD_BACKLIGHT_PIN, HIGH); + #endif + + TERN_(HAS_LCD_CONTRAST, refresh_contrast()); + + #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(FSMC_CS_PIN, FSMC_RS_PIN); + + _delay_ms(5); + + LCD_IO_WriteReg(0x00D3); + DeviceCode = ILI9488_ReadRAM(); //dummy read + DeviceCode = ILI9488_ReadRAM(); + DeviceCode = ILI9488_ReadRAM(); + DeviceCode <<= 8; + DeviceCode |= ILI9488_ReadRAM(); + + if (DeviceCode == 0x9488) { + LCD_IO_WriteReg(0x00E0); + LCD_IO_WriteData(0x0000); + LCD_IO_WriteData(0x0007); + LCD_IO_WriteData(0x000f); + LCD_IO_WriteData(0x000D); + LCD_IO_WriteData(0x001B); + LCD_IO_WriteData(0x000A); + LCD_IO_WriteData(0x003c); + LCD_IO_WriteData(0x0078); + LCD_IO_WriteData(0x004A); + LCD_IO_WriteData(0x0007); + LCD_IO_WriteData(0x000E); + LCD_IO_WriteData(0x0009); + LCD_IO_WriteData(0x001B); + LCD_IO_WriteData(0x001e); + LCD_IO_WriteData(0x000f); + + LCD_IO_WriteReg(0x00E1); + LCD_IO_WriteData(0x0000); + LCD_IO_WriteData(0x0022); + LCD_IO_WriteData(0x0024); + LCD_IO_WriteData(0x0006); + LCD_IO_WriteData(0x0012); + LCD_IO_WriteData(0x0007); + LCD_IO_WriteData(0x0036); + LCD_IO_WriteData(0x0047); + LCD_IO_WriteData(0x0047); + LCD_IO_WriteData(0x0006); + LCD_IO_WriteData(0x000a); + LCD_IO_WriteData(0x0007); + LCD_IO_WriteData(0x0030); + LCD_IO_WriteData(0x0037); + LCD_IO_WriteData(0x000f); + + LCD_IO_WriteReg(0x00C0); + LCD_IO_WriteData(0x0010); + LCD_IO_WriteData(0x0010); + + LCD_IO_WriteReg(0x00C1); + LCD_IO_WriteData(0x0041); + + LCD_IO_WriteReg(0x00C5); + LCD_IO_WriteData(0x0000); + LCD_IO_WriteData(0x0022); + LCD_IO_WriteData(0x0080); + + LCD_IO_WriteReg(0x0036); + //ILI9488_WriteData(0x0068); + //if (gCfgItems.overturn_180 != 0xEE) { + LCD_IO_WriteData(0x0068); + //} + //else { + //ILI9488_WriteData(0x00A8); + //} + + LCD_IO_WriteReg(0x003A); //Interface Mode Control + LCD_IO_WriteData(0x0055); + + LCD_IO_WriteReg(0x00B0); //Interface Mode Control + LCD_IO_WriteData(0x0000); + LCD_IO_WriteReg(0x00B1); //Frame rate 70HZ + LCD_IO_WriteData(0x00B0); + LCD_IO_WriteData(0x0011); + LCD_IO_WriteReg(0x00B4); + LCD_IO_WriteData(0x0002); + LCD_IO_WriteReg(0x00B6); //RGB/MCU Interface Control + LCD_IO_WriteData(0x0002); + LCD_IO_WriteData(0x0042); + + LCD_IO_WriteReg(0x00B7); + LCD_IO_WriteData(0x00C6); + + //WriteComm(0xBE); + //WriteData(0x00); + //WriteData(0x04); + + LCD_IO_WriteReg(0x00E9); + LCD_IO_WriteData(0x0000); + + LCD_IO_WriteReg(0x00F7); + LCD_IO_WriteData(0x00A9); + LCD_IO_WriteData(0x0051); + LCD_IO_WriteData(0x002C); + LCD_IO_WriteData(0x0082); + + LCD_IO_WriteReg(0x0011); + for (i = 0; i < 65535; i++); + LCD_IO_WriteReg(0x0029); + + ili9320_SetWindows(0, 0, 480, 320); + LCD_Clear(0x0000); + + OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH); + } +} + +#endif // !TFT_LVGL_UI_SPI + +extern uint8_t bmp_public_buf[17 * 1024]; + +void tft_lvgl_init() { + + //uint16_t test_id=0; + W25QXX.init(SPI_QUARTER_SPEED); + //test_id=W25QXX.W25QXX_ReadID(); + + gCfgItems_init(); + ui_cfg_init(); + disp_language_init(); + + //init tft first! + #if ENABLED(TFT_LVGL_UI_SPI) + SPI_TFT.spi_init(SPI_FULL_SPEED); + SPI_TFT.LCD_init(); + #else + init_tft(); + #endif + + #if ENABLED(SDSUPPORT) + UpdateAssets(); + #endif + mks_test_get(); + + //spi_flash_read_test(); + + TERN_(TOUCH_BUTTONS, touch.init()); + + lv_init(); + + lv_disp_buf_init(&disp_buf, bmp_public_buf, NULL, LV_HOR_RES_MAX * 18); /*Initialize the display buffer*/ + + lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/ + lv_disp_drv_init(&disp_drv); /*Basic initialization*/ + disp_drv.flush_cb = my_disp_flush; /*Set your driver function*/ + disp_drv.buffer = &disp_buf; /*Assign the buffer to the display*/ + lv_disp_drv_register(&disp_drv); /*Finally register the driver*/ + + lv_indev_drv_t indev_drv; + lv_indev_drv_init(&indev_drv); /*Descriptor of a input device driver*/ + indev_drv.type = LV_INDEV_TYPE_POINTER; /*Touch pad is a pointer-like device*/ + indev_drv.read_cb = my_touchpad_read; /*Set your driver function*/ + lv_indev_drv_register(&indev_drv); /*Finally register the driver*/ + + systick_attach_callback(SysTick_Callback); + + #if HAS_SPI_FLASH_FONT + init_gb2312_font(); + #endif + + tft_style_init(); + + filament_pin_setup(); + + #if ENABLED(POWER_LOSS_RECOVERY) + if (recovery.valid()) { + if (gCfgItems.from_flash_pic == 1) + flash_preview_begin = 1; + else + default_preview_flg = 1; + + uiCfg.print_state = REPRINTING; + + ZERO(public_buf_m); + strncpy(public_buf_m, recovery.info.sd_filename, sizeof(public_buf_m)); + card.printLongPath(public_buf_m); + + strncpy(list_file.long_name[sel_id], card.longFilename, sizeof(list_file.long_name[sel_id])); + + lv_draw_printing(); + } + else + #endif + lv_draw_ready_print(); + + if (mks_test_flag == 0x1E) + mks_gpio_test(); +} + +void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p) { + #if ENABLED(TFT_LVGL_UI_SPI) + uint16_t i, width, height; + uint16_t clr_temp; + uint8_t tbuf[480 * 2]; + + SPI_TFT.spi_init(SPI_FULL_SPEED); + + width = area->x2 - area->x1 + 1; + height = area->y2 - area->y1 + 1; + + for (int j = 0; j < height; j++) { + SPI_TFT.SetCursor(0, 0); + SPI_TFT.SetWindows((uint16_t)area->x1, (uint16_t)area->y1 + j, width, 1); + SPI_TFT.LCD_WriteRAM_Prepare(); + + for (i = 0; i < width * 2;) { + clr_temp = (uint16_t)(((uint16_t)color_p->ch.red << 11) + | ((uint16_t)color_p->ch.green << 5) + | ((uint16_t)color_p->ch.blue)); + + tbuf[i] = clr_temp >> 8; + tbuf[i + 1] = clr_temp; + i += 2; + color_p++; + } + SPI_TFT_CS_L; + SPI_TFT_DC_H; + SPI.dmaSend(tbuf, width * 2, true); + SPI_TFT_CS_H; + } + + lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/ + + W25QXX.init(SPI_QUARTER_SPEED); + + #else // !TFT_LVGL_UI_SPI + + #if 1 + uint16_t i, width, height; + uint16_t clr_temp; + width = area->x2 - area->x1 + 1; + height = area->y2 - area->y1 + 1; + ili9320_SetWindows((uint16_t)area->x1, (uint16_t)area->y1, width, height); + LCD_WriteRAM_Prepare(); + for (i = 0; i < width * height - 2; i++) { + clr_temp = (uint16_t)(((uint16_t)color_p->ch.red << 11) + | ((uint16_t)color_p->ch.green << 5) + | ((uint16_t)color_p->ch.blue)); + LCD_IO_WriteData(clr_temp); + color_p++; + } + + lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/ + #endif + + #endif // !TFT_LVGL_UI_SPI +} + +#define TICK_CYCLE 1 + +static int32_t touch_time1 = 0; + +unsigned int getTickDiff(unsigned int curTick, unsigned int lastTick) { + return TICK_CYCLE * (lastTick <= curTick ? (curTick - lastTick) : (0xFFFFFFFF - lastTick + curTick)); +} + +#if ENABLED(TFT_LVGL_UI_SPI) + + #ifndef USE_XPT2046 + #define USE_XPT2046 1 + #define XPT2046_XY_SWAP 1 + #define XPT2046_X_INV 1 + #define XPT2046_Y_INV 0 + #endif + + #if USE_XPT2046 + #define XPT2046_HOR_RES 480 + #define XPT2046_VER_RES 320 + #define XPT2046_X_MIN 201 + #define XPT2046_Y_MIN 164 + #define XPT2046_X_MAX 3919 + #define XPT2046_Y_MAX 3776 + #define XPT2046_AVG 4 + #define XPT2046_INV 1 + #endif + +#else + + #ifndef USE_XPT2046 + #define USE_XPT2046 1 + #ifndef XPT2046_XY_SWAP + #define XPT2046_XY_SWAP 1 + #endif + #ifndef XPT2046_X_INV + #define XPT2046_X_INV 0 + #endif + #ifndef XPT2046_Y_INV + #define XPT2046_Y_INV 1 + #endif + #endif + + #if USE_XPT2046 + #ifndef XPT2046_HOR_RES + #define XPT2046_HOR_RES 480 + #endif + #ifndef XPT2046_VER_RES + #define XPT2046_VER_RES 320 + #endif + #ifndef XPT2046_X_MIN + #define XPT2046_X_MIN 201 + #endif + #ifndef XPT2046_Y_MIN + #define XPT2046_Y_MIN 164 + #endif + #ifndef XPT2046_X_MAX + #define XPT2046_X_MAX 3919 + #endif + #ifndef XPT2046_Y_MAX + #define XPT2046_Y_MAX 3776 + #endif + #ifndef XPT2046_AVG + #define XPT2046_AVG 4 + #endif + #ifndef XPT2046_INV + #define XPT2046_INV 0 + #endif + #endif + +#endif + +static void xpt2046_corr(uint16_t *x, uint16_t *y) { + #if XPT2046_XY_SWAP + int16_t swap_tmp; + swap_tmp = *x; + *x = *y; + *y = swap_tmp; + #endif + if ((*x) > XPT2046_X_MIN) (*x) -= XPT2046_X_MIN; else (*x) = 0; + if ((*y) > XPT2046_Y_MIN) (*y) -= XPT2046_Y_MIN; else (*y) = 0; + (*x) = uint32_t(uint32_t(*x) * XPT2046_HOR_RES) / (XPT2046_X_MAX - XPT2046_X_MIN); + (*y) = uint32_t(uint32_t(*y) * XPT2046_VER_RES) / (XPT2046_Y_MAX - XPT2046_Y_MIN); + #if XPT2046_X_INV + (*x) = XPT2046_HOR_RES - (*x); + #endif + #if XPT2046_Y_INV + (*y) = XPT2046_VER_RES - (*y); + #endif +} + +#define times 4 +#define CHX 0x90 +#define CHY 0xD0 + +int SPI2_ReadWrite2Bytes(void) { + #define SPI_READ_WRITE_BYTE(B) TERN(TFT_LVGL_UI_SPI, SPI_TFT.spi_read_write_byte, W25QXX.spi_flash_read_write_byte)(B) + const uint16_t t1 = SPI_READ_WRITE_BYTE(0xFF), + t2 = SPI_READ_WRITE_BYTE(0xFF); + return (((t1 << 8) | t2) >> 3) & 0x0FFF; +} + +uint16_t x_addata[times], y_addata[times]; +void XPT2046_Rd_Addata(uint16_t *X_Addata, uint16_t *Y_Addata) { + uint16_t i, j, k; + + TERN(TFT_LVGL_UI_SPI, SPI_TFT.spi_init, W25QXX.init)(SPI_SPEED_6); + + for (i = 0; i < times; i++) { + #if ENABLED(TFT_LVGL_UI_SPI) + OUT_WRITE(TOUCH_CS_PIN, LOW); + SPI_TFT.spi_read_write_byte(CHX); + y_addata[i] = SPI2_ReadWrite2Bytes(); + WRITE(TOUCH_CS_PIN, HIGH); + + OUT_WRITE(TOUCH_CS_PIN, LOW); + SPI_TFT.spi_read_write_byte(CHY); + x_addata[i] = SPI2_ReadWrite2Bytes(); + WRITE(TOUCH_CS_PIN, HIGH); + #else // #if ENABLED(TOUCH_BUTTONS) + OUT_WRITE(TOUCH_CS_PIN, LOW); + W25QXX.spi_flash_read_write_byte(CHX); + y_addata[i] = SPI2_ReadWrite2Bytes(); + WRITE(TOUCH_CS_PIN, HIGH); + + OUT_WRITE(TOUCH_CS_PIN, LOW); + W25QXX.spi_flash_read_write_byte(CHY); + x_addata[i] = SPI2_ReadWrite2Bytes(); + WRITE(TOUCH_CS_PIN, HIGH); + #endif + + } + TERN(TFT_LVGL_UI_SPI,,W25QXX.init(SPI_QUARTER_SPEED)); + + for (i = 0; i < times; i++) + for (j = i + 1; j < times; j++) + if (x_addata[j] > x_addata[i]) { + k = x_addata[j]; + x_addata[j] = x_addata[i]; + x_addata[i] = k; + } + if (x_addata[times / 2 - 1] - x_addata[times / 2] > 50) { + *X_Addata = *Y_Addata = 0; + return; + } + + *X_Addata = (x_addata[times / 2 - 1] + x_addata[times / 2]) / 2; + + for (i = 0; i < times; i++) + for (j = i + 1; j < times; j++) + if (y_addata[j] > y_addata[i]) { + k = y_addata[j]; + y_addata[j] = y_addata[i]; + y_addata[i] = k; + } + + if (y_addata[times / 2 - 1] - y_addata[times / 2] > 50) { + *X_Addata = *Y_Addata = 0; + return; + } + + *Y_Addata = (y_addata[times / 2 - 1] + y_addata[times / 2]) / 2; +} + +#define ADC_VALID_OFFSET 10 + +uint8_t TOUCH_PressValid(uint16_t _usX, uint16_t _usY) { + if ( (_usX <= ADC_VALID_OFFSET) + || (_usY <= ADC_VALID_OFFSET) + || (_usX >= 4095 - ADC_VALID_OFFSET) + || (_usY >= 4095 - ADC_VALID_OFFSET) + ) return 0; + return 1; +} + +static lv_coord_t last_x = 0, last_y = 0; +bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) { + uint32_t tmpTime, diffTime = 0; + + tmpTime = millis(); + diffTime = getTickDiff(tmpTime, touch_time1); + /*Save the state and save the pressed coordinate*/ + //data->state = TOUCH_PressValid(last_x, last_y) ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL; + //if (data->state == LV_INDEV_STATE_PR) ADS7843_Rd_Addata((u16 *)&last_x, (u16 *)&last_y); + //touchpad_get_xy(&last_x, &last_y); + /*Save the pressed coordinates and the state*/ + if (diffTime > 10) { + //use marlin touch code if enabled + #if ENABLED(TOUCH_BUTTONS) + touch.getTouchPoint(reinterpret_cast(last_x), reinterpret_cast(last_y)); + #else + XPT2046_Rd_Addata((uint16_t *)&last_x, (uint16_t *)&last_y); + #endif + if (TOUCH_PressValid(last_x, last_y)) { + + data->state = LV_INDEV_STATE_PR; + + /* Set the coordinates (if released use the last pressed coordinates) */ + + // SERIAL_ECHOLNPAIR("antes X: ", last_x, ", y: ", last_y); + xpt2046_corr((uint16_t *)&last_x, (uint16_t *)&last_y); + // SERIAL_ECHOLNPAIR("X: ", last_x, ", y: ", last_y); + data->point.x = last_x; + data->point.y = last_y; + + last_x = 0; + last_y = 0; + } + else { + data->state = LV_INDEV_STATE_REL; + } + touch_time1 = tmpTime; + } + + return false; /*Return `false` because we are not buffering and no more data to read*/ +} + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h new file mode 100644 index 0000000000..1b33d6e6bf --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h @@ -0,0 +1,46 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 tft_lvgl_configuration.h + * @date 2020-02-21 + * */ + +//#ifdef __cplusplus +//extern "C" { +//#endif + +#include + +void tft_lvgl_init(); +void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p); +bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data); + +void LCD_Clear(uint16_t Color); +void tft_set_point(uint16_t x, uint16_t y, uint16_t point); +void ili9320_SetWindows(uint16_t StartX, uint16_t StartY, uint16_t width, uint16_t heigh); +void LCD_WriteRAM_Prepare(void); + +//#ifdef __cplusplus +//} /* extern "C" */ +//#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp new file mode 100644 index 0000000000..1ea47cef2d --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp @@ -0,0 +1,2614 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_TFT_LVGL_UI + +#include "../../../../MarlinCore.h" + +#include "draw_ui.h" +#include "tft_multi_language.h" + +// ********************************************* // + +common_menu_def common_menu; +main_menu_def main_menu; +preheat_menu_def preheat_menu; +move_menu_def move_menu; +home_menu_def home_menu; +file_menu_def file_menu; +extrude_menu_def extrude_menu; +leveling_menu_def leveling_menu; +set_menu_def set_menu; +more_menu_def more_menu; +wifi_menu_def wifi_menu; +cloud_menu_def cloud_menu; +about_menu_def about_menu; +fan_menu_def fan_menu; +filament_menu_def filament_menu; +printing_menu_def printing_menu; +operation_menu_def operation_menu; +pause_menu_def pause_menu; +speed_menu_def speed_menu; +printing_more_menu_def printing_more_menu; +dialog_menu_def dialog_menu; +language_menu_def language_menu; +print_file_dialog_menu_def print_file_dialog_menu; +filesys_menu_def filesys_menu; +zoffset_menu_def zoffset_menu; +tool_menu_def tool_menu; +MachinePara_menu_def MachinePara_menu; +MachineSettings_menu_def MachineSettings_menu; +TemperatureSettings_menu_def TemperatureSettings_menu; +pause_msg_def pause_msg_menu; +eeprom_def eeprom_menu; + +machine_common_def machine_menu; +void machine_setting_disp() { + if (gCfgItems.language == LANG_SIMPLE_CHINESE) { + MachinePara_menu.title = MACHINE_PARA_TITLE_CN; + MachinePara_menu.MachineSetting = MACHINE_TYPE_CNOFIG_CN; + MachinePara_menu.TemperatureSetting = TEMPERATURE_CONFIG_CN; + MachinePara_menu.MotorSetting = MOTOR_CONFIG_CN; + MachinePara_menu.AdvanceSetting = ADVANCE_CONFIG_CN; + + machine_menu.default_value = DEFAULT_CN; + machine_menu.next = NEXT_CN; + machine_menu.previous = PREVIOUS_CN; + + machine_menu.MachineConfigTitle = MACHINE_CONFIG_TITLE_CN; + machine_menu.MachineType = MACHINE_TYPE_CN; + machine_menu.Stroke = MACHINE_STROKE_CN; + machine_menu.HomeDir = MACHINE_HOMEDIR_CN; + machine_menu.EndStopType = MACHINE_ENDSTOP_TYPE_CN; + machine_menu.FilamentConf = MACHINE_FILAMENT_CONFIG_CN; + machine_menu.LevelingConf = MACHINE_LEVELING_CONFIG_CN; + + machine_menu.MachineTypeConfTitle = MACHINE_TYPE_CONFIG_TITLE_CN; + machine_menu.xyz = MACHINE_TYPE_XYZ_CN; + machine_menu.delta = MACHINE_TYPE_DELTA_CN; + machine_menu.corexy = MACHINE_TYPE_COREXY_CN; + + machine_menu.StrokeConfTitle = MACHINE_STROKE_CONF_TITLE_CN; + machine_menu.xStroke = X_MAX_LENGTH_CN; + machine_menu.yStroke = Y_MAX_LENGTH_CN; + machine_menu.zStroke = Z_MAX_LENGTH_CN; + + machine_menu.xmin = X_MIN_LENGTH_CN; + machine_menu.ymin = Y_MIN_LENGTH_CN; + machine_menu.zmin = Z_MIN_LENGTH_CN; + + machine_menu.HomeDirConfTitle = HOME_DIR_CONF_TITLE_CN; + machine_menu.xHomeDir = HOME_DIR_X_CN; + machine_menu.yHomeDir = HOME_DIR_Y_CN; + machine_menu.zHomeDir = HOME_DIR_Z_CN; + machine_menu.min = HOME_MIN_CN; + machine_menu.max = HOME_MAX_CN; + + machine_menu.EndstopConfTitle = ENDSTOP_CONF_TITLE_CN; + machine_menu.xEndstop_min = MIN_ENDSTOP_X_CN; + machine_menu.yEndstop_min = MIN_ENDSTOP_Y_CN; + machine_menu.zEndstop_min = MIN_ENDSTOP_Z_CN; + machine_menu.xEndstop_max = MAX_ENDSTOP_X_CN; + machine_menu.yEndstop_max = MAX_ENDSTOP_Y_CN; + machine_menu.zEndstop_max = MAX_ENDSTOP_Z_CN; + machine_menu.FilamentEndstop = ENDSTOP_FIL_CN; + machine_menu.LevelingEndstop = ENDSTOP_LEVEL_CN; + machine_menu.opened = ENDSTOP_OPENED_CN; + machine_menu.closed = ENDSTOP_CLOSED_CN; + + machine_menu.FilamentConfTitle = FILAMENT_CONF_TITLE_CN; + machine_menu.InTemperature = FILAMENT_IN_TEMPERATURE_CN; + machine_menu.InLength = FILAMENT_IN_LENGTH_CN; + machine_menu.InSpeed = FILAMENT_IN_SPEED_CN; + machine_menu.OutTemperature = FILAMENT_OUT_TEMPERATURE_CN; + machine_menu.OutLength = FILAMENT_OUT_LENGTH_CN; + machine_menu.OutSpeed = FILAMENT_OUT_SPEED_CN; + + machine_menu.LevelingParaConfTitle = LEVELING_CONF_TITLE_CN; + machine_menu.LevelingParaConf = LEVELING_PARA_CONF_CN; + machine_menu.DeltaLevelConf = LEVELING_DELTA_CN; + machine_menu.XYZLevelconf = LEVELING_XYZ_CN; + + machine_menu.LevelingSubConfTitle = LEVELING_PARA_CONF_TITLE_CN; + machine_menu.AutoLevelEnable = AUTO_LEVELING_ENABLE_CN; + machine_menu.BLtouchEnable = BLTOUCH_LEVELING_ENABLE_CN; + machine_menu.ProbePort = PROBE_PORT_CN; + machine_menu.ProbeXoffset = PROBE_X_OFFSET_CN; + machine_menu.ProbeYoffset = PROBE_Y_OFFSET_CN; + machine_menu.ProbeZoffset = PROBE_Z_OFFSET_CN; + machine_menu.ProbeXYspeed = PROBE_XY_SPEED_CN; + machine_menu.ProbeZspeed = PROBE_Z_SPEED_CN; + machine_menu.enable = ENABLE_CN; + machine_menu.disable = DISABLE_CN; + machine_menu.z_min = Z_MIN_CN; + machine_menu.z_max = Z_MAX_CN; + + machine_menu.LevelingSubDeltaConfTitle = DELTA_LEVEL_CONF_TITLE_CN; + machine_menu.MachineRadius = DELTA_MACHINE_RADIUS_CN; + machine_menu.DiagonalRod = DELTA_DIAGONAL_ROD_CN; + machine_menu.PrintableRadius = DELTA_PRINT_RADIUS_CN; + machine_menu.DeltaHeight = DELTA_HEIGHT_CN; + machine_menu.SmoothRodOffset = SMOOTH_ROD_OFFSET_CN; + machine_menu.EffectorOffset = EFFECTOR_OFFSET_CN; + machine_menu.CalibrationRadius = CALIBRATION_RADIUS_CN; + + machine_menu.LevelingSubXYZConfTitle = XYZ_LEVEL_CONF_TITLE_CN; + // machine_menu.ProbeMaxLeft=PROBE_REACH_MAX_LEFT_CN; + // machine_menu.ProbeMaxRigh=PROBE_REACH_MAX_RIGHT_CN; + // machine_menu.ProbeMaxfront=PROBE_REACH_MAX_FRONT_CN; + // machine_menu.ProbeMaxback=PROBE_REACH_MAX_BACK_CN; + + machine_menu.TemperatureConfTitle = TEMPERATURE_CONF_TITLE_CN; + machine_menu.NozzleConf = NOZZLE_CONF_CN; + machine_menu.HotBedConf = HOTBED_CONF_CN; + machine_menu.PreheatTemperConf = PREHEAT_TEMPER_CN; + + machine_menu.NozzleConfTitle = NOZZLE_CONF_TITLE_CN; + machine_menu.NozzleCnt = NOZZLECNT_CN; + machine_menu.NozzleType = NOZZLE_TYPE_CN; + machine_menu.NozzleAdjustType = NOZZLE_ADJUST_TYPE_CN; + machine_menu.NozzleMinTemperature = NOZZLE_MIN_TEMPERATURE_CN; + machine_menu.NozzleMaxTemperature = NOZZLE_MAX_TEMPERATURE_CN; + machine_menu.Extrude_Min_Temper = EXTRUD_MIN_TEMPER_CN; + + // machine_menu.HotbedEnable=HOTBED_ENABLE_CN; + machine_menu.HotbedConfTitle = HOTBED_CONF_TITLE_CN; + machine_menu.HotbedAjustType = HOTBED_ADJUST_CN; + machine_menu.HotbedMinTemperature = HOTBED_MIN_TEMPERATURE_CN; + machine_menu.HotbedMaxTemperature = HOTBED_MAX_TEMPERATURE_CN; + + machine_menu.MotorConfTitle = MOTOR_CONF_TITLE_CN; + machine_menu.MaxFeedRateConf = MAXFEEDRATE_CONF_CN; + machine_menu.AccelerationConf = ACCELERATION_CONF_CN; + machine_menu.JerkConf = JERKCONF_CN; + machine_menu.StepsConf = STEPSCONF_CN; + machine_menu.TMCcurrentConf = TMC_CURRENT_CN; + machine_menu.TMCStepModeConf = TMC_STEP_MODE_CN; + machine_menu.MotorDirConf = MOTORDIRCONF_CN; + machine_menu.HomeFeedRateConf = HOMEFEEDRATECONF_CN; + machine_menu.PausePosition = PAUSE_POSITION_CN; + + machine_menu.MaxFeedRateConfTitle = MAXFEEDRATE_CONF_TITLE_CN; + machine_menu.XMaxFeedRate = X_MAXFEEDRATE_CN; + machine_menu.YMaxFeedRate = Y_MAXFEEDRATE_CN; + machine_menu.ZMaxFeedRate = Z_MAXFEEDRATE_CN; + machine_menu.E0MaxFeedRate = E0_MAXFEEDRATE_CN; + machine_menu.E1MaxFeedRate = E1_MAXFEEDRATE_CN; + + machine_menu.AccelerationConfTitle = ACCELERATION_CONF_TITLE_CN; + machine_menu.PrintAcceleration = PRINT_ACCELERATION_CN; + machine_menu.RetractAcceleration = RETRACT_ACCELERATION_CN; + machine_menu.TravelAcceleration = TRAVEL_ACCELERATION_CN; + machine_menu.X_Acceleration = X_ACCELERATION_CN; + machine_menu.Y_Acceleration = Y_ACCELERATION_CN; + machine_menu.Z_Acceleration = Z_ACCELERATION_CN; + machine_menu.E0_Acceleration = E0_ACCELERATION_CN; + machine_menu.E1_Acceleration = E1_ACCELERATION_CN; + + machine_menu.JerkConfTitle = JERK_CONF_TITLE_CN; + machine_menu.X_Jerk = X_JERK_CN; + machine_menu.Y_Jerk = Y_JERK_CN; + machine_menu.Z_Jerk = Z_JERK_CN; + machine_menu.E_Jerk = E_JERK_CN; + + machine_menu.StepsConfTitle = STEPS_CONF_TITLE_CN; + machine_menu.X_Steps = X_STEPS_CN; + machine_menu.Y_Steps = Y_STEPS_CN; + machine_menu.Z_Steps = Z_STEPS_CN; + machine_menu.E0_Steps = E0_STEPS_CN; + machine_menu.E1_Steps = E1_STEPS_CN; + + machine_menu.TmcCurrentConfTitle = TMC_CURRENT_CONF_TITLE_CN; + machine_menu.X_Current = X_TMC_CURRENT_CN; + machine_menu.Y_Current = Y_TMC_CURRENT_CN; + machine_menu.Z_Current = Z_TMC_CURRENT_CN; + machine_menu.E0_Current = E0_TMC_CURRENT_CN; + machine_menu.E1_Current = E1_TMC_CURRENT_CN; + + machine_menu.TmcStepModeConfTitle = TMC_MODE_CONF_TITLE_CN; + machine_menu.X_StepMode = X_TMC_MODE_CN; + machine_menu.Y_StepMode = Y_TMC_MODE_CN; + machine_menu.Z_StepMode = Z_TMC_MODE_CN; + machine_menu.E0_StepMode = E0_TMC_MODE_CN; + machine_menu.E1_StepMode = E1_TMC_MODE_CN; + + machine_menu.MotorDirConfTitle = MOTORDIR_CONF_TITLE_CN; + machine_menu.X_MotorDir = X_MOTORDIR_CN; + machine_menu.Y_MotorDir = Y_MOTORDIR_CN; + machine_menu.Z_MotorDir = Z_MOTORDIR_CN; + machine_menu.E0_MotorDir = E0_MOTORDIR_CN; + machine_menu.E1_MotorDir = E1_MOTORDIR_CN; + machine_menu.Invert_0 = INVERT_P_CN; + machine_menu.Invert_1 = INVERT_N_CN; + + machine_menu.HomeFeedRateConfTitle = HOMEFEEDRATE_CONF_TITLE_CN; + machine_menu.XY_HomeFeedRate = X_HOMESPEED_CN; + // machine_menu.Y_HomeFeedRate=Y_HOMESPEED_CN; + machine_menu.Z_HomeFeedRate = Z_HOMESPEED_CN; + + machine_menu.AdvancedConfTitle = ADVANCED_CONF_TITLE_CN; + machine_menu.PwrOffDection = PWROFF_DECTION_CN; + machine_menu.PwrOffAfterPrint = PWROFF_AFTER_PRINT_CN; + machine_menu.HaveUps = HAVE_UPS_CN; + machine_menu.Z2andZ2Endstop = Z2_AND_Z2ENDSTOP_CONF_CN; + machine_menu.EnablePinsInvert = ENABLE_PINS_CONF_CN; + + machine_menu.Z2ConfTitle = Z2_AND_Z2ENDSTOP_CONF_TITLE_CN; + machine_menu.Z2Enable = Z2_ENABLE_CN; + machine_menu.Z2EndstopEnable = Z2_ENDSTOP_CN; + machine_menu.Z2Port = Z2_PORT_CN; + + machine_menu.EnablePinsInvertTitle = ENABLE_PINS_CONF_TITLE_CN; + machine_menu.XInvert = X_ENABLE_PINS_INVERT_CN; + machine_menu.YInvert = Y_ENABLE_PINS_INVERT_CN; + machine_menu.ZInvert = Z_ENABLE_PINS_INVERT_CN; + machine_menu.EInvert = E_ENABLE_PINS_INVERT_CN; + + machine_menu.key_back = KEY_BACK_CN; + machine_menu.key_reset = KEY_REST_CN; + machine_menu.key_confirm = KEY_CONFIRM_CN; + + machine_menu.PausePosText = PAUSE_POSITION_CN; + machine_menu.xPos = PAUSE_POSITION_X_CN; + machine_menu.yPos = PAUSE_POSITION_Y_CN; + machine_menu.zPos = PAUSE_POSITION_Z_CN; + } + else if (gCfgItems.language == LANG_COMPLEX_CHINESE) { + MachinePara_menu.title = MACHINE_PARA_TITLE_T_CN; + MachinePara_menu.MachineSetting = MACHINE_TYPE_CNOFIG_T_CN; + MachinePara_menu.TemperatureSetting = TEMPERATURE_CONFIG_T_CN; + MachinePara_menu.MotorSetting = MOTOR_CONFIG_T_CN; + MachinePara_menu.AdvanceSetting = ADVANCE_CONFIG_T_CN; + + machine_menu.default_value = DEFAULT_T_CN; + machine_menu.next = NEXT_T_CN; + machine_menu.previous = PREVIOUS_T_CN; + + machine_menu.MachineConfigTitle = MACHINE_CONFIG_TITLE_T_CN; + machine_menu.MachineType = MACHINE_TYPE_T_CN; + machine_menu.Stroke = MACHINE_STROKE_T_CN; + machine_menu.HomeDir = MACHINE_HOMEDIR_T_CN; + machine_menu.EndStopType = MACHINE_ENDSTOP_TYPE_T_CN; + machine_menu.FilamentConf = MACHINE_FILAMENT_CONFIG_T_CN; + machine_menu.LevelingConf = MACHINE_LEVELING_CONFIG_T_CN; + + machine_menu.MachineTypeConfTitle = MACHINE_TYPE_CONFIG_TITLE_T_CN; + machine_menu.xyz = MACHINE_TYPE_XYZ_T_CN; + machine_menu.delta = MACHINE_TYPE_DELTA_T_CN; + machine_menu.corexy = MACHINE_TYPE_COREXY_T_CN; + + machine_menu.StrokeConfTitle = MACHINE_STROKE_CONF_TITLE_T_CN; + machine_menu.xStroke = X_MAX_LENGTH_T_CN; + machine_menu.yStroke = Y_MAX_LENGTH_T_CN; + machine_menu.zStroke = Z_MAX_LENGTH_T_CN; + + machine_menu.xmin = X_MIN_LENGTH_T_CN; + machine_menu.ymin = Y_MIN_LENGTH_T_CN; + machine_menu.zmin = Z_MIN_LENGTH_T_CN; + + machine_menu.HomeDirConfTitle = HOME_DIR_CONF_TITLE_T_CN; + machine_menu.xHomeDir = HOME_DIR_X_T_CN; + machine_menu.yHomeDir = HOME_DIR_Y_T_CN; + machine_menu.zHomeDir = HOME_DIR_Z_T_CN; + machine_menu.min = HOME_MIN_T_CN; + machine_menu.max = HOME_MAX_T_CN; + + machine_menu.EndstopConfTitle = ENDSTOP_CONF_TITLE_T_CN; + machine_menu.xEndstop_min = MIN_ENDSTOP_X_T_CN; + machine_menu.yEndstop_min = MIN_ENDSTOP_Y_T_CN; + machine_menu.zEndstop_min = MIN_ENDSTOP_Z_T_CN; + machine_menu.xEndstop_max = MAX_ENDSTOP_X_T_CN; + machine_menu.yEndstop_max = MAX_ENDSTOP_Y_T_CN; + machine_menu.zEndstop_max = MAX_ENDSTOP_Z_T_CN; + machine_menu.FilamentEndstop = ENDSTOP_FIL_T_CN; + machine_menu.LevelingEndstop = ENDSTOP_LEVEL_T_CN; + machine_menu.opened = ENDSTOP_OPENED_T_CN; + machine_menu.closed = ENDSTOP_CLOSED_T_CN; + + machine_menu.FilamentConfTitle = FILAMENT_CONF_TITLE_T_CN; + machine_menu.InTemperature = FILAMENT_IN_TEMPERATURE_T_CN; + machine_menu.InLength = FILAMENT_IN_LENGTH_T_CN; + machine_menu.InSpeed = FILAMENT_IN_SPEED_T_CN; + machine_menu.OutTemperature = FILAMENT_OUT_TEMPERATURE_T_CN; + machine_menu.OutLength = FILAMENT_OUT_LENGTH_T_CN; + machine_menu.OutSpeed = FILAMENT_OUT_SPEED_T_CN; + + machine_menu.LevelingParaConfTitle = LEVELING_CONF_TITLE_T_CN; + machine_menu.LevelingParaConf = LEVELING_PARA_CONF_T_CN; + machine_menu.DeltaLevelConf = LEVELING_DELTA_T_CN; + machine_menu.XYZLevelconf = LEVELING_XYZ_T_CN; + + machine_menu.LevelingSubConfTitle = LEVELING_PARA_CONF_TITLE_T_CN; + machine_menu.AutoLevelEnable = AUTO_LEVELING_ENABLE_T_CN; + machine_menu.BLtouchEnable = BLTOUCH_LEVELING_ENABLE_T_CN; + machine_menu.ProbePort = PROBE_PORT_T_CN; + machine_menu.ProbeXoffset = PROBE_X_OFFSET_T_CN; + machine_menu.ProbeYoffset = PROBE_Y_OFFSET_T_CN; + machine_menu.ProbeZoffset = PROBE_Z_OFFSET_T_CN; + machine_menu.ProbeXYspeed = PROBE_XY_SPEED_T_CN; + machine_menu.ProbeZspeed = PROBE_Z_SPEED_T_CN; + machine_menu.enable = ENABLE_T_CN; + machine_menu.disable = DISABLE_T_CN; + machine_menu.z_min = Z_MIN_T_CN; + machine_menu.z_max = Z_MAX_T_CN; + + machine_menu.LevelingSubDeltaConfTitle = DELTA_LEVEL_CONF_TITLE_T_CN; + machine_menu.MachineRadius = DELTA_MACHINE_RADIUS_T_CN; + machine_menu.DiagonalRod = DELTA_DIAGONAL_ROD_T_CN; + machine_menu.PrintableRadius = DELTA_PRINT_RADIUS_T_CN; + machine_menu.DeltaHeight = DELTA_HEIGHT_T_CN; + machine_menu.SmoothRodOffset = SMOOTH_ROD_OFFSET_T_CN; + machine_menu.EffectorOffset = EFFECTOR_OFFSET_T_CN; + machine_menu.CalibrationRadius = CALIBRATION_RADIUS_T_CN; + + machine_menu.LevelingSubXYZConfTitle = XYZ_LEVEL_CONF_TITLE_T_CN; + // machine_menu.ProbeMaxLeft=PROBE_REACH_MAX_LEFT_T_CN; + // machine_menu.ProbeMaxRigh=PROBE_REACH_MAX_RIGHT_T_CN; + // machine_menu.ProbeMaxfront=PROBE_REACH_MAX_FRONT_T_CN; + // machine_menu.ProbeMaxback=PROBE_REACH_MAX_BACK_T_CN; + + machine_menu.TemperatureConfTitle = TEMPERATURE_CONF_TITLE_T_CN; + machine_menu.NozzleConf = NOZZLE_CONF_T_CN; + machine_menu.HotBedConf = HOTBED_CONF_T_CN; + machine_menu.PreheatTemperConf = PREHEAT_TEMPER_T_CN; + + machine_menu.NozzleConfTitle = NOZZLE_CONF_TITLE_T_CN; + machine_menu.NozzleCnt = NOZZLECNT_T_CN; + machine_menu.NozzleType = NOZZLE_TYPE_T_CN; + machine_menu.NozzleAdjustType = NOZZLE_ADJUST_TYPE_T_CN; + machine_menu.NozzleMinTemperature = NOZZLE_MIN_TEMPERATURE_T_CN; + machine_menu.NozzleMaxTemperature = NOZZLE_MAX_TEMPERATURE_T_CN; + machine_menu.Extrude_Min_Temper = EXTRUD_MIN_TEMPER_T_CN; + + // machine_menu.HotbedEnable=HOTBED_ENABLE_T_CN; + machine_menu.HotbedConfTitle = HOTBED_CONF_TITLE_T_CN; + machine_menu.HotbedAjustType = HOTBED_ADJUST_T_CN; + machine_menu.HotbedMinTemperature = HOTBED_MIN_TEMPERATURE_T_CN; + machine_menu.HotbedMaxTemperature = HOTBED_MAX_TEMPERATURE_T_CN; + + machine_menu.MotorConfTitle = MOTOR_CONF_TITLE_T_CN; + machine_menu.MaxFeedRateConf = MAXFEEDRATE_CONF_T_CN; + machine_menu.AccelerationConf = ACCELERATION_CONF_T_CN; + machine_menu.JerkConf = JERKCONF_T_CN; + machine_menu.StepsConf = STEPSCONF_T_CN; + machine_menu.TMCcurrentConf = TMC_CURRENT_T_CN; + machine_menu.TMCStepModeConf = TMC_STEP_MODE_T_CN; + machine_menu.MotorDirConf = MOTORDIRCONF_T_CN; + machine_menu.HomeFeedRateConf = HOMEFEEDRATECONF_T_CN; + machine_menu.PausePosition = PAUSE_POSITION_T_CN; + + machine_menu.MaxFeedRateConfTitle = MAXFEEDRATE_CONF_TITLE_T_CN; + machine_menu.XMaxFeedRate = X_MAXFEEDRATE_T_CN; + machine_menu.YMaxFeedRate = Y_MAXFEEDRATE_T_CN; + machine_menu.ZMaxFeedRate = Z_MAXFEEDRATE_T_CN; + machine_menu.E0MaxFeedRate = E0_MAXFEEDRATE_T_CN; + machine_menu.E1MaxFeedRate = E1_MAXFEEDRATE_T_CN; + + machine_menu.AccelerationConfTitle = ACCELERATION_CONF_TITLE_T_CN; + machine_menu.PrintAcceleration = PRINT_ACCELERATION_T_CN; + machine_menu.RetractAcceleration = RETRACT_ACCELERATION_T_CN; + machine_menu.TravelAcceleration = TRAVEL_ACCELERATION_T_CN; + machine_menu.X_Acceleration = X_ACCELERATION_T_CN; + machine_menu.Y_Acceleration = Y_ACCELERATION_T_CN; + machine_menu.Z_Acceleration = Z_ACCELERATION_T_CN; + machine_menu.E0_Acceleration = E0_ACCELERATION_T_CN; + machine_menu.E1_Acceleration = E1_ACCELERATION_T_CN; + + machine_menu.JerkConfTitle = JERK_CONF_TITLE_T_CN; + machine_menu.X_Jerk = X_JERK_T_CN; + machine_menu.Y_Jerk = Y_JERK_T_CN; + machine_menu.Z_Jerk = Z_JERK_T_CN; + machine_menu.E_Jerk = E_JERK_T_CN; + + machine_menu.StepsConfTitle = STEPS_CONF_TITLE_T_CN; + machine_menu.X_Steps = X_STEPS_T_CN; + machine_menu.Y_Steps = Y_STEPS_T_CN; + machine_menu.Z_Steps = Z_STEPS_T_CN; + machine_menu.E0_Steps = E0_STEPS_T_CN; + machine_menu.E1_Steps = E1_STEPS_T_CN; + + machine_menu.TmcCurrentConfTitle = TMC_CURRENT_CONF_TITLE_T_CN; + machine_menu.X_Current = X_TMC_CURRENT_T_CN; + machine_menu.Y_Current = Y_TMC_CURRENT_T_CN; + machine_menu.Z_Current = Z_TMC_CURRENT_T_CN; + machine_menu.E0_Current = E0_TMC_CURRENT_T_CN; + machine_menu.E1_Current = E1_TMC_CURRENT_T_CN; + + machine_menu.TmcStepModeConfTitle = TMC_MODE_CONF_TITLE_T_CN; + machine_menu.X_StepMode = X_TMC_MODE_T_CN; + machine_menu.Y_StepMode = Y_TMC_MODE_T_CN; + machine_menu.Z_StepMode = Z_TMC_MODE_T_CN; + machine_menu.E0_StepMode = E0_TMC_MODE_T_CN; + machine_menu.E1_StepMode = E1_TMC_MODE_T_CN; + + machine_menu.MotorDirConfTitle = MOTORDIR_CONF_TITLE_T_CN; + machine_menu.X_MotorDir = X_MOTORDIR_T_CN; + machine_menu.Y_MotorDir = Y_MOTORDIR_T_CN; + machine_menu.Z_MotorDir = Z_MOTORDIR_T_CN; + machine_menu.E0_MotorDir = E0_MOTORDIR_T_CN; + machine_menu.E1_MotorDir = E1_MOTORDIR_T_CN; + machine_menu.Invert_0 = INVERT_P_T_CN; + machine_menu.Invert_1 = INVERT_N_T_CN; + + machine_menu.HomeFeedRateConfTitle = HOMEFEEDRATE_CONF_TITLE_T_CN; + machine_menu.XY_HomeFeedRate = X_HOMESPEED_T_CN; + // machine_menu.Y_HomeFeedRate=Y_HOMESPEED_T_CN; + machine_menu.Z_HomeFeedRate = Z_HOMESPEED_T_CN; + + machine_menu.AdvancedConfTitle = ADVANCED_CONF_TITLE_T_CN; + machine_menu.PwrOffDection = PWROFF_DECTION_T_CN; + machine_menu.PwrOffAfterPrint = PWROFF_AFTER_PRINT_T_CN; + machine_menu.HaveUps = HAVE_UPS_T_CN; + machine_menu.Z2andZ2Endstop = Z2_AND_Z2ENDSTOP_CONF_T_CN; + machine_menu.EnablePinsInvert = ENABLE_PINS_CONF_T_CN; + + machine_menu.Z2ConfTitle = Z2_AND_Z2ENDSTOP_CONF_TITLE_T_CN; + machine_menu.Z2Enable = Z2_ENABLE_T_CN; + machine_menu.Z2EndstopEnable = Z2_ENDSTOP_T_CN; + machine_menu.Z2Port = Z2_PORT_T_CN; + + machine_menu.EnablePinsInvertTitle = ENABLE_PINS_CONF_TITLE_T_CN; + machine_menu.XInvert = X_ENABLE_PINS_INVERT_T_CN; + machine_menu.YInvert = Y_ENABLE_PINS_INVERT_T_CN; + machine_menu.ZInvert = Z_ENABLE_PINS_INVERT_T_CN; + machine_menu.EInvert = E_ENABLE_PINS_INVERT_T_CN; + + machine_menu.key_back = KEY_BACK_T_CN; + machine_menu.key_reset = KEY_REST_T_CN; + machine_menu.key_confirm = KEY_CONFIRM_T_CN; + // machine_menu.high_level = MOTOR_EN_HIGH_LEVEL_T_CN; + // machine_menu.low_level = MOTOR_EN_LOW_LEVEL_T_CN; + + machine_menu.PausePosText = PAUSE_POSITION_T_CN; + machine_menu.xPos = PAUSE_POSITION_X_T_CN; + machine_menu.yPos = PAUSE_POSITION_Y_T_CN; + machine_menu.zPos = PAUSE_POSITION_Z_T_CN; + + } + else { + MachinePara_menu.title = MACHINE_PARA_TITLE_EN; + MachinePara_menu.MachineSetting = MACHINE_TYPE_CNOFIG_EN; + MachinePara_menu.TemperatureSetting = TEMPERATURE_CONFIG_EN; + MachinePara_menu.MotorSetting = MOTOR_CONFIG_EN; + MachinePara_menu.AdvanceSetting = ADVANCE_CONFIG_EN; + + machine_menu.default_value = DEFAULT_EN; + machine_menu.next = NEXT_EN; + machine_menu.previous = PREVIOUS_EN; + + machine_menu.MachineConfigTitle = MACHINE_CONFIG_TITLE_EN; + machine_menu.MachineType = MACHINE_TYPE_EN; + machine_menu.Stroke = MACHINE_STROKE_EN; + machine_menu.HomeDir = MACHINE_HOMEDIR_EN; + machine_menu.EndStopType = MACHINE_ENDSTOP_TYPE_EN; + machine_menu.FilamentConf = MACHINE_FILAMENT_CONFIG_EN; + machine_menu.LevelingConf = MACHINE_LEVELING_CONFIG_EN; + + machine_menu.MachineTypeConfTitle = MACHINE_TYPE_CONFIG_TITLE_EN; + machine_menu.xyz = MACHINE_TYPE_XYZ_EN; + machine_menu.delta = MACHINE_TYPE_DELTA_EN; + machine_menu.corexy = MACHINE_TYPE_COREXY_EN; + + machine_menu.StrokeConfTitle = MACHINE_STROKE_CONF_TITLE_EN; + machine_menu.xStroke = X_MAX_LENGTH_EN; + machine_menu.yStroke = Y_MAX_LENGTH_EN; + machine_menu.zStroke = Z_MAX_LENGTH_EN; + + machine_menu.xmin = X_MIN_LENGTH_EN; + machine_menu.ymin = Y_MIN_LENGTH_EN; + machine_menu.zmin = Z_MIN_LENGTH_EN; + + machine_menu.HomeDirConfTitle = HOME_DIR_CONF_TITLE_EN; + machine_menu.xHomeDir = HOME_DIR_X_EN; + machine_menu.yHomeDir = HOME_DIR_Y_EN; + machine_menu.zHomeDir = HOME_DIR_Z_EN; + machine_menu.min = HOME_MIN_EN; + machine_menu.max = HOME_MAX_EN; + + machine_menu.EndstopConfTitle = ENDSTOP_CONF_TITLE_EN; + machine_menu.xEndstop_min = MIN_ENDSTOP_X_EN; + machine_menu.yEndstop_min = MIN_ENDSTOP_Y_EN; + machine_menu.zEndstop_min = MIN_ENDSTOP_Z_EN; + machine_menu.xEndstop_max = MAX_ENDSTOP_X_EN; + machine_menu.yEndstop_max = MAX_ENDSTOP_Y_EN; + machine_menu.zEndstop_max = MAX_ENDSTOP_Z_EN; + machine_menu.FilamentEndstop = ENDSTOP_FIL_EN; + machine_menu.LevelingEndstop = ENDSTOP_LEVEL_EN; + machine_menu.opened = ENDSTOP_OPENED_EN; + machine_menu.closed = ENDSTOP_CLOSED_EN; + + machine_menu.FilamentConfTitle = FILAMENT_CONF_TITLE_EN; + machine_menu.InTemperature = FILAMENT_IN_TEMPERATURE_EN; + machine_menu.InLength = FILAMENT_IN_LENGTH_EN; + machine_menu.InSpeed = FILAMENT_IN_SPEED_EN; + machine_menu.OutTemperature = FILAMENT_OUT_TEMPERATURE_EN; + machine_menu.OutLength = FILAMENT_OUT_LENGTH_EN; + machine_menu.OutSpeed = FILAMENT_OUT_SPEED_EN; + + machine_menu.LevelingParaConfTitle = LEVELING_CONF_TITLE_EN; + machine_menu.LevelingParaConf = LEVELING_PARA_CONF_EN; + machine_menu.DeltaLevelConf = LEVELING_DELTA_EN; + machine_menu.XYZLevelconf = LEVELING_XYZ_EN; + + machine_menu.LevelingSubConfTitle = LEVELING_PARA_CONF_TITLE_EN; + machine_menu.AutoLevelEnable = AUTO_LEVELING_ENABLE_EN; + machine_menu.BLtouchEnable = BLTOUCH_LEVELING_ENABLE_EN; + machine_menu.ProbePort = PROBE_PORT_EN; + machine_menu.ProbeXoffset = PROBE_X_OFFSET_EN; + machine_menu.ProbeYoffset = PROBE_Y_OFFSET_EN; + machine_menu.ProbeZoffset = PROBE_Z_OFFSET_EN; + machine_menu.ProbeXYspeed = PROBE_XY_SPEED_EN; + machine_menu.ProbeZspeed = PROBE_Z_SPEED_EN; + machine_menu.enable = ENABLE_EN; + machine_menu.disable = DISABLE_EN; + machine_menu.z_min = Z_MIN_EN; + machine_menu.z_max = Z_MAX_EN; + + machine_menu.LevelingSubDeltaConfTitle = DELTA_LEVEL_CONF_TITLE_EN; + machine_menu.MachineRadius = DELTA_MACHINE_RADIUS_EN; + machine_menu.DiagonalRod = DELTA_DIAGONAL_ROD_EN; + machine_menu.PrintableRadius = DELTA_PRINT_RADIUS_EN; + machine_menu.DeltaHeight = DELTA_HEIGHT_EN; + machine_menu.SmoothRodOffset = SMOOTH_ROD_OFFSET_EN; + machine_menu.EffectorOffset = EFFECTOR_OFFSET_EN; + machine_menu.CalibrationRadius = CALIBRATION_RADIUS_EN; + + machine_menu.LevelingSubXYZConfTitle = XYZ_LEVEL_CONF_TITLE_EN; + // machine_menu.Level_positon=PROBE_REACH_MAX_LEFT_EN; + // machine_menu.ProbeMaxRigh=PROBE_REACH_MAX_RIGHT_EN; + // machine_menu.ProbeMaxfront=PROBE_REACH_MAX_FRONT_EN; + // machine_menu.ProbeMaxback=PROBE_REACH_MAX_BACK_EN; + + machine_menu.TemperatureConfTitle = TEMPERATURE_CONF_TITLE_EN; + machine_menu.NozzleConf = NOZZLE_CONF_EN; + machine_menu.HotBedConf = HOTBED_CONF_EN; + machine_menu.PreheatTemperConf = PREHEAT_TEMPER_EN; + + machine_menu.NozzleConfTitle = NOZZLE_CONF_TITLE_EN; + machine_menu.NozzleCnt = NOZZLECNT_EN; + machine_menu.NozzleType = NOZZLE_TYPE_EN; + machine_menu.NozzleAdjustType = NOZZLE_ADJUST_TYPE_EN; + machine_menu.NozzleMinTemperature = NOZZLE_MIN_TEMPERATURE_EN; + machine_menu.NozzleMaxTemperature = NOZZLE_MAX_TEMPERATURE_EN; + machine_menu.Extrude_Min_Temper = EXTRUD_MIN_TEMPER_EN; + + machine_menu.HotbedEnable = HOTBED_ENABLE_EN; + machine_menu.HotbedConfTitle = HOTBED_CONF_TITLE_EN; + machine_menu.HotbedAjustType = HOTBED_ADJUST_EN; + machine_menu.HotbedMinTemperature = HOTBED_MIN_TEMPERATURE_EN; + machine_menu.HotbedMaxTemperature = HOTBED_MAX_TEMPERATURE_EN; + + machine_menu.MotorConfTitle = MOTOR_CONF_TITLE_EN; + machine_menu.MaxFeedRateConf = MAXFEEDRATE_CONF_EN; + machine_menu.AccelerationConf = ACCELERATION_CONF_EN; + machine_menu.JerkConf = JERKCONF_EN; + machine_menu.StepsConf = STEPSCONF_EN; + machine_menu.TMCcurrentConf = TMC_CURRENT_EN; + machine_menu.TMCStepModeConf = TMC_STEP_MODE_EN; + machine_menu.MotorDirConf = MOTORDIRCONF_EN; + machine_menu.HomeFeedRateConf = HOMEFEEDRATECONF_EN; + machine_menu.PausePosition = PAUSE_POSITION_EN; + + machine_menu.MaxFeedRateConfTitle = MAXFEEDRATE_CONF_TITLE_EN; + machine_menu.XMaxFeedRate = X_MAXFEEDRATE_EN; + machine_menu.YMaxFeedRate = Y_MAXFEEDRATE_EN; + machine_menu.ZMaxFeedRate = Z_MAXFEEDRATE_EN; + machine_menu.E0MaxFeedRate = E0_MAXFEEDRATE_EN; + machine_menu.E1MaxFeedRate = E1_MAXFEEDRATE_EN; + + machine_menu.AccelerationConfTitle = ACCELERATION_CONF_TITLE_EN; + machine_menu.PrintAcceleration = PRINT_ACCELERATION_EN; + machine_menu.RetractAcceleration = RETRACT_ACCELERATION_EN; + machine_menu.TravelAcceleration = TRAVEL_ACCELERATION_EN; + machine_menu.X_Acceleration = X_ACCELERATION_EN; + machine_menu.Y_Acceleration = Y_ACCELERATION_EN; + machine_menu.Z_Acceleration = Z_ACCELERATION_EN; + machine_menu.E0_Acceleration = E0_ACCELERATION_EN; + machine_menu.E1_Acceleration = E1_ACCELERATION_EN; + + machine_menu.JerkConfTitle = JERK_CONF_TITLE_EN; + machine_menu.X_Jerk = X_JERK_EN; + machine_menu.Y_Jerk = Y_JERK_EN; + machine_menu.Z_Jerk = Z_JERK_EN; + machine_menu.E_Jerk = E_JERK_EN; + + machine_menu.StepsConfTitle = STEPS_CONF_TITLE_EN; + machine_menu.X_Steps = X_STEPS_EN; + machine_menu.Y_Steps = Y_STEPS_EN; + machine_menu.Z_Steps = Z_STEPS_EN; + machine_menu.E0_Steps = E0_STEPS_EN; + machine_menu.E1_Steps = E1_STEPS_EN; + + machine_menu.TmcCurrentConfTitle = TMC_CURRENT_CONF_TITLE_EN; + machine_menu.X_Current = X_TMC_CURRENT_EN; + machine_menu.Y_Current = Y_TMC_CURRENT_EN; + machine_menu.Z_Current = Z_TMC_CURRENT_EN; + machine_menu.E0_Current = E0_TMC_CURRENT_EN; + machine_menu.E1_Current = E1_TMC_CURRENT_EN; + + machine_menu.TmcStepModeConfTitle = TMC_MODE_CONF_TITLE_EN; + machine_menu.X_StepMode = X_TMC_MODE_EN; + machine_menu.Y_StepMode = Y_TMC_MODE_EN; + machine_menu.Z_StepMode = Z_TMC_MODE_EN; + machine_menu.E0_StepMode = E0_TMC_MODE_EN; + machine_menu.E1_StepMode = E1_TMC_MODE_EN; + + machine_menu.MotorDirConfTitle = MOTORDIR_CONF_TITLE_EN; + machine_menu.X_MotorDir = X_MOTORDIR_EN; + machine_menu.Y_MotorDir = Y_MOTORDIR_EN; + machine_menu.Z_MotorDir = Z_MOTORDIR_EN; + machine_menu.E0_MotorDir = E0_MOTORDIR_EN; + machine_menu.E1_MotorDir = E1_MOTORDIR_EN; + machine_menu.Invert_0 = INVERT_P_EN; + machine_menu.Invert_1 = INVERT_N_EN; + + machine_menu.HomeFeedRateConfTitle = HOMEFEEDRATE_CONF_TITLE_EN; + machine_menu.XY_HomeFeedRate = X_HOMESPEED_EN; + // machine_menu.Y_HomeFeedRate=Y_HOMESPEED_EN; + machine_menu.Z_HomeFeedRate = Z_HOMESPEED_EN; + + machine_menu.AdvancedConfTitle = ADVANCED_CONF_TITLE_EN; + machine_menu.PwrOffDection = PWROFF_DECTION_EN; + machine_menu.PwrOffAfterPrint = PWROFF_AFTER_PRINT_EN; + machine_menu.HaveUps = HAVE_UPS_EN; + machine_menu.Z2andZ2Endstop = Z2_AND_Z2ENDSTOP_CONF_EN; + machine_menu.EnablePinsInvert = ENABLE_PINS_CONF_EN; + + machine_menu.Z2ConfTitle = Z2_AND_Z2ENDSTOP_CONF_TITLE_EN; + machine_menu.Z2Enable = Z2_ENABLE_EN; + machine_menu.Z2EndstopEnable = Z2_ENDSTOP_EN; + machine_menu.Z2Port = Z2_PORT_EN; + + machine_menu.EnablePinsInvertTitle = ENABLE_PINS_CONF_TITLE_EN; + machine_menu.XInvert = X_ENABLE_PINS_INVERT_EN; + machine_menu.YInvert = Y_ENABLE_PINS_INVERT_EN; + machine_menu.ZInvert = Z_ENABLE_PINS_INVERT_EN; + machine_menu.EInvert = E_ENABLE_PINS_INVERT_EN; + + machine_menu.key_back = KEY_BACK_EN; + machine_menu.key_reset = KEY_REST_EN; + machine_menu.key_confirm = KEY_CONFIRM_EN; + // + machine_menu.high_level = MOTOR_EN_HIGH_LEVEL_EN; + machine_menu.low_level = MOTOR_EN_LOW_LEVEL_EN; + + machine_menu.PausePosText = PAUSE_POSITION_EN; + machine_menu.xPos = PAUSE_POSITION_X_EN; + machine_menu.yPos = PAUSE_POSITION_Y_EN; + machine_menu.zPos = PAUSE_POSITION_Z_EN; + } +} + +void disp_language_init() { + preheat_menu.value_state = TEXT_VALUE; + preheat_menu.step_1c = TEXT_1C; + preheat_menu.step_5c = TEXT_5C; + preheat_menu.step_10c = TEXT_10C; + + move_menu.x_add = AXIS_X_ADD_TEXT; + move_menu.x_dec = AXIS_X_DEC_TEXT; + move_menu.y_add = AXIS_Y_ADD_TEXT; + move_menu.y_dec = AXIS_Y_DEC_TEXT; + move_menu.z_add = AXIS_Z_ADD_TEXT; + move_menu.z_dec = AXIS_Z_DEC_TEXT; + + move_menu.step_001mm = TEXT_001MM; + move_menu.step_005mm = TEXT_005MM; + move_menu.step_01mm = TEXT_01MM; + move_menu.step_1mm = TEXT_1MM; + move_menu.step_10mm = TEXT_10MM; + + home_menu.home_x = HOME_X_TEXT; + home_menu.home_y = HOME_Y_TEXT; + home_menu.home_z = HOME_Z_TEXT; + home_menu.home_all = HOME_ALL_TEXT; + + extrude_menu.temp_value = TEXT_VALUE_T; + extrude_menu.count_value_mm = TEXT_VALUE_mm; + extrude_menu.count_value_cm = TEXT_VALUE_cm; + extrude_menu.count_value_m = TEXT_VALUE_m; + extrude_menu.step_1mm = EXTRUDE_1MM_TEXT; + extrude_menu.step_5mm = EXTRUDE_5MM_TEXT; + extrude_menu.step_10mm = EXTRUDE_10MM_TEXT; + + fan_menu.full = FAN_OPEN_TEXT; + fan_menu.half = FAN_HALF_TEXT; + fan_menu.off = FAN_CLOSE_TEXT; + + speed_menu.step_1percent = STEP_1PERCENT; + speed_menu.step_5percent = STEP_5PERCENT; + speed_menu.step_10percent = STEP_10PERCENT; + + language_menu.chinese_s = LANGUAGE_S_CN; + language_menu.chinese_t = LANGUAGE_T_CN; + language_menu.english = LANGUAGE_EN; + language_menu.russian = LANGUAGE_RU; + language_menu.spanish = LANGUAGE_SP; + language_menu.german = LANGUAGE_GE; + language_menu.japan = LANGUAGE_JP; + language_menu.korean = LANGUAGE_KR; + language_menu.portuguese = LANGUAGE_PR; + language_menu.italy = LANGUAGE_IT; + language_menu.brazil = LANGUAGE_BR; + language_menu.french = LANGUAGE_FR; + + about_menu.type_name = ABOUT_TYPE_TEXT; + about_menu.firmware_v = ABOUT_VERSION_TEXT; + // about_menu.wifi = ABOUT_WIFI_TEXT; + + wifi_menu.ip = WIFI_IP_TEXT; + wifi_menu.wifi = WIFI_NAME_TEXT; + wifi_menu.key = WIFI_KEY_TEXT; + wifi_menu.state_ap = WIFI_STATE_AP_TEXT; + wifi_menu.state_sta = WIFI_STATE_STA_TEXT; + wifi_menu.connected = WIFI_CONNECTED_TEXT; + wifi_menu.disconnected = WIFI_DISCONNECTED_TEXT; + wifi_menu.exception = WIFI_EXCEPTION_TEXT; + + printing_menu.temp1 = TEXT_VALUE; + printing_menu.temp2 = TEXT_VALUE; + printing_menu.bed_temp = TEXT_VALUE; + + filament_menu.stat_temp = TEXT_VALUE; + + zoffset_menu.step001 = ZOFFSET_STEP001; + zoffset_menu.step01 = ZOFFSET_STEP01; + zoffset_menu.step1 = ZOFFSET_STEP1; + + machine_menu.key_0 = KEYBOARD_KEY0_EN; + machine_menu.key_1 = KEYBOARD_KEY1_EN; + machine_menu.key_2 = KEYBOARD_KEY2_EN; + machine_menu.key_3 = KEYBOARD_KEY3_EN; + machine_menu.key_4 = KEYBOARD_KEY4_EN; + machine_menu.key_5 = KEYBOARD_KEY5_EN; + machine_menu.key_6 = KEYBOARD_KEY6_EN; + machine_menu.key_7 = KEYBOARD_KEY7_EN; + machine_menu.key_8 = KEYBOARD_KEY8_EN; + machine_menu.key_9 = KEYBOARD_KEY9_EN; + machine_menu.key_point = KEYBOARD_KEY_POINT_EN; + machine_menu.negative = KEYBOARD_KEY_NEGATIVE_EN; + // wifi-list + #if 0 + list_menu.title = TEXT_WIFI_MENU_TITLE_EN; + list_menu.file_pages = FILE_PAGES_EN; + // keyboard + keyboard_menu.apply = MANUAL_IP_APPLY_EN; + keyboard_menu.password = TEXT_WIFI_PASSWORD_EN; + keyboard_menu.space = TEXT_WIFI_SAPCE_EN; + keyboard_menu.letter = TEXT_WIFI_LETTER_EN; + keyboard_menu.digital = TEXT_WIFI_DIGITAL_EN; + keyboard_menu.symbol = TEXT_WIFI_SYMBOL_EN; + // tips + tips_menu.pointBold = TEXT_WIFI_POINT_BOLD_EN; + tips_menu.joining = TEXT_WIFI_JOINING_EN; + tips_menu.failedJoin = TEXT_WIFI_FAILED_JOIN_EN; + tips_menu.wifiConected = TEXT_WIFI_WIFI_CONECTED_EN; + #endif + machine_setting_disp(); + + operation_menu.babystep = TEXT_BABY_STEP_EN; + + switch (gCfgItems.language) { + case LANG_SIMPLE_CHINESE: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_CN; + common_menu.text_back = BACK_TEXT_CN; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_CN; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_CN; + common_menu.print_special_title = PRINTING_GBK; + common_menu.pause_special_title = PRINTING_PAUSE_GBK; + common_menu.operate_special_title = PRINTING_OPERATION_GBK; + // + main_menu.title = TITLE_READYPRINT_CN; + main_menu.preheat = PREHEAT_TEXT_CN; + main_menu.move = MOVE_TEXT_CN; + main_menu.home = HOME_TEXT_CN; + main_menu.print = PRINT_TEXT_CN; + main_menu.extrude = EXTRUDE_TEXT_CN; + main_menu.leveling = LEVELING_TEXT_CN; + main_menu.autoleveling = AUTO_LEVELING_TEXT_CN; + main_menu.fan = FAN_TEXT_CN; + main_menu.set = SET_TEXT_CN; + main_menu.more = MORE_TEXT_CN; + main_menu.tool = TOOL_TEXT_CN; + // TOOL + tool_menu.title = TOOL_TEXT_CN; + tool_menu.preheat = TOOL_PREHEAT_CN; + tool_menu.extrude = TOOL_EXTRUDE_CN; + tool_menu.move = TOOL_MOVE_CN; + tool_menu.home = TOOL_HOME_CN; + tool_menu.leveling = TOOL_LEVELING_CN; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_CN; + tool_menu.filament = TOOL_FILAMENT_CN; + tool_menu.more = TOOL_MORE_CN; + // + preheat_menu.adjust_title = TITLE_ADJUST_CN; + preheat_menu.title = TITLE_PREHEAT_CN; + preheat_menu.add = ADD_TEXT_CN; + preheat_menu.dec = DEC_TEXT_CN; + preheat_menu.ext1 = EXTRUDER_1_TEXT_CN; + preheat_menu.ext2 = EXTRUDER_2_TEXT_CN; + preheat_menu.hotbed = HEATBED_TEXT_CN; + preheat_menu.off = CLOSE_TEXT_CN; + + preheat_menu.value_state = TEXT_VALUE_CN; + preheat_menu.step_1c = TEXT_1C_CN; + preheat_menu.step_5c = TEXT_5C_CN; + preheat_menu.step_10c = TEXT_10C_CN; + // + move_menu.title = MOVE_TEXT_CN; + // + home_menu.title = TITLE_HOME_CN; + home_menu.stopmove = HOME_STOPMOVE_CN; + // + file_menu.title = TITLE_CHOOSEFILE_CN; + file_menu.page_up = PAGE_UP_TEXT_CN; + file_menu.page_down = PAGE_DOWN_TEXT_CN; + file_menu.file_loading = FILE_LOADING_CN; + file_menu.no_file = NO_FILE_CN; + file_menu.no_file_and_check = NO_FILE_CN;// NO_FILE_AND_CHECK_CN; + // + extrude_menu.title = TITLE_EXTRUDE_CN; + extrude_menu.in = EXTRUDER_IN_TEXT_CN; + extrude_menu.out = EXTRUDER_OUT_TEXT_CN; + extrude_menu.ext1 = EXTRUDER_1_TEXT_CN; + extrude_menu.ext2 = EXTRUDER_2_TEXT_CN; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_CN; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_CN; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_CN; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_CN; + extrude_menu.temp_value = EXTRUDE_TEXT_VALUE_T_CN; + // + leveling_menu.title = TITLE_LEVELING_CN; + leveling_menu.position1 = LEVELING_POINT1_TEXT_CN; + leveling_menu.position2 = LEVELING_POINT2_TEXT_CN; + leveling_menu.position3 = LEVELING_POINT3_TEXT_CN; + leveling_menu.position4 = LEVELING_POINT4_TEXT_CN; + leveling_menu.position5 = LEVELING_POINT5_TEXT_CN; + // + set_menu.title = TITLE_SET_CN; + set_menu.filesys = FILESYS_TEXT_CN; + set_menu.wifi = WIFI_TEXT_CN; + set_menu.about = ABOUT_TEXT_CN; + set_menu.fan = FAN_TEXT_CN; + set_menu.filament = FILAMENT_TEXT_CN; + set_menu.breakpoint = BREAK_POINT_TEXT_CN; + set_menu.motoroff = MOTOR_OFF_TEXT_CN; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_CN; + set_menu.language = LANGUAGE_TEXT_CN; + set_menu.shutdown = SHUTDOWN_TEXT_CN; + set_menu.machine_para = MACHINE_PARA_CN; + set_menu.eepromSet = EEPROM_SETTINGS_CN; + // + filesys_menu.title = TITLE_FILESYS_CN; + filesys_menu.sd_sys = SD_CARD_TEXT_CN; + filesys_menu.usb_sys = U_DISK_TEXT_CN; + // + more_menu.title = TITLE_MORE_CN; + more_menu.zoffset = ZOFFSET_CN; + // WIFI + wifi_menu.title = WIFI_TEXT; + // wifi_menu.key = WIFI_KEY_TEXT_CN; + // wifi_menu.ip = WIFI_IP_TEXT_CN; + // wifi_menu.state = WIFI_STA_TEXT_CN; + wifi_menu.cloud = CLOUD_TEXT_CN; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_CN; + // CLOUD + cloud_menu.title = TITLE_CLOUD_TEXT_CN; + cloud_menu.bind = CLOUD_BINDED_CN; + cloud_menu.binded = CLOUD_BINDED_CN; + cloud_menu.unbind = CLOUD_UNBIND_CN; + cloud_menu.unbinding = CLOUD_UNBINDED_CN; + cloud_menu.disconnected = CLOUD_DISCONNECTED_CN; + cloud_menu.disable = CLOUD_DISABLE_CN; + // + about_menu.title = ABOUT_TEXT_CN; + about_menu.type = ABOUT_TYPE_TEXT_CN; + about_menu.version = ABOUT_VERSION_TEXT_CN; + about_menu.wifi = ABOUT_WIFI_TEXT_CN; + + // + fan_menu.title = FAN_TEXT_CN; + fan_menu.add = FAN_ADD_TEXT_CN; + fan_menu.dec = FAN_DEC_TEXT_CN; + fan_menu.state = FAN_TIPS1_TEXT_CN; + // + filament_menu.title = TITLE_FILAMENT_CN; + filament_menu.in = FILAMENT_IN_TEXT_CN; + filament_menu.out = FILAMENT_OUT_TEXT_CN; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_CN; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_CN; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_CN; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_CN; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_CN; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_CN; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_CN; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_CN; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_CN; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_CN; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_CN; + + + // + language_menu.title = TITLE_LANGUAGE_CN; + language_menu.next = PAGE_DOWN_TEXT_CN; + language_menu.up = PAGE_UP_TEXT_CN; + + // + printing_menu.title = TITLE_PRINTING_CN; + printing_menu.option = PRINTING_OPERATION_CN; + printing_menu.stop = PRINTING_STOP_CN; + printing_menu.pause = PRINTING_PAUSE_CN; + printing_menu.resume = PRINTING_RESUME_CN; + + // + operation_menu.title = TITLE_OPERATION_CN; + operation_menu.pause = PRINTING_PAUSE_CN; + operation_menu.stop = PRINTING_STOP_CN; + operation_menu.temp = PRINTING_TEMP_CN; + operation_menu.fan = FAN_TEXT_CN; + operation_menu.filament = FILAMENT_TEXT_CN; + operation_menu.extr = PRINTING_EXTRUDER_CN; + operation_menu.speed = PRINTING_CHANGESPEED_CN; + operation_menu.more = PRINTING_MORE_CN; + operation_menu.move = PRINTING_MOVE_CN; + operation_menu.auto_off = AUTO_SHUTDOWN_CN; + operation_menu.manual_off = MANUAL_SHUTDOWN_CN; + // + pause_menu.title = TITLE_PAUSE_CN; + pause_menu.resume = PRINTING_RESUME_CN; + pause_menu.stop = PRINTING_STOP_CN; + pause_menu.extrude = PRINTING_EXTRUDER_CN; + pause_menu.move = PRINTING_MOVE_CN; + pause_menu.filament = FILAMENT_TEXT_CN; + pause_menu.more = PRINTING_MORE_CN; + + // + speed_menu.title = PRINTING_CHANGESPEED_CN; + speed_menu.add = ADD_TEXT_CN; + speed_menu.dec = DEC_TEXT_CN; + speed_menu.move = MOVE_SPEED_CN; + speed_menu.extrude = EXTRUDER_SPEED_CN; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_CN; + speed_menu.move_speed = MOVE_SPEED_STATE_CN; + // + printing_more_menu.title = TITLE_MORE_CN; + printing_more_menu.fan = FAN_TEXT_CN; + printing_more_menu.auto_close = AUTO_SHUTDOWN_CN; + printing_more_menu.manual = MANUAL_SHUTDOWN_CN; + printing_more_menu.speed = PRINTING_CHANGESPEED_CN; + printing_more_menu.temp = PRINTING_TEMP_CN; + + // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_CN; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_CN; + print_file_dialog_menu.cancle = DIALOG_CANCLE_CN; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_CN; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_CN; + print_file_dialog_menu.retry = DIALOG_RETRY_CN; + print_file_dialog_menu.stop = DIALOG_STOP_CN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_CN; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_CN; + + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_CN; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_CN; + + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_CN; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_CN; + print_file_dialog_menu.reprint = DIALOG_REPRINT_CN; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_CN; + + // ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_CN; + zoffset_menu.inc = ZOFFSET_INC_CN; + zoffset_menu.dec = ZOFFSET_DEC_CN; + + pause_msg_menu.pausing = MESSAGE_PAUSING_CN; + pause_msg_menu.changing = MESSAGE_CHANGING_CN; + pause_msg_menu.unload = MESSAGE_UNLOAD_CN; + pause_msg_menu.waiting = MESSAGE_WAITING_CN; + pause_msg_menu.insert = MESSAGE_INSERT_CN; + pause_msg_menu.load = MESSAGE_LOAD_CN; + pause_msg_menu.purge = MESSAGE_PURGE_CN; + pause_msg_menu.resume = MESSAGE_RESUME_CN; + pause_msg_menu.heat = MESSAGE_HEAT_CN; + pause_msg_menu.heating = MESSAGE_HEATING_CN; + pause_msg_menu.option = MESSAGE_OPTION_CN; + pause_msg_menu.purgeMore = MESSAGE_PURGE_MORE_CN; + pause_msg_menu.continuePrint = MESSAGE_CONTINUE_PRINT_CN; + eeprom_menu.title = EEPROM_SETTINGS_TITLE_CN; + eeprom_menu.store = EEPROM_SETTINGS_STORE_CN; + eeprom_menu.read = EEPROM_SETTINGS_READ_CN; + eeprom_menu.revert = EEPROM_SETTINGS_REVERT_CN; + eeprom_menu.storeTips = EEPROM_STORE_TIPS_CN; + eeprom_menu.readTips = EEPROM_READ_TIPS_CN; + eeprom_menu.revertTips = EEPROM_REVERT_TIPS_CN; + break; + + #if 1 + #if 1 + + case LANG_COMPLEX_CHINESE: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_T_CN; + common_menu.text_back = BACK_TEXT_T_CN; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_T_CN; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_T_CN; + common_menu.print_special_title = PRINTING_GBK; + common_menu.pause_special_title = PRINTING_PAUSE_GBK; + common_menu.operate_special_title = PRINTING_OPERATION_GBK; + // + main_menu.title = TITLE_READYPRINT_T_CN; + main_menu.preheat = PREHEAT_TEXT_T_CN; + main_menu.move = MOVE_TEXT_T_CN; + main_menu.home = HOME_TEXT_T_CN; + main_menu.print = PRINT_TEXT_T_CN; + main_menu.extrude = EXTRUDE_TEXT_T_CN; + main_menu.leveling = LEVELING_TEXT_T_CN; + main_menu.autoleveling = AUTO_LEVELING_TEXT_T_CN; + main_menu.fan = FAN_TEXT_T_CN; + main_menu.set = SET_TEXT_T_CN; + main_menu.more = MORE_TEXT_T_CN; + main_menu.tool = TOOL_TEXT_T_CN; + // TOOL + tool_menu.title = TOOL_TEXT_T_CN; + tool_menu.preheat = TOOL_PREHEAT_T_CN; + tool_menu.extrude = TOOL_EXTRUDE_T_CN; + tool_menu.move = TOOL_MOVE_T_CN; + tool_menu.home = TOOL_HOME_T_CN; + tool_menu.leveling = TOOL_LEVELING_T_CN; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_T_CN; + tool_menu.filament = TOOL_FILAMENT_T_CN; + tool_menu.more = TOOL_MORE_T_CN; + // + preheat_menu.adjust_title = TITLE_ADJUST_T_CN; + preheat_menu.title = TITLE_PREHEAT_T_CN; + preheat_menu.add = ADD_TEXT_T_CN; + preheat_menu.dec = DEC_TEXT_T_CN; + preheat_menu.ext1 = EXTRUDER_1_TEXT_T_CN; + preheat_menu.ext2 = EXTRUDER_2_TEXT_T_CN; + preheat_menu.hotbed = HEATBED_TEXT_T_CN; + preheat_menu.off = CLOSE_TEXT_T_CN; + preheat_menu.value_state = TEXT_VALUE_T_CN; + preheat_menu.step_1c = TEXT_1C_T_CN; + preheat_menu.step_5c = TEXT_5C_T_CN; + preheat_menu.step_10c = TEXT_10C_T_CN; + // + move_menu.title = MOVE_TEXT_T_CN; + more_menu.zoffset = ZOFFSET_T_CN; + // + home_menu.title = TITLE_HOME_T_CN; + home_menu.stopmove = HOME_STOPMOVE_T_CN; + // + file_menu.title = TITLE_CHOOSEFILE_T_CN; + file_menu.page_up = PAGE_UP_TEXT_T_CN; + file_menu.page_down = PAGE_DOWN_TEXT_T_CN; + file_menu.file_loading = FILE_LOADING_T_CN; + file_menu.no_file = NO_FILE_T_CN; + file_menu.no_file_and_check = NO_FILE_T_CN;// NO_FILE_AND_CHECK_T_CN; + // + extrude_menu.title = TITLE_EXTRUDE_T_CN; + extrude_menu.in = EXTRUDER_IN_TEXT_T_CN; + extrude_menu.out = EXTRUDER_OUT_TEXT_T_CN; + extrude_menu.ext1 = EXTRUDER_1_TEXT_T_CN; + extrude_menu.ext2 = EXTRUDER_2_TEXT_T_CN; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_T_CN; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_T_CN; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_T_CN; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_T_CN; + extrude_menu.temp_value = EXTRUDE_TEXT_VALUE_T_T_CN; + // + leveling_menu.title = TITLE_LEVELING_CN; + leveling_menu.position1 = LEVELING_POINT1_TEXT_T_CN; + leveling_menu.position2 = LEVELING_POINT2_TEXT_T_CN; + leveling_menu.position3 = LEVELING_POINT3_TEXT_T_CN; + leveling_menu.position4 = LEVELING_POINT4_TEXT_T_CN; + leveling_menu.position5 = LEVELING_POINT5_TEXT_T_CN; + // + set_menu.title = TITLE_SET_T_CN; + set_menu.filesys = FILESYS_TEXT_T_CN; + set_menu.wifi = WIFI_TEXT_T_CN; + set_menu.about = ABOUT_TEXT_T_CN; + set_menu.fan = FAN_TEXT_T_CN; + set_menu.filament = FILAMENT_TEXT_T_CN; + set_menu.breakpoint = BREAK_POINT_TEXT_T_CN; + set_menu.motoroff = MOTOR_OFF_TEXT_T_CN; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_T_CN; + set_menu.language = LANGUAGE_TEXT_T_CN; + set_menu.shutdown = SHUTDOWN_TEXT_T_CN; + set_menu.machine_para = MACHINE_PARA_T_CN; + set_menu.eepromSet = EEPROM_SETTINGS_T_CN; + filesys_menu.title = TITLE_FILESYS_T_CN; + filesys_menu.sd_sys = SD_CARD_TEXT_T_CN; + filesys_menu.usb_sys = U_DISK_TEXT_T_CN; + // + more_menu.title = TITLE_MORE_T_CN; + // WIFI + wifi_menu.title = WIFI_TEXT; + // wifi_menu.key = WIFI_KEY_TEXT_CN; + // wifi_menu.ip = WIFI_IP_TEXT_CN; + // wifi_menu.state= WIFI_STA_TEXT_CN; + wifi_menu.cloud = CLOUD_TEXT_T_CN; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_T_CN; + // CLOUD + cloud_menu.title = TITLE_CLOUD_TEXT_T_CN; + cloud_menu.bind = CLOUD_BINDED_T_CN; + cloud_menu.binded = CLOUD_BINDED_T_CN; + cloud_menu.unbind = CLOUD_UNBIND_T_CN; + cloud_menu.unbinding = CLOUD_UNBINDED_T_CN; + cloud_menu.disconnected = CLOUD_DISCONNECTED_T_CN; + cloud_menu.disable = CLOUD_DISABLE_T_CN; + // + about_menu.title = ABOUT_TEXT_T_CN; + about_menu.type = ABOUT_TYPE_TEXT_T_CN; + about_menu.version = ABOUT_VERSION_TEXT_T_CN; + about_menu.wifi = ABOUT_WIFI_TEXT_T_CN; + + // + fan_menu.title = FAN_TEXT_T_CN; + fan_menu.add = FAN_ADD_TEXT_T_CN; + fan_menu.dec = FAN_DEC_TEXT_T_CN; + fan_menu.state = FAN_TIPS1_TEXT_T_CN; + // + filament_menu.title = TITLE_FILAMENT_T_CN; + filament_menu.in = FILAMENT_IN_TEXT_T_CN; + filament_menu.out = FILAMENT_OUT_TEXT_T_CN; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_T_CN; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_T_CN; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_T_CN; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_T_CN; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_T_CN; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_T_CN; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_T_CN; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_T_CN; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_T_CN; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_T_CN; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_T_CN; + + + // + language_menu.title = TITLE_LANGUAGE_T_CN; + language_menu.next = PAGE_DOWN_TEXT_T_CN; + language_menu.up = PAGE_UP_TEXT_T_CN; + + // + printing_menu.title = TITLE_PRINTING_T_CN; + printing_menu.option = PRINTING_OPERATION_T_CN; + printing_menu.stop = PRINTING_STOP_T_CN; + printing_menu.pause = PRINTING_PAUSE_T_CN; + printing_menu.resume = PRINTING_RESUME_T_CN; + + // + operation_menu.title = TITLE_OPERATION_T_CN; + operation_menu.pause = PRINTING_PAUSE_T_CN; + operation_menu.stop = PRINTING_STOP_T_CN; + operation_menu.temp = PRINTING_TEMP_T_CN; + operation_menu.fan = FAN_TEXT_T_CN; + operation_menu.extr = PRINTING_EXTRUDER_T_CN; + operation_menu.speed = PRINTING_CHANGESPEED_T_CN; + operation_menu.filament = FILAMENT_TEXT_T_CN; + operation_menu.more = PRINTING_MORE_T_CN; + operation_menu.move = PRINTING_MOVE_T_CN; + operation_menu.auto_off = AUTO_SHUTDOWN_T_CN; + operation_menu.manual_off = MANUAL_SHUTDOWN_T_CN; + // + pause_menu.title = TITLE_PAUSE_T_CN; + pause_menu.resume = PRINTING_RESUME_T_CN; + pause_menu.stop = PRINTING_STOP_T_CN; + pause_menu.extrude = PRINTING_EXTRUDER_T_CN; + pause_menu.move = PRINTING_MOVE_T_CN; + pause_menu.filament = FILAMENT_TEXT_T_CN; + pause_menu.more = PRINTING_MORE_T_CN; + + // + speed_menu.title = PRINTING_CHANGESPEED_T_CN; + speed_menu.add = ADD_TEXT_T_CN; + speed_menu.dec = DEC_TEXT_T_CN; + speed_menu.move = MOVE_SPEED_T_CN; + speed_menu.extrude = EXTRUDER_SPEED_T_CN; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_T_CN; + speed_menu.move_speed = MOVE_SPEED_STATE_T_CN; + // + printing_more_menu.title = TITLE_MORE_T_CN; + printing_more_menu.fan = FAN_TEXT_T_CN; + printing_more_menu.auto_close = AUTO_SHUTDOWN_T_CN; + printing_more_menu.manual = MANUAL_SHUTDOWN_T_CN; + printing_more_menu.speed = PRINTING_CHANGESPEED_T_CN; + printing_more_menu.temp = PRINTING_TEMP_T_CN; + + // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_CN; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_T_CN; + print_file_dialog_menu.cancle = DIALOG_CANCLE_T_CN; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_T_CN; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_T_CN; + print_file_dialog_menu.retry = DIALOG_RETRY_T_CN; + print_file_dialog_menu.stop = DIALOG_STOP_T_CN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_T_CN; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_T_CN; + + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_T_CN; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_T_CN; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_T_CN; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_T_CN; + print_file_dialog_menu.reprint = DIALOG_REPRINT_T_CN; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_T_CN; + // ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_T_CN; + zoffset_menu.inc = ZOFFSET_INC_T_CN; + zoffset_menu.dec = ZOFFSET_DEC_T_CN; + + pause_msg_menu.pausing = MESSAGE_PAUSING_T_CN; + pause_msg_menu.changing = MESSAGE_CHANGING_T_CN; + pause_msg_menu.unload = MESSAGE_UNLOAD_T_CN; + pause_msg_menu.waiting = MESSAGE_WAITING_T_CN; + pause_msg_menu.insert = MESSAGE_INSERT_T_CN; + pause_msg_menu.load = MESSAGE_LOAD_T_CN; + pause_msg_menu.purge = MESSAGE_PURGE_T_CN; + pause_msg_menu.resume = MESSAGE_RESUME_T_CN; + pause_msg_menu.heat = MESSAGE_HEAT_T_CN; + pause_msg_menu.heating = MESSAGE_HEATING_T_CN; + pause_msg_menu.option = MESSAGE_OPTION_T_CN; + pause_msg_menu.purgeMore = MESSAGE_PURGE_MORE_T_CN; + pause_msg_menu.continuePrint = MESSAGE_CONTINUE_PRINT_T_CN; + eeprom_menu.title = EEPROM_SETTINGS_TITLE_T_CN; + eeprom_menu.store = EEPROM_SETTINGS_STORE_T_CN; + eeprom_menu.read = EEPROM_SETTINGS_READ_T_CN; + eeprom_menu.revert = EEPROM_SETTINGS_REVERT_T_CN; + eeprom_menu.storeTips = EEPROM_STORE_TIPS_T_CN; + eeprom_menu.readTips = EEPROM_READ_TIPS_T_CN; + eeprom_menu.revertTips = EEPROM_REVERT_TIPS_T_CN; + break; + case LANG_ENGLISH: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_EN; + common_menu.text_back = BACK_TEXT_EN; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_EN; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_EN; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + // + main_menu.title = TITLE_READYPRINT_EN; + main_menu.preheat = PREHEAT_TEXT_EN; + main_menu.move = MOVE_TEXT_EN; + main_menu.home = HOME_TEXT_EN; + main_menu.print = PRINT_TEXT_EN; + main_menu.extrude = EXTRUDE_TEXT_EN; + main_menu.leveling = LEVELING_TEXT_EN; + main_menu.autoleveling = AUTO_LEVELING_TEXT_EN; + main_menu.fan = FAN_TEXT_EN; + main_menu.set = SET_TEXT_EN; + main_menu.more = MORE_TEXT_EN; + main_menu.tool = TOOL_TEXT_EN; + // TOOL + tool_menu.title = TOOL_TEXT_EN; + tool_menu.preheat = TOOL_PREHEAT_EN; + tool_menu.extrude = TOOL_EXTRUDE_EN; + tool_menu.move = TOOL_MOVE_EN; + tool_menu.home = TOOL_HOME_EN; + tool_menu.leveling = TOOL_LEVELING_EN; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_EN; + tool_menu.filament = TOOL_FILAMENT_EN; + tool_menu.more = TOOL_MORE_EN; + // + preheat_menu.adjust_title = TITLE_ADJUST_EN; + preheat_menu.title = TITLE_PREHEAT_EN; + preheat_menu.add = ADD_TEXT_EN; + preheat_menu.dec = DEC_TEXT_EN; + preheat_menu.ext1 = EXTRUDER_1_TEXT_EN; + preheat_menu.ext2 = EXTRUDER_2_TEXT_EN; + preheat_menu.hotbed = HEATBED_TEXT_EN; + preheat_menu.off = CLOSE_TEXT_EN; + // + move_menu.title = TITLE_MOVE_EN; + // + home_menu.title = TITLE_HOME_EN; + home_menu.stopmove = HOME_STOPMOVE_EN; + // + file_menu.title = TITLE_CHOOSEFILE_EN; + file_menu.page_up = PAGE_UP_TEXT_EN; + file_menu.page_down = PAGE_DOWN_TEXT_EN; + file_menu.file_loading = FILE_LOADING_EN; + file_menu.no_file = NO_FILE_EN; + file_menu.no_file_and_check = NO_FILE_EN;// NO_FILE_AND_CHECK_EN; + // + extrude_menu.title = TITLE_EXTRUDE_EN; + extrude_menu.in = EXTRUDER_IN_TEXT_EN; + extrude_menu.out = EXTRUDER_OUT_TEXT_EN; + extrude_menu.ext1 = EXTRUDER_1_TEXT_EN; + extrude_menu.ext2 = EXTRUDER_2_TEXT_EN; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_EN; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_EN; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_EN; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_EN; + // + leveling_menu.title = TITLE_LEVELING_EN; + leveling_menu.position1 = LEVELING_POINT1_TEXT_EN; + leveling_menu.position2 = LEVELING_POINT2_TEXT_EN; + leveling_menu.position3 = LEVELING_POINT3_TEXT_EN; + leveling_menu.position4 = LEVELING_POINT4_TEXT_EN; + leveling_menu.position5 = LEVELING_POINT5_TEXT_EN; + // + set_menu.title = TITLE_SET_EN; + set_menu.filesys = FILESYS_TEXT_EN; + set_menu.wifi = WIFI_TEXT_EN; + set_menu.about = ABOUT_TEXT_EN; + set_menu.fan = FAN_TEXT_EN; + set_menu.filament = FILAMENT_TEXT_EN; + set_menu.breakpoint = BREAK_POINT_TEXT_EN; + set_menu.motoroff = MOTOR_OFF_TEXT_EN; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_EN; + set_menu.language = LANGUAGE_TEXT_EN; + set_menu.shutdown = SHUTDOWN_TEXT_EN; + set_menu.machine_para = MACHINE_PARA_EN; + set_menu.eepromSet = EEPROM_SETTINGS_EN; + more_menu.title = TITLE_MORE_EN; + more_menu.zoffset = ZOFFSET_EN; + // + filesys_menu.title = TITLE_FILESYS_EN; + filesys_menu.sd_sys = SD_CARD_TEXT_EN; + filesys_menu.usb_sys = U_DISK_TEXT_EN; + // WIFI + wifi_menu.title = WIFI_TEXT; + // wifi_menu.key = WIFI_KEY_TEXT_EN; + // wifi_menu.ip = WIFI_IP_TEXT_EN; + // wifi_menu.state = WIFI_STA_TEXT_EN; + wifi_menu.cloud = CLOUD_TEXT_EN; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_EN; + + cloud_menu.title = TITLE_CLOUD_TEXT_EN; + cloud_menu.bind = CLOUD_BINDED_EN; + cloud_menu.binded = CLOUD_BINDED_EN; + cloud_menu.unbind = CLOUD_UNBIND_EN; + cloud_menu.unbinding = CLOUD_UNBINDED_EN; + cloud_menu.disconnected = CLOUD_DISCONNECTED_EN; + cloud_menu.disable = CLOUD_DISABLE_EN; + // + about_menu.title = TITLE_ABOUT_EN; + about_menu.type = ABOUT_TYPE_TEXT_EN; + about_menu.version = ABOUT_VERSION_TEXT_EN; + about_menu.wifi = ABOUT_WIFI_TEXT_EN; + // + fan_menu.title = TITLE_FAN_EN; + fan_menu.add = FAN_ADD_TEXT_EN; + fan_menu.dec = FAN_DEC_TEXT_EN; + fan_menu.state = FAN_TIPS1_TEXT_EN; + // + filament_menu.title = TITLE_FILAMENT_EN; + filament_menu.in = FILAMENT_IN_TEXT_EN; + filament_menu.out = FILAMENT_OUT_TEXT_EN; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_EN; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_EN; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_EN; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_EN; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_EN; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN; + + // + language_menu.title = TITLE_LANGUAGE_EN; + language_menu.next = PAGE_DOWN_TEXT_EN; + language_menu.up = PAGE_UP_TEXT_EN; + // + printing_menu.title = TITLE_PRINTING_EN; + printing_menu.option = PRINTING_OPERATION_EN; + printing_menu.stop = PRINTING_STOP_EN; + printing_menu.pause = PRINTING_PAUSE_EN; + printing_menu.resume = PRINTING_RESUME_EN; + + // + operation_menu.title = TITLE_OPERATION_EN; + operation_menu.pause = PRINTING_PAUSE_EN; + operation_menu.stop = PRINTING_STOP_EN; + operation_menu.temp = PRINTING_TEMP_EN; + operation_menu.fan = FAN_TEXT_EN; + operation_menu.extr = PRINTING_EXTRUDER_EN; + operation_menu.speed = PRINTING_CHANGESPEED_EN; + operation_menu.filament = FILAMENT_TEXT_EN; + operation_menu.more = PRINTING_MORE_EN; + operation_menu.move = PRINTING_MOVE_EN; + operation_menu.auto_off = AUTO_SHUTDOWN_EN; + operation_menu.manual_off = MANUAL_SHUTDOWN_EN; + // + pause_menu.title = TITLE_PAUSE_EN; + pause_menu.resume = PRINTING_RESUME_EN; + pause_menu.stop = PRINTING_STOP_EN; + pause_menu.extrude = PRINTING_EXTRUDER_EN; + pause_menu.move = PRINTING_MOVE_EN; + pause_menu.filament = FILAMENT_TEXT_EN; + pause_menu.more = PRINTING_MORE_EN; + + // + speed_menu.title = TITLE_CHANGESPEED_EN; + speed_menu.add = ADD_TEXT_EN; + speed_menu.dec = DEC_TEXT_EN; + speed_menu.move = MOVE_SPEED_EN; + speed_menu.extrude = EXTRUDER_SPEED_EN; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_EN; + speed_menu.move_speed = MOVE_SPEED_STATE_EN; + // + printing_more_menu.title = TITLE_MORE_EN; + printing_more_menu.fan = FAN_TEXT_EN; + printing_more_menu.auto_close = AUTO_SHUTDOWN_EN; + printing_more_menu.manual = MANUAL_SHUTDOWN_EN; + printing_more_menu.speed = PRINTING_CHANGESPEED_EN; + printing_more_menu.temp = PRINTING_TEMP_EN; + + // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_EN; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_EN; + print_file_dialog_menu.cancle = DIALOG_CANCLE_EN; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_EN; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_EN; + print_file_dialog_menu.retry = DIALOG_RETRY_EN; + print_file_dialog_menu.stop = DIALOG_STOP_EN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_EN; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_EN; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_EN; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_EN; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_EN; + print_file_dialog_menu.reprint = DIALOG_REPRINT_EN; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_EN; + // ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_EN; + zoffset_menu.inc = ZOFFSET_INC_EN; + zoffset_menu.dec = ZOFFSET_DEC_EN; + + pause_msg_menu.pausing = MESSAGE_PAUSING_EN; + pause_msg_menu.changing = MESSAGE_CHANGING_EN; + pause_msg_menu.unload = MESSAGE_UNLOAD_EN; + pause_msg_menu.waiting = MESSAGE_WAITING_EN; + pause_msg_menu.insert = MESSAGE_INSERT_EN; + pause_msg_menu.load = MESSAGE_LOAD_EN; + pause_msg_menu.purge = MESSAGE_PURGE_EN; + pause_msg_menu.resume = MESSAGE_RESUME_EN; + pause_msg_menu.heat = MESSAGE_HEAT_EN; + pause_msg_menu.heating = MESSAGE_HEATING_EN; + pause_msg_menu.option = MESSAGE_OPTION_EN; + pause_msg_menu.purgeMore = MESSAGE_PURGE_MORE_EN; + pause_msg_menu.continuePrint = MESSAGE_CONTINUE_PRINT_EN; + eeprom_menu.title = EEPROM_SETTINGS_TITLE_EN; + eeprom_menu.store = EEPROM_SETTINGS_STORE_EN; + eeprom_menu.read = EEPROM_SETTINGS_READ_EN; + eeprom_menu.revert = EEPROM_SETTINGS_REVERT_EN; + eeprom_menu.storeTips = EEPROM_STORE_TIPS_EN; + eeprom_menu.readTips = EEPROM_READ_TIPS_EN; + eeprom_menu.revertTips = EEPROM_REVERT_TIPS_EN; + break; + case LANG_RUSSIAN: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_RU; + common_menu.text_back = BACK_TEXT_RU; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_RU; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_RU; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + // + main_menu.title = TITLE_READYPRINT_RU; + main_menu.preheat = PREHEAT_TEXT_RU; + main_menu.move = MOVE_TEXT_RU; + main_menu.home = HOME_TEXT_RU; + main_menu.print = PRINT_TEXT_RU; + main_menu.extrude = EXTRUDE_TEXT_RU; + main_menu.leveling = LEVELING_TEXT_RU; + main_menu.autoleveling = AUTO_LEVELING_TEXT_RU; + main_menu.fan = FAN_TEXT_RU; + main_menu.set = SET_TEXT_RU; + main_menu.more = MORE_TEXT_RU; + main_menu.tool = TOOL_TEXT_RU; + // TOOL + tool_menu.title = TOOL_TEXT_RU; + tool_menu.preheat = TOOL_PREHEAT_RU; + tool_menu.extrude = TOOL_EXTRUDE_RU; + tool_menu.move = TOOL_MOVE_RU; + tool_menu.home = TOOL_HOME_RU; + tool_menu.leveling = TOOL_LEVELING_RU; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_RU; + tool_menu.filament = TOOL_FILAMENT_RU; + tool_menu.more = TOOL_MORE_RU; + // + preheat_menu.adjust_title = TITLE_ADJUST_RU; + preheat_menu.title = TITLE_PREHEAT_RU; + preheat_menu.add = ADD_TEXT_RU; + preheat_menu.dec = DEC_TEXT_RU; + preheat_menu.ext1 = EXTRUDER_1_TEXT_RU; + preheat_menu.ext2 = EXTRUDER_2_TEXT_RU; + preheat_menu.hotbed = HEATBED_TEXT_RU; + preheat_menu.off = CLOSE_TEXT_RU; + // + move_menu.title = MOVE_TEXT_RU; + // + home_menu.title = TITLE_HOME_RU; + home_menu.stopmove = HOME_STOPMOVE_RU; + // + file_menu.title = TITLE_CHOOSEFILE_RU; + file_menu.page_up = PAGE_UP_TEXT_RU; + file_menu.page_down = PAGE_DOWN_TEXT_RU; + file_menu.file_loading = FILE_LOADING_RU; + file_menu.no_file = NO_FILE_RU; + file_menu.no_file_and_check = NO_FILE_RU;// NO_FILE_AND_CHECK_RU; + // + extrude_menu.title = TITLE_EXTRUDE_RU; + extrude_menu.in = EXTRUDER_IN_TEXT_RU; + extrude_menu.out = EXTRUDER_OUT_TEXT_RU; + extrude_menu.ext1 = EXTRUDER_1_TEXT_RU; + extrude_menu.ext2 = EXTRUDER_2_TEXT_RU; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_RU; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_RU; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_RU; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_RU; + // + leveling_menu.title = TITLE_LEVELING_RU; + leveling_menu.position1 = LEVELING_POINT1_TEXT_RU; + leveling_menu.position2 = LEVELING_POINT2_TEXT_RU; + leveling_menu.position3 = LEVELING_POINT3_TEXT_RU; + leveling_menu.position4 = LEVELING_POINT4_TEXT_RU; + leveling_menu.position5 = LEVELING_POINT5_TEXT_RU; + // + set_menu.title = TITLE_SET_RU; + set_menu.filesys = FILESYS_TEXT_RU; + set_menu.wifi = WIFI_TEXT_RU; + set_menu.about = ABOUT_TEXT_RU; + set_menu.fan = FAN_TEXT_RU; + set_menu.filament = FILAMENT_TEXT_RU; + set_menu.breakpoint = BREAK_POINT_TEXT_RU; + set_menu.motoroff = MOTOR_OFF_TEXT_RU; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_RU; + set_menu.language = LANGUAGE_TEXT_RU; + set_menu.shutdown = SHUTDOWN_TEXT_RU; + set_menu.machine_para = MACHINE_PARA_RU; + set_menu.eepromSet = EEPROM_SETTINGS_RU; + more_menu.title = TITLE_MORE_RU; + more_menu.zoffset = ZOFFSET_RU; + // + filesys_menu.title = TITLE_FILESYS_RU; + filesys_menu.sd_sys = SD_CARD_TEXT_RU; + filesys_menu.usb_sys = U_DISK_TEXT_RU; + // WIFI + wifi_menu.title = WIFI_TEXT; + // wifi_menu.key = WIFI_KEY_TEXT_RU; + // wifi_menu.ip = WIFI_IP_TEXT_RU; + // wifi_menu.state = WIFI_STA_TEXT_RU; + wifi_menu.cloud = CLOUD_TEXT_RU; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_RU; + + + cloud_menu.title = TITLE_CLOUD_TEXT_RU; + cloud_menu.bind = CLOUD_BINDED_RU; + cloud_menu.binded = CLOUD_BINDED_RU; + cloud_menu.unbind = CLOUD_UNBIND_RU; + cloud_menu.unbinding = CLOUD_UNBINDED_RU; + cloud_menu.disconnected = CLOUD_DISCONNECTED_RU; + cloud_menu.disable = CLOUD_DISABLE_RU; + // + about_menu.title = ABOUT_TEXT_RU; + about_menu.type = ABOUT_TYPE_TEXT_RU; + about_menu.version = ABOUT_VERSION_TEXT_RU; + about_menu.wifi = ABOUT_WIFI_TEXT_RU; + // + fan_menu.title = FAN_TEXT_RU; + fan_menu.add = FAN_ADD_TEXT_RU; + fan_menu.dec = FAN_DEC_TEXT_RU; + fan_menu.state = FAN_TIPS1_TEXT_RU; + // + filament_menu.title = TITLE_FILAMENT_RU; + filament_menu.in = FILAMENT_IN_TEXT_RU; + filament_menu.out = FILAMENT_OUT_TEXT_RU; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_RU; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_RU; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_RU; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_RU; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_RU; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU; + + // + language_menu.title = LANGUAGE_TEXT_RU; + language_menu.next = PAGE_DOWN_TEXT_RU; + language_menu.up = PAGE_UP_TEXT_RU; + // + printing_menu.title = TITLE_PRINTING_RU; + printing_menu.option = PRINTING_OPERATION_RU; + printing_menu.stop = PRINTING_STOP_RU; + printing_menu.pause = PRINTING_PAUSE_RU; + printing_menu.resume = PRINTING_RESUME_RU; + + // + operation_menu.title = TITLE_OPERATION_RU; + operation_menu.pause = PRINTING_PAUSE_RU; + operation_menu.stop = PRINTING_STOP_RU; + operation_menu.temp = PRINTING_TEMP_RU; + operation_menu.fan = FAN_TEXT_RU; + operation_menu.extr = PRINTING_EXTRUDER_RU; + operation_menu.speed = PRINTING_CHANGESPEED_RU; + operation_menu.filament = FILAMENT_TEXT_RU; + operation_menu.more = PRINTING_MORE_RU; + operation_menu.move = PRINTING_MOVE_RU; + operation_menu.auto_off = AUTO_SHUTDOWN_RU; + operation_menu.manual_off = MANUAL_SHUTDOWN_RU; + // + pause_menu.title = TITLE_PAUSE_RU; + pause_menu.resume = PRINTING_RESUME_RU; + pause_menu.stop = PRINTING_STOP_RU; + pause_menu.extrude = PRINTING_EXTRUDER_RU; + pause_menu.move = PRINTING_MOVE_RU; + pause_menu.filament = FILAMENT_TEXT_RU; + pause_menu.more = PRINTING_MORE_RU; + + // + speed_menu.title = PRINTING_CHANGESPEED_RU; + speed_menu.add = ADD_TEXT_RU; + speed_menu.dec = DEC_TEXT_RU; + speed_menu.move = MOVE_SPEED_RU; + speed_menu.extrude = EXTRUDER_SPEED_RU; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_RU; + speed_menu.move_speed = MOVE_SPEED_STATE_RU; + // + printing_more_menu.title = TITLE_MORE_RU; + printing_more_menu.fan = FAN_TEXT_RU; + printing_more_menu.auto_close = AUTO_SHUTDOWN_RU; + printing_more_menu.manual = MANUAL_SHUTDOWN_RU; + printing_more_menu.speed = PRINTING_CHANGESPEED_RU; + printing_more_menu.temp = PRINTING_TEMP_RU; + // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_RU; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_RU; + print_file_dialog_menu.cancle = DIALOG_CANCLE_RU; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_RU; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_RU; + print_file_dialog_menu.retry = DIALOG_RETRY_RU; + print_file_dialog_menu.stop = DIALOG_STOP_RU; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_RU; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_RU; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_RU; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_RU; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_RU; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_RU; + print_file_dialog_menu.reprint = DIALOG_REPRINT_RU; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_RU; + // ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_RU; + zoffset_menu.inc = ZOFFSET_INC_RU; + zoffset_menu.dec = ZOFFSET_DEC_RU; + + pause_msg_menu.pausing = MESSAGE_PAUSING_RU; + pause_msg_menu.changing = MESSAGE_CHANGING_RU; + pause_msg_menu.unload = MESSAGE_UNLOAD_RU; + pause_msg_menu.waiting = MESSAGE_WAITING_RU; + pause_msg_menu.insert = MESSAGE_INSERT_RU; + pause_msg_menu.load = MESSAGE_LOAD_RU; + pause_msg_menu.purge = MESSAGE_PURGE_RU; + pause_msg_menu.resume = MESSAGE_RESUME_RU; + pause_msg_menu.heat = MESSAGE_HEAT_RU; + pause_msg_menu.heating = MESSAGE_HEATING_RU; + pause_msg_menu.option = MESSAGE_OPTION_RU; + pause_msg_menu.purgeMore = MESSAGE_PURGE_MORE_RU; + pause_msg_menu.continuePrint = MESSAGE_CONTINUE_PRINT_RU; + eeprom_menu.title = EEPROM_SETTINGS_TITLE_RU; + eeprom_menu.store = EEPROM_SETTINGS_STORE_RU; + eeprom_menu.read = EEPROM_SETTINGS_READ_RU; + eeprom_menu.revert = EEPROM_SETTINGS_REVERT_RU; + eeprom_menu.storeTips = EEPROM_STORE_TIPS_RU; + eeprom_menu.readTips = EEPROM_READ_TIPS_RU; + eeprom_menu.revertTips = EEPROM_REVERT_TIPS_RU; + break; + case LANG_SPANISH: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_SP; + common_menu.text_back = BACK_TEXT_SP; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_SP; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_SP; + common_menu.print_special_title = PRINTING_SP; + common_menu.pause_special_title = PRINTING_PAUSAR_SP; + common_menu.operate_special_title = PRINTING_AJUSTES_SP; + // + main_menu.title = TITLE_READYPRINT_SP; + main_menu.preheat = PREHEAT_TEXT_SP; + main_menu.move = MOVE_TEXT_SP; + main_menu.home = HOME_TEXT_SP; + main_menu.print = PRINT_TEXT_SP; + main_menu.extrude = EXTRUDE_TEXT_SP; + main_menu.leveling = LEVELING_TEXT_SP; + main_menu.autoleveling = AUTO_LEVELING_TEXT_SP; + main_menu.fan = FAN_TEXT_SP; + main_menu.set = SET_TEXT_SP; + main_menu.more = MORE_TEXT_SP; + main_menu.tool = TOOL_TEXT_SP; + // TOOL + tool_menu.title = TOOL_TEXT_SP; + tool_menu.preheat = TOOL_PREHEAT_SP; + tool_menu.extrude = TOOL_EXTRUDE_SP; + tool_menu.move = TOOL_MOVE_SP; + tool_menu.home = TOOL_HOME_SP; + tool_menu.leveling = TOOL_LEVELING_SP; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_SP; + tool_menu.filament = TOOL_FILAMENT_SP; + tool_menu.more = TOOL_MORE_SP; + // + preheat_menu.adjust_title = TITLE_ADJUST_SP; + preheat_menu.title = TITLE_PREHEAT_SP; + preheat_menu.add = ADD_TEXT_SP; + preheat_menu.dec = DEC_TEXT_SP; + preheat_menu.ext1 = EXTRUDER_1_TEXT_SP; + preheat_menu.ext2 = EXTRUDER_2_TEXT_SP; + preheat_menu.hotbed = HEATBED_TEXT_SP; + preheat_menu.off = CLOSE_TEXT_SP; + // + move_menu.title = MOVE_TEXT_SP; + // + home_menu.title = TITLE_HOME_SP; + home_menu.home_x = HOME_X_TEXT_SP; + home_menu.home_y = HOME_Y_TEXT_SP; + home_menu.home_z = HOME_Z_TEXT_SP; + home_menu.home_all = HOME_ALL_TEXT_SP; + home_menu.stopmove = HOME_STOPMOVE_SP; + // + file_menu.title = TITLE_CHOOSEFILE_SP; + file_menu.page_up = PAGE_UP_TEXT_SP; + file_menu.page_down = PAGE_DOWN_TEXT_SP; + file_menu.file_loading = FILE_LOADING_SP; + file_menu.no_file = NO_FILE_SP; + file_menu.no_file_and_check = NO_FILE_SP;// NO_FILE_AND_CHECK_SP; + // + extrude_menu.title = TITLE_EXTRUDE_SP; + extrude_menu.in = EXTRUDER_IN_TEXT_SP; + extrude_menu.out = EXTRUDER_OUT_TEXT_SP; + extrude_menu.ext1 = EXTRUDER_1_TEXT_SP; + extrude_menu.ext2 = EXTRUDER_2_TEXT_SP; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_SP; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_SP; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_SP; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_SP; + // + leveling_menu.title = TITLE_LEVELING_SP; + leveling_menu.position1 = LEVELING_POINT1_TEXT_SP; + leveling_menu.position2 = LEVELING_POINT2_TEXT_SP; + leveling_menu.position3 = LEVELING_POINT3_TEXT_SP; + leveling_menu.position4 = LEVELING_POINT4_TEXT_SP; + leveling_menu.position5 = LEVELING_POINT5_TEXT_SP; + // + set_menu.title = TITLE_SET_SP; + set_menu.filesys = FILESYS_TEXT_SP; + set_menu.wifi = WIFI_TEXT_SP; + set_menu.about = ABOUT_TEXT_SP; + set_menu.fan = FAN_TEXT_SP; + set_menu.filament = FILAMENT_TEXT_SP; + set_menu.breakpoint = BREAK_POINT_TEXT_SP; + set_menu.motoroff = MOTOR_OFF_TEXT_SP; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_SP; + set_menu.language = LANGUAGE_TEXT_SP; + set_menu.shutdown = SHUTDOWN_TEXT_SP; + set_menu.machine_para = MACHINE_PARA_SP; + set_menu.eepromSet = EEPROM_SETTINGS_SP; + more_menu.title = TITLE_MORE_SP; + more_menu.zoffset = ZOFFSET_SP; + // + filesys_menu.title = TITLE_FILESYS_SP; + filesys_menu.sd_sys = SD_CARD_TEXT_SP; + filesys_menu.usb_sys = U_DISK_TEXT_SP; + + // WIFI + wifi_menu.title = WIFI_TEXT; + // wifi_menu.key = WIFI_KEY_TEXT_SP; + // wifi_menu.ip = WIFI_IP_TEXT_SP; + // wifi_menu.state = WIFI_STA_TEXT_SP; + wifi_menu.cloud = CLOUD_TEXT_SP; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_SP; + + cloud_menu.title = TITLE_CLOUD_TEXT_SP; + cloud_menu.bind = CLOUD_BINDED_SP; + cloud_menu.binded = CLOUD_BINDED_SP; + cloud_menu.unbind = CLOUD_UNBIND_SP; + cloud_menu.unbinding = CLOUD_UNBINDED_SP; + cloud_menu.disconnected = CLOUD_DISCONNECTED_SP; + cloud_menu.disable = CLOUD_DISABLE_SP; + // + about_menu.title = ABOUT_TEXT_SP; + about_menu.type = ABOUT_TYPE_TEXT_SP; + about_menu.version = ABOUT_VERSION_TEXT_SP; + about_menu.wifi = ABOUT_WIFI_TEXT_SP; + // + fan_menu.title = FAN_TEXT_SP; + fan_menu.add = FAN_ADD_TEXT_SP; + fan_menu.dec = FAN_DEC_TEXT_SP; + fan_menu.state = FAN_TIPS1_TEXT_SP; + // + filament_menu.title = TITLE_FILAMENT_SP; + filament_menu.in = FILAMENT_IN_TEXT_SP; + filament_menu.out = FILAMENT_OUT_TEXT_SP; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_SP; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_SP; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_SP; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_SP; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_SP; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP; + + // + language_menu.title = LANGUAGE_TEXT_SP; + language_menu.next = PAGE_DOWN_TEXT_SP; + language_menu.up = PAGE_UP_TEXT_SP; + // + printing_menu.title = TITLE_PRINTING_SP; + printing_menu.option = PRINTING_OPERATION_SP; + printing_menu.stop = PRINTING_STOP_SP; + printing_menu.pause = PRINTING_PAUSE_SP; + printing_menu.resume = PRINTING_RESUME_SP; + + // + operation_menu.title = TITLE_OPERATION_SP; + operation_menu.pause = PRINTING_PAUSE_SP; + operation_menu.stop = PRINTING_STOP_SP; + operation_menu.temp = PRINTING_TEMP_SP; + operation_menu.fan = FAN_TEXT_SP; + operation_menu.extr = PRINTING_EXTRUDER_SP; + operation_menu.speed = PRINTING_CHANGESPEED_SP; + operation_menu.filament = FILAMENT_TEXT_SP; + operation_menu.more = PRINTING_MORE_SP; + operation_menu.move = PRINTING_MOVE_SP; + operation_menu.auto_off = AUTO_SHUTDOWN_SP; + operation_menu.manual_off = MANUAL_SHUTDOWN_SP; + // + pause_menu.title = TITLE_PAUSE_RU; + pause_menu.resume = PRINTING_RESUME_SP; + pause_menu.stop = PRINTING_STOP_SP; + pause_menu.extrude = PRINTING_EXTRUDER_SP; + pause_menu.move = PRINTING_MOVE_SP; + pause_menu.filament = FILAMENT_TEXT_SP; + pause_menu.more = PRINTING_MORE_SP; + + // + speed_menu.title = PRINTING_CHANGESPEED_SP; + speed_menu.add = ADD_TEXT_SP; + speed_menu.dec = DEC_TEXT_SP; + speed_menu.move = MOVE_SPEED_SP; + speed_menu.extrude = EXTRUDER_SPEED_SP; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_SP; + speed_menu.move_speed = MOVE_SPEED_STATE_SP; + // + printing_more_menu.title = TITLE_MORE_SP; + printing_more_menu.fan = FAN_TEXT_SP; + printing_more_menu.auto_close = AUTO_SHUTDOWN_SP; + printing_more_menu.manual = MANUAL_SHUTDOWN_SP; + printing_more_menu.speed = PRINTING_CHANGESPEED_SP; + printing_more_menu.temp = PRINTING_TEMP_SP; + + // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_SP; + print_file_dialog_menu.cancle = DIALOG_CANCLE_SP; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_SP; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_SP; + print_file_dialog_menu.retry = DIALOG_RETRY_SP; + print_file_dialog_menu.stop = DIALOG_STOP_SP; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_SP; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_SP; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_SP; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_SP; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_SP; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_SP; + print_file_dialog_menu.reprint = DIALOG_REPRINT_SP; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_SP; + // ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_SP; + zoffset_menu.inc = ZOFFSET_INC_SP; + zoffset_menu.dec = ZOFFSET_DEC_SP; + + pause_msg_menu.pausing = MESSAGE_PAUSING_SP; + pause_msg_menu.changing = MESSAGE_CHANGING_SP; + pause_msg_menu.unload = MESSAGE_UNLOAD_SP; + pause_msg_menu.waiting = MESSAGE_WAITING_SP; + pause_msg_menu.insert = MESSAGE_INSERT_SP; + pause_msg_menu.load = MESSAGE_LOAD_SP; + pause_msg_menu.purge = MESSAGE_PURGE_SP; + pause_msg_menu.resume = MESSAGE_RESUME_SP; + pause_msg_menu.heat = MESSAGE_HEAT_SP; + pause_msg_menu.heating = MESSAGE_HEATING_SP; + pause_msg_menu.option = MESSAGE_OPTION_SP; + pause_msg_menu.purgeMore = MESSAGE_PURGE_MORE_SP; + pause_msg_menu.continuePrint = MESSAGE_CONTINUE_PRINT_SP; + eeprom_menu.title = EEPROM_SETTINGS_TITLE_SP; + eeprom_menu.store = EEPROM_SETTINGS_STORE_SP; + eeprom_menu.read = EEPROM_SETTINGS_READ_SP; + eeprom_menu.revert = EEPROM_SETTINGS_REVERT_SP; + eeprom_menu.storeTips = EEPROM_STORE_TIPS_SP; + eeprom_menu.readTips = EEPROM_READ_TIPS_SP; + eeprom_menu.revertTips = EEPROM_REVERT_TIPS_SP; + break; + + #endif // if 1 + + case LANG_FRENCH: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_FR; + common_menu.text_back = BACK_TEXT_FR; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_FR; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_FR; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + + // + main_menu.title = TITLE_READYPRINT_FR; + main_menu.preheat = PREHEAT_TEXT_FR; + main_menu.move = MOVE_TEXT_FR; + main_menu.home = HOME_TEXT_FR; + main_menu.print = PRINT_TEXT_FR; + main_menu.extrude = EXTRUDE_TEXT_FR; + main_menu.leveling = LEVELING_TEXT_FR; + main_menu.autoleveling = AUTO_LEVELING_TEXT_FR; + main_menu.fan = FAN_TEXT_FR; + main_menu.set = SET_TEXT_FR; + main_menu.more = MORE_TEXT_FR; + main_menu.tool = TOOL_TEXT_FR; + // TOOL + tool_menu.title = TOOL_TEXT_FR; + tool_menu.preheat = TOOL_PREHEAT_FR; + tool_menu.extrude = TOOL_EXTRUDE_FR; + tool_menu.move = TOOL_MOVE_FR; + tool_menu.home = TOOL_HOME_FR; + tool_menu.leveling = TOOL_LEVELING_FR; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_FR; + tool_menu.filament = TOOL_FILAMENT_FR; + tool_menu.more = TOOL_MORE_FR; + // + preheat_menu.adjust_title = TITLE_ADJUST_FR; + preheat_menu.title = TITLE_PREHEAT_FR; + preheat_menu.add = ADD_TEXT_FR; + preheat_menu.dec = DEC_TEXT_FR; + preheat_menu.ext1 = EXTRUDER_1_TEXT_FR; + preheat_menu.ext2 = EXTRUDER_2_TEXT_FR; + preheat_menu.hotbed = HEATBED_TEXT_FR; + preheat_menu.off = CLOSE_TEXT_FR; + // + move_menu.title = MOVE_TEXT_FR; + // + home_menu.title = TITLE_HOME_FR; + home_menu.stopmove = HOME_STOPMOVE_FR; + // + file_menu.title = TITLE_CHOOSEFILE_FR; + file_menu.page_up = PAGE_UP_TEXT_FR; + file_menu.page_down = PAGE_DOWN_TEXT_FR; + // + extrude_menu.title = TITLE_EXTRUDE_FR; + extrude_menu.in = EXTRUDER_IN_TEXT_FR; + extrude_menu.out = EXTRUDER_OUT_TEXT_FR; + extrude_menu.ext1 = EXTRUDER_1_TEXT_FR; + extrude_menu.ext2 = EXTRUDER_2_TEXT_FR; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_FR; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_FR; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_FR; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_FR; + // + leveling_menu.title = TITLE_LEVELING_FR; + leveling_menu.position1 = LEVELING_POINT1_TEXT_FR; + leveling_menu.position2 = LEVELING_POINT2_TEXT_FR; + leveling_menu.position3 = LEVELING_POINT3_TEXT_FR; + leveling_menu.position4 = LEVELING_POINT4_TEXT_FR; + leveling_menu.position5 = LEVELING_POINT5_TEXT_FR; + // + set_menu.title = TITLE_SET_FR; + set_menu.filesys = FILESYS_TEXT_FR; + set_menu.wifi = WIFI_TEXT_FR; + set_menu.about = ABOUT_TEXT_FR; + set_menu.fan = FAN_TEXT_FR; + set_menu.filament = FILAMENT_TEXT_FR; + set_menu.breakpoint = BREAK_POINT_TEXT_FR; + set_menu.motoroff = MOTOR_OFF_TEXT_FR; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_FR; + set_menu.language = LANGUAGE_TEXT_FR; + set_menu.shutdown = SHUTDOWN_TEXT_FR; + set_menu.machine_para = MACHINE_PARA_FR; + set_menu.eepromSet = EEPROM_SETTINGS_FR; + more_menu.title = TITLE_MORE_FR; + more_menu.zoffset = ZOFFSET_FR; + // + filesys_menu.title = TITLE_FILESYS_FR; + filesys_menu.sd_sys = SD_CARD_TEXT_FR; + filesys_menu.usb_sys = U_DISK_TEXT_FR; + file_menu.file_loading = FILE_LOADING_FR; + file_menu.no_file = NO_FILE_FR; + file_menu.no_file_and_check = NO_FILE_FR;// NO_FILE_AND_CHECK_FR; + // WIFI + wifi_menu.title = WIFI_NAME_TEXT_FR; + // wifi_menu.key = WIFI_KEY_TEXT_FR; + // wifi_menu.ip = WIFI_IP_TEXT_FR; + // wifi_menu.state = WIFI_STA_TEXT_FR; + // wifi_menu.cloud = CLOSE_TEXT_FR; + wifi_menu.cloud = CLOUD_TEXT_FR; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_FR; + + cloud_menu.title = TITLE_CLOUD_TEXT_FR; + cloud_menu.bind = CLOUD_BINDED_FR; + cloud_menu.binded = CLOUD_BINDED_FR; + cloud_menu.unbind = CLOUD_UNBIND_FR; + cloud_menu.unbinding = CLOUD_UNBINDED_FR; + cloud_menu.disconnected = CLOUD_DISCONNECTED_FR; + cloud_menu.disable = CLOUD_DISABLE_FR; + // + about_menu.title = ABOUT_TEXT_FR; + about_menu.type = ABOUT_TYPE_TEXT_FR; + about_menu.version = ABOUT_VERSION_TEXT_FR; + about_menu.wifi = ABOUT_WIFI_TEXT_FR; + // + fan_menu.title = FAN_TEXT_FR; + fan_menu.add = FAN_ADD_TEXT_FR; + fan_menu.dec = FAN_DEC_TEXT_FR; + fan_menu.state = FAN_TIPS1_TEXT_FR; + // + filament_menu.title = TITLE_FILAMENT_FR; + filament_menu.in = FILAMENT_IN_TEXT_FR; + filament_menu.out = FILAMENT_OUT_TEXT_FR; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_FR; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_FR; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_FR; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_FR; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_FR; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR; + + // + language_menu.title = LANGUAGE_TEXT_FR; + + // + printing_menu.title = TITLE_PRINTING_FR; + printing_menu.option = PRINTING_OPERATION_FR; + printing_menu.stop = PRINTING_STOP_FR; + printing_menu.pause = PRINTING_PAUSE_FR; + printing_menu.resume = PRINTING_RESUME_FR; + + // + operation_menu.title = TITLE_OPERATION_FR; + operation_menu.pause = PRINTING_PAUSE_FR; + operation_menu.stop = PRINTING_STOP_FR; + operation_menu.temp = PRINTING_TEMP_FR; + operation_menu.fan = FAN_TEXT_FR; + operation_menu.extr = PRINTING_EXTRUDER_FR; + operation_menu.speed = PRINTING_CHANGESPEED_FR; + operation_menu.filament = FILAMENT_TEXT_FR; + operation_menu.more = PRINTING_MORE_FR; + operation_menu.move = PRINTING_MOVE_FR; + operation_menu.auto_off = AUTO_SHUTDOWN_FR; + operation_menu.manual_off = MANUAL_SHUTDOWN_FR; + // + pause_menu.title = TITLE_PAUSE_FR; + pause_menu.resume = PRINTING_RESUME_FR; + pause_menu.stop = PRINTING_STOP_FR; + pause_menu.extrude = PRINTING_EXTRUDER_FR; + pause_menu.move = PRINTING_MOVE_FR; + pause_menu.filament = FILAMENT_TEXT_FR; + pause_menu.more = PRINTING_MORE_FR; + + // + speed_menu.title = PRINTING_CHANGESPEED_FR; + speed_menu.add = ADD_TEXT_FR; + speed_menu.dec = DEC_TEXT_FR; + speed_menu.move = MOVE_SPEED_FR; + speed_menu.extrude = EXTRUDER_SPEED_FR; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_FR; + speed_menu.move_speed = MOVE_SPEED_STATE_FR; + // + printing_more_menu.fan = FAN_TEXT_FR; + printing_more_menu.auto_close = AUTO_SHUTDOWN_FR; + printing_more_menu.manual = MANUAL_SHUTDOWN_FR; + printing_more_menu.speed = PRINTING_CHANGESPEED_FR; + printing_more_menu.temp = PRINTING_TEMP_FR; + + // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_FR; + print_file_dialog_menu.cancle = DIALOG_CANCLE_FR; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_FR; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_FR; + print_file_dialog_menu.retry = DIALOG_RETRY_FR; + print_file_dialog_menu.stop = DIALOG_STOP_FR; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_FR; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_FR; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_FR; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_FR; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_FR; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_FR; + print_file_dialog_menu.reprint = DIALOG_REPRINT_FR; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_FR; + // ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_FR; + zoffset_menu.inc = ZOFFSET_INC_FR; + zoffset_menu.dec = ZOFFSET_DEC_FR; + + pause_msg_menu.pausing = MESSAGE_PAUSING_FR; + pause_msg_menu.changing = MESSAGE_CHANGING_FR; + pause_msg_menu.unload = MESSAGE_UNLOAD_FR; + pause_msg_menu.waiting = MESSAGE_WAITING_FR; + pause_msg_menu.insert = MESSAGE_INSERT_FR; + pause_msg_menu.load = MESSAGE_LOAD_FR; + pause_msg_menu.purge = MESSAGE_PURGE_FR; + pause_msg_menu.resume = MESSAGE_RESUME_FR; + pause_msg_menu.heat = MESSAGE_HEAT_FR; + pause_msg_menu.heating = MESSAGE_HEATING_FR; + pause_msg_menu.option = MESSAGE_OPTION_FR; + pause_msg_menu.purgeMore = MESSAGE_PURGE_MORE_FR; + pause_msg_menu.continuePrint = MESSAGE_CONTINUE_PRINT_FR; + eeprom_menu.title = EEPROM_SETTINGS_TITLE_FR; + eeprom_menu.store = EEPROM_SETTINGS_STORE_FR; + eeprom_menu.read = EEPROM_SETTINGS_READ_FR; + eeprom_menu.revert = EEPROM_SETTINGS_REVERT_FR; + eeprom_menu.storeTips = EEPROM_STORE_TIPS_FR; + eeprom_menu.readTips = EEPROM_READ_TIPS_FR; + eeprom_menu.revertTips = EEPROM_REVERT_TIPS_FR; + break; + + case LANG_ITALY: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_IT; + common_menu.text_back = BACK_TEXT_IT; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_IT; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_IT; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + + // + main_menu.title = TITLE_READYPRINT_IT; + main_menu.preheat = PREHEAT_TEXT_IT; + main_menu.move = MOVE_TEXT_IT; + main_menu.home = HOME_TEXT_IT; + main_menu.print = PRINT_TEXT_IT; + main_menu.extrude = EXTRUDE_TEXT_IT; + main_menu.leveling = LEVELING_TEXT_IT; + main_menu.autoleveling = AUTO_LEVELING_TEXT_IT; + main_menu.fan = FAN_TEXT_IT; + main_menu.set = SET_TEXT_IT; + main_menu.more = MORE_TEXT_IT; + main_menu.tool = TOOL_TEXT_IT; + // TOOL + tool_menu.title = TOOL_TEXT_IT; + tool_menu.preheat = TOOL_PREHEAT_IT; + tool_menu.extrude = TOOL_EXTRUDE_IT; + tool_menu.move = TOOL_MOVE_IT; + tool_menu.home = TOOL_HOME_IT; + tool_menu.leveling = TOOL_LEVELING_IT; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_IT; + tool_menu.filament = TOOL_FILAMENT_IT; + tool_menu.more = TOOL_MORE_IT; + // + preheat_menu.adjust_title = TITLE_ADJUST_IT; + preheat_menu.title = TITLE_PREHEAT_IT; + preheat_menu.add = ADD_TEXT_IT; + preheat_menu.dec = DEC_TEXT_IT; + preheat_menu.ext1 = EXTRUDER_1_TEXT_IT; + preheat_menu.ext2 = EXTRUDER_2_TEXT_IT; + preheat_menu.hotbed = HEATBED_TEXT_IT; + preheat_menu.off = CLOSE_TEXT_IT; + // + move_menu.title = MOVE_TEXT_IT; + // + home_menu.title = TITLE_HOME_IT; + home_menu.stopmove = HOME_STOPMOVE_IT; + // + file_menu.title = TITLE_CHOOSEFILE_IT; + file_menu.page_up = PAGE_UP_TEXT_IT; + file_menu.page_down = PAGE_DOWN_TEXT_IT; + file_menu.file_loading = FILE_LOADING_IT; + file_menu.no_file = NO_FILE_IT; + file_menu.no_file_and_check = NO_FILE_IT;// NO_FILE_AND_CHECK_IT; + // + extrude_menu.title = TITLE_EXTRUDE_IT; + extrude_menu.in = EXTRUDER_IN_TEXT_IT; + extrude_menu.out = EXTRUDER_OUT_TEXT_IT; + extrude_menu.ext1 = EXTRUDER_1_TEXT_IT; + extrude_menu.ext2 = EXTRUDER_2_TEXT_IT; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_IT; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_IT; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_IT; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_IT; + // + leveling_menu.title = TITLE_LEVELING_IT; + leveling_menu.position1 = LEVELING_POINT1_TEXT_IT; + leveling_menu.position2 = LEVELING_POINT2_TEXT_IT; + leveling_menu.position3 = LEVELING_POINT3_TEXT_IT; + leveling_menu.position4 = LEVELING_POINT4_TEXT_IT; + leveling_menu.position5 = LEVELING_POINT5_TEXT_IT; + // + set_menu.title = TITLE_SET_IT; + set_menu.filesys = FILESYS_TEXT_IT; + set_menu.wifi = WIFI_TEXT_IT; + set_menu.about = ABOUT_TEXT_IT; + set_menu.fan = FAN_TEXT_IT; + set_menu.filament = FILAMENT_TEXT_IT; + set_menu.breakpoint = BREAK_POINT_TEXT_IT; + set_menu.motoroff = MOTOR_OFF_TEXT_IT; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_IT; + set_menu.language = LANGUAGE_TEXT_IT; + set_menu.shutdown = SHUTDOWN_TEXT_IT; + set_menu.machine_para = MACHINE_PARA_IT; + set_menu.eepromSet = EEPROM_SETTINGS_IT; + more_menu.title = TITLE_MORE_IT; + more_menu.zoffset = ZOFFSET_IT; + // + filesys_menu.title = TITLE_FILESYS_IT; + filesys_menu.sd_sys = SD_CARD_TEXT_IT; + filesys_menu.usb_sys = U_DISK_TEXT_IT; + + // WIFI + wifi_menu.title = WIFI_NAME_TEXT_IT; + // wifi_menu.key = WIFI_KEY_TEXT_IT; + // wifi_menu.ip = WIFI_IP_TEXT_IT; + // wifi_menu.state = WIFI_STA_TEXT_IT; + wifi_menu.cloud = CLOSE_TEXT_IT; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_IT; + + cloud_menu.title = TITLE_CLOUD_TEXT_IT; + cloud_menu.bind = CLOUD_BINDED_IT; + cloud_menu.binded = CLOUD_BINDED_IT; + cloud_menu.unbind = CLOUD_UNBIND_IT; + cloud_menu.unbinding = CLOUD_UNBINDED_IT; + cloud_menu.disconnected = CLOUD_DISCONNECTED_IT; + cloud_menu.disable = CLOUD_DISABLE_IT; + // + about_menu.title = ABOUT_TEXT_IT; + about_menu.type = ABOUT_TYPE_TEXT_IT; + about_menu.version = ABOUT_VERSION_TEXT_IT; + about_menu.wifi = ABOUT_WIFI_TEXT_IT; + // + fan_menu.title = FAN_TEXT_IT; + fan_menu.add = FAN_ADD_TEXT_IT; + fan_menu.dec = FAN_DEC_TEXT_IT; + fan_menu.state = FAN_TIPS1_TEXT_IT; + // + filament_menu.title = TITLE_FILAMENT_IT; + filament_menu.in = FILAMENT_IN_TEXT_IT; + filament_menu.out = FILAMENT_OUT_TEXT_IT; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_IT; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_IT; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_IT; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_IT; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_IT; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_IT; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_IT; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_IT; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT; + + // + language_menu.title = LANGUAGE_TEXT_IT; + + // + printing_menu.title = TITLE_PRINTING_IT; + printing_menu.option = PRINTING_OPERATION_IT; + printing_menu.stop = PRINTING_STOP_IT; + printing_menu.pause = PRINTING_PAUSE_IT; + printing_menu.resume = PRINTING_RESUME_IT; + + // + operation_menu.title = TITLE_OPERATION_IT; + operation_menu.pause = PRINTING_PAUSE_IT; + operation_menu.stop = PRINTING_STOP_IT; + operation_menu.temp = PRINTING_TEMP_IT; + operation_menu.fan = FAN_TEXT_IT; + operation_menu.extr = PRINTING_EXTRUDER_IT; + operation_menu.speed = PRINTING_CHANGESPEED_IT; + operation_menu.filament = FILAMENT_TEXT_IT; + operation_menu.more = PRINTING_MORE_IT; + operation_menu.move = PRINTING_MOVE_IT; + operation_menu.auto_off = AUTO_SHUTDOWN_IT; + operation_menu.manual_off = MANUAL_SHUTDOWN_IT; + // + pause_menu.title = TITLE_PAUSE_IT; + pause_menu.resume = PRINTING_RESUME_IT; + pause_menu.stop = PRINTING_STOP_IT; + pause_menu.extrude = PRINTING_EXTRUDER_IT; + pause_menu.move = PRINTING_MOVE_IT; + pause_menu.filament = FILAMENT_TEXT_IT; + pause_menu.more = PRINTING_MORE_IT; + + // + speed_menu.title = PRINTING_CHANGESPEED_IT; + speed_menu.add = ADD_TEXT_IT; + speed_menu.dec = DEC_TEXT_IT; + speed_menu.move = MOVE_SPEED_IT; + speed_menu.extrude = EXTRUDER_SPEED_IT; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_IT; + speed_menu.move_speed = MOVE_SPEED_STATE_IT; + // + printing_more_menu.fan = FAN_TEXT_IT; + printing_more_menu.auto_close = AUTO_SHUTDOWN_IT; + printing_more_menu.manual = MANUAL_SHUTDOWN_IT; + printing_more_menu.temp = PRINTING_TEMP_IT; + printing_more_menu.speed = PRINTING_CHANGESPEED_IT; + + // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_IT; + print_file_dialog_menu.cancle = DIALOG_CANCLE_IT; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_IT; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_IT; + print_file_dialog_menu.retry = DIALOG_RETRY_IT; + print_file_dialog_menu.stop = DIALOG_STOP_IT; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_IT; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_IT; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_IT; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_IT; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_IT; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_IT; + print_file_dialog_menu.reprint = DIALOG_REPRINT_IT; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_IT; + // ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_IT; + zoffset_menu.inc = ZOFFSET_INC_IT; + zoffset_menu.dec = ZOFFSET_DEC_IT; + + pause_msg_menu.pausing = MESSAGE_PAUSING_IT; + pause_msg_menu.changing = MESSAGE_CHANGING_IT; + pause_msg_menu.unload = MESSAGE_UNLOAD_IT; + pause_msg_menu.waiting = MESSAGE_WAITING_IT; + pause_msg_menu.insert = MESSAGE_INSERT_IT; + pause_msg_menu.load = MESSAGE_LOAD_IT; + pause_msg_menu.purge = MESSAGE_PURGE_IT; + pause_msg_menu.resume = MESSAGE_RESUME_IT; + pause_msg_menu.heat = MESSAGE_HEAT_IT; + pause_msg_menu.heating = MESSAGE_HEATING_IT; + pause_msg_menu.option = MESSAGE_OPTION_IT; + pause_msg_menu.purgeMore = MESSAGE_PURGE_MORE_IT; + pause_msg_menu.continuePrint = MESSAGE_CONTINUE_PRINT_IT; + eeprom_menu.title = EEPROM_SETTINGS_TITLE_IT; + eeprom_menu.store = EEPROM_SETTINGS_STORE_IT; + eeprom_menu.read = EEPROM_SETTINGS_READ_IT; + eeprom_menu.revert = EEPROM_SETTINGS_REVERT_IT; + eeprom_menu.storeTips = EEPROM_STORE_TIPS_IT; + eeprom_menu.readTips = EEPROM_READ_TIPS_IT; + eeprom_menu.revertTips = EEPROM_REVERT_TIPS_IT; + break; + + #endif // if 1 + + default: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_EN; + common_menu.text_back = BACK_TEXT_EN; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_EN; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_EN; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + // + main_menu.title = TITLE_READYPRINT_EN; + main_menu.preheat = PREHEAT_TEXT_EN; + main_menu.move = MOVE_TEXT_EN; + main_menu.home = HOME_TEXT_EN; + main_menu.print = PRINT_TEXT_EN; + main_menu.extrude = EXTRUDE_TEXT_EN; + main_menu.leveling = LEVELING_TEXT_EN; + main_menu.autoleveling = AUTO_LEVELING_TEXT_EN; + main_menu.fan = FAN_TEXT_EN; + main_menu.set = SET_TEXT_EN; + main_menu.more = MORE_TEXT_EN; + main_menu.tool = TOOL_TEXT_EN; + // TOOL + tool_menu.title = TOOL_TEXT_EN; + tool_menu.preheat = TOOL_PREHEAT_EN; + tool_menu.extrude = TOOL_EXTRUDE_EN; + tool_menu.move = TOOL_MOVE_EN; + tool_menu.home = TOOL_HOME_EN; + tool_menu.leveling = TOOL_LEVELING_EN; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_EN; + tool_menu.filament = TOOL_FILAMENT_EN; + tool_menu.more = TOOL_MORE_EN; + // + preheat_menu.adjust_title = TITLE_ADJUST_EN; + preheat_menu.title = TITLE_PREHEAT_EN; + preheat_menu.add = ADD_TEXT_EN; + preheat_menu.dec = DEC_TEXT_EN; + preheat_menu.ext1 = EXTRUDER_1_TEXT_EN; + preheat_menu.ext2 = EXTRUDER_2_TEXT_EN; + preheat_menu.hotbed = HEATBED_TEXT_EN; + preheat_menu.off = CLOSE_TEXT_EN; + // + move_menu.title = TITLE_MOVE_EN; + // + home_menu.title = TITLE_HOME_EN; + home_menu.stopmove = HOME_STOPMOVE_EN; + // + file_menu.title = TITLE_CHOOSEFILE_EN; + file_menu.page_up = PAGE_UP_TEXT_EN; + file_menu.page_down = PAGE_DOWN_TEXT_EN; + file_menu.file_loading = FILE_LOADING_EN; + file_menu.no_file = NO_FILE_EN; + file_menu.no_file_and_check = NO_FILE_EN;// NO_FILE_AND_CHECK_EN; + // + extrude_menu.title = TITLE_EXTRUDE_EN; + extrude_menu.in = EXTRUDER_IN_TEXT_EN; + extrude_menu.out = EXTRUDER_OUT_TEXT_EN; + extrude_menu.ext1 = EXTRUDER_1_TEXT_EN; + extrude_menu.ext2 = EXTRUDER_2_TEXT_EN; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_EN; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_EN; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_EN; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_EN; + // + leveling_menu.title = TITLE_LEVELING_EN; + leveling_menu.position1 = LEVELING_POINT1_TEXT_EN; + leveling_menu.position2 = LEVELING_POINT2_TEXT_EN; + leveling_menu.position3 = LEVELING_POINT3_TEXT_EN; + leveling_menu.position4 = LEVELING_POINT4_TEXT_EN; + leveling_menu.position5 = LEVELING_POINT5_TEXT_EN; + // + set_menu.title = TITLE_SET_EN; + set_menu.filesys = FILESYS_TEXT_EN; + set_menu.wifi = WIFI_TEXT_EN; + set_menu.about = ABOUT_TEXT_EN; + set_menu.fan = FAN_TEXT_EN; + set_menu.filament = FILAMENT_TEXT_EN; + set_menu.breakpoint = BREAK_POINT_TEXT_EN; + set_menu.motoroff = MOTOR_OFF_TEXT_EN; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_EN; + set_menu.language = LANGUAGE_TEXT_EN; + set_menu.shutdown = SHUTDOWN_TEXT_EN; + set_menu.machine_para = MACHINE_PARA_EN; + set_menu.eepromSet = EEPROM_SETTINGS_EN; + // + more_menu.title = TITLE_MORE_EN; + more_menu.zoffset = ZOFFSET_EN; + // + filesys_menu.title = TITLE_FILESYS_EN; + filesys_menu.sd_sys = SD_CARD_TEXT_EN; + filesys_menu.usb_sys = U_DISK_TEXT_EN; + // WIFI + wifi_menu.title = WIFI_TEXT; + // wifi_menu.key = WIFI_KEY_TEXT_EN; + // wifi_menu.ip = WIFI_IP_TEXT_EN; + // wifi_menu.state = WIFI_STA_TEXT_EN; + wifi_menu.cloud = CLOUD_TEXT_EN; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_EN; + + cloud_menu.title = TITLE_CLOUD_TEXT_EN; + cloud_menu.bind = CLOUD_BINDED_EN; + cloud_menu.binded = CLOUD_BINDED_EN; + cloud_menu.unbind = CLOUD_UNBIND_EN; + cloud_menu.unbinding = CLOUD_UNBINDED_EN; + cloud_menu.disconnected = CLOUD_DISCONNECTED_EN; + cloud_menu.disable = CLOUD_DISABLE_EN; + // + about_menu.title = TITLE_ABOUT_EN; + about_menu.type = ABOUT_TYPE_TEXT_EN; + about_menu.version = ABOUT_VERSION_TEXT_EN; + about_menu.wifi = ABOUT_WIFI_TEXT_EN; + // + fan_menu.title = TITLE_FAN_EN; + fan_menu.add = FAN_ADD_TEXT_EN; + fan_menu.dec = FAN_DEC_TEXT_EN; + fan_menu.state = FAN_TIPS1_TEXT_EN; + // + filament_menu.title = TITLE_FILAMENT_EN; + filament_menu.in = FILAMENT_IN_TEXT_EN; + filament_menu.out = FILAMENT_OUT_TEXT_EN; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_EN; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_EN; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_EN; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_EN; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_EN; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN; + + // + language_menu.title = TITLE_LANGUAGE_EN; + language_menu.next = PAGE_DOWN_TEXT_EN; + language_menu.up = PAGE_UP_TEXT_EN; + // + printing_menu.title = TITLE_PRINTING_EN; + printing_menu.option = PRINTING_OPERATION_EN; + printing_menu.stop = PRINTING_STOP_EN; + printing_menu.pause = PRINTING_PAUSE_EN; + printing_menu.resume = PRINTING_RESUME_EN; + + // + operation_menu.title = TITLE_OPERATION_EN; + operation_menu.pause = PRINTING_PAUSE_EN; + operation_menu.stop = PRINTING_STOP_EN; + operation_menu.temp = PRINTING_TEMP_EN; + operation_menu.fan = FAN_TEXT_EN; + operation_menu.extr = PRINTING_EXTRUDER_EN; + operation_menu.speed = PRINTING_CHANGESPEED_EN; + operation_menu.filament = FILAMENT_TEXT_EN; + operation_menu.more = PRINTING_MORE_EN; + operation_menu.move = PRINTING_MOVE_EN; + operation_menu.auto_off = AUTO_SHUTDOWN_EN; + operation_menu.manual_off = MANUAL_SHUTDOWN_EN; + // + pause_menu.title = TITLE_PAUSE_EN; + pause_menu.resume = PRINTING_RESUME_EN; + pause_menu.stop = PRINTING_STOP_EN; + pause_menu.extrude = PRINTING_EXTRUDER_EN; + pause_menu.move = PRINTING_MOVE_EN; + pause_menu.filament = FILAMENT_TEXT_EN; + pause_menu.more = PRINTING_MORE_EN; + + // + speed_menu.title = TITLE_CHANGESPEED_EN; + speed_menu.add = ADD_TEXT_EN; + speed_menu.dec = DEC_TEXT_EN; + speed_menu.move = MOVE_SPEED_EN; + speed_menu.extrude = EXTRUDER_SPEED_EN; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_EN; + speed_menu.move_speed = MOVE_SPEED_STATE_EN; + // + printing_more_menu.title = TITLE_MORE_EN; + printing_more_menu.fan = FAN_TEXT_EN; + printing_more_menu.auto_close = AUTO_SHUTDOWN_EN; + printing_more_menu.manual = MANUAL_SHUTDOWN_EN; + printing_more_menu.speed = PRINTING_CHANGESPEED_EN; + printing_more_menu.temp = PRINTING_TEMP_EN; + + // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_EN; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_EN; + print_file_dialog_menu.cancle = DIALOG_CANCLE_EN; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_EN; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_EN; + print_file_dialog_menu.retry = DIALOG_RETRY_EN; + print_file_dialog_menu.stop = DIALOG_STOP_EN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_EN; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_EN; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_EN; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_EN; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_EN; + print_file_dialog_menu.reprint = DIALOG_REPRINT_EN; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_EN; + // ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_EN; + zoffset_menu.inc = ZOFFSET_INC_EN; + zoffset_menu.dec = ZOFFSET_DEC_EN; + + pause_msg_menu.pausing = MESSAGE_PAUSING_EN; + pause_msg_menu.changing = MESSAGE_CHANGING_EN; + pause_msg_menu.unload = MESSAGE_UNLOAD_EN; + pause_msg_menu.waiting = MESSAGE_WAITING_EN; + pause_msg_menu.insert = MESSAGE_INSERT_EN; + pause_msg_menu.load = MESSAGE_LOAD_EN; + pause_msg_menu.purge = MESSAGE_PURGE_EN; + pause_msg_menu.resume = MESSAGE_RESUME_EN; + pause_msg_menu.heat = MESSAGE_HEAT_EN; + pause_msg_menu.heating = MESSAGE_HEATING_EN; + pause_msg_menu.option = MESSAGE_OPTION_EN; + pause_msg_menu.purgeMore = MESSAGE_PURGE_MORE_EN; + pause_msg_menu.continuePrint = MESSAGE_CONTINUE_PRINT_EN; + eeprom_menu.title = EEPROM_SETTINGS_TITLE_EN; + eeprom_menu.store = EEPROM_SETTINGS_STORE_EN; + eeprom_menu.read = EEPROM_SETTINGS_READ_EN; + eeprom_menu.revert = EEPROM_SETTINGS_REVERT_EN; + eeprom_menu.storeTips = EEPROM_STORE_TIPS_EN; + eeprom_menu.readTips = EEPROM_READ_TIPS_EN; + eeprom_menu.revertTips = EEPROM_REVERT_TIPS_EN; + break; + } +} + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h new file mode 100644 index 0000000000..5851009356 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h @@ -0,0 +1,848 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 "tft_Language_en.h" +#include "tft_Language_s_cn.h" +#include "tft_Language_t_cn.h" +#include "tft_Language_ru.h" +#include "tft_Language_fr.h" +#include "tft_Language_sp.h" +#include "tft_Language_it.h" + +extern void disp_language_init(); + +#define LANG_SIMPLE_CHINESE 1 +#define LANG_COMPLEX_CHINESE 2 +#define LANG_ENGLISH 3 +#define LANG_JAPAN 4 +#define LANG_GERMAN 5 +#define LANG_FRENCH 6 +#define LANG_RUSSIAN 7 +#define LANG_KOREAN 8 +#define LANG_TURKISH 9 +#define LANG_SPANISH 10 +#define LANG_GREEK 11 +#define LANG_ITALY 12 +#define LANG_PORTUGUESE 13 + +#define MULTI_LANGUAGE_ENABLE 1 +#define MULTI_LANGUAGE_DISABLE 0 + +typedef struct machine_common_disp{ + const char *default_value; + + const char *next; + const char *previous; + + const char *MachineConfigTitle; + const char *MachineType; + const char *Stroke; + const char *HomeDir; + const char *EndStopType; + const char *FilamentConf; + const char *LevelingConf; + + const char *MachineTypeConfTitle; + const char *xyz; + const char *delta; + const char *corexy; + + const char *StrokeConfTitle; + const char *xStroke; + const char *yStroke; + const char *zStroke; + + const char *xmin; + const char *ymin; + const char *zmin; + + const char *HomeDirConfTitle; + const char *xHomeDir; + const char *yHomeDir; + const char *zHomeDir; + const char *min; + const char *max; + + const char *EndstopConfTitle; + const char *xEndstop_min; + const char *yEndstop_min; + const char *zEndstop_min; + const char *xEndstop_max; + const char *yEndstop_max; + const char *zEndstop_max; + const char *FilamentEndstop; + const char *LevelingEndstop; + const char *opened; + const char *closed; + + const char *FilamentConfTitle; + const char *InTemperature; + const char *InLength; + const char *InSpeed; + const char *OutTemperature; + const char *OutLength; + const char *OutSpeed; + + const char *LevelingParaConfTitle; + const char *LevelingParaConf; + const char *DeltaLevelConf; + const char *XYZLevelconf; + + const char *LevelingSubConfTitle; + const char *AutoLevelEnable; + const char *BLtouchEnable; + const char *ProbePort; + const char *ProbeXoffset; + const char *ProbeYoffset; + const char *ProbeZoffset; + const char *ProbeXYspeed; + const char *ProbeZspeed; + const char *enable; + const char *disable; + const char *z_min; + const char *z_max; + + const char *LevelingSubDeltaConfTitle; + const char *MachineRadius; + const char *DiagonalRod; + const char *PrintableRadius; + const char *DeltaHeight; + const char *SmoothRodOffset; + const char *EffectorOffset; + const char *CalibrationRadius; + + const char *LevelingSubXYZConfTitle; + //const char *Level_positon1; + //const char *Level_positon2; + //const char *Level_positon3; + //const char *Level_positon4; + + const char *TemperatureConfTitle; + const char *NozzleConf; + const char *HotBedConf; + const char *PreheatTemperConf; + + const char *NozzleCnt; + const char *NozzleConfTitle; + const char *NozzleType; + const char *NozzleAdjustType; + const char *NozzleMinTemperature; + const char *NozzleMaxTemperature; + const char *Extrude_Min_Temper; + + const char *HotbedEnable; + const char *HotbedConfTitle; + const char *HotbedAjustType; + const char *HotbedMinTemperature; + const char *HotbedMaxTemperature; + + const char *MotorConfTitle; + const char *MaxFeedRateConf; + const char *AccelerationConf; + const char *JerkConf; + const char *StepsConf; + const char *MotorDirConf; + const char *HomeFeedRateConf; + const char *TMCcurrentConf; + const char *TMCStepModeConf; + + const char *MaxFeedRateConfTitle; + const char *XMaxFeedRate; + const char *YMaxFeedRate; + const char *ZMaxFeedRate; + const char *E0MaxFeedRate; + const char *E1MaxFeedRate; + + const char *AccelerationConfTitle; + const char *PrintAcceleration; + const char *RetractAcceleration; + const char *TravelAcceleration; + const char *X_Acceleration; + const char *Y_Acceleration; + const char *Z_Acceleration; + const char *E0_Acceleration; + const char *E1_Acceleration; + + const char *JerkConfTitle; + const char *X_Jerk; + const char *Y_Jerk; + const char *Z_Jerk; + const char *E_Jerk; + + const char *StepsConfTitle; + const char *X_Steps; + const char *Y_Steps; + const char *Z_Steps; + const char *E0_Steps; + const char *E1_Steps; + + const char *TmcCurrentConfTitle; + const char *X_Current; + const char *Y_Current; + const char *Z_Current; + const char *E0_Current; + const char *E1_Current; + + const char *TmcStepModeConfTitle; + const char *X_StepMode; + const char *Y_StepMode; + const char *Z_StepMode; + const char *E0_StepMode; + const char *E1_StepMode; + + const char *MotorDirConfTitle; + const char *X_MotorDir; + const char *Y_MotorDir; + const char *Z_MotorDir; + const char *E0_MotorDir; + const char *E1_MotorDir; + const char *Invert_1; + const char *Invert_0; + + const char *HomeFeedRateConfTitle; + const char *XY_HomeFeedRate; + const char *Y_HomeFeedRate; + const char *Z_HomeFeedRate; + + const char *AdvancedConfTitle; + const char *PwrOffDection; + const char *PwrOffAfterPrint; + const char *HaveUps; + const char *Z2andZ2Endstop; + const char *EnablePinsInvert; + const char *PausePosition; + + const char *Z2ConfTitle; + const char *Z2Enable; + const char *Z2EndstopEnable; + const char *Z2Port; + + const char *EnablePinsInvertTitle; + const char *XInvert; + const char *YInvert; + const char *ZInvert; + const char *EInvert; + + const char *key_1; + const char *key_2; + const char *key_3; + const char *key_4; + const char *key_5; + const char *key_6; + const char *key_7; + const char *key_8; + const char *key_9; + const char *key_0; + const char *key_point; + const char *key_back; + const char *key_reset; + const char *key_confirm; + const char *negative; + const char *low_level; + const char *high_level; + + const char *PausePosText; + const char *xPos; + const char *yPos; + const char *zPos; + +} machine_common_def; + +extern machine_common_def machine_menu; + +typedef struct common_menu_disp { + const char *text_back; + const char *dialog_confirm_title; + const char *close_machine_tips; + const char *unbind_printer_tips; + const char *print_special_title; + const char *pause_special_title; + const char *operate_special_title; + const char *next; + const char *previous; +} common_menu_def; + +extern common_menu_def common_menu; + +typedef struct main_menu_disp { + const char *title; + const char *preheat; + const char *move; + const char *home; + const char *print; + const char *extrude; + const char *leveling; + const char *autoleveling; + const char *fan; + const char *set; + const char *tool; + const char *more; + const char *machine_para; +} main_menu_def; + +extern main_menu_def main_menu; + +typedef struct preheat_menu_disp { + const char *adjust_title; + const char *title; + const char *add; + const char *dec; + const char *ext1; + const char *ext2; + const char *hotbed; + const char *off; + const char *step_1c; + const char *step_5c; + const char *step_10c; + const char *back; + + const char *value_state; + + const char *dialog_tips; + +} preheat_menu_def; + +extern preheat_menu_def preheat_menu; + +typedef struct move_menu_disp { + const char *title; + const char *x_add; + const char *x_dec; + const char *y_add; + const char *y_dec; + const char *z_add; + const char *z_dec; + const char *step_001mm; + const char *step_005mm; + const char *step_01mm; + const char *step_1mm; + const char *step_10mm; + const char *back; +} move_menu_def; + +extern move_menu_def move_menu; + +typedef struct home_menu_disp { + const char *title; + const char *home_all; + const char *home_x; + const char *home_y; + const char *home_z; + const char *stopmove; + const char *back; +} home_menu_def; + +extern home_menu_def home_menu; + +typedef struct file_menu_disp { + const char *title; + const char *page_up; + const char *page_down; + const char *back; + + const char *file_loading; + const char *no_file; + const char *no_file_and_check; + +} file_menu_def; + +extern file_menu_def file_menu; + +typedef struct extrude_menu_disp { + const char *title; + const char *in; + const char *out; + const char *ext1; + const char *ext2; + const char *step_1mm; + const char *step_5mm; + const char *step_10mm; + const char *low; + const char *normal; + const char *high; + const char *back; + + const char *count_value_mm; + const char *count_value_cm; + const char *count_value_m; + const char *temp_value; + const char *temper_text; +} extrude_menu_def; + +extern extrude_menu_def extrude_menu; + +typedef struct leveling_menu_disp { + const char *title; + const char *position1; + const char *position2; + const char *position3; + const char *position4; + const char *position5; + + char *back; +} leveling_menu_def; + +extern leveling_menu_def leveling_menu; + +typedef struct set_menu_disp { + const char *title; + const char *filesys; + const char *wifi; + const char *about; + const char *fan; + const char *filament; + const char *breakpoint; + const char *motoroff; + const char *motoroffXY; + const char *shutdown; + const char *language; + const char *machine_para; + const char *eepromSet; + const char *back; +} set_menu_def; + +extern set_menu_def set_menu; + +typedef struct filesys_menu_disp { + const char *title; + const char *filesys; + const char *sd_sys; + const char *usb_sys; + const char *back; +} filesys_menu_def; + +extern filesys_menu_def filesys_menu; + +typedef struct more_menu_disp { + const char *title; + const char *zoffset; + const char *back; +} more_menu_def; + +extern more_menu_def more_menu; + +typedef struct wifi_menu_disp { + const char *title; + const char *ip; + const char *wifi; + const char *key; + const char *state_ap; + const char *state_sta; + const char *cloud; + const char *connected; + const char *disconnected; + const char *exception; + const char *back; + const char *reconnect; +} wifi_menu_def; + +extern wifi_menu_def wifi_menu; + +typedef struct cloud_menu_disp { + const char *title; + const char *unbind; + const char *unbinding; + const char *unbinded; + const char *bind; + const char *binding; + const char *binded; + const char *disable; + const char *disconnected; + const char *back; + const char *unbind_printer_tips; +} cloud_menu_def; + +extern cloud_menu_def cloud_menu; + +typedef struct about_menu_disp { + const char *title; + const char *type_name; + const char *firmware_v; + const char *type; + const char *version; + const char *wifi; + const char *type_robin; + const char *type_robin_mini; + const char *back; +} about_menu_def; + +extern about_menu_def about_menu; + +typedef struct fan_menu_disp { + const char *title; + const char *add; + const char *dec; + const char *full; + const char *half; + const char *off; + const char *back; + + const char *state; + const char *state_value; +} fan_menu_def; + +extern fan_menu_def fan_menu; + +typedef struct filament_menu_disp { + const char *title; + const char *in; + const char *out; + const char *ext1; + const char *ext2; + const char *back; + const char *stat_temp; + const char *ready_replace; + const char *replacing; + const char *loading; + const char *unloading; + const char *heating; + const char *complete_and_back; + const char *filament_dialog_load_heat; + const char *filament_dialog_unload_heat; + const char *filament_dialog_load_heat_confirm; + const char *filament_dialog_unload_heat_confirm; + const char *filament_dialog_loading; + const char *filament_dialog_unloading; + const char *filament_dialog_load_completed; + const char *filament_dialog_unload_completed; + const char *filament_dialog_ok; + const char *filament_dialog_back; +} filament_menu_def; + +extern filament_menu_def filament_menu; + +typedef struct language_menu { + const char *title; + const char *chinese_s; + const char *chinese_t; + const char *english; + const char *russian; + const char *japan; + const char *italy; + const char *german; + const char *spanish; + const char *korean; + const char *french; + const char *brazil; + const char *portuguese; + const char *next; + const char *up; + const char *back; +} language_menu_def; + +extern language_menu_def language_menu; + +typedef struct printing_menu_disp { + const char *title; + const char *option; + const char *temp1; + const char *temp2; + const char *bed_temp; + const char *fan_speed; + const char *pause; + const char *resume; + const char *stop; +} printing_menu_def; + +extern printing_menu_def printing_menu; + +typedef struct operation_menu_disp { + const char *title; + const char *pause; + const char *stop; + const char *temp; + const char *fan; + const char *filament; + const char *extr; + const char *speed; + const char *move; + const char *more; + const char *auto_off; + const char *manual_off; + const char *back; + const char *babystep; +} operation_menu_def; + +extern operation_menu_def operation_menu; + +typedef struct pause_menu_disp { + const char *title; + const char *resume; + const char *stop; + const char *extrude; + const char *move; + const char *filament; + const char *more; +} pause_menu_def; + +extern pause_menu_def pause_menu; + +typedef struct speed_menu_disp { + const char *title; + const char *add; + const char *dec; + const char *extrude; + const char *move; + const char *step_1percent; + const char *step_5percent; + const char *step_10percent; + const char *back; + const char *move_speed; + const char *extrude_speed; +} speed_menu_def; + +extern speed_menu_def speed_menu; + +typedef struct printing_more_menu_disp { + const char *title; + const char *fan; + const char *auto_close; + const char *manual; + const char *temp; + const char *speed; + const char *back; +} printing_more_menu_def; + +extern printing_more_menu_def printing_more_menu; + +typedef struct dialog_menu_disp { + const char *confirm_title; + + const char *error1_repint_no_file; + const char *error2_communication_fail; + const char *error3_filename_too_long; + const char *error4_no_file; + const char *error5_check_filesys; + + const char *tip1_print_file; + const char *tip2_stop_file; +} dialog_menu_def; + +extern dialog_menu_def dialog_menu; + +typedef struct print_file_dialog_disp { + const char *title; + const char *confirm; + const char *cancle; + const char *print_file; + const char *cancle_print; + const char *retry; + const char *stop; + const char *no_file_print_tips; + const char *print_from_breakpoint; + const char *file_name_too_long_error; + const char *close_machine_error; + const char *filament_no_press; + const char *print_finish; + const char *print_time; + const char *reprint; + const char *wifi_enable_tips; +} print_file_dialog_menu_def; + +extern print_file_dialog_menu_def print_file_dialog_menu; + +typedef struct zoffset_menu_disp { + const char *title; + const char *inc; + const char *dec; + const char *step001; + const char *step01; + const char *step1; + const char *back; +} zoffset_menu_def; + +extern zoffset_menu_def zoffset_menu; + +typedef struct tool_menu_disp { + const char *title; + const char *preheat; + const char *extrude; + const char *move; + const char *home; + const char *leveling; + const char *autoleveling; + const char *filament; + const char *more; + const char *back; +} tool_menu_def; + +extern tool_menu_def tool_menu; + +typedef struct MachinePara_menu_disp { + const char *title; + const char *MachineSetting; + const char *TemperatureSetting; + const char *MotorSetting; + const char *AdvanceSetting; + //const char *back; +} MachinePara_menu_def; + +extern MachinePara_menu_def MachinePara_menu; + +typedef struct MachineSettings_menu_disp { + const char *title; + const char *Machine; + const char *Stroke; + const char *HomeDir; + const char *EndStopType; + const char *filamet; + const char *leveling; + const char *back; +} MachineSettings_menu_def; + +extern MachineSettings_menu_def MachineSettings_menu; + +typedef struct TemperatureSettings_menu_disp { + const char *title; + const char *nozzle; + const char *hotbed; + const char *preheat; + const char *back; +} TemperatureSettings_menu_def; + +extern TemperatureSettings_menu_def TemperatureSettings_menu; + +typedef struct pause_msg_disp { + const char *pausing; + const char *changing; + const char *unload; + const char *waiting; + const char *insert; + const char *load; + const char *purge; + const char *resume; + const char *heat; + const char *heating; + const char *option; + const char *purgeMore; + const char *continuePrint; +} pause_msg_def; + +extern pause_msg_def pause_msg_menu; + +typedef struct eeprom_disp{ + const char *title; + const char *store; + const char *read; + const char *revert; + const char *storeTips; + const char *readTips; + const char *revertTips; +} eeprom_def; + +extern eeprom_def eeprom_menu; +/*****************************************/ +//********************************************// +//#if defined(TFT70) +// +//#elif defined(TFT35) +#define TEXT_VALUE "%d/%d" +//#endif + +#define TEXT_VALUE_T ": %d℃" +#define TEXT_VALUE_mm ": %dmm" +#define TEXT_VALUE_cm ": %dcm" +#define TEXT_VALUE_m ": %dm" + +#define TEMP_UNIT_SYBOL "%d℃" +#define FLOAT_TEMP_UNIT_SYBOL "%.1f℃" + +#define TEXT_1C "1℃" +#define TEXT_5C "5℃" +#define TEXT_10C "10℃" + +#define AXIS_X_ADD_TEXT "X+" +#define AXIS_X_DEC_TEXT "X-" +#define AXIS_Y_ADD_TEXT "Y+" +#define AXIS_Y_DEC_TEXT "Y-" +#define AXIS_Z_ADD_TEXT "Z+" +#define AXIS_Z_DEC_TEXT "Z-" +#define TEXT_001MM "0.01mm" +#define TEXT_005MM "0.05mm" +#define TEXT_01MM "0.1mm" +#define TEXT_1MM "1mm" +#define TEXT_10MM "10mm" + +#define EXTRUDE_1MM_TEXT "1mm" +#define EXTRUDE_5MM_TEXT "5mm" +#define EXTRUDE_10MM_TEXT "10mm" + +#define STEP_1PERCENT "1%" +#define STEP_5PERCENT "5%" +#define STEP_10PERCENT "10%" + +#define LANGUAGE_S_CN "简体" +#define LANGUAGE_T_CN "繁体" +#define LANGUAGE_EN "English" +#define LANGUAGE_JP "日本語" +#define LANGUAGE_GE "Deutsch" +#define LANGUAGE_FR "français" +#define LANGUAGE_IT "Italiano" +#define LANGUAGE_PR "português" +#define LANGUAGE_KR "Korean" +#define LANGUAGE_BR "Brazil" +#define LANGUAGE_RU "русский" +#define LANGUAGE_SP "español" + +#define HOME_X_TEXT "X" +#define HOME_Y_TEXT "Y" +#define HOME_Z_TEXT "Z" +#define HOME_ALL_TEXT "All" +//#if defined(MKS_ROBIN_NANO) +#define ABOUT_TYPE_TEXT "MKS Robin Pro" +//#elif defined(MKS_ROBIN_MINI) +//#define ABOUT_TYPE_TEXT "MKS Robin Mini" +//#endif +#define ABOUT_VERSION_TEXT "1.0.0" +//#define ABOUT_WIFI_TEXT "WiFi:" + +#define FAN_OPEN_TEXT "100%" +#define FAN_HALF_TEXT "50%" +#define FAN_CLOSE_TEXT "0%" +//#define FAN_TIPS1_TEXT "FAN" +//#define FAN_TIPS2_TEXT "FAN\nClose" + +#define WIFI_TEXT "WIFI" +#define WIFI_IP_TEXT "IP: " +#define WIFI_NAME_TEXT "WiFi: " +#define WIFI_KEY_TEXT "Key: " +#define WIFI_STATE_AP_TEXT "State: AP" +#define WIFI_STATE_STA_TEXT "State: STA" +#define WIFI_CONNECTED_TEXT "Connected" +#define WIFI_DISCONNECTED_TEXT "Disconnected" +#define WIFI_EXCEPTION_TEXT "Exception" + +#define FILAMENT_TIPS2_TEXT "T:" + +#define DIALOG_UPLOAD_ING_EN "Uploading......" +#define DIALOG_UPLOAD_ERROR_EN "Upload error" +#define DIALOG_UPLOAD_FINISH_EN "Upload finished" +#define DIALOG_UPLOAD_SIZE_EN "Size" +#define DIALOG_UPLOAD_TIME_EN "Time" +#define DIALOG_UPLOAD_SPEED_EN "Speed" +#define DIALOG_UPDATE_WIFI_FIRMWARE_EN "Updating wifi model firmware" +#define DIALOG_UPDATE_WIFI_WEB_EN "Updating wifi model web data" + +#define ZOFFSET_STEP001 "0.01mm" +#define ZOFFSET_STEP01 "0.1mm" +#define ZOFFSET_STEP1 "1mm" diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 79e12f36d1..b5dbb11a06 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -38,7 +38,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../../inc/MarlinConfigPre.h" @@ -54,6 +54,7 @@ #include "../../module/printcounter.h" #include "../../libs/duration_t.h" #include "../../HAL/shared/Delay.h" +#include "../../sd/cardreader.h" #if ENABLED(PRINTCOUNTER) #include "../../core/utility.h" @@ -68,13 +69,6 @@ #include "../../feature/e_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_CONFIG #include "../../feature/tmc_util.h" #include "../../module/stepper/indirection.h" @@ -109,9 +103,8 @@ namespace ExtUI { static struct { uint8_t printer_killed : 1; - #if ENABLED(JOYSTICK) - uint8_t jogging : 1; - #endif + TERN_(JOYSTICK, uint8_t jogging : 1); + TERN_(SDSUPPORT, uint8_t was_sd_printing : 1); } flags; #ifdef __SAM3X8E__ @@ -165,12 +158,11 @@ namespace ExtUI { } void yield() { - if (!flags.printer_killed) - thermalManager.manage_heater(); + if (!flags.printer_killed) thermalManager.manage_heater(); } void enableHeater(const extruder_t extruder) { - #if HOTENDS && HEATER_IDLE_HANDLER + #if HAS_HOTEND && HEATER_IDLE_HANDLER thermalManager.reset_hotend_idle_timer(extruder - E0); #else UNUSED(extruder); @@ -181,17 +173,11 @@ namespace ExtUI { #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 + case BED: thermalManager.reset_bed_idle_timer(); return; #endif + TERN_(HAS_HEATED_CHAMBER, case CHAMBER: return); // Chamber has no idle timer default: - #if HOTENDS - thermalManager.reset_hotend_idle_timer(heater - H0); - #endif + TERN_(HAS_HOTEND, thermalManager.reset_hotend_idle_timer(heater - H0)); break; } #else @@ -236,30 +222,21 @@ namespace ExtUI { #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 - ; + #if HAS_HOTEND && HEATER_IDLE_HANDLER + return thermalManager.hotend_idle[extruder - E0].timed_out; + #else + UNUSED(extruder); + return false; + #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 + TERN_(HAS_HEATED_BED, case BED: return thermalManager.bed_idle.timed_out); + TERN_(HAS_HEATED_CHAMBER, case CHAMBER: return false); // Chamber has no idle timer default: - #if HOTENDS - return thermalManager.hotend_idle[heater - H0].timed_out; - #else - return false; - #endif + return TERN0(HAS_HOTEND, thermalManager.hotend_idle[heater - H0].timed_out); } #else UNUSED(heater); @@ -275,12 +252,8 @@ namespace ExtUI { 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 + TERN_(HAS_HEATED_BED, case BED: return GET_TEMP_ADJUSTMENT(thermalManager.degBed())); + TERN_(HAS_HEATED_CHAMBER, case CHAMBER: return GET_TEMP_ADJUSTMENT(thermalManager.degChamber())); default: return GET_TEMP_ADJUSTMENT(thermalManager.degHotend(heater - H0)); } } @@ -291,12 +264,8 @@ namespace ExtUI { 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 + TERN_(HAS_HEATED_BED, case BED: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetBed())); + TERN_(HAS_HEATED_CHAMBER, case CHAMBER: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetChamber())); default: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetHotend(heater - H0)); } } @@ -306,7 +275,7 @@ namespace ExtUI { } float getTargetFan_percent(const fan_t fan) { - #if FAN_COUNT > 0 + #if HAS_FAN return thermalManager.fanPercent(thermalManager.fan_speed[fan - FAN0]); #else UNUSED(fan); @@ -315,7 +284,7 @@ namespace ExtUI { } float getActualFan_percent(const fan_t fan) { - #if FAN_COUNT > 0 + #if HAS_FAN return thermalManager.fanPercent(thermalManager.scaledFanSpeed(fan - FAN0)); #else UNUSED(fan); @@ -324,22 +293,13 @@ namespace ExtUI { } float getAxisPosition_mm(const axis_t axis) { - return - #if ENABLED(JOYSTICK) - flags.jogging ? destination[axis] : - #endif - current_position[axis]; + return TERN_(JOYSTICK, flags.jogging ? destination[axis] :) 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 - ); + const float epos = TERN_(JOYSTICK, flags.jogging ? destination.e :) current_position.e; setActiveTool(old_tool, true); return epos; } @@ -353,28 +313,16 @@ namespace ExtUI { #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 + TERN_(MIN_SOFTWARE_ENDSTOP_X, min = soft_endstop.min.x); + TERN_(MAX_SOFTWARE_ENDSTOP_X, max = soft_endstop.max.x); 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 + TERN_(MIN_SOFTWARE_ENDSTOP_Y, min = soft_endstop.min.y); + TERN_(MAX_SOFTWARE_ENDSTOP_Y, max = soft_endstop.max.y); 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 + TERN_(MIN_SOFTWARE_ENDSTOP_Z, min = soft_endstop.min.z); + TERN_(MAX_SOFTWARE_ENDSTOP_Z, max = soft_endstop.max.z); default: break; } #endif // HAS_SOFTWARE_ENDSTOPS @@ -382,8 +330,8 @@ namespace ExtUI { // 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 + if (axis != Z) { + max = SQRT(sq(float(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y - axis])); // (Y - axis) == the other axis min = -max; } #endif @@ -538,15 +486,14 @@ namespace ExtUI { 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 + TERN_(X_SENSORLESS, case X: return stepperX.homing_threshold()); + TERN_(X2_SENSORLESS, case X2: return stepperX2.homing_threshold()); + TERN_(Y_SENSORLESS, case Y: return stepperY.homing_threshold()); + TERN_(Y2_SENSORLESS, case Y2: return stepperY2.homing_threshold()); + TERN_(Z_SENSORLESS, case Z: return stepperZ.homing_threshold()); + TERN_(Z2_SENSORLESS, case Z2: return stepperZ2.homing_threshold()); + TERN_(Z3_SENSORLESS, case Z3: return stepperZ3.homing_threshold()); + TERN_(Z4_SENSORLESS, case Z4: return stepperZ4.homing_threshold()); default: return 0; } } @@ -555,14 +502,29 @@ namespace ExtUI { switch (axis) { #if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS #if X_SENSORLESS - case X: stepperX.homing_threshold(value); break; + case X: stepperX.homing_threshold(value); break; + #endif + #if X2_SENSORLESS + case X2: stepperX2.homing_threshold(value); break; #endif #if Y_SENSORLESS case Y: stepperY.homing_threshold(value); break; #endif + #if Y2_SENSORLESS + case Y2: stepperY2.homing_threshold(value); break; + #endif #if Z_SENSORLESS case Z: stepperZ.homing_threshold(value); break; #endif + #if Z2_SENSORLESS + case Z2: stepperZ2.homing_threshold(value); break; + #endif + #if Z3_SENSORLESS + case Z3: stepperZ3.homing_threshold(value); break; + #endif + #if Z4_SENSORLESS + case Z4: stepperZ4.homing_threshold(value); break; + #endif #else UNUSED(value); #endif @@ -628,8 +590,10 @@ namespace ExtUI { #if HAS_FILAMENT_SENSOR bool getFilamentRunoutEnabled() { return runout.enabled; } void setFilamentRunoutEnabled(const bool value) { runout.enabled = value; } + bool getFilamentRunoutState() { return runout.filament_ran_out; } + void setFilamentRunoutState(const bool value) { runout.filament_ran_out = value; } - #ifdef FILAMENT_RUNOUT_DISTANCE_MM + #if HAS_FILAMENT_RUNOUT_DISTANCE float getFilamentRunoutDistance_mm() { return runout.runout_distance(); } void setFilamentRunoutDistance_mm(const float value) { runout.set_runout_distance(constrain(value, 0, 999)); } #endif @@ -662,17 +626,15 @@ namespace ExtUI { } #endif - #if DISABLED(CLASSIC_JERK) + #if HAS_JUNCTION_DEVIATION 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 + planner.junction_deviation_mm = constrain(value, 0.001, 0.3); + TERN_(LIN_ADVANCE, planner.recalculate_max_e_jerk()); } #else @@ -702,10 +664,7 @@ namespace ExtUI { 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 setFlow_percent(const int16_t flow, const extruder_t extr) { planner.set_flow(extr, flow); } 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; } @@ -777,18 +736,18 @@ namespace ExtUI { */ 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); + 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 (planner.steps_to_mm[Z_AXIS] * babystep.axis_total[BS_AXIS_IND(Z_AXIS)]); - #else - return 0.0; - #endif + return (0.0f + #if HAS_BED_PROBE + + probe.offset.z + #elif ENABLED(BABYSTEP_DISPLAY_TOTAL) + + planner.steps_to_mm[Z_AXIS] * babystep.axis_total[BS_AXIS_IND(Z_AXIS)] + #endif + ); } void setZOffset_mm(const float value) { @@ -868,9 +827,7 @@ namespace ExtUI { 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 + TERN_(ABL_BILINEAR_SUBDIVISION, bed_level_virt_interpolate()); } } #endif @@ -895,17 +852,9 @@ namespace ExtUI { float getFeedrate_percent() { return feedrate_percentage; } #if ENABLED(PIDTEMP) - float getPIDValues_Kp(const extruder_t tool) { - return PID_PARAM(Kp, tool); - } - - float getPIDValues_Ki(const extruder_t tool) { - return unscalePID_i(PID_PARAM(Ki, tool)); - } - - float getPIDValues_Kd(const extruder_t tool) { - return unscalePID_d(PID_PARAM(Kd, tool)); - } + float getPIDValues_Kp(const extruder_t tool) { return PID_PARAM(Kp, tool); } + float getPIDValues_Ki(const extruder_t tool) { return unscalePID_i(PID_PARAM(Ki, tool)); } + float getPIDValues_Kd(const extruder_t tool) { return unscalePID_d(PID_PARAM(Kd, tool)); } void setPIDValues(const float p, const float i, const float d, extruder_t tool) { thermalManager.temp_hotend[tool].pid.Kp = p; @@ -914,23 +863,15 @@ namespace ExtUI { thermalManager.updatePID(); } - void startPIDTune(const float temp, extruder_t tool){ + void startPIDTune(const float temp, extruder_t tool) { thermalManager.PID_autotune(temp, (heater_ind_t)tool, 8, true); } #endif #if ENABLED(PIDTEMPBED) - float getBedPIDValues_Kp() { - return thermalManager.temp_bed.pid.Kp; - } - - float getBedPIDValues_Ki() { - return unscalePID_i(thermalManager.temp_bed.pid.Ki); - } - - float getBedPIDValues_Kd() { - return unscalePID_d(thermalManager.temp_bed.pid.Kd); - } + float getBedPIDValues_Kp() { return thermalManager.temp_bed.pid.Kp; } + float getBedPIDValues_Ki() { return unscalePID_i(thermalManager.temp_bed.pid.Ki); } + float getBedPIDValues_Kd() { return unscalePID_d(thermalManager.temp_bed.pid.Kd); } void setBedPIDValues(const float p, const float i, const float d) { thermalManager.temp_bed.pid.Kp = p; @@ -944,25 +885,18 @@ namespace ExtUI { } #endif - void injectCommands_P(PGM_P const gcode) { - queue.inject_P(gcode); - } + void injectCommands_P(PGM_P const gcode) { queue.inject_P(gcode); } + void injectCommands(char * const gcode) { queue.inject(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 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; + static PGMSTR(firmware_name, "Marlin " SHORT_BUILD_VERSION); return firmware_name; } @@ -978,14 +912,13 @@ namespace ExtUI { #endif #if HAS_HEATED_BED if (heater == BED) - thermalManager.setTargetBed(LROUND(constrain(value, 0, BED_MAXTEMP - 10))); + thermalManager.setTargetBed(LROUND(constrain(value, 0, BED_MAX_TARGET))); 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, HEATER_6_MAXTEMP, HEATER_7_MAXTEMP); + #if HAS_HOTEND const int16_t e = heater - H0; - thermalManager.setTargetHotend(LROUND(constrain(value, 0, heater_maxtemp[e] - 15)), e); + thermalManager.setTargetHotend(LROUND(constrain(value, 0, thermalManager.heater_maxtemp[e] - HOTEND_OVERSHOOT)), e); #endif } } @@ -994,16 +927,15 @@ namespace ExtUI { #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, HEATER_6_MAXTEMP, HEATER_7_MAXTEMP); + #if HAS_HOTEND const int16_t e = extruder - E0; enableHeater(extruder); - thermalManager.setTargetHotend(LROUND(constrain(value, 0, heater_maxtemp[e] - 15)), e); + thermalManager.setTargetHotend(LROUND(constrain(value, 0, thermalManager.heater_maxtemp[e] - HOTEND_OVERSHOOT)), e); #endif } void setTargetFan_percent(const float value, const fan_t fan) { - #if FAN_COUNT > 0 + #if HAS_FAN if (fan < FAN_COUNT) thermalManager.set_fan_speed(fan - FAN0, map(constrain(value, 0, 100), 0, 100, 0, 255)); #else @@ -1017,9 +949,7 @@ namespace ExtUI { } void setUserConfirmed() { - #if HAS_RESUME_CONTINUE - wait_for_user = false; - #endif + TERN_(HAS_RESUME_CONTINUE, wait_for_user = false); } void printFile(const char *filename) { @@ -1032,28 +962,27 @@ namespace ExtUI { } bool isPrintingFromMedia() { - return IFSD(card.isFileOpen(), false); + #if ENABLED(SDSUPPORT) + // Account for when IS_SD_PRINTING() reports the end of the + // print when there is still SD card data in the planner. + flags.was_sd_printing = card.isFileOpen() || (flags.was_sd_printing && commandsInQueue()); + return flags.was_sd_printing; + #else + return false; + #endif } bool isPrinting() { - return (planner.movesplanned() || isPrintingFromMedia() || IFSD(IS_SD_PRINTING(), false)); + return (commandsInQueue() || 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 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]; @@ -1061,6 +990,12 @@ namespace ExtUI { onUserConfirmRequired(msg); } + void onStatusChanged_P(PGM_P const pstr) { + char msg[strlen_P(pstr) + 1]; + strcpy_P(msg, pstr); + onStatusChanged(msg); + } + FileList::FileList() { refresh(); } void FileList::refresh() { num_files = 0xFFFF; } @@ -1068,13 +1003,7 @@ namespace ExtUI { 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); + card.getfilename_sorted(pos); return card.filename[0] != '\0'; #else UNUSED(pos); @@ -1104,11 +1033,7 @@ namespace ExtUI { } bool FileList::isAtRootDir() { - return (true - #if ENABLED(SDSUPPORT) - && card.flag.workDirIsRoot - #endif - ); + return IFSD(card.flag.workDirIsRoot, true); } void FileList::upDir() { @@ -1139,28 +1064,7 @@ void MarlinUI::init() { 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::update() { ExtUI::onIdle(); } void MarlinUI::kill_screen(PGM_P const error, PGM_P const component) { using namespace ExtUI; diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index 01e0d1b7a3..ae6f31d43e 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -39,7 +39,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../../inc/MarlinConfig.h" @@ -52,7 +52,7 @@ namespace ExtUI { static constexpr size_t eeprom_data_size = 48; - enum axis_t : uint8_t { X, Y, Z }; + enum axis_t : uint8_t { X, Y, Z, X2, Y2, Z2, Z3, Z4 }; enum extruder_t : uint8_t { E0, E1, E2, E3, E4, E5, E6, E7 }; enum heater_t : uint8_t { H0, H1, H2, H3, H4, H5, BED, CHAMBER }; enum fan_t : uint8_t { FAN0, FAN1, FAN2, FAN3, FAN4, FAN5, FAN6, FAN7 }; @@ -74,6 +74,7 @@ namespace ExtUI { bool canMove(const axis_t); bool canMove(const extruder_t); void injectCommands_P(PGM_P const); + void injectCommands(char * const); bool commandsInQueue(); bool isHeaterIdle(const heater_t); @@ -141,6 +142,10 @@ namespace ExtUI { 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); } + + typedef enum : unsigned char { PROBE_START, PROBE_FINISH } probe_state_t; + void onMeshUpdate(const int8_t xpos, const int8_t ypos, probe_state_t state); + inline void onMeshUpdate(const xy_int8_t &pos, probe_state_t state) { onMeshUpdate(pos.x, pos.y, state); } #endif #endif @@ -182,7 +187,7 @@ namespace ExtUI { void setLinearAdvance_mm_mm_s(const float, const extruder_t); #endif - #if DISABLED(CLASSIC_JERK) + #if HAS_JUNCTION_DEVIATION float getJunctionDeviation_mm(); void setJunctionDeviation_mm(const float); #else @@ -232,8 +237,10 @@ namespace ExtUI { #if HAS_FILAMENT_SENSOR bool getFilamentRunoutEnabled(); void setFilamentRunoutEnabled(const bool); + bool getFilamentRunoutState(); + void setFilamentRunoutState(const bool); - #ifdef FILAMENT_RUNOUT_DISTANCE_MM + #if HAS_FILAMENT_RUNOUT_DISTANCE float getFilamentRunoutDistance_mm(); void setFilamentRunoutDistance_mm(const float); #endif @@ -335,6 +342,7 @@ namespace ExtUI { void onUserConfirmRequired(const char * const msg); void onUserConfirmRequired_P(PGM_P const pstr); void onStatusChanged(const char * const msg); + void onStatusChanged_P(PGM_P const pstr); void onFactoryReset(); void onStoreSettings(char *); void onLoadSettings(const char *); diff --git a/Marlin/src/lcd/extui_anycubic_tft.cpp b/Marlin/src/lcd/extui_anycubic_tft.cpp new file mode 100644 index 0000000000..6383ee7b53 --- /dev/null +++ b/Marlin/src/lcd/extui_anycubic_tft.cpp @@ -0,0 +1,104 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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_anycubic_tft.cpp + */ + +#include "../inc/MarlinConfigPre.h" + +#if BOTH(ANYCUBIC_TFT_MODEL, EXTENSIBLE_UI) + +#include "extui/lib/anycubic/anycubic_tft.h" +#include "extui/ui_api.h" + +#include // for the ::tone() call + +namespace ExtUI { + + void onStartup() { AnycubicTFT.OnSetup(); } + void onIdle() { AnycubicTFT.OnCommandScan(); } + void onPrinterKilled(PGM_P const error, PGM_P const component) { AnycubicTFT.OnKillTFT(); } + void onMediaInserted() { AnycubicTFT.OnSDCardStateChange(true); } + void onMediaError() { AnycubicTFT.OnSDCardError(); } + void onMediaRemoved() { AnycubicTFT.OnSDCardStateChange(false); } + void onPlayTone(const uint16_t frequency, const uint16_t duration) { + #if ENABLED(SPEAKER) + ::tone(BEEPER_PIN, frequency, duration); + #endif + } + void onPrintTimerStarted() { AnycubicTFT.OnPrintTimerStarted(); } + void onPrintTimerPaused() { AnycubicTFT.OnPrintTimerPaused(); } + void onPrintTimerStopped() { AnycubicTFT.OnPrintTimerStopped(); } + void onFilamentRunout(const extruder_t extruder) { AnycubicTFT.OnFilamentRunout(); } + void onUserConfirmRequired(const char * const msg) { AnycubicTFT.OnUserConfirmRequired(msg); } + void onStatusChanged(const char * const msg) {} + void onFactoryReset() {} + + void onStoreSettings(char *buff) { + // 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) { + // 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) { + // Called after the entire EEPROM has been written, + // whether successful or not. + } + + void onConfigurationStoreRead(bool success) { + // 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) { + // Called when any mesh points are updated + } + + #if ENABLED(POWER_LOSS_RECOVERY) + void onPowerLossResume() { + // Called on resume from power-loss + } + #endif + + #if HAS_PID_HEATING + void onPidTuning(const result_t rst) { + // Called for temperature PID tuning result + } + #endif +} + +#endif // ANYCUBIC_TFT_MODEL && EXTENSIBLE_UI diff --git a/Marlin/src/lcd/extui_dgus_lcd.cpp b/Marlin/src/lcd/extui_dgus_lcd.cpp index 855d09033e..c3978eb7e1 100644 --- a/Marlin/src/lcd/extui_dgus_lcd.cpp +++ b/Marlin/src/lcd/extui_dgus_lcd.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -33,6 +33,7 @@ #include "extui/ui_api.h" #include "extui/lib/dgus/DGUSDisplay.h" #include "extui/lib/dgus/DGUSDisplayDef.h" +#include "extui/lib/dgus/DGUSScreenHandler.h" extern const char NUL_STR[]; @@ -45,27 +46,15 @@ namespace ExtUI { void onIdle() { ScreenHandler.loop(); } - void onPrinterKilled(PGM_P error, PGM_P component) { + void onPrinterKilled(PGM_P const error, PGM_P const component) { 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() { - #if ENABLED(SDSUPPORT) - ScreenHandler.SDCardInserted(); - #endif - } - void onMediaError() { - #if ENABLED(SDSUPPORT) - ScreenHandler.SDCardError(); - #endif - } - void onMediaRemoved() { - #if ENABLED(SDSUPPORT) - ScreenHandler.SDCardRemoved(); - #endif - } + void onMediaInserted() { TERN_(SDSUPPORT, ScreenHandler.SDCardInserted()); } + void onMediaError() { TERN_(SDSUPPORT, ScreenHandler.SDCardError()); } + void onMediaRemoved() { TERN_(SDSUPPORT, ScreenHandler.SDCardRemoved()); } void onPlayTone(const uint16_t frequency, const uint16_t duration) {} void onPrintTimerStarted() {} @@ -118,9 +107,15 @@ namespace ExtUI { // whether successful or not. } - void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) { - // Called when any mesh points are updated - } + #if HAS_MESH + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) { + // Called when any mesh points are updated + } + + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const ExtUI::probe_state_t state) { + // Called to indicate a special condition + } + #endif #if ENABLED(POWER_LOSS_RECOVERY) void onPowerLossResume() { @@ -133,19 +128,18 @@ namespace ExtUI { #if HAS_PID_HEATING void onPidTuning(const result_t rst) { // Called for temperature PID tuning result - SERIAL_ECHOLNPAIR("onPidTuning:",rst); - switch(rst) { + switch (rst) { case PID_BAD_EXTRUDER_NUM: - ScreenHandler.setstatusmessagePGM(PSTR(STR_PID_BAD_EXTRUDER_NUM)); + ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_BAD_EXTRUDER_NUM)); break; case PID_TEMP_TOO_HIGH: - ScreenHandler.setstatusmessagePGM(PSTR(STR_PID_TEMP_TOO_HIGH)); + ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_TEMP_TOO_HIGH)); break; case PID_TUNING_TIMEOUT: - ScreenHandler.setstatusmessagePGM(PSTR(STR_PID_TIMEOUT)); + ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_TIMEOUT)); break; case PID_DONE: - ScreenHandler.setstatusmessagePGM(PSTR(STR_PID_AUTOTUNE_FINISHED)); + ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_AUTOTUNE_DONE)); break; } ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN); diff --git a/Marlin/src/lcd/extui_example.cpp b/Marlin/src/lcd/extui_example.cpp index 5c9a193ded..5258a5b6a2 100644 --- a/Marlin/src/lcd/extui_example.cpp +++ b/Marlin/src/lcd/extui_example.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../inc/MarlinConfigPre.h" @@ -89,9 +89,15 @@ namespace ExtUI { // whether successful or not. } - void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) { - // Called when any mesh points are updated - } + #if HAS_MESH + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) { + // Called when any mesh points are updated + } + + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const ExtUI::probe_state_t state) { + // Called to indicate a special condition + } + #endif #if ENABLED(POWER_LOSS_RECOVERY) void onPowerLossResume() { diff --git a/Marlin/src/lcd/extui_malyan_lcd.cpp b/Marlin/src/lcd/extui_malyan_lcd.cpp index ddb8b846cb..38a8fbc0f9 100644 --- a/Marlin/src/lcd/extui_malyan_lcd.cpp +++ b/Marlin/src/lcd/extui_malyan_lcd.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -71,7 +71,7 @@ #define MAX_CURLY_COMMAND (32 + LONG_FILENAME_LENGTH) * 2 // Track incoming command bytes from the LCD -int inbound_count; +uint16_t inbound_count; // For sending print completion messages bool last_printing_status = false; @@ -97,6 +97,18 @@ void write_to_lcd(const char * const message) { LCD_SERIAL.Print::write(encoded_message, message_length); } +// {E:} is for error states. +void set_lcd_error_P(PGM_P const error, PGM_P const component=nullptr) { + write_to_lcd_P(PSTR("{E:")); + write_to_lcd_P(error); + if (component) { + write_to_lcd_P(PSTR(" ")); + write_to_lcd_P(component); + } + write_to_lcd_P(PSTR("}")); +} + + /** * Process an LCD 'C' command. * These are currently all temperature commands @@ -194,18 +206,19 @@ void process_lcd_eb_command(const char* command) { * {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); - }; +template +void j_move_axis(const char* command, const T axis) { + const float dist = atof(command + 1) / 10.0; + ExtUI::setAxisPosition_mm(ExtUI::getAxisPosition_mm(axis) + dist, axis); +}; +void process_lcd_j_command(const char* command) { 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; + case 'A': j_move_axis(command, ExtUI::extruder_t::E0); break; + case 'Y': j_move_axis(command, ExtUI::axis_t::Y); break; + case 'Z': j_move_axis(command, ExtUI::axis_t::Z); break; + case 'X': j_move_axis(command, ExtUI::axis_t::X); break; default: DEBUG_ECHOLNPAIR("UNKNOWN J COMMAND ", command); } } @@ -361,29 +374,38 @@ void process_lcd_command(const char* command) { 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; +// +void parse_lcd_byte(const byte b) { 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; + static uint8_t parsing = 0; // Parsing state + static bool prevcr = false; // Was the last c a CR? + + const char c = b & 0x7F; + + if (parsing) { + const bool is_lcd = parsing == 1; // 1 for LCD + if ( ( is_lcd && c == '}') // Closing brace on LCD command + || (!is_lcd && c == '\n') // LF on a G-code command + ) { + inbound_buffer[inbound_count] = '\0'; // Reset before processing + inbound_count = 0; // Reset buffer index + if (parsing == 1) + process_lcd_command(inbound_buffer); // Handle the LCD command + else queue.enqueue_one_now(inbound_buffer); // Handle the G-code command - } + parsing = 0; // Unflag and... } + else if (inbound_count < MAX_CURLY_COMMAND - 2) + inbound_buffer[inbound_count++] = is_lcd ? c : b; // Buffer while space remains } - 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 (c == '{') parsing = 1; // Brace opens an LCD command + else if (prevcr && c == '\n') parsing = 2; // CRLF indicates G-code + prevcr = (c == '\r'); // Remember if it was a CR } - else if (inbound_count < MAX_CURLY_COMMAND - 2) - inbound_buffer[inbound_count++] = b; // Buffer only if space remains } /** @@ -433,9 +455,8 @@ namespace ExtUI { update_usb_status(false); // now drain commands... - while (LCD_SERIAL.available()) { - parse_lcd_byte((byte)LCD_SERIAL.read() & 0x7F); - } + while (LCD_SERIAL.available()) + parse_lcd_byte((byte)LCD_SERIAL.read()); #if ENABLED(SDSUPPORT) // The way last printing status works is simple: @@ -457,15 +478,33 @@ namespace ExtUI { #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 onPrinterKilled(PGM_P const error, PGM_P const component) { + set_lcd_error_P(error, component); } + #if HAS_PID_HEATING + + void onPidTuning(const result_t rst) { + // Called for temperature PID tuning result + //SERIAL_ECHOLNPAIR("OnPidTuning:", rst); + switch (rst) { + case PID_BAD_EXTRUDER_NUM: + set_lcd_error_P(GET_TEXT(MSG_PID_BAD_EXTRUDER_NUM)); + break; + case PID_TEMP_TOO_HIGH: + set_lcd_error_P(GET_TEXT(MSG_PID_TEMP_TOO_HIGH)); + break; + case PID_TUNING_TIMEOUT: + set_lcd_error_P(GET_TEXT(MSG_PID_TIMEOUT)); + break; + case PID_DONE: + set_lcd_error_P(GET_TEXT(MSG_PID_AUTOTUNE_DONE)); + break; + } + } + + #endif + void onPrintTimerStarted() { write_to_lcd_P(PSTR("{SYS:BUILD}")); } void onPrintTimerPaused() {} void onPrintTimerStopped() { write_to_lcd_P(PSTR("{TQ:100}")); } @@ -483,7 +522,15 @@ namespace ExtUI { void onLoadSettings(const char*) {} void onConfigurationStoreWritten(bool) {} void onConfigurationStoreRead(bool) {} - void onPidTuning(const result_t) {} + + #if HAS_MESH + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {} + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const ExtUI::probe_state_t state) {} + #endif + + #if ENABLED(POWER_LOSS_RECOVERY) + void onPowerLossResume() {} + #endif } #endif // MALYAN_LCD diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index 8e7798d72d..1cb64f985b 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Aragonese * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ @@ -56,20 +56,23 @@ namespace Language_an { 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"); + #if PREHEAT_COUNT + 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_M = _UxGT("Precalentar $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Precalentar $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Precal. $ Boquilla"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Precal. $ Boquilla ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Precalentar $ Tot"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Precalentar $ Base"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Precalentar $ Conf"); + #endif 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"); @@ -165,7 +168,6 @@ namespace Language_an { 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"); diff --git a/Marlin/src/lcd/language/language_bg.h b/Marlin/src/lcd/language/language_bg.h index 1987c20766..8917d98e68 100644 --- a/Marlin/src/lcd/language/language_bg.h +++ b/Marlin/src/lcd/language/language_bg.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Bulgarian * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ @@ -46,20 +46,23 @@ namespace Language_bg { 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; + #if PREHEAT_COUNT + 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; + + PROGMEM Language_Str MSG_PREHEAT_M = _UxGT("Подгряване $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Подгряване $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Подгряване $ Дюза"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Подгряване $ Дюза ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Подгр. $ Всички"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Подгр. $ Легло"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Настройки $"); + #endif PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Охлаждане"); PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Вкл. захранване"); PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Изкл. захранване"); @@ -149,5 +152,5 @@ namespace Language_bg { 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("Неправилен принтер"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Неправилен принтер"); } diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index ef5334f878..1c4a029ff7 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Catalan * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ namespace Language_ca { @@ -54,23 +54,25 @@ namespace Language_ca { 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."); + #if PREHEAT_COUNT + 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("Preescalfa ") PREHEAT_1_LABEL _UxGT(" End"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Preescalfa ") PREHEAT_1_LABEL _UxGT(" End ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Preescalfa ") PREHEAT_1_LABEL _UxGT(" Tot"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Preescalfa ") PREHEAT_1_LABEL _UxGT(" Llit"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Preescalfa ") PREHEAT_1_LABEL _UxGT(" Conf."); + + PROGMEM Language_Str MSG_PREHEAT_M = _UxGT("Preescalfa $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Preescalfa $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Preescalfa $ End"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Preescalfa $ End ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Preescalfa $ Tot"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Preescalfa $ Llit"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Preescalfa $ Conf."); + #endif 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"); @@ -98,11 +100,7 @@ namespace Language_ca { 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"); @@ -161,7 +159,6 @@ namespace Language_ca { 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 @@ -204,14 +201,10 @@ namespace Language_ca { 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_X = _UxGT("X Driver %"); - PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Driver %"); - PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Driver %"); - PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E 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"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Impressora incorrecta"); // // Filament Change screens show up to 3 lines on a 4-line display diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index 77e25b7332..c21cacddc8 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -26,11 +26,11 @@ * UTF-8 for Graphical Display * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * * Translated by Petr Zahradnik, Computer Laboratory * Blog and video blog Zahradnik se bavi - * http://www.zahradniksebavi.cz + * https://www.zahradniksebavi.cz * */ @@ -49,7 +49,6 @@ namespace Language_cz { PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Rušení..."); PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Médium vloženo"); PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Médium vyjmuto"); - PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("Médium uvolněno"); PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Čekání na médium"); PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Chyba čtení média"); PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB odstraněno"); @@ -80,20 +79,23 @@ namespace Language_cz { 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"); + #if PREHEAT_COUNT + 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_M = _UxGT("Zahřát $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Zahřát $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Zahřát $ end"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Zahřát $ end ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Zahřát $ vše"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Zahřát $ podlož"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Zahřát $ nast"); + #endif 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"); @@ -157,14 +159,14 @@ namespace Language_cz { 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; + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("Síť bodů $"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Kontrola sítě $"); + #endif 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_G26_HEATING_BED = _UxGT("G26 zahřívání podl."); PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 zařívání trysky"); @@ -197,8 +199,8 @@ namespace Language_cz { 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_MESH_LOADED = _UxGT("Síť %i načtena"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("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"); @@ -358,8 +360,8 @@ namespace Language_cz { PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Délka zavedení"); 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_SINGLENOZZLE_PRIME_SPEED = _UxGT("Rychlost primár."); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _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 *"); @@ -414,7 +416,6 @@ namespace Language_cz { 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"); @@ -464,7 +465,7 @@ namespace Language_cz { PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Osvětlení"); PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Jas světla"); - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("NESPRÁVNÁ TISKÁRNA"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("NESPRÁVNÁ TISKÁRNA"); #if LCD_WIDTH >= 20 PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Počet tisků"); @@ -500,13 +501,13 @@ namespace Language_cz { 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("Délka mm senz.fil."); - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Parkování selhalo"); + PROGMEM Language_Str MSG_KILL_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_KILL_MMU2_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í..."); @@ -563,7 +564,7 @@ namespace Language_cz { #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_PAUSE_PRINT_PARKING = _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")); @@ -576,7 +577,7 @@ namespace Language_cz { #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_PAUSE_PRINT_PARKING = _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í")); diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index 23d931c174..7a9321d001 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Danish * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ @@ -49,20 +49,23 @@ namespace Language_da { 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"); + #if PREHEAT_COUNT + 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_M = _UxGT("Forvarm $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Forvarm $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Forvarm $ end") + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Forvarm $ end ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Forvarm $ Alle"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Forvarm $ Bed"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Forvarm $ conf"); + #endif 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"); @@ -141,7 +144,6 @@ namespace Language_da { 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 @@ -185,7 +187,7 @@ namespace Language_da { PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Forsæt print"); - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Forkert printer"); + PROGMEM Language_Str MSG_KILL_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")); diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index cd201ded34..ebd0805037 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * German * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ @@ -43,7 +43,6 @@ namespace Language_de { 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"); @@ -65,22 +64,26 @@ namespace Language_de { 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"); + #if PREHEAT_COUNT + 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_M = _UxGT("$ Vorwärmen"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("$ Vorwärmen") " ~"; + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("$ Extr. Vorwärmen"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("$ Extr. Vorwärm. ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("$ Alles Vorwärmen"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("$ Bett Vorwärmen"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("$ Einstellungen"); + #endif PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("benutzerdef. Heizen"); PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Abkühlen"); + PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frequenz"); 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"); @@ -140,17 +143,17 @@ namespace Language_de { 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"); + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("$ Netz erstellen"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("$ Netz validieren"); + #endif 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_HEATING_NOZZLE = _UxGT("G26 Düse aufheizen"); 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"); @@ -179,8 +182,8 @@ namespace Language_de { 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_MESH_LOADED = _UxGT("Netz %i geladen"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("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."); @@ -230,10 +233,12 @@ namespace Language_de { 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_NOZZLE_PARKED = _UxGT("Düse geparkt"); 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_STORED_FAN_N = _UxGT("Gespeich. 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_CONTROLLER_FAN = _UxGT("Lüfter Kontroller"); @@ -297,6 +302,7 @@ namespace Language_de { PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Konfig. laden"); PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Standardwerte laden"); PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Werkseinstellungen"); + PROGMEM Language_Str MSG_SETTINGS_STORED = _UxGT("Einstell. gespei."); 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"); @@ -311,9 +317,13 @@ namespace Language_de { 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_BUTTON_BACK = _UxGT("Zurück"); + PROGMEM Language_Str MSG_PAUSING = _UxGT("Pause..."); 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_CANCEL_OBJECT = _UxGT("Objekt abbrechen"); + PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Objekt 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"); @@ -322,6 +332,7 @@ namespace Language_de { 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_PRINT_DONE = _UxGT("Druck fertig"); PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Motoren angeschaltet"); PROGMEM Language_Str MSG_KILLED = _UxGT("ABGEBROCHEN"); PROGMEM Language_Str MSG_STOPPED = _UxGT("ANGEHALTEN"); @@ -338,8 +349,8 @@ namespace Language_de { 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_SINGLENOZZLE_PRIME_SPEED = _UxGT("Prime-Geschwin."); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _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 *"); @@ -374,6 +385,9 @@ namespace Language_de { 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_OFFSETS = _UxGT("Sondenversatz"); + PROGMEM Language_Str MSG_ZPROBE_XOFFSET = _UxGT("Sondenversatz X"); + PROGMEM Language_Str MSG_ZPROBE_YOFFSET = _UxGT("Sondenversatz Y"); 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"); @@ -393,7 +407,6 @@ namespace Language_de { 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 @@ -433,7 +446,7 @@ namespace Language_de { 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"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Falscher Drucker"); #if LCD_WIDTH >= 20 PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Gesamte Drucke"); @@ -469,13 +482,13 @@ namespace Language_de { 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_KILL_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_KILL_MMU2_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..."); @@ -523,7 +536,7 @@ namespace Language_de { // ...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_PAUSE_PRINT_PARKING = _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")); @@ -535,7 +548,7 @@ namespace Language_de { 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_PAUSE_PRINT_PARKING = _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")); @@ -561,4 +574,9 @@ namespace Language_de { 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"); + PROGMEM Language_Str MSG_LEVEL_X_AXIS = _UxGT("X Achse leveln"); + PROGMEM Language_Str MSG_AUTO_CALIBRATE = _UxGT("Auto. Kalibiren"); + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Heizung Timeout"); + PROGMEM Language_Str MSG_REHEAT = _UxGT("Erneut aufheizen"); + PROGMEM Language_Str MSG_REHEATING = _UxGT("Erneut aufhei. ..."); } diff --git a/Marlin/src/lcd/language/language_el.h b/Marlin/src/lcd/language/language_el.h index 6cb177d108..cee8dd0e55 100644 --- a/Marlin/src/lcd/language/language_el.h +++ b/Marlin/src/lcd/language/language_el.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Greek * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ @@ -54,20 +54,23 @@ namespace Language_el { 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 + #if PREHEAT_COUNT + 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_M = _UxGT("Προθέρμανση $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Προθέρμανση $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Προθέρμανση $ End"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Προθέρμανση $ End ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Προθέρμανση $ όλα"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Προθέρμανση $ bed"); //SHORTEN + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Προθέρμανση $ επιβεβαίωση"); //SHORTEN + #endif PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Μειωση θερμοκρασιας"); PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Ενεργοποίηση"); PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Απενεργοποίηση"); @@ -188,5 +191,5 @@ namespace Language_el { PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Βαθμονόμηση Z"); PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Βαθμονόμηση κέντρου"); - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Εσφαλμένος εκτυπωτής"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Εσφαλμένος εκτυπωτής"); } diff --git a/Marlin/src/lcd/language/language_el_gr.h b/Marlin/src/lcd/language/language_el_gr.h index 5213dc7db9..d7bead9ea6 100644 --- a/Marlin/src/lcd/language/language_el_gr.h +++ b/Marlin/src/lcd/language/language_el_gr.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Greek (Greece) * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ @@ -55,20 +55,23 @@ namespace Language_el_gr { 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(" επιβεβαίωση"); + #if PREHEAT_COUNT + 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_M = _UxGT("Προθέρμανση $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Προθέρμανση $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Προθέρμανση $ End"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Προθέρμανση $ End ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Προθέρμανση $ όλα"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Προθέρμανση $ κλίνη"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Προθέρμανση $ επιβεβαίωση"); + #endif PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Μειωση θερμοκρασιας"); PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Ενεργοποίηση"); PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Απενεργοποίηση"); @@ -189,5 +192,5 @@ namespace Language_el_gr { PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Βαθμονόμηση Z"); PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Βαθμονόμηση κέντρου"); - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Εσφαλμένος εκτυπωτής"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Εσφαλμένος εκτυπωτής"); } diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index a52d9652ac..391cb598cf 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * English * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ @@ -47,11 +47,11 @@ namespace Language_en { 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_KILL_SUBCALL_OVERFLOW = _UxGT("Subcall Overflow"); 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"); @@ -66,6 +66,7 @@ namespace Language_en { 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_ASSISTED_TRAMMING = _UxGT("Assisted Tramming"); 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"); @@ -74,22 +75,26 @@ namespace Language_en { 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"); + #if PREHEAT_COUNT + 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_M = _UxGT("Preheat $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Preheat $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Preheat $ End"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Preheat $ End ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Preheat $ All"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Preheat $ Bed"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Preheat $ Conf"); + #endif PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Preheat Custom"); PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Cooldown"); + PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frequency"); 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"); @@ -149,14 +154,12 @@ namespace Language_en { 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_MESH_M = _UxGT("Build 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("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_MESH_M = _UxGT("Validate Mesh ($)"); 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"); @@ -189,8 +192,8 @@ namespace Language_en { 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_MESH_LOADED = _UxGT("Mesh %i Loaded"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("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"); @@ -240,6 +243,8 @@ namespace Language_en { 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_NOZZLE_PARKED = _UxGT("Nozzle Parked"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Nozzle Standby"); PROGMEM Language_Str MSG_BED = _UxGT("Bed"); PROGMEM Language_Str MSG_CHAMBER = _UxGT("Enclosure"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Fan Speed"); @@ -263,6 +268,10 @@ namespace Language_en { 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_AUTOTUNE_DONE = _UxGT("PID tuning done"); + PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune failed. Bad extruder."); + PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed. Temperature too high."); + PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Autotune failed! Timeout."); 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"); @@ -298,16 +307,20 @@ namespace Language_en { 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_XY_FREQUENCY_LIMIT = _UxGT("Frequency max"); + PROGMEM Language_Str MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Feed min"); 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_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("E steps/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_VOLUMETRIC_LIMIT = _UxGT("E Limit in mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT_E = _UxGT("E Limit *"); 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"); @@ -319,32 +332,39 @@ namespace Language_en { PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Load Settings"); PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Restore Defaults"); PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Initialize EEPROM"); - PROGMEM Language_Str MSG_ERR_EEPROM_CRC = _UxGT("Err: EEPROM CRC"); - PROGMEM Language_Str MSG_ERR_EEPROM_INDEX = _UxGT("Err: EEPROM Index"); - PROGMEM Language_Str MSG_ERR_EEPROM_VERSION = _UxGT("Err: EEPROM Version"); + PROGMEM Language_Str MSG_ERR_EEPROM_CRC = _UxGT("EEPROM CRC Error"); + PROGMEM Language_Str MSG_ERR_EEPROM_INDEX = _UxGT("EEPROM Index Error"); + PROGMEM Language_Str MSG_ERR_EEPROM_VERSION = _UxGT("EEPROM Version Error"); + PROGMEM Language_Str MSG_SETTINGS_STORED = _UxGT("Settings Stored"); 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_REFRESH = LCD_STR_REFRESH _UxGT("Refresh"); PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Info Screen"); PROGMEM Language_Str MSG_PREPARE = _UxGT("Prepare"); PROGMEM Language_Str MSG_TUNE = _UxGT("Tune"); + PROGMEM Language_Str MSG_POWER_MONITOR = _UxGT("Power monitor"); + PROGMEM Language_Str MSG_CURRENT = _UxGT("Current"); + PROGMEM Language_Str MSG_VOLTAGE = _UxGT("Voltage"); + PROGMEM Language_Str MSG_POWER = _UxGT("Power"); 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_IGNORE = _UxGT("Ignore"); 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_PAUSING = _UxGT("Pausing..."); 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_OUTAGE_RECOVERY = _UxGT("Power Outage"); 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..."); @@ -366,12 +386,22 @@ namespace Language_en { 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_SWAP_EXTRA = _UxGT("Swap Extra"); 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_SINGLENOZZLE_PRIME_SPEED = _UxGT("Prime Speed"); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Retract Speed"); + PROGMEM Language_Str MSG_FILAMENT_PARK_ENABLED = _UxGT("Park Head"); + PROGMEM Language_Str MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Recover Speed"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Fan Speed"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Fan Time"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_ON = _UxGT("Auto ON"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_OFF = _UxGT("Auto OFF"); + PROGMEM Language_Str MSG_TOOL_MIGRATION = _UxGT("Tool Migration"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_AUTO = _UxGT("Auto-migration"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_END = _UxGT("Last Extruder"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_SWAP = _UxGT("Migrate to *"); 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"); @@ -385,14 +415,14 @@ namespace Language_en { 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_SELFTEST = _UxGT("Self-Test"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Reset"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Stow"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Deploy"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("SW-Mode"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("5V-Mode"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("OD-Mode"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("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"); @@ -427,7 +457,6 @@ namespace Language_en { 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 @@ -466,10 +495,11 @@ namespace Language_en { 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_HOTEND_IDLE_TIMEOUT = _UxGT("Hotend Idle Timeout"); 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"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("INCORRECT PRINTER"); #if LCD_WIDTH >= 20 PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Print Count"); @@ -505,29 +535,29 @@ namespace Language_en { 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_KILL_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_KILL_MMU2_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_RESUME = _UxGT("MMU Resume"); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("MMU Resuming..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("MMU Load"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("MMU Load All"); + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("MMU Load to Nozzle"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("MMU Eject"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("MMU Eject ~"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("MMU Unload"); 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_RESETTING = _UxGT("MMU Resetting..."); PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Remove, click"); PROGMEM Language_Str MSG_MIX = _UxGT("Mix"); @@ -555,9 +585,8 @@ namespace Language_en { 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 + PROGMEM Language_Str MSG_BAD_PAGE = _UxGT("Bad page index"); + PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Bad page speed"); // // Filament Change screens show up to 3 lines on a 4-line display @@ -565,7 +594,7 @@ namespace Language_en { // #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_PAUSE_PRINT_PARKING = _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")); @@ -577,7 +606,7 @@ namespace Language_en { 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_PAUSE_PRINT_PARKING = _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")); @@ -602,9 +631,12 @@ namespace Language_en { 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"); - + PROGMEM Language_Str MSG_LEVEL_X_AXIS = _UxGT("Level X Axis"); PROGMEM Language_Str MSG_AUTO_CALIBRATE = _UxGT("Auto Calibrate"); + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Heater Timeout"); + PROGMEM Language_Str MSG_REHEAT = _UxGT("Reheat"); + PROGMEM Language_Str MSG_REHEATING = _UxGT("Reheating..."); } #if FAN_COUNT == 1 diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index 12d487b35b..2b10bfe313 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,26 +25,24 @@ * Spanish * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://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 WELCOME_MSG = MACHINE_NAME _UxGT(" Lista"); + PROGMEM Language_Str MSG_MARLIN = _UxGT("Marlin"); 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"); @@ -67,33 +65,37 @@ namespace Language_es { 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_Z_FADE_HEIGHT = _UxGT("Compen. 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."); + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Precal. ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Precal. ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Precal. ") PREHEAT_1_LABEL _UxGT(" Fusor"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Precal. ") PREHEAT_1_LABEL _UxGT(" Fusor ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Precal. ") PREHEAT_1_LABEL _UxGT(" Todo"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Precal. ") PREHEAT_1_LABEL _UxGT(" Cama"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Precal. ") PREHEAT_1_LABEL _UxGT(" Ajuste"); + + PROGMEM Language_Str MSG_PREHEAT_M = _UxGT("Precal. $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Precal. $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Precal. $ Fusor"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Precal. $ Fusor ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Precal. $ Todo"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Precal. $ Cama"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Precal. $ Ajuste"); + #endif + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Precal. manual"); PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Enfriar"); + PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frecuencia"); 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_OFF = _UxGT("Apagar Láser"); + PROGMEM Language_Str MSG_LASER_ON = _UxGT("Encender Láser"); 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_OFF = _UxGT("Apagar Mandrino"); + PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Encender Mandrino"); 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"); @@ -112,22 +114,22 @@ namespace Language_es { 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_USER_MENU = _UxGT("Com. Personalizados"); 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_OFFSETS_MENU = _UxGT("Desfase Herramienta"); 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_HOTEND_OFFSET_X = _UxGT("2ª Fusor X"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2ª Fusor Y"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2ª Fusor 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_UBL_LEVEL_BED = _UxGT("Nivelado 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"); @@ -137,24 +139,24 @@ namespace Language_es { 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_BED_TEMP_CUSTOM = _UxGT("Temp. Cama perso."); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Temp. Fusor"); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Temp. Fusor perso."); 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_CUSTOM_MESH = _UxGT("Crear Mallado Pers."); 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(")"); + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("Crear Mallado ($)"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Valid. Mall. ($)"); + #endif 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_UBL_VALIDATE_MESH_MENU = _UxGT("Valid. Mallado"); + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Valid. Mall. 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..."); @@ -165,14 +167,14 @@ namespace Language_es { 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_GRID_MESH_LEVELING = _UxGT("Niv. Mall. cuadri"); 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_OUTPUT_MAP_BACKUP = _UxGT("Cópia de seg. ext"); 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"); @@ -183,28 +185,28 @@ namespace Language_es { 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_STORAGE_SLOT = _UxGT("Huecos memoria"); + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Cargar Mall. cama"); + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Guardar Mall. cama"); + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("Malla %i Cargada"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("Malla %i Guardada"); 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_1_BUILD_COLD_MESH = _UxGT("1.Crear Mall. Frío"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Relleno intelig."); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Valid. 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_5_VALIDATE_MESH_MENU = _UxGT("5.Valid. 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_UBL_7_SAVE_MESH = _UxGT("7.Guardar Mall. 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_LEDS = _UxGT("LEDS"); + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Color predefinido"); 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"); @@ -214,7 +216,7 @@ namespace Language_es { 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_CUSTOM_LEDS = _UxGT("Color personalizado"); 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"); @@ -237,27 +239,59 @@ namespace Language_es { 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_NOZZLE_PARKED = _UxGT("Boquilla Aparcada"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Boquilla en Espera"); 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_STORED_FAN_N = _UxGT("Vent. almacenado ~"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Vel. Ext. ventil."); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Vel. Ext. ventil. ~"); + PROGMEM Language_Str MSG_CONTROLLER_FAN = _UxGT("Controlador Vent."); + PROGMEM Language_Str MSG_CONTROLLER_FAN_IDLE_SPEED = _UxGT("Velocidad en reposo"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_AUTO_ON = _UxGT("Modo Auto"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_SPEED = _UxGT("Velocidad Activa"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_DURATION = _UxGT("Periodo de reposo"); 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_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Factor"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Temp. Autom."); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("Enc"); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Apg"); + PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID Auto-ajuste"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID Auto-ajuste *"); + 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_PID_F = _UxGT("PID-F"); + PROGMEM Language_Str MSG_PID_F_E = _UxGT("PID-F *"); 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_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("Desvi. Unión"); PROGMEM Language_Str MSG_VELOCITY = _UxGT("Velocidad"); + 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("Vel. viaje min"); - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Accel"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Acceleración"); 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; @@ -275,8 +309,8 @@ namespace Language_es { 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_DIAM = _UxGT("Diámetro Fil."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diámetro Fil. *"); 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"); @@ -286,6 +320,9 @@ namespace Language_es { PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Cargar EEPROM"); PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Rest. fábrica"); PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Inicializar EEPROM"); + PROGMEM Language_Str MSG_ERR_EEPROM_CRC = _UxGT("Err: EEPROM CRC"); + PROGMEM Language_Str MSG_ERR_EEPROM_INDEX = _UxGT("Err: Índice EEPROM"); + PROGMEM Language_Str MSG_ERR_EEPROM_VERSION = _UxGT("Err: Versión 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"); @@ -300,10 +337,15 @@ namespace Language_es { 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_BUTTON_BACK = _UxGT("Retroceder"); + PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Proceder"); 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_PRINTING_OBJECT = _UxGT("Imprimiendo Objeto"); + PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Cancelar Objeto"); + PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Cancelar Objeto ="); + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Rec. Fallo electrico"); 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..."); @@ -311,6 +353,7 @@ namespace Language_es { 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_PRINT_DONE = _UxGT("Impresión Completada"); PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Sin movimiento"); PROGMEM Language_Str MSG_KILLED = _UxGT("MUERTA"); PROGMEM Language_Str MSG_STOPPED = _UxGT("DETENIDA"); @@ -327,9 +370,8 @@ namespace Language_es { 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_SINGLENOZZLE_PRIME_SPEED = _UxGT("Vel. de Cebado"); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Vel. de retracción"); 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"); @@ -343,14 +385,14 @@ namespace Language_es { 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: Subir pistón"); - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Cmd: Bajar 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_SELFTEST = _UxGT("Auto-Prueba"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Reiniciar"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Subir pistón"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Bajar pistón"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Modo Software"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Modo 5V"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Modo OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("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"); @@ -362,8 +404,11 @@ namespace Language_es { 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_HOME_FIRST = _UxGT("Origen %s%s%s Prim."); + PROGMEM Language_Str MSG_ZPROBE_OFFSETS = _UxGT("Desf. Sonda"); + PROGMEM Language_Str MSG_ZPROBE_XOFFSET = _UxGT("Desf. Sonda X"); + PROGMEM Language_Str MSG_ZPROBE_YOFFSET = _UxGT("Desf. Sonda Y"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Desf. Sonda 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"); @@ -382,7 +427,6 @@ namespace Language_es { 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 @@ -406,7 +450,7 @@ namespace Language_es { 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_MENU = _UxGT("Info. 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"); @@ -419,10 +463,12 @@ namespace Language_es { 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_INFO_RUNAWAY_OFF = _UxGT("Vig. Fuga Térm.: OFF"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Vig. Fuga Térm.: ON"); + 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"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Impresora incorrecta"); #if LCD_WIDTH >= 20 PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Cont. de impresión"); @@ -437,9 +483,10 @@ namespace Language_es { 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_INFO_PSU = _UxGT("F. Aliment."); PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Fuerza de empuje"); PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Driver %"); PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Driver %"); @@ -455,15 +502,15 @@ namespace Language_es { 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_RUNOUT_SENSOR = _UxGT("Sens. filamento"); + PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Dist. filamento mm"); + PROGMEM Language_Str MSG_KILL_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_KILL_MMU2_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..."); @@ -501,7 +548,7 @@ namespace Language_es { 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_GAMES = _UxGT("Juegos"); PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Brickout"); PROGMEM Language_Str MSG_INVADERS = _UxGT("Invaders"); PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); @@ -509,18 +556,19 @@ namespace Language_es { #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_PAUSE_PRINT_PARKING = _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_LOAD = _UxGT(MSG_2_LINE("Espere para", "cargar 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_PAUSE_PRINT_PARKING = _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")); @@ -531,17 +579,24 @@ namespace Language_es { 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 = _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("Corrección"); PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Suavizado"); + + PROGMEM Language_Str MSG_LEVEL_X_AXIS = _UxGT("Nivel Eje X"); + PROGMEM Language_Str MSG_AUTO_CALIBRATE = _UxGT("Auto Calibrar"); + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("T. de esp. Calent."); + PROGMEM Language_Str MSG_REHEAT = _UxGT("Recalentar"); + PROGMEM Language_Str MSG_REHEATING = _UxGT("Recalentando..."); } diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index a6a0a52518..5b38299e76 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Basque-Euskera * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ @@ -58,20 +58,23 @@ namespace Language_eu { 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."); + #if PREHEAT_COUNT + 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_M = _UxGT("Berotu $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Berotu $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Berotu $ Amaia"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Berotu $ Amaia ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Berotu $ Guztia"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Berotu $ Ohea"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Berotu $ Ezarp."); + #endif 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"); @@ -98,13 +101,13 @@ namespace Language_eu { 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"); + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("$ sarea sortu"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("$ sarea balioetsi"); + #endif 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"); @@ -243,7 +246,6 @@ namespace Language_eu { 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 @@ -306,11 +308,11 @@ namespace Language_eu { 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_KILL_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"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Inprimagailu okerra"); // // Filament Change screens show up to 3 lines on a 4-line display diff --git a/Marlin/src/lcd/language/language_fi.h b/Marlin/src/lcd/language/language_fi.h index 79124c0007..77424df353 100644 --- a/Marlin/src/lcd/language/language_fi.h +++ b/Marlin/src/lcd/language/language_fi.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Finnish * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ @@ -45,20 +45,23 @@ namespace Language_fi { 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"); + #if PREHEAT_COUNT + 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_M = _UxGT("Esilämmitä $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Esilämmitä $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Esilä. $Suutin"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Esilä. $Suutin ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Esilä. $ Kaikki"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Esilä. $ Alusta"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Esilämm. $ konf"); + #endif 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"); @@ -124,5 +127,5 @@ namespace Language_fi { 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"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Väärä tulostin"); } diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index e691d26ab4..d403477eb0 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * French * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ @@ -44,7 +44,6 @@ namespace Language_fr { 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é"); @@ -54,7 +53,7 @@ namespace Language_fr { 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_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."); @@ -71,20 +70,23 @@ namespace Language_fr { 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; + #if PREHEAT_COUNT + 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_M = _UxGT("Préchauffage $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Préchauffage $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Préch. $ buse"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Préch. $ buse ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Préch. $ Tout"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Préch. $ lit"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Régler préch. $"); + #endif PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Préchauf. perso"); PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Refroidir"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Contrôle Laser"); @@ -147,15 +149,15 @@ namespace Language_fr { PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Réglage fin"); PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Terminer"); PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Créer la grille"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Créer grille ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Créer grille ") PREHEAT_2_LABEL; + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("Créer grille $"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Impr. grille $"); + #endif PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Créer grille ..."); PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Mesure à froid"); PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Ajuster haut. couche"); PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Hauteur (x0.1mm)"); PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Vérifier grille"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Impr. grille ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Impr. grille ") PREHEAT_2_LABEL; PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Impr. grille ..."); PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Continuer grille"); PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Niveau par mailles"); @@ -249,6 +251,12 @@ namespace Language_fr { 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_PID_AUTOTUNE = _UxGT("PID Autotune"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_DONE = _UxGT("Tuning PID terminé"); + PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Echec Autotune! E incorrect"); + PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("Echec Autotune! Temp. trop haute"); + PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Echec Autotune! Opér. expirée"); 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"); @@ -263,6 +271,8 @@ namespace Language_fr { PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Accélération"); PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Acc.rétraction"); PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Acc.course"); + PROGMEM Language_Str MSG_XY_FREQUENCY_LIMIT = _UxGT("Fréquence max"); + PROGMEM Language_Str MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Vitesse min"); 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"); @@ -273,6 +283,8 @@ namespace Language_fr { PROGMEM Language_Str MSG_MOTION = _UxGT("Mouvement"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("Limite en mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT_E = _UxGT("Limite *"); 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"); @@ -284,6 +296,7 @@ namespace Language_fr { PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Charger config."); PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Restaurer défauts"); PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Initialiser EEPROM"); + PROGMEM Language_Str MSG_SETTINGS_STORED = _UxGT("Config. enregistrée"); 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"); @@ -296,10 +309,12 @@ namespace Language_fr { 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_IGNORE = _UxGT("Ignorer"); PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Annuler"); PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Terminé"); PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Retour"); PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Procéder"); + PROGMEM Language_Str MSG_PAUSING = _UxGT("Mise en pause..."); 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."); @@ -328,10 +343,21 @@ namespace Language_fr { PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Rétraction 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 rétract°"); + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPEED = _UxGT("Vitesse primaire"); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Vitesse rétract°"); + PROGMEM Language_Str MSG_FILAMENT_PARK_ENABLED = _UxGT("Garer Extrudeur"); + PROGMEM Language_Str MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Vitesse reprise"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Vit. ventil."); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Temps ventil."); + PROGMEM Language_Str MSG_TOOL_MIGRATION_ON = _UxGT("Auto ON"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_OFF = _UxGT("Auto OFF"); + PROGMEM Language_Str MSG_TOOL_MIGRATION = _UxGT("Migration d'outil"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_AUTO = _UxGT("Migration auto"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_END = _UxGT("Extrudeur Final"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_SWAP = _UxGT("Migrer vers *"); PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Attente buse"); PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Longueur retrait"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_EXTRA = _UxGT("Longueur Extra"); 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 *"); @@ -346,13 +372,13 @@ namespace Language_fr { 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_SELFTEST = _UxGT("Self-Test"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Reset"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Ranger"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Déployer"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Mode SW"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Mode 5V"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("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"); @@ -376,7 +402,6 @@ namespace Language_fr { 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"); @@ -418,11 +443,11 @@ namespace Language_fr { PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocole"); PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Protection inactive"); PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Protection active"); + PROGMEM Language_Str MSG_HOTEND_IDLE_TIMEOUT = _UxGT("Hotend Idle Timeout"); 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"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Imprimante incorrecte"); #if LCD_WIDTH >= 20 PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Nbre impressions"); @@ -458,19 +483,20 @@ namespace Language_fr { 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_KILL_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_KILL_MMU2_FIRMWARE = _UxGT("MAJ firmware MMU!!"); 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_RESUME = _UxGT("Continuer Imp. MMU"); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Reprise MMU..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Charge dans MMU"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Charger tous dans MMU"); 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 = _UxGT("Ejecter fil. du MMU"); 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..."); @@ -505,10 +531,13 @@ namespace Language_fr { PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); PROGMEM Language_Str MSG_MAZE = _UxGT("Labyrinthe"); + PROGMEM Language_Str MSG_BAD_PAGE = _UxGT("Erreur index page"); + PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Erreur vitesse page"); + #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_PAUSE_PRINT_PARKING = _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...")); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index 6a8f166ff1..4415fc5e1c 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,12 +25,11 @@ * Galician language (ISO "gl") * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://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 @@ -39,50 +38,202 @@ namespace Language_gl { PROGMEM Language_Str LANGUAGE = _UxGT("Galician"); PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" lista."); + PROGMEM Language_Str MSG_MARLIN = _UxGT("Marlin"); + PROGMEM Language_Str MSG_YES = _UxGT("SI"); + PROGMEM Language_Str MSG_NO = _UxGT("NON"); + PROGMEM Language_Str MSG_BACK = _UxGT("Atrás"); + PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Cancelando..."); PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Tarxeta inserida"); PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Tarxeta retirada"); + PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Agardando ao SD/USB"); + PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Erro 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_KILL_SUBCALL_OVERFLOW = _UxGT("Desbord. Subch."); PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("FinCarro"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Menu principal"); + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("FinCarro SW"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Menú principal"); + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Axustes avanzados"); + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configuración"); PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autoarranque"); 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("Test barra progreso"); 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_AUTO_Z_ALIGN = _UxGT("Autoaliñar 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_LEVEL_BED_DONE = _UxGT("Fin Nivelación!"); + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Compensación Altura"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Axustar Desfases"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Desfases aplicados"); 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"); + #if PREHEAT_COUNT + 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_M = _UxGT("Prequentar $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Prequentar $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Preque. $ Bico"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Preque. $ Bico ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Preque. $ Todo"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Preque. $ Cama"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Preque. $ conf"); + #endif + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Preque. Personali."); PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Arrefriar"); + PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frecuencia"); + 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 Aceso"); + PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Potencia Láser"); + PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Control Fuso"); + PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Fuso Apagado"); + PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Fuso Aceso"); + PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Potencia Fuso"); + PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Inverter xiro"); 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_EXTRUDE = _UxGT("Extruír"); 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_BED_LEVELING = _UxGT("Nivelando Cama"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Nivelar Cama"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Nivelar Cantos"); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Seguinte Canto"); + 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 Detida"); + PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Punto de Proba"); + 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("Ferramentas Compens"); + PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Estacionar"); + PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplicación"); + PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Copia Espello"); + PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Control Total"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2º Bico X"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2º Bico Y"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2º 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("Unified Bed Leveling"); + PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Punto de inclinación"); + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Facer Malla Manual"); + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Colocar Calzo e Medir"); + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Medir"); + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Quitar e Medir Cama"); + PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Mover ao Seguinte"); + 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("Temp Cama"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Temp Bico"); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Temp Bico"); + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Editar Malla"); + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Edit. Malla Person."); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Axuste Fino da Malla"); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Fin Edición da Malla"); + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Crear Malla Person."); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Crear Malla"); + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("Crear Malla ($)"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Validar Malla ($)"); + #endif + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Crear Malla Fría"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Axustar Altura Malla"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Altura"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Validar Malla"); + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Validar Malla perso."); + PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 Quentando Cama"); + PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 Quentando Bico"); + PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Traballo manual..."); + PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Traballo Lonxit Fixa"); + PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Fin Traballo"); + PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 Cancelado"); + PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Saíndo de G26"); + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Continuar Malla"); + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Nivelación Malla"); + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("Nivelación 3Puntos"); + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Nivelación Grid"); + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Nivelar Malla"); + PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Puntos Laterais"); + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Tipo de Mapa "); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Gardar Mapa"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Enviar ao Host"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Gardar en CSV"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Backup Externo"); + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Info do UBL"); + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Cantidade de Recheo"); + PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Recheo Manual"); + PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Recheo Intelixente"); + PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Recheo da Malla"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Invalidar todo"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Invalidar cercanos"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Axustar Fino Todo"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Axustar Fino Cerc"); + PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Almacenamento Malla"); + PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Rañura Memoria"); + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Cargar Malla Cama"); + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Gardar Malla Cama"); + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("Malla %i Cargada"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("Malla %i Gardada"); + PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Sen Gardar"); + PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Erro: Gardadado UBL"); + PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Erro: Recuperación UBL"); + PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Desfase de Z: "); + PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Desfase de Z Detido"); + 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 Malla Fría"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2. Recheo Intelixente"); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3. Validar Malla"); + PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4. Axustar Fino Todo"); + PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5. Validar Malla"); + PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6. Axustar Fino Todo"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7. Gardar Malla Cama"); + + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Control LED"); + PROGMEM Language_Str MSG_LEDS = _UxGT("Luces"); + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Axustes Luz"); + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Vermello"); + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Laranxa"); + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Amarelo"); + 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("Branco"); + 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("Intensidade Vermello"); + 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("Brillo"); + + PROGMEM Language_Str MSG_MOVING = _UxGT("Movendo..."); + 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("Bico moi frío"); 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"); @@ -91,17 +242,72 @@ namespace Language_gl { 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_NOZZLE_PARKED = _UxGT("Bico Estacionado"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Bico Standby"); 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_CHAMBER = _UxGT("Cámara"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Vel. Ventilador"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vel. Ventilador ~"); + PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Ventilador Mem. ~"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Vel. Vent. Extra"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Vel. Vent. Extra ~"); + PROGMEM Language_Str MSG_CONTROLLER_FAN = _UxGT("Controlador Vent."); + PROGMEM Language_Str MSG_CONTROLLER_FAN_IDLE_SPEED = _UxGT("Velocidade Repouso"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_AUTO_ON = _UxGT("Modo Auto"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_SPEED = _UxGT("Velocidade Activa"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_DURATION = _UxGT("Tempo Repouso"); 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_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("Acender"); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Apagar"); + PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("Auto-Sint. PID"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("Auto-Sint. PID *"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_DONE = _UxGT("Fin Auto-Sint PID"); + PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Auto-Sint. fallida. Extrusor danado."); + PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("Auto-Sint. fallida. Temperatura moi alta."); + PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Auto-Sint. fallida. Tempo excedido."); + 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_PID_F = _UxGT("PID-F"); + PROGMEM Language_Str MSG_PID_F_E = _UxGT("PID-F *"); 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_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("Desvío Unión"); + PROGMEM Language_Str MSG_VELOCITY = _UxGT("Velocidade"); + 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("V-viaxe min"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Aceleración"); + 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-retrac."); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-viaxe"); + PROGMEM Language_Str MSG_XY_FREQUENCY_LIMIT = _UxGT("Frecuencia max"); + PROGMEM Language_Str MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Avance min"); 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"); @@ -114,102 +320,306 @@ namespace Language_gl { PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm³"); PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Diam. fil."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diam. fil. *"); + 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("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_DEFAULTS = _UxGT("Cargar de firm."); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Volver a cargar"); - PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Monitorizacion"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Gardar Configuración"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Cargar Configuración"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Rest. Defecto"); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Inicializar EEPROM"); + PROGMEM Language_Str MSG_ERR_EEPROM_CRC = _UxGT("Erro: CRC EEPROM"); + PROGMEM Language_Str MSG_ERR_EEPROM_INDEX = _UxGT("Erro: Índice EEPROM"); + PROGMEM Language_Str MSG_ERR_EEPROM_VERSION = _UxGT("Erro: Versión EEPROM"); + PROGMEM Language_Str MSG_SETTINGS_STORED = _UxGT("Config Gardada"); + PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Actualizar SD/USB"); + PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Reiniciar Impresora"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Recargar"); + PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Información"); 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_START_PRINT = _UxGT("Comezar impresión"); + PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Seguinte"); + PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Comezar"); + PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Deter"); + 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_BUTTON_BACK = _UxGT("Atrás"); + PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Proceder"); + PROGMEM Language_Str MSG_PAUSING = _UxGT("Pausando..."); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausar impresión"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Retomar impresión"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Deter impresión"); + PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Imprimindo Obxecto"); + PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Cancelar Obxecto"); + PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Cancelar Obxecto ="); + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Recuperar Impresión"); 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_USERWAIT = _UxGT("Prema para Retomar.."); + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Impresión Pausada"); + PROGMEM Language_Str MSG_PRINTING = _UxGT("Imprimindo..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Impresión Cancelada"); + PROGMEM Language_Str MSG_PRINT_DONE = _UxGT("Fin Impresión"); 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_KILLED = _UxGT("MORTO."); + PROGMEM Language_Str MSG_STOPPED = _UxGT("DETIDO."); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retraer 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_RETRACTF = _UxGT("Retraer 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_ATTACH_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_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Auto-Retracción"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Lonxitude Retracción"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_EXTRA = _UxGT("Cambio Extra"); + PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Lonxitude de Purga"); + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Cambiar Ferramenta"); + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Levantar Z"); + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPEED = _UxGT("Velocidade prim."); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Vel. de Retracción"); + PROGMEM Language_Str MSG_FILAMENT_PARK_ENABLED = _UxGT("Extrusor Est."); + PROGMEM Language_Str MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Vel. Recuperación"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Vel. Ventilador"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Tempo Ventilador"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_ON = _UxGT("Auto ON"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_OFF = _UxGT("Auto OFF"); + PROGMEM Language_Str MSG_TOOL_MIGRATION = _UxGT("Cambio Ferramenta"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_AUTO = _UxGT("Cambio Automático"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_END = _UxGT("Último Extrusor"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_SWAP = _UxGT("Cambio a *"); + 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 Filamento *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Descargar Todo"); + PROGMEM Language_Str MSG_ATTACH_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 fóra 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("Auto-Test"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Reiniciar"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Recoller"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Estender"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Modo Software"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Modo 5V"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Modo OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Modo Almacenar"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Axustar BLTouch a 5V"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Axustar BLTouch a OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Modo de Informe"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("PERIGO: Unha mala configuración pode 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("Gardar"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Estender TouchMI"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Estender Sonda Z"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Recoller Sonda Z"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Orixe %s%s%s Primeiro"); + PROGMEM Language_Str MSG_ZPROBE_OFFSETS = _UxGT("Desfases Sonda"); + PROGMEM Language_Str MSG_ZPROBE_XOFFSET = _UxGT("Desfase Sonda X"); + PROGMEM Language_Str MSG_ZPROBE_YOFFSET = _UxGT("Desfase Sonda Y"); + 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("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_BABYSTEP_TOTAL = _UxGT("Total"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Erro FinCarro"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Fallo Quentando"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Fallo Quent. Cama"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_CHAMBER = _UxGT("Fallo Quent. Cámara"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Erro:Temp Redundante"); + 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 CÁMARA"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Erro:TEMP MÁX"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Erro:TEMP MÍN"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Erro:TEMP MÁX CAMA"); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Erro:TEMP MÍN CAMA"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Erro:TEMP MÁX CÁMARA"); + PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Erro:TEMP MÍN CÁMARA"); + PROGMEM Language_Str MSG_HALTED = _UxGT("IMPRESORA DETIDA"); PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Debe reiniciar!"); + 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("Quentando..."); + PROGMEM Language_Str MSG_COOLING = _UxGT("Arrefriando..."); PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Quentando cama..."); + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Enfriando Cama..."); + PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Quentando Cámara..."); + PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Arrefriando Cámara..."); 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_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("Ax. Altura Delta"); + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Axustar 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..."); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Informacion"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Estadisticas"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Información"); + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("Nivelación 3puntos"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Nivelación Lineal"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Nivelación Bilineal"); + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Nivelación UBL"); + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Nivelación en Malla"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Estatísticas"); 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"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Reloxo Traballo: OFF"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Reloxo Traballo: ON"); + + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Luz da Caixa"); + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Brillo Luces"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("IMPRESORA INCORRECTA"); + #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"); + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Total Impresións"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completadas"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tempo Total Imp."); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Impresión máis longa"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Total Extruído"); #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_COUNT = _UxGT("Impresións"); + 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áis Longa"); 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_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("Fonte Alimentación"); + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Forza do Motor"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("ERRO 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("OPCIÓN DE RETOMAR:"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Purgar máis"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Retomar traballo"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Bico: "); + PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Sensor Filamento"); + PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Dist mm Sensor Fil"); + PROGMEM Language_Str MSG_KILL_HOMING_FAILED = _UxGT("Fallo ao ir á Orixe"); + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Fallo ao Sondar"); + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Moi Frío"); - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Impresora incorrecta"); + PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("ESCOLLE FILAMENTO"); + PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); + PROGMEM Language_Str MSG_KILL_MMU2_FIRMWARE = _UxGT("Actualizar FW MMU!"); + PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU Precisa Atención."); + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Retomar impr."); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Retomando..."); + 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 até bico"); + 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("Expulsar, premer"); + + PROGMEM Language_Str MSG_MIX = _UxGT("Mestura"); + PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Compoñente ="); + PROGMEM Language_Str MSG_MIXER = _UxGT("Mesturadora"); + PROGMEM Language_Str MSG_GRADIENT = _UxGT("Degradado"); + PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Degradado Total"); + PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Mestura Conmutada"); + PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Mestura Cíclica"); + PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Mestura de Degradado"); + PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Degradado Inverso"); + PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Activar Ferr-V"); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Inicio Ferr-V"); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT(" Fin Ferr-V"); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Alias Ferr-V"); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Reiniciar Ferr-V"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Commit mest. Ferr-V"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("Ferr-V reiniciadas"); + PROGMEM Language_Str MSG_START_Z = _UxGT("Inicio Z:"); + PROGMEM Language_Str MSG_END_Z = _UxGT(" Fin Z:"); + + PROGMEM Language_Str MSG_GAMES = _UxGT("Xogos"); + 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("Labirinto"); #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_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Preme o botón para", "continuar impresión")); + PROGMEM Language_Str MSG_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("Estacionando...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Agarde para", "comezar cambio", "de filamento")); PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Introduza o", "filamento e", "faga click")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Prema o botón para", "quentar o bico")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Quentando bico", "Agarde, por favor...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_3_LINE("Agarde pola", "descarga do", "filamento")); 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_PURGE = _UxGT(MSG_2_LINE("Agarde para", "purgar o filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Prema para finalizar", "a purga do filamen.")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_3_LINE("Agarde a que", "se retome", "a impresión")); + #else + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Premer para continuar")); + PROGMEM Language_Str MSG_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("Estacionando...")); 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_HEAT = _UxGT(MSG_1_LINE("Prema para quentar")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Quentando...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Descargando...")); 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 + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Purgando...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Prema para finalizar")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Retomando...")); + #endif + + PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("Controladores TMC"); + PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Controlador Actual"); + PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Limiar Hibrido"); + PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Orixe sen 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 = _UxGT("Reacción"); + 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("Corrección"); + PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Suavizado"); + + PROGMEM Language_Str MSG_LEVEL_X_AXIS = _UxGT("Nivel Eixe X"); + PROGMEM Language_Str MSG_AUTO_CALIBRATE = _UxGT("Auto Calibrar"); + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Tempo exc. Quent."); + PROGMEM Language_Str MSG_REHEAT = _UxGT("Requentar"); + PROGMEM Language_Str MSG_REHEATING = _UxGT("Requentando..."); } diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index 740d7e5625..4873f5c254 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Croatian (Hrvatski) * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ @@ -55,20 +55,23 @@ namespace Language_hr { 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"); + #if PREHEAT_COUNT + 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_M = _UxGT("Predgrij $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Predgrij $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Predgrij $ Dizna"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Predgrij $ Dizna ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Predgrij $ Sve"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Predgrij $ Bed"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Predgrij $ conf"); + #endif 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"); @@ -132,7 +135,7 @@ namespace Language_hr { 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č"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Neispravan pisač"); #if LCD_WIDTH >= 20 PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Broj printova"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h new file mode 100644 index 0000000000..182ed27072 --- /dev/null +++ b/Marlin/src/lcd/language/language_hu.h @@ -0,0 +1,638 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Magyar + * + * LCD Menü Üzenetek. Lásd még https://marlinfw.org/docs/development/lcd_language.html + * Marlin 2.0.x bugfix Magyar fordítása. A fordítást folyamatosan javítom és frissítem. + * A Magyar fordítást készítette: AntoszHUN + * + * + * + */ + +namespace Language_hu { + using namespace Language_en; // A fordítás az örökölt Amerikai Angol (English) karakterláncokat használja. + + + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Magyar"); + + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" Kész."); + PROGMEM Language_Str MSG_MARLIN = _UxGT("Marlin"); + PROGMEM Language_Str MSG_YES = _UxGT("IGEN"); + PROGMEM Language_Str MSG_NO = _UxGT("NEM"); + PROGMEM Language_Str MSG_BACK = _UxGT("Vissza"); + PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Megszakítás..."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Tároló Behelyezve"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Tároló Eltávolítva"); + PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Várakozás a tárolóra"); + PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Tároló olvasási hiba"); + PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB eltávolítva"); + PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("USB eszköz hiba"); + PROGMEM Language_Str MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Túlfolyás"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Végállás"); // Maximum 8 karakter + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Szoft. Végállás"); + PROGMEM Language_Str MSG_MAIN = _UxGT(""); + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("További Beállítások"); + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Konfiguráció"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autoinditás"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Motorok kikapcsolása"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Hiba Menü"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Haladás sáv teszt"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("XYZ Auto kezdöpont"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("X Kezdöpont"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Y Kezdöpont"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Z Kezdöpont"); + PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto Z-Igazítás"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("XYZ Kezdöpont"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Kattints a kezdéshez."); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Következö Pont"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Szintezés Kész!"); + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Szint Csökkentés"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Kezdöpont eltolás"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Eltolás beállítva."); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Eredeti Be"); + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Fütés ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Fütés ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Fütés ") PREHEAT_1_LABEL _UxGT(" Fej"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Fütés ") PREHEAT_1_LABEL _UxGT(" Fej ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Fütés ") PREHEAT_1_LABEL _UxGT(" Mind"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Fütés ") PREHEAT_1_LABEL _UxGT(" Ágy"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Fütés ") PREHEAT_1_LABEL _UxGT(" Beáll"); + + PROGMEM Language_Str MSG_PREHEAT_M = _UxGT("Fütés $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Fütés $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Fütés $ Fej"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Fütés $ Fej ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Fütés $ Mind"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Fütés $ Ágy"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Fütés $ Beáll"); + #endif + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Egyedi Elömelegítés"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Visszahütés"); + PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frekvencia"); + PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Lézer Vezérlés"); + PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Lézer Ki"); + PROGMEM Language_Str MSG_LASER_ON = _UxGT("Lézer Be"); + PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Lézer Teljesítmény"); + PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Orsó Vezérlés"); + PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Orsó Ki"); + PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Orsó Be"); + PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Orsó Teljesítmény"); + PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Orsó Hátra"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Bekapcsolás"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Kikapcsolás"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrudál"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Visszahúz"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Tengelyek Mozgatása"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Ágy Szintezés"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Ágy szintezése"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Sarok szint"); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Következö sarok"); + PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Háló Szerkesztö"); + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Háló Szerkesztése"); + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Háló Szerk. Állj"); + PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Próbapont"); + 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 Érték"); + PROGMEM Language_Str MSG_USER_MENU = _UxGT("Egyéni Parancs"); + PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48 Probe Teszt"); + PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 Pont"); + PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Eltérés"); + PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("IDEX Mód"); + PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Eszköz Eltolás"); + PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Parkolás"); + PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplikálás"); + PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Tükrözött másolás"); + PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Teljes felügyelet"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2. fúvóka X"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2. fúvóka Y"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2. fúvóka Z"); + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Szintezz! G29"); + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("UBL Eszköz"); + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Egységes Ágy Szint"); + PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Döntési Pont"); + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Kézi Háló Építés"); + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Tégy alátétet és mérj"); + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Mérés"); + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Üres ágyat mérj"); + PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Továbblépés"); + PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("UBL Aktivál"); + PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("UBL Deaktivál"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Ágy Höfok"); + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Ágy Höfok"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Fúvóka Höfok"); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Fúvóka Höfok"); + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Háló Szerkesztés"); + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Egyéni Háló Szerkesztés"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Finomított Háló"); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Háló Kész"); + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Egyéni Háló Építés"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Háló Építés"); + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("Háló Építés ($)"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Háló Elfogadás ($)"); + #endif + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Hideg Háló Építés"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("AHáló Magasság Állítása"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Összmagasság"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Háló Elfogadás"); + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Valódi Háló Elfogadása"); + PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 Ágy Fűtés"); + PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 Fúvóka Fűtés"); + PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Kézi alapozás..."); + PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Fix hosszúságú alap"); + PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Alapozás Kész"); + PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 Törölve"); + PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Kilépö G26"); + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Ágy Háló Folyt."); + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Háló Szintezés"); + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3-Pontos Szintezés"); + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Rács Szintezés"); + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Háló Szint"); + PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Oldal pontok"); + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Térkép Típus"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Háló Térkép Kimenet"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Host Kimenet"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("CSV Kimenet"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Nyomtató Backup Ki"); + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("UBL Infó Kimenet"); + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Kitöltési Költség"); + PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Kézi Kitöltés"); + PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Okos Kitöltés"); + PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Háló Kitöltés"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Minden Érvénytelen"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Közelebbi Érvénytelen"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Mindet Finomhangolja"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Közelebbi Finomhangolása"); + PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Háló Tárolás"); + PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Memória Foglalat"); + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Ágy háló Betöltés"); + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Ágy háló Mentés"); + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Háló %i Betöltve"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Háló %i Mentve"); + PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Nincs tároló"); + PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Hiba: UBL Mentés"); + PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Hiba: UBL Visszaáll"); + PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Z-Eltolás: "); + PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z-Eltolás Leállítva"); + PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("Lépésröl Lépésre UBL"); + PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1. Hideg Háló Készítés"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2. Inteligens Kitöltés"); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3. Háló Érvényesítés"); + PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4. Minden Finomítása"); + PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5. Háló Érvényesítés"); + PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6. Minden Finomítása"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7. Ágy Háló Mentése"); + + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("LED Vezérlés"); + PROGMEM Language_Str MSG_LEDS = _UxGT("Világítás"); + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Beállított Színek"); + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Piros"); + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Narancs"); + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Sárga"); + PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Zöld"); + PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Kék"); + PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indigó"); + PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Viola"); + PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Fehér"); + PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Alapérték"); + PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Egyéni Szín"); + PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Piros Intenzitás"); + PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Zöld Intenzitás"); + PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Kék Intenzitás"); + PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Fehér Intenzitás"); + PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Fényerö"); + + PROGMEM Language_Str MSG_MOVING = _UxGT("Mozgás..."); + PROGMEM Language_Str MSG_FREE_XY = _UxGT("XY Szabad"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("X Mozgás"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Y Mozgás"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Z Mozgás"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Adagoló"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Adagoló *"); + PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("A fúvóka túl hideg"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mozgás %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mozgás 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mozgás 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mozgás 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Sebesség"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Z ágy"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Fúvóka"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Fúvóka ~"); + PROGMEM Language_Str MSG_NOZZLE_PARKED = _UxGT("Fej Parkolva"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Fej Készenlétbe"); + PROGMEM Language_Str MSG_BED = _UxGT("Ágy"); + PROGMEM Language_Str MSG_CHAMBER = _UxGT("Burkolat"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Hütés sebesség"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Hütés sebesség ="); + PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Tárolt Hütés ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Extra hütés sebesség"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Extra hütés sebesség ="); + PROGMEM Language_Str MSG_CONTROLLER_FAN = _UxGT("Hűtésvezérlés"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_IDLE_SPEED = _UxGT("Alapjárat"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_AUTO_ON = _UxGT("Automatikus Mód"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_SPEED = _UxGT("Aktív Sebesség"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_DURATION = _UxGT("Készenlét"); + PROGMEM Language_Str MSG_FLOW = _UxGT("Folyás"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Folyás ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Konfiguráció"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Minimum"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Maximum"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Tényezö"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Automata Höfok"); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("Be"); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Ki"); + PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID Hangolás"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID Hangolás *"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_DONE = _UxGT("PID hangolás kész"); + PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Hangolási hiba. Rossz Adagoló."); + PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("Hangolási hiba. Magas hömérséklet."); + PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Hangolási hiba! Idötúllépés."); + 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_PID_F = _UxGT("PID-F"); + PROGMEM Language_Str MSG_PID_F_E = _UxGT("PID-F *"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Kiválaszt"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Kiválaszt *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Gyorsítás"); + PROGMEM Language_Str MSG_JERK = _UxGT("Rántás"); + PROGMEM Language_Str MSG_VA_JERK = LCD_STR_A _UxGT(" Ránt. Seb."); + PROGMEM Language_Str MSG_VB_JERK = LCD_STR_B _UxGT(" Ránt. Seb."); + PROGMEM Language_Str MSG_VC_JERK = LCD_STR_C _UxGT(" Ránt. Seb."); + PROGMEM Language_Str MSG_VE_JERK = _UxGT("E Ránt. Seb."); + PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Csomopont Eltérés"); + PROGMEM Language_Str MSG_VELOCITY = _UxGT("Sebesség"); + PROGMEM Language_Str MSG_VMAX_A = _UxGT("Max Sebesség ") LCD_STR_A; + PROGMEM Language_Str MSG_VMAX_B = _UxGT("Max Sebesség ") LCD_STR_B; + PROGMEM Language_Str MSG_VMAX_C = _UxGT("Max Sebesség ") LCD_STR_C; + PROGMEM Language_Str MSG_VMAX_E = _UxGT("Max Sebesség ") LCD_STR_E; + PROGMEM Language_Str MSG_VMAX_EN = _UxGT("Max Sebesség *"); + PROGMEM Language_Str MSG_VMIN = _UxGT("Min Sebesség"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Min Utazó.seb."); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Gyorsulás"); + PROGMEM Language_Str MSG_AMAX_A = _UxGT("Max Gyors. ") LCD_STR_A; + PROGMEM Language_Str MSG_AMAX_B = _UxGT("Max Gyors. ") LCD_STR_B; + PROGMEM Language_Str MSG_AMAX_C = _UxGT("Max Gyors. ") LCD_STR_C; + PROGMEM Language_Str MSG_AMAX_E = _UxGT("Max Gyors. ") LCD_STR_E; + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Max Gyorsulás *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Visszahúzás"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Utazás"); + PROGMEM Language_Str MSG_XY_FREQUENCY_LIMIT = _UxGT("Max Frekvencia"); + PROGMEM Language_Str MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Min Elötolás"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Lépés/mm"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" lépés/mm"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" lépés/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" lépés/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("E lépés/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*lépés/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Höfok"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Mozgatások"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Nyomtatószál"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E mm³-ben"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Szál. Átm."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Szál. Átm. *"); + PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Kiadás mm"); + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Betöltés mm"); + PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Haladó K"); + PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Haladó K *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD kontraszt"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Mentés EEPROM"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Betöltés EEPROM"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Alapértelmezett"); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("EEPROM Inicializálás"); + PROGMEM Language_Str MSG_ERR_EEPROM_CRC = _UxGT("Hiba: EEPROM CRC"); + PROGMEM Language_Str MSG_ERR_EEPROM_INDEX = _UxGT("Hiba: EEPROM Index"); + PROGMEM Language_Str MSG_ERR_EEPROM_VERSION = _UxGT("Hiba: EEPROM Verzió"); + PROGMEM Language_Str MSG_SETTINGS_STORED = _UxGT("Beállítások Mentve"); + PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Tároló Frissítés"); + PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Nyomtató Újraindítása"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Frissítés"); + PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT(""); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Vezérlés"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Hangolás"); + PROGMEM Language_Str MSG_START_PRINT = _UxGT("Nyomtatás Indítása"); + PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Tovább"); + PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Kezdet"); + PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Állj"); + PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Nyomtatás"); + PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Újraindítás"); + PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Mégse"); + PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Kész"); + PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Vissza"); + PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Folytatás"); + PROGMEM Language_Str MSG_PAUSING = _UxGT("Szüneteltetve..."); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Nyomtatás Szünetelés"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Nyomtatás folytatása"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Nyomtatás leállítása"); + PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Objektum Nyomtatása"); + PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Objektum Törlése"); + PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Objektum Törlése ="); + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Kiesés Helyreáll."); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Nyomtatás Tárolóról"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Nincs Tároló"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Alvás..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Katt a folytatáshoz..."); + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Nyomtatás szünetelve"); + PROGMEM Language_Str MSG_PRINTING = _UxGT("Nyomtatás..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Nyomtatás leállítva"); + PROGMEM Language_Str MSG_PRINT_DONE = _UxGT("Nyomtatás Kész"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Nincs mozgás."); + PROGMEM Language_Str MSG_KILLED = _UxGT("HALOTT! "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("MEGÁLLT! "); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Visszahúzás mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Visszahúzás Cs. mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Viszahúzás"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Ugrás mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Visszah.helyre mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Csere.Visszah.helyre 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("AutoVisszah."); + PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Visszahúzás Távolság"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_EXTRA = _UxGT("Extra Csere"); + PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Tisztítási Távolság"); + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Szerszámcsere"); + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Z Emelés"); + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPEED = _UxGT("Fösebesség"); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Visszah. Sebesség"); + PROGMEM Language_Str MSG_FILAMENT_PARK_ENABLED = _UxGT("Fej Parkolás"); + PROGMEM Language_Str MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Visszahúzás Sebesség"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("FAN Sebesség"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_TIME = _UxGT("FAN idö"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_ON = _UxGT("Auto BE"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_OFF = _UxGT("Auto KI"); + PROGMEM Language_Str MSG_TOOL_MIGRATION = _UxGT("Szerszámcsere"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_AUTO = _UxGT("Automata Csere"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_END = _UxGT("Utolsó Adagoló"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_SWAP = _UxGT("Csere *"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Szál csere"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Szál csere *"); + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Szál betöltés"); + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Szál betöltés *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Szál eltávolítás"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Szál eltávolítás *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Mindet Eltávolít"); + PROGMEM Language_Str MSG_ATTACH_MEDIA = _UxGT("Tároló"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Tároló csere"); + PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Tároló Kiadása"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z szonda tálcán kivül"); + PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Ferdeség Faktor"); + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Önteszt"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Visszaállítás"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Elhelyez"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Telepít"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("SW-Mód"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("5V-Mód"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("OD-Mód"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Módok"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("BLTouch 5V Mód"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("BLTouch OD Mód"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Jelentés"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("VESZÉLY: A rossz beállítások kárt okozhatnak! Biztos továbblép?"); + PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Kezd TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Z Offset Teszt"); + PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Mentés"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("TouchMI Használ"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Z-Probe Használ"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Z-Probe Elhelyezés"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Elsö %s%s%s Kell"); + PROGMEM Language_Str MSG_ZPROBE_OFFSETS = _UxGT("Szonda Eltolások"); + PROGMEM Language_Str MSG_ZPROBE_XOFFSET = _UxGT("Szonda X Eltolás"); + PROGMEM Language_Str MSG_ZPROBE_YOFFSET = _UxGT("Szonda Y Eltolás"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Szonda Z Eltolás"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Mikrolépés X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Mikrolépés Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Mikrolépés Z"); + PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Teljes"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Végállás megszakítva!"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Fütés hiba!"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Ágy fütés hiba!"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_CHAMBER = _UxGT("Kamra fütés hiba!"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Hiba: SZÜKSÉGTELEN HÖFOK"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("FÜTÉS KIMARADÁS"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("ÁGY FÜTÉS KIMARADÁS"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("KAMRA FÜTÉS KIMARADÁS"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Hiba: MAX Höfok"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Hiba: MIN Höfok"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Hiba: MAX ÁGY HÖFOK"); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Hiba: MIN ÁGY HÖFOK"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Hiba: MAX KAMRA HÖFOK"); + PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Hiba: MIN KAMRA HÖFOK"); + PROGMEM Language_Str MSG_HALTED = _UxGT("A NYOMTATÓ LEFAGYOTT"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Indítsd újra!"); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("n"); // Csak egy karakter + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("ó"); // Csak egy karakter + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("p"); // Csak egy karakter + PROGMEM Language_Str MSG_HEATING = _UxGT("Fütés..."); + PROGMEM Language_Str MSG_COOLING = _UxGT("Hütés..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Ágy fütés..."); + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Ágy hütés..."); + PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Kamra fütés..."); + PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Kamra hütés..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Kalibráció"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("X Kalibrálás"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Y Kalibrálás"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Z Kalibrálás"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Központ Kalibrálás"); + PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Delta Beállítások"); + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto Kalibráció"); + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Delta Magasság Kalib."); + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Z Szonda Eltolás"); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Diag Rúd"); + PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Magasság"); + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Sugár"); + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("A Nyomtatóról"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Nyomtató Infó"); + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-Pontos Szintezés"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Lineáris Szintezés"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Bilineáris Szintezés"); + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Egységes Ágy Szintezés"); + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Háló Szintezés"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Statisztikák"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Alaplap Infó"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termisztorok"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Adagolók"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Átviteli sebesség"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protokoll"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Futáselemzés: KI"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Futáselemzés: BE"); + + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Munkalámpa"); + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Fényerösség"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("HELYTELEN NYOMTATÓ"); + + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Nyomtatás Számláló"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Befejezett"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Összes nyomtatási idö"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Leghosszabb munkaidö"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Összes anyag"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Nyomtatások"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Befejezett"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Összes"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Leghosszabb"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Kiadott"); + #endif + + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Min Höfok"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Max Höfok"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("PSU"); + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Meghajtási Erö"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Meghajtó %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Meghajtó %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Meghajtó %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Meghajtó %"); + PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("TMC CSATLAKOZÁSI HIBA"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Írása"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("NYOMTATÓSZÁL CSERE"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("NYOMTATÁS SZÜNETEL"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("SZÁL BETÖLTÉS"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("SZÁL ELTÁVOLÍTÁS"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("FOLYTATÁSI OPCIÓ:"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Tisztítsd meg"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Folytatás"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Fúvóka: "); + PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Túlfutás Szenzor"); + PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Túlfutás Táv. mm"); + PROGMEM Language_Str MSG_KILL_HOMING_FAILED = _UxGT("Tájolási hiba"); + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Szondázás hiba"); + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Túl hideg"); + + PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("SZÁLVÁLASZTÁS"); + PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); + PROGMEM Language_Str MSG_KILL_MMU2_FIRMWARE = _UxGT("MMU Szoftver Feltöltése!"); + PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU Figyelmeztetés."); + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Nyomtatás Folytatása"); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Folytatás..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Szál Betöltése"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Összes Betöltése"); + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Fúvóka Betöltése"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Szál Kiadása"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Szál Kiadása ~"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Kiadja a szálat"); + PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Szál betölt. %i..."); + PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Szál kiadás...."); + PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Szál kiadása...."); + PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Mind"); + PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Nyomtatószál ~"); + PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("MMU Újraindítás"); + PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("MMU Újraindul..."); + PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Eltávolít, kattint"); + + PROGMEM Language_Str MSG_MIX = _UxGT("Kever"); + PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Összetevö ="); + PROGMEM Language_Str MSG_MIXER = _UxGT("Keverö"); + PROGMEM Language_Str MSG_GRADIENT = _UxGT("Színátm."); + PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Teljes Színátm."); + PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Váltás Keverésre"); + PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Ciklikus Keverés"); + PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Színátm. Keverés"); + PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Fordított Színátm."); + PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Aktív V-szerszám"); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Kezdés V-szerszám"); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT(" Vége V-szerszám"); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Ál V-szerszám"); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Újra V-szerszám"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Gyors V-szerszám Kev."); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-szersz. visszaáll."); + PROGMEM Language_Str MSG_START_Z = _UxGT("Kezdés Z:"); + PROGMEM Language_Str MSG_END_Z = _UxGT(" Vége Z:"); + + PROGMEM Language_Str MSG_GAMES = _UxGT("Játékok"); + 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"); + + // + // 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("Nyomj gombot", "nyomtatás folytatáshoz")); + PROGMEM Language_Str MSG_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("Parkolás...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Várj míg", "szál csere", "indítás")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Szál behelyezés", "majd nyomj gombot", "a folytatáshoz")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Nyomj gombot", "a fúvóka fűtéséhez")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Fúvóka fűtése", "Kérlek várj...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Várj a", "szál kiadására")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Várj a", "szál betöltésére")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Várj a", "szál tisztításra")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Kattints a készre", "szál tiszta")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Várj a nyomtatóra", "majd foltyat...")); + #else + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Katt a folytatáshoz")); + PROGMEM Language_Str MSG_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("Parkolás...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Kérlek Várj...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Behelyez majd katt")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Katt a fűtéshez")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Fűtés...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Kiadás...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Betöltés...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Tisztítás...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Katt ha kész")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Folytatás...")); + #endif + PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("TMC Meghajtók"); + PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Meghajtó áram"); + PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Hibrid Küszöbérték"); + PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Motoros Kezdöpont"); + PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Léptetö Mód"); + PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop Mód"); + PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Újraindítás"); + PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" be:"); + PROGMEM Language_Str MSG_BACKLASH = _UxGT("Holtjáték"); + 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("Korrekció"); + PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Simítás"); + + PROGMEM Language_Str MSG_LEVEL_X_AXIS = _UxGT("X Tengely Szint"); + PROGMEM Language_Str MSG_AUTO_CALIBRATE = _UxGT("Önkalibrálás"); + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Fűtéskimaradás"); + PROGMEM Language_Str MSG_REHEAT = _UxGT("Újrafűt"); + PROGMEM Language_Str MSG_REHEATING = _UxGT("Újrafűtés..."); +} + +#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/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 8d8112d523..6de5d9e032 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Italian * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ @@ -45,11 +45,11 @@ namespace Language_it { 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_KILL_SUBCALL_OVERFLOW = _UxGT("Overflow subchiamate"); 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"); @@ -72,22 +72,26 @@ namespace Language_it { 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"); + #if PREHEAT_COUNT + 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_M = _UxGT("Preriscalda $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Preriscalda $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Preris.$ Ugello"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Preris.$ Ugello ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Preris.$ Tutto"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Preris.$ Piatto"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Preris.$ conf"); + #endif PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Prerisc.personal."); PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Raffredda"); + PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frequenza"); 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"); @@ -147,14 +151,14 @@ namespace Language_it { 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; + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("Crea Mesh ($)"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Valida Mesh ($)"); + #endif 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..."); @@ -187,8 +191,8 @@ namespace Language_it { 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_MESH_LOADED = _UxGT("Mesh %i caricata"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("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"); @@ -238,6 +242,8 @@ namespace Language_it { 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_NOZZLE_PARKED = _UxGT("Ugello parcheggiato"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Ugello in pausa"); 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 @@ -259,8 +265,12 @@ namespace Language_it { 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_AUTOTUNE = _UxGT("Calibrazione PID"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("Calibraz. PID *"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_DONE = _UxGT("Calibr.PID eseguita"); + PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Calibrazione fallita. Estrusore errato."); + PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("Calibrazione fallita. Temperatura troppo alta."); + PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Calibrazione fallita! Tempo scaduto."); 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"); @@ -296,6 +306,8 @@ namespace Language_it { 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_XY_FREQUENCY_LIMIT = _UxGT("Frequenza max"); + PROGMEM Language_Str MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Feed min"); 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"); @@ -306,6 +318,8 @@ namespace Language_it { 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_VOLUMETRIC_LIMIT = _UxGT("Limite E in mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT_E = _UxGT("Limite E *"); 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"); @@ -320,22 +334,29 @@ namespace Language_it { PROGMEM Language_Str MSG_ERR_EEPROM_CRC = _UxGT("Err: CRC EEPROM"); PROGMEM Language_Str MSG_ERR_EEPROM_INDEX = _UxGT("Err: Indice EEPROM"); PROGMEM Language_Str MSG_ERR_EEPROM_VERSION = _UxGT("Err: Versione EEPROM"); + PROGMEM Language_Str MSG_SETTINGS_STORED = _UxGT("Impostazioni mem."); 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_INFO_SCREEN = _UxGT("Schermata info"); PROGMEM Language_Str MSG_PREPARE = _UxGT("Prepara"); PROGMEM Language_Str MSG_TUNE = _UxGT("Regola"); + PROGMEM Language_Str MSG_POWER_MONITOR = _UxGT("Controllo aliment."); + PROGMEM Language_Str MSG_CURRENT = _UxGT("Corrente"); + PROGMEM Language_Str MSG_VOLTAGE = _UxGT("Tensione"); + PROGMEM Language_Str MSG_POWER = _UxGT("Potenza"); 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_IGNORE = _UxGT("Ignora"); 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_PAUSING = _UxGT("Messa in pausa..."); 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"); @@ -349,7 +370,8 @@ namespace Language_it { 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_PRINT_ABORTED = _UxGT("Stampa Annullata"); + PROGMEM Language_Str MSG_PRINT_DONE = _UxGT("Stampa Eseguita"); PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Nessun Movimento"); PROGMEM Language_Str MSG_KILLED = _UxGT("UCCISO. "); PROGMEM Language_Str MSG_STOPPED = _UxGT("ARRESTATO. "); @@ -362,19 +384,29 @@ namespace Language_it { 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_SWAP_LENGTH = _UxGT("Lunghezza scambio"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_EXTRA = _UxGT("Extra scambio"); 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_SINGLENOZZLE_PRIME_SPEED = _UxGT("Velocità innesco"); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Velocità retrazione"); + PROGMEM Language_Str MSG_FILAMENT_PARK_ENABLED = _UxGT("Parcheggia testa"); + PROGMEM Language_Str MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Recover Speed"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Velocità ventola"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Tempo ventola"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_ON = _UxGT("Auto ON"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_OFF = _UxGT("Auto OFF"); + PROGMEM Language_Str MSG_TOOL_MIGRATION = _UxGT("Migrazione utensile"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_AUTO = _UxGT("Auto-migrazione"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_END = _UxGT("Ultimo estrusore"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_SWAP = _UxGT("Migra a *"); PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Cambia filamento"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Cambia filamento *"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Cambia filam. *"); 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_E = _UxGT("Rimuovi filam. *"); PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Rimuovi tutto"); PROGMEM Language_Str MSG_ATTACH_MEDIA = _UxGT("Collega media"); PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Cambia media"); @@ -424,7 +456,6 @@ namespace Language_it { 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 @@ -463,8 +494,12 @@ namespace Language_it { 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_HOTEND_IDLE_TIMEOUT = _UxGT("Timeout inatt.ugello"); + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Luci Case"); PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Luminosità Luci"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("STAMPANTE ERRATA"); + #if LCD_WIDTH >= 20 PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Contat. stampa"); PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completati"); @@ -498,13 +533,13 @@ namespace Language_it { 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_KILL_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_KILL_MMU2_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..."); @@ -548,14 +583,15 @@ namespace Language_it { PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); PROGMEM Language_Str MSG_MAZE = _UxGT("Maze"); - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Stampante errata"); + PROGMEM Language_Str MSG_BAD_PAGE = _UxGT("Indice pag. errato"); + PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Vel. pag. 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_PAUSE_PRINT_PARKING = _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")); @@ -581,7 +617,7 @@ namespace Language_it { 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_HOMING_THRS = _UxGT("Azzer. senza sens."); PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Modo stepping"); PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop abil."); @@ -593,5 +629,11 @@ namespace Language_it { 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"); + PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Appianamento"); + + PROGMEM Language_Str MSG_LEVEL_X_AXIS = _UxGT("Livello asse X"); + PROGMEM Language_Str MSG_AUTO_CALIBRATE = _UxGT("Auto Calibra"); + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Timeout riscaldatore"); + PROGMEM Language_Str MSG_REHEAT = _UxGT("Riscalda"); + PROGMEM Language_Str MSG_REHEATING = _UxGT("Riscaldando..."); } diff --git a/Marlin/src/lcd/language/language_jp_kana.h b/Marlin/src/lcd/language/language_jp_kana.h index 809ee83de8..5f679dd49d 100644 --- a/Marlin/src/lcd/language/language_jp_kana.h +++ b/Marlin/src/lcd/language/language_jp_kana.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -26,7 +26,7 @@ * UTF-8 for Graphical Display * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ @@ -46,7 +46,6 @@ namespace Language_jp_kana { 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" @@ -64,20 +63,23 @@ namespace Language_jp_kana { 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" + #if PREHEAT_COUNT + 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_M = _UxGT("$ ヨネツ"); // "Preheat " PREHEAT_1_LABEL + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("$ ヨネツ ~"); // "Preheat " PREHEAT_1_LABEL + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("$ ヨネツノズル"); // " Nozzle" + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("$ ヨネツノズル ~"); // " Nozzle" + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("$ スベテヨネツ"); // " All" + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("$ ベッドヨネツ"); // " Bed" + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("$ ヨネツセッテイ"); // " conf" + #endif 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" @@ -184,7 +186,6 @@ namespace Language_jp_kana { 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 @@ -228,7 +229,7 @@ namespace Language_jp_kana { 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_KILL_EXPECTED_PRINTER = _UxGT("マチガッタプリンター"); // "Wrong printer" PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("セッテイカンリ"); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("ショウサイセッテイ"); diff --git a/Marlin/src/lcd/language/language_ko_KR.h b/Marlin/src/lcd/language/language_ko_KR.h index 4d8142e38b..2ffcdf7b41 100644 --- a/Marlin/src/lcd/language/language_ko_KR.h +++ b/Marlin/src/lcd/language/language_ko_KR.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Korean * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ namespace Language_ko_KR { @@ -55,14 +55,17 @@ namespace Language_ko_KR { 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(" 노즐 ~"); + #if PREHEAT_COUNT + 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_M = _UxGT("예열하기 - $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("예열하기 - $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("예열하기 - $ 노즐"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("예열하기 - $ 노즐 ~"); + #endif PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Custom 예열"); PROGMEM Language_Str MSG_COOLDOWN = _UxGT("식히기"); PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("스위치 전원 켜기"); @@ -100,5 +103,5 @@ namespace Language_ko_KR { 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("잘못된 프린터"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("잘못된 프린터"); } diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index d5d46ecfe6..c8c79e472a 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Dutch * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ @@ -46,33 +46,32 @@ namespace Language_nl { 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_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"); + #if PREHEAT_COUNT + 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_M = _UxGT("$ voorverwarmen"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("$ voorverw. ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("$ voorverw. Einde"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("$ voorverw. Einde ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("$ voorverw. aan"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("$ voorverw. Bed"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("$ verw. conf"); + #endif 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"); @@ -115,8 +114,8 @@ namespace Language_nl { 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_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 mm³"); PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); @@ -139,7 +138,7 @@ namespace Language_nl { 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 = _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"); @@ -155,7 +154,7 @@ namespace Language_nl { 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_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"); @@ -167,7 +166,6 @@ namespace Language_nl { 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 @@ -183,17 +181,9 @@ namespace Language_nl { 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"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Onjuiste printer"); #if LCD_WIDTH >= 20 PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Printed Aantal"); @@ -211,16 +201,13 @@ namespace Language_nl { 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_INFO_PSU = _UxGT("PSU"); // accepted English term in Dutch PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Motorstroom"); - PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Driver %"); //accepted English term in Dutch - PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Driver %"); //accepted English term in Dutch - PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Driver %"); //accepted English term in Dutch - PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E 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 + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Nozzle: "); // accepted 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 diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 113c58629f..79190ddfcb 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Polish - includes accented characters * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ @@ -44,7 +44,6 @@ namespace Language_pl { 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"); @@ -71,20 +70,23 @@ namespace Language_pl { 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."); + #if PREHEAT_COUNT + 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_M = _UxGT("Rozgrzej $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Rozgrzej $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Rozgrzej $ Dysza"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Rozgrzej $ Dysza ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Rozgrzej $ wsz."); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Rozgrzej $ stół"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Rozgrzej $ ustaw."); + #endif 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"); @@ -146,20 +148,20 @@ namespace Language_pl { 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(")"); + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("Buduj siatkę ($)"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Sprawdzenie siatki ($)"); + #endif 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_PRIME_DONE = _UxGT("Napełnianie 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"); @@ -184,17 +186,17 @@ namespace Language_pl { 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_LOAD_MESH = _UxGT("Załaduj siatkę stołu"); + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Zapisz siatkę stołu"); + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("Siatka %i załadowana"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("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_1_BUILD_COLD_MESH = _UxGT("1. Tworzenie zimnej 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"); @@ -291,8 +293,8 @@ namespace Language_pl { PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E w mm³"); 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_FILAMENT_UNLOAD = _UxGT("Wysuń mm"); + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Wsuń 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"); @@ -340,16 +342,16 @@ namespace Language_pl { 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_SINGLENOZZLE_PRIME_SPEED = _UxGT("Prędkość napełniania"); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _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_FILAMENTLOAD = _UxGT("Wsuń Filament"); + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Wsuń Filament *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Wysuń Filament"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Wysuń Filament *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Wysuń wszystkie"); PROGMEM Language_Str MSG_ATTACH_MEDIA = _UxGT("Inicjal. karty SD"); PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Zmiana karty SD"); PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Zwolnienie karty"); @@ -358,16 +360,16 @@ namespace Language_pl { 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_STOW = _UxGT("Stow"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Deploy"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("SW-Mode"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("5V-Mode"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("OD-Mode"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("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_BLTOUCH_MODE_CHANGE = _UxGT("UWAGA: 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"); @@ -395,7 +397,6 @@ namespace Language_pl { 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 @@ -437,7 +438,7 @@ namespace Language_pl { 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"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Niepoprawna drukarka"); #if LCD_WIDTH >= 20 PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Wydrukowano"); @@ -465,33 +466,33 @@ namespace Language_pl { 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_HEADER_LOAD = _UxGT("WSUŃ FILAMENT"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("WYSUŃ 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_KILL_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_KILL_MMU2_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_LOAD_FILAMENT = _UxGT("Wsuń filament"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Wsuń wszystko"); + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Wsuń 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_UNLOAD_FILAMENT = _UxGT("Wysuń filament"); + PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Wsuwanie 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_UNLOADING_FILAMENT = _UxGT("Wysuwanie 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"); @@ -507,25 +508,6 @@ namespace Language_pl { 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 @@ -533,7 +515,7 @@ namespace Language_pl { // #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_PAUSE_PRINT_PARKING = _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ę")); @@ -545,29 +527,15 @@ namespace Language_pl { 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_PAUSE_PRINT_PARKING = _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_LOAD = _UxGT(MSG_1_LINE("Wsuwanie...")); 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/src/lcd/language/language_pt.h b/Marlin/src/lcd/language/language_pt.h index 69c8be603f..1180649c98 100644 --- a/Marlin/src/lcd/language/language_pt.h +++ b/Marlin/src/lcd/language/language_pt.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -26,7 +26,7 @@ * UTF-8 for Graphical Display * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ @@ -54,20 +54,23 @@ namespace Language_pt { 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; + #if PREHEAT_COUNT + 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_M = _UxGT("Pre-aquecer $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Pre-aquecer $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Pre-aquecer $ Bico"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Pre-aquecer $ Bico ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Pre-aq. $ Tudo"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Pre-aq. $ ") LCD_STR_THERMOMETER _UxGT("Base"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Definições $"); + #endif 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"); @@ -159,5 +162,5 @@ namespace Language_pt { PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Fim de curso"); - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Impressora Incorreta"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Impressora Incorreta"); } diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index 9ce6a7042b..e0a52fc390 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -26,7 +26,7 @@ * UTF-8 for Graphical Display * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ namespace Language_pt_br { @@ -36,10 +36,17 @@ namespace Language_pt_br { PROGMEM Language_Str LANGUAGE = _UxGT("Portuguese (BR)"); PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" pronto."); - + PROGMEM Language_Str MSG_YES = _UxGT("SIM"); + PROGMEM Language_Str MSG_NO = _UxGT("NÃO"); PROGMEM Language_Str MSG_BACK = _UxGT("Voltar"); + PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Abortando..."); PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Cartão inserido"); PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Cartão removido"); + PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("Cartão liberado"); + PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Aguardando cartão"); + PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Erro de leitura"); + PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB removido"); + PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("USB falhou"); 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"); @@ -62,20 +69,23 @@ namespace Language_pt_br { 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; + #if PREHEAT_COUNT + 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_M = _UxGT("Pre-aquecer $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Pre-aquecer $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Extrusora $"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Extrusora $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Pre-aq.Todo $"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Pre-aq.Mesa $"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Ajustar $"); + #endif 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"); @@ -87,13 +97,16 @@ namespace Language_pt_br { 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_MESH_EDITOR = _UxGT("Editor de Malha"); PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Editar Malha"); PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Fim da Edição"); + PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Sondando ponto"); 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_M48_TEST = _UxGT("M48 Teste de sonda"); + PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 Ponto"); 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"); @@ -102,7 +115,6 @@ namespace Language_pt_br { 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."); @@ -114,24 +126,28 @@ namespace Language_pt_br { 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_BED_TEMP_CUSTOM = _UxGT("Temp. Mesa"); 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_HOTEND_TEMP_CUSTOM = _UxGT("Temp. Extrusora"); 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; + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("Montar $"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Checar $"); + #endif 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_G26_HEATING_BED = _UxGT("G26 Aquecendo Mesa"); + PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 Aquecendo Ext."); + PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 Cancelado"); + PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("G26 Saindo"); 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"); @@ -156,11 +172,12 @@ namespace Language_pt_br { 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_MESH_LOADED = _UxGT("Malha %i carregada"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("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 = _UxGT("Compensação Z: "); 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"); @@ -189,6 +206,7 @@ namespace Language_pt_br { 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"); @@ -260,9 +278,22 @@ namespace Language_pt_br { PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Informações"); PROGMEM Language_Str MSG_PREPARE = _UxGT("Preparar"); PROGMEM Language_Str MSG_TUNE = _UxGT("Ajustar"); + PROGMEM Language_Str MSG_START_PRINT = _UxGT("Iniciar Impressão"); + PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Prox."); + 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("Resetar"); + PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Cancelar"); + PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Pronto"); + PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Voltar"); + PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Continuar"); PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausar impressão"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Resumir impressão"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Continuar impressão"); PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Parar impressão"); + PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Imprimindo objeto"); + PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Cancelar Objeto"); + PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Cancelar Objeto ="); 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"); @@ -284,43 +315,54 @@ namespace Language_pt_br { 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_FILAMENT_PURGE_LENGTH = _UxGT("Distancia Purga"); 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_SINGLENOZZLE_PRIME_SPEED = _UxGT("Preparar Veloc."); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Veloc. Retração"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Standby bico"); PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Trocar Filamento"); PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Trocar Filamento *"); + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Carregar Filamento"); PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Carregar Filamento *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Descarreg. Filamento"); PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Descarreg. Filamento *"); PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Descarregar Todos"); PROGMEM Language_Str MSG_ATTACH_MEDIA = _UxGT("Iniciar SD"); PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Trocar SD"); + PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Liberar 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_BLTOUCH_DEPLOY = _UxGT("Estender 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_OFFSETS = _UxGT("Compensar Sonda"); + PROGMEM Language_Str MSG_ZPROBE_XOFFSET = _UxGT("Compensar Sonda em X"); + PROGMEM Language_Str MSG_ZPROBE_YOFFSET = _UxGT("Compensar Sonda em Y"); 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_BABYSTEP_TOTAL = _UxGT("Total"); 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_HEATING_FAILED_LCD_CHAMBER = _UxGT("Aquecer câmara 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_THERMAL_RUNAWAY_CHAMBER = _UxGT("ESCAPE TÉRMICO CAMARA"); 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_ERR_MAXTEMP_CHAMBER = _UxGT("Erro:Temp Câmara Máx"); + PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Erro:Temp Câmara Min"); 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"); @@ -330,12 +372,13 @@ namespace Language_pt_br { 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_CHAMBER_HEATING = _UxGT("Aquecendo Câmara..."); + PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Esfriando Câmara..."); 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"); @@ -356,10 +399,10 @@ namespace Language_pt_br { 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"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Impressora Incorreta"); #if LCD_WIDTH >= 20 PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Total de Impressões"); @@ -380,7 +423,7 @@ namespace Language_pt_br { 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 = _UxGT("TROCA DE FILAMENTO"); 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"); @@ -389,12 +432,38 @@ namespace Language_pt_br { 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_KILL_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"); + PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("ESCOLHER FILAMENTO"); + PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); + + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Continuar Impressão"); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Continuando..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Carregar Filamento"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Carregar Todos"); + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Carregar para bocal"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Ejetar Filamento"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Ejetar Filamento ~"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Liberar Filamento"); + PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Carregando Fil. %i..."); + PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Ejetando Fil. ..."); + PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Carregando Fil...."); + PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Todos"); + PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Filamento ~"); + PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Resetar MMU"); + PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Resetando MMU..."); + + PROGMEM Language_Str MSG_GAMES = _UxGT("Jogos"); + 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("Labirinto"); + #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_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Estacionando...")); 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")); @@ -406,8 +475,10 @@ namespace Language_pt_br { 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_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Estacionando...")); 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_HEAT = _UxGT(MSG_1_LINE("Clique para Aquecer")); 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...")); diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h new file mode 100644 index 0000000000..39e5cb9e2c --- /dev/null +++ b/Marlin/src/lcd/language/language_ro.h @@ -0,0 +1,645 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + + /** + * Romanian + * + * LCD Menu Messages + * See also https://marlinfw.org/docs/development/lcd_language.html + * + * Translation by cristyanul + */ +namespace Language_ro { + using namespace Language_en; // Inherit undefined strings from English + + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Romanian"); + + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" Pregatit."); + PROGMEM Language_Str MSG_MARLIN = _UxGT("Marlin"); + PROGMEM Language_Str MSG_YES = _UxGT("DA"); + PROGMEM Language_Str MSG_NO = _UxGT("NU"); + PROGMEM Language_Str MSG_BACK = _UxGT("Inapoi"); + PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Abandon..."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Media Introdus"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Media Inlaturat"); + PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Astept Media"); + PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Eroare Citire Media"); + PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("Dispozitiv USB Inlaturat"); + PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("Pornire USB Esuata"); + PROGMEM Language_Str MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Eroare:Subcall Overflow"); + 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("Principal"); + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Setari Avansate"); + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configurare"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Dezactivare Motoare"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Meniu Debug"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test Bara Progres"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Auto Acasa"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Acasa X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Acasa Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Acasa Z"); + PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto Aliniere-Z"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Acasa XYZ"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Click pentru a incepe"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Urmatorul Punct"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Nivelare Terminata!"); + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Fade Inaltime"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Seteaza Offseturile Acasa"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offseturi Aplicate"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Seteaza Originea"); + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Preincalzeste ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Preincalzeste ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Preincalzeste ") PREHEAT_1_LABEL _UxGT(" Capatul"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Preincalzeste ") PREHEAT_1_LABEL _UxGT(" Capatul ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Preincalzeste ") PREHEAT_1_LABEL _UxGT(" Tot"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Preincalzeste ") PREHEAT_1_LABEL _UxGT(" Patul"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Preincalzeste ") PREHEAT_1_LABEL _UxGT(" Conf"); + + PROGMEM Language_Str MSG_PREHEAT_M = _UxGT("Preincalzeste $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Preincalzeste $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Preincalzeste $ Capatul"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Preincalzeste $ Capatul ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Preincalzeste $ Tot"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Preincalzeste $ Patul"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Preincalzeste $ Conf"); + #endif + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Preincalzeste Personalizat"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Racire"); + PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frecventa"); + PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Control Laser"); + PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Laser Oprit"); + PROGMEM Language_Str MSG_LASER_ON = _UxGT("Laser Pornit"); + PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Puterea Laserului"); + PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Controlul Spindle"); + PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Spindle Oprit"); + PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Spindle Pornit"); + PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Puterea Spindle"); + PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Spindle Invers"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Porneste"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Opreste"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrudeaza"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Retracteaza"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Muta Axa"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Nivelarea Patului"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Niveleaza Patul"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Niveleaza Colturile"); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Urmatorul Colt"); + PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Editor Mesh"); + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Editeaza Mesh"); + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Editarea Meshului Oprita"); + PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Punctul de Probare"); + 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("Valoare Z"); + PROGMEM Language_Str MSG_USER_MENU = _UxGT("Comenzi Personalizate"); + 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"); + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("Build Mesh ($)"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Validate Mesh ($)"); + #endif + 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_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 Imprimanta 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("Mesh %i Loaded"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("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("Capat Prea Rece"); + 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_NOZZLE_PARKED = _UxGT("Nozzle Parked"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Nozzle Standby"); + 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_CONTROLLER_FAN = _UxGT("Controller Fan"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_IDLE_SPEED = _UxGT("Idle Speed"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_AUTO_ON = _UxGT("Auto Mode"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_SPEED = _UxGT("Active Speed"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_DURATION = _UxGT("Idle Period"); + 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_AUTOTUNE_DONE = _UxGT("PID tuning done"); + PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune failed. Bad extruder."); + PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed. Temperature too high."); + PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Autotune failed! Timeout."); + 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_PID_F = _UxGT("PID-F"); + PROGMEM Language_Str MSG_PID_F_E = _UxGT("PID-F *"); + 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_XY_FREQUENCY_LIMIT = _UxGT("Frequency max"); + PROGMEM Language_Str MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Feed min"); + 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_VOLUMETRIC_LIMIT = _UxGT("E Limit in mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT_E = _UxGT("E Limit *"); + 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_DEFAULTS = _UxGT("Restore Defaults"); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Initialize EEPROM"); + PROGMEM Language_Str MSG_ERR_EEPROM_CRC = _UxGT("EEPROM CRC Error"); + PROGMEM Language_Str MSG_ERR_EEPROM_INDEX = _UxGT("EEPROM Index Error"); + PROGMEM Language_Str MSG_ERR_EEPROM_VERSION = _UxGT("EEPROM Version Error"); + PROGMEM Language_Str MSG_SETTINGS_STORED = _UxGT("Settings Stored"); + PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Media Update"); + PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Reset Imprimanta"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Refresh"); + PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Info Screen"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Prepare"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Tune"); + PROGMEM Language_Str MSG_POWER_MONITOR = _UxGT("Power monitor"); + PROGMEM Language_Str MSG_CURRENT = _UxGT("Intensitate"); + PROGMEM Language_Str MSG_VOLTAGE = _UxGT("Voltaj"); + PROGMEM Language_Str MSG_POWER = _UxGT("Putere"); + PROGMEM Language_Str MSG_START_PRINT = _UxGT("Start Imprimare"); + PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Urmatorul"); + PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Initiere"); + PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Stop"); + PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Imprimeaza"); + PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Reseteaza"); + PROGMEM Language_Str MSG_BUTTON_IGNORE = _UxGT("Ignora"); + PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Anuleaza"); + PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("OK"); + PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Inapoi"); + PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Proceed"); + PROGMEM Language_Str MSG_PAUSING = _UxGT("Pausing..."); + 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_PRINT_DONE = _UxGT("Print Done"); + 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_SWAP_EXTRA = _UxGT("Swap Extra"); + PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Purge Length"); + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Tool Inlocuire"); + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Z Raise"); + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPEED = _UxGT("Prime Speed"); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Retract Speed"); + PROGMEM Language_Str MSG_FILAMENT_PARK_ENABLED = _UxGT("Park Head"); + PROGMEM Language_Str MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Recover Speed"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Fan Speed"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Fan Time"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_ON = _UxGT("Auto Pornit"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_OFF = _UxGT("Auto Oprit"); + PROGMEM Language_Str MSG_TOOL_MIGRATION = _UxGT("Tool Migration"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_AUTO = _UxGT("Auto-migrare"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_END = _UxGT("Last Extruder"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_SWAP = _UxGT("Migrate to *"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Inlocuire Filament"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Inlocuire Filament *"); + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Incarcare Filament"); + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Incarcare Filament *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Scoatere Filament"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Scoatere Filament *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Scoate Tot"); + PROGMEM Language_Str MSG_ATTACH_MEDIA = _UxGT("Atasare Media"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Inlocuire Media"); + PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Eliberare 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("Self-Test"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Reset"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Stow"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Deploy"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("SW-Mode"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("5V-Mode"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("OD-Mode"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("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_OFFSETS = _UxGT("Probe Offsets"); + PROGMEM Language_Str MSG_ZPROBE_XOFFSET = _UxGT("Probe X Offset"); + PROGMEM Language_Str MSG_ZPROBE_YOFFSET = _UxGT("Probe Y Offset"); + 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_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("Inaltime"); + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Radius"); + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Despre Imprimanta"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Info Imprimanta"); + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("Nivelare in 3 puncte"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Nivelare Lineara"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Nivelare Bilineara"); + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Nivelarea Patului Unificata"); + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Nivelare Mesh"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Status Imprimanta"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Informatii Placa"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistoare"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extrudere"); + 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_HOTEND_IDLE_TIMEOUT = _UxGT("Hotend Idle Timeout"); + + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Case Light"); + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Light Brightness"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("INCORRECT PRINTER"); + +#if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Total Printuri"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completat"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Timp Imprimare Total"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Longest Job Time"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Total Extrudat"); +#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("Temperatura Minima"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Temperatura Maxima"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("PSU"); + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Drive Strength"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E 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_KILL_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_KILL_MMU2_FIRMWARE = _UxGT("Update MMU Firmware!"); + PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU Needs Attention."); + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("MMU Resume"); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("MMU Resuming..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("MMU Load"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("MMU Load All"); + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("MMU Load to Nozzle"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("MMU Eject"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("MMU Eject ~"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("MMU Unload"); + 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("MMU Resetting..."); + 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("Jocuri"); + 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_BAD_PAGE = _UxGT("Bad page index"); + PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Bad page speed"); + + // + // Filament Inlocuire 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("Apasa Butonul", "pentru a reveni la print")); + PROGMEM Language_Str MSG_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("Parcare...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Astept ca", "inlocuirea filamentului", "sa inceapa")); + 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_PARKING = _UxGT(MSG_1_LINE("Parcare...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Va rog asteptati...")); + 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 pentru incalzire")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Incalzire...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Ejectare...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Incarcare...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Curatare...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Click pentru a termina")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Se Reia...")); +#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("Corectare"); + PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Smoothing"); + + PROGMEM Language_Str MSG_LEVEL_X_AXIS = _UxGT("Nivelare Axa X"); + PROGMEM Language_Str MSG_AUTO_CALIBRATE = _UxGT("Auto Calibrare"); + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Timeout Incalzitor"); + PROGMEM Language_Str MSG_REHEAT = _UxGT("Reincalzire"); + PROGMEM Language_Str MSG_REHEATING = _UxGT("Reincalzire..."); +} + +#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/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index a7c971e8c7..6228e92346 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Russian * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ #define DISPLAY_CHARSET_ISO10646_5 @@ -36,16 +36,27 @@ namespace Language_ru { constexpr uint8_t CHARSIZE = 2; PROGMEM Language_Str LANGUAGE = _UxGT("Russian"); - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" готов."); + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" Готов."); + PROGMEM Language_Str MSG_YES = _UxGT("Да"); + PROGMEM Language_Str MSG_NO = _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_MEDIA_ABORTING = _UxGT("Прерывание..."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("SD-карта вставлена"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("SD-карта извлечена"); + PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Вставьте SD-карту"); + PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Ошибка считывания"); + PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB диск удалён"); + PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("Ошибка USB диска"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Переполнение вызова"); + #else + PROGMEM Language_Str MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Переполн. вызова"); + #endif PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Прогр. эндстопы"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Меню"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Эндстопы"); // Max length 8 characters + PROGMEM Language_Str MSG_MAIN = _UxGT("Основное меню"); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Другие настройки"); - PROGMEM Language_Str MSG_CONFIGURATION = _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("Меню отладки"); @@ -54,60 +65,85 @@ namespace Language_ru { 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_AUTO_Z_ALIGN = _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(" правка"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Установ. смещения дома"); + #else + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Установ.смещ.дома"); + #endif + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Смещения применены"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Установить ноль"); + #if PREHEAT_COUNT + 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_M = _UxGT("Преднагрев $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Нагрев $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Нагрев $ сопло"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Нагрев $ сопло ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Нагрев $ всё"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Нагрев $ стол"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Нагрев $ правка"); + #endif + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Нагрев Свой"); PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Охлаждение"); + PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Частота"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Управление лазером"); PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Выключить лазер"); PROGMEM Language_Str MSG_LASER_ON = _UxGT("Включить лазер"); PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Мощность лазера"); - PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Шпиндель управление"); + PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Управление шпинделем"); PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Выключить шпиндель"); PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Включить шпиндель"); - PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Мощность шпинделя"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Мощность шпинделя"); + #else + PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Мощн.шпинделя"); + #endif PROGMEM Language_Str MSG_SPINDLE_REVERSE = _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_BED_LEVELING = _UxGT("Выравнивание стола"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Выровнять стол"); PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Выровнять углы"); PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Следующий угол"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Смещение по Z"); + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Правка сетки окончена"); + #else + PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Смещение Z"); + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Правка окончена"); + #endif PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Редактировать сетку"); - PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Правка сетки окончена"); - PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Точка сетки:"); + PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Точка сетки"); PROGMEM Language_Str MSG_MESH_X = _UxGT("Индекс X"); PROGMEM Language_Str MSG_MESH_Y = _UxGT("Индекс Y"); PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Значение Z"); PROGMEM Language_Str MSG_USER_MENU = _UxGT("Свои команды"); - PROGMEM Language_Str MSG_M48_TEST = _UxGT("Проверка Z-датчика"); + PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48 тест Z-зонда"); PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Отклонение"); - PROGMEM Language_Str MSG_M48_POINT = _UxGT("Измерение"); + PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 точка"); + + PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("Меню IDEX"); + PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Авто парковка"); + PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Размножение"); + PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Зеркальная копия"); + PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Полный контроль"); - // TODO: IDEX Menu PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Размещение сопел"); PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2-е сопло X"); @@ -115,72 +151,118 @@ namespace Language_ru { 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("Z-пробник и замеры"); + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Инструменты UBL"); + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Настройка UBL"); + PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Точка разворота"); + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Ручной ввод сетки"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Разместить шайбу и измерить"); + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Убрать и замерить стол"); + #else + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Разм.шайбу,измерить"); + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Убрать, измер. стол"); + #endif 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("Температура стола"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Температура сопла"); - PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Температура сопла"); + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Редактор сеток"); PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Править свою сетку"); + + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Температура стола"); + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Температура стола"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Температура сопла"); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Температура сопла"); + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Построить свою сетку"); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Правка сетки завершена"); + #else + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = LCD_STR_THERMOMETER _UxGT(" стола, ") LCD_STR_DEGREE "C"; + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = LCD_STR_THERMOMETER _UxGT(" стола, ") LCD_STR_DEGREE "C"; + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = LCD_STR_THERMOMETER _UxGT(" сопла, ") LCD_STR_DEGREE "C"; + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = LCD_STR_THERMOMETER _UxGT(" сопла, ") LCD_STR_DEGREE "C"; + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Построить свою"); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Правка завершена"); + #endif 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("Построить хол. сетку"); + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("Построить сетку $"); + #endif + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Построить холодную сетку"); + #else + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Строить холод.сетку"); + #endif 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("Проверить свою сетку"); + #if LCD_WIDTH > 21 + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Проверить сетку $"); + #endif + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Проверить свою сетку"); + #else + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Провер. сетку $"); + #endif + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Провер. свою сетку"); + #endif + PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 нагрев стола"); + PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 нагрев сопла"); + PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Ручная грунтовка"); + PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Грунт фикс. длины"); + PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Грунтовка сделана"); + PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 завершена"); + PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Выйти из G26"); 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_MESH_LEVELING = _UxGT("Выравнивание сетки"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3-х точечное выравнивание"); + #else + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3-точечное выравн."); + #endif PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Калибровка растера"); - PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _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"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Сохранить сетку снаружи"); + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Вывод информации UBL"); + #else + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Сохранить снаружи"); + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Информация UBL"); + #endif 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_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_LOAD_MESH = _UxGT("Загрузить сетку"); + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Сохранить сетку"); + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("Сетка %i загружена"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("Сетка %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_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_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_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_UBL_6_FINE_TUNE_ALL = _UxGT("6.Точно настр. всё"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Сохранить сетку"); PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Настройка подсветки"); PROGMEM Language_Str MSG_LEDS = _UxGT("Подсветка"); @@ -202,7 +284,7 @@ namespace Language_ru { 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_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"); @@ -215,29 +297,39 @@ namespace Language_ru { 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 = _UxGT("Сопло, ") LCD_STR_DEGREE "C"; PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Сопло ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Стол"); + PROGMEM Language_Str MSG_NOZZLE_PARKED = _UxGT("Сопло запарковано"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Сопло ожидает"); + PROGMEM Language_Str MSG_BED = _UxGT("Стол, ") LCD_STR_DEGREE "C"; + PROGMEM Language_Str MSG_CHAMBER = _UxGT("Камера,") LCD_STR_DEGREE "C"; 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_CONTROLLER_FAN = _UxGT("Обдув платы"); - PROGMEM Language_Str MSG_CONTROLLER_FAN_IDLE_SPEED = _UxGT("Обороты простоя"); + PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Сохранённый кулер ~"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Дополн. кулер"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Дополн. кулер ~"); + PROGMEM Language_Str MSG_CONTROLLER_FAN = _UxGT("Контроллер кулера"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_IDLE_SPEED = _UxGT("Холостые обороты"); PROGMEM Language_Str MSG_CONTROLLER_FAN_AUTO_ON = _UxGT("Автовключение"); PROGMEM Language_Str MSG_CONTROLLER_FAN_SPEED = _UxGT("Рабочие обороты"); - PROGMEM Language_Str MSG_CONTROLLER_FAN_DURATION = _UxGT("Простой после"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_DURATION = _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_MIN = " " LCD_STR_THERMOMETER ", " LCD_STR_DEGREE _UxGT("С мин"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER ", " LCD_STR_DEGREE _UxGT("С макс"); PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Фактор"); - PROGMEM Language_Str MSG_AUTOTEMP = _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_AUTOTUNE = _UxGT("Автонастройка"); - PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("Автонастройка *"); + + PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("Автоподбор PID"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("Автоподбор PID *"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_DONE = _UxGT("Подбор PID выполнен"); + PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Сбой автоподбора. Плохой экструдер."); + PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("Сбой автоподбора. Температура повышена."); + PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Сбой автоподбора! Завершение времени."); + PROGMEM Language_Str MSG_SELECT = _UxGT("Выбор"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Выбор *"); PROGMEM Language_Str MSG_ACC = _UxGT("Ускорение"); @@ -246,127 +338,210 @@ namespace Language_ru { 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("*шаг/мм"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Отклонение узла"); + #else + PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Отклон. узла"); + #endif + PROGMEM Language_Str MSG_VELOCITY = _UxGT("Скорость, мм/с"); + PROGMEM Language_Str MSG_VMAX_A = _UxGT("Скор.макс ") LCD_STR_A; + 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("Скор.макс *"); + PROGMEM Language_Str MSG_VMIN = _UxGT("Скор.мин"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Перемещение мин"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Ускорение, мм/с2"); + PROGMEM Language_Str MSG_AMAX_A = _UxGT("Ускор.макс ") LCD_STR_A; + 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("Ускор.макс *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Ускор.втягив."); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Ускор.путеш."); + PROGMEM Language_Str MSG_XY_FREQUENCY_LIMIT = _UxGT("Частота макс."); + PROGMEM Language_Str MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Подача мин."); + 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 в мм³"); - 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_VOLUMETRIC_LIMIT = _UxGT("E огран.,мм³"); + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT_E = _UxGT("E огран. *"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Диам. филамента"); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Диам. филамента *"); + #else + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Диам. филам."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Диам. филам. *"); + #endif + 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("Контраст экрана"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Сохранить настройки"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Загрузить настройки"); - PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Вернуть настройки"); - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Изначальный EEPROM"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("На базовые параметры"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Инициализация EEPROM"); + #else + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Инициализ. EEPROM"); + #endif + PROGMEM Language_Str MSG_ERR_EEPROM_CRC = _UxGT("Сбой EEPROM: CRC"); + PROGMEM Language_Str MSG_ERR_EEPROM_INDEX = _UxGT("Сбой EEPROM: индекс"); + PROGMEM Language_Str MSG_ERR_EEPROM_VERSION = _UxGT("Сбой EEPROM: версия"); + PROGMEM Language_Str MSG_SETTINGS_STORED = _UxGT("Параметры сохранены"); 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_REFRESH = LCD_STR_REFRESH _UxGT(" Обновить"); PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Главный экран"); PROGMEM Language_Str MSG_PREPARE = _UxGT("Подготовить"); PROGMEM Language_Str MSG_TUNE = _UxGT("Настроить"); + PROGMEM Language_Str MSG_POWER_MONITOR = _UxGT("Монитор питания"); + PROGMEM Language_Str MSG_CURRENT = _UxGT("Ток"); + PROGMEM Language_Str MSG_VOLTAGE = _UxGT("Напряжение"); + PROGMEM Language_Str MSG_POWER = _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_NEXT = _UxGT("Дальше"); //short text for buttons + 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_IGNORE = _UxGT("Игнорир."); PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Отмена"); PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Готово"); + PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Назад"); + PROGMEM Language_Str MSG_BUTTON_PROCEED = _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_PRINTING_OBJECT = _UxGT("Печать объекта"); + PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Завершить объект"); + PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _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_PRINTING = _UxGT("Печать..."); PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Печать отменена"); + PROGMEM Language_Str MSG_PRINT_DONE = _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("Втягивание смены мм"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Втягивание, мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Смена втягив., мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Возврат смены, мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("Возврат смены, V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Автовтягивание"); + #else + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Втягив., мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Смена втяг.,мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Возвр.смены,мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("Возвр.смены V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Автовтягив."); + #endif + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _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_RECOVER = _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_FILAMENT_SWAP_LENGTH = _UxGT("Поменять длины"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_FILAMENT_SWAP_EXTRA = _UxGT("Поменять дополнительно"); + #else + PROGMEM Language_Str MSG_FILAMENT_SWAP_EXTRA = _UxGT("Поменять дополнит."); + #endif + PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Очистить длину"); PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Смена сопел"); PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Поднятие по Z"); - - // TODO: Singlenozzle, nozzle standby - + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPEED = _UxGT("Начальная скор."); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Скорость втягив."); + #else + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPEED = _UxGT("Началь.скор."); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Скор.втягив."); + #endif + PROGMEM Language_Str MSG_FILAMENT_PARK_ENABLED = _UxGT("Парковать голову"); + PROGMEM Language_Str MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Вернуть скорость"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Обороти кулера"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Время кулера"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_ON = _UxGT("Авто Вкл."); + PROGMEM Language_Str MSG_TOOL_MIGRATION_OFF = _UxGT("Авто Выкл."); + PROGMEM Language_Str MSG_TOOL_MIGRATION = _UxGT("Замена инструмента"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_AUTO = _UxGT("Авто замена"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_END = _UxGT("Последний экструдер"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_SWAP = _UxGT("Замена на *"); 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_FILAMENTLOAD = _UxGT("Загрузить филамент"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Загрузить филамент *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Выгрузить филамент *"); + #else + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Подать филамент *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Убрать филамент *"); + #endif PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Выгрузить всё"); - PROGMEM Language_Str MSG_ATTACH_MEDIA = _UxGT("Активировать SD"); + PROGMEM Language_Str MSG_ATTACH_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_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 = _UxGT("Z-зонд 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_OFFSETS = _UxGT("Отступы Z-датчика"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Опустить BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Режим SW"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Режим 5V"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Режим OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Режим сохранения"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Установить на 5V"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Установить на OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Слив отчёта"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("ОПАСНОСТЬ: Неправильные параметры приводят к повреждениям! Продолжить?"); + PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("Z-Зонд TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Инициализация"); + PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Тест Z-смещения"); + PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Сохранить"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Установить TouchMI"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Установить зонд"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Загрузить зонд"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Сначала паркуй %s%s%s"); + PROGMEM Language_Str MSG_ZPROBE_OFFSETS = _UxGT("Смещения Z-зонда"); PROGMEM Language_Str MSG_ZPROBE_XOFFSET = _UxGT("Смещение X"); PROGMEM Language_Str MSG_ZPROBE_YOFFSET = _UxGT("Смещение Y"); 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_BABYSTEP_TOTAL = _UxGT("Сумарно"); 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_HEATING_FAILED_LCD_BED = _UxGT("Сбой нагрева стола"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_CHAMBER = _UxGT("Сбой нагрева камеры"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Ошибка:Избыточная Т"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("УТЕЧКА ТЕПЛА"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("УТЕЧКА ТЕПЛА СТОЛА"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _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("Ошибка: Т стола мин."); - // TODO: Heated chamber - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Паркуй XY сначала"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Ошибка:Т камеры макс"); + PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Ошибка:Т камеры мин."); PROGMEM Language_Str MSG_HALTED = _UxGT("ПРИНТЕР ОСТАНОВЛЕН"); PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Сделайте сброс"); PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("д"); // One character only @@ -375,8 +550,9 @@ namespace Language_ru { PROGMEM Language_Str MSG_HEATING = _UxGT("Нагрев..."); PROGMEM Language_Str MSG_COOLING = _UxGT("Охлаждение..."); PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Нагрев стола..."); + PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Нагрев камеры..."); PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Охлаждение стола..."); - // TODO: Heated chamber + PROGMEM Language_Str MSG_CHAMBER_COOLING = _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"); @@ -384,67 +560,151 @@ namespace Language_ru { 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_CALIBRATE = _UxGT("Высота Delta"); + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Зондировать Z-смещение"); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Стержень диагонали"); + #else + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Зондир. Z-смещения"); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Стержень диаг."); + #endif 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("Калибровка сетки"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-точечное выравнивание"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Линейное выравнивание"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Билинейное выравнивание"); + #else + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-точ. выравнив."); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Линейное выравн."); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Билин. выравнив."); + #endif + 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_BAUDRATE = _UxGT("Скорость,БОД"); PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Протокол"); - PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Контроль темп.: Выкл"); - PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Контроль темп.: Вкл"); - + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Контроль утечки Т: Выкл"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Контроль утечки Т: Вкл"); + PROGMEM Language_Str MSG_HOTEND_IDLE_TIMEOUT = _UxGT("Время простоя хотенда"); + #else + PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Контр.утечки Т:Выкл"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Контр.утечки Т:Вкл"); + PROGMEM Language_Str MSG_HOTEND_IDLE_TIMEOUT = _UxGT("Время прост.хот-а"); + #endif PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Подсветка корпуса"); PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Яркость подсветки"); - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Неверный принтер"); + PROGMEM Language_Str MSG_KILL_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_COMPLETED_PRINTS = _UxGT("Завершено"); + + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Мин. ") LCD_STR_THERMOMETER; + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Макс. ") LCD_STR_THERMOMETER; PROGMEM Language_Str MSG_INFO_PSU = _UxGT("БП"); PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Сила привода"); - PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Привод %"); - PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Привод %"); - PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Привод %"); - PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Привод %"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Запись DAC EEPROM"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Привод, %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Привод, %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Привод, %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Привод, %"); + PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("СБОЙ СВЯЗИ С TMC"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Запись DAC в EEPROM"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("ЗАМЕНА ФИЛАМЕНТА"); 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_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: Низкая Т"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Датчик оконч. филамента"); + #else + PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Датчик оконч.филам."); + #endif + PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("До конца, мм"); + PROGMEM Language_Str MSG_KILL_HOMING_FAILED = _UxGT("Ошибка парковки"); + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Ошибка зондирования"); + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Низкая Т") LCD_STR_DEGREE; - // TODO: MMU2 - - // TODO: Mixing + PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("ВЫБИРЕТЕ ФИЛАМЕНТ"); + PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("Настройки MMU"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_KILL_MMU2_FIRMWARE = _UxGT("Обновить прошивку MMU!"); + #else + PROGMEM Language_Str MSG_KILL_MMU2_FIRMWARE = _UxGT("Обнови прошивку MMU"); + #endif + PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU требует внимания"); + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Продолжить печать"); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Продолжение..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Загрузить филамент"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Загрузить всё"); + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Загрузить в сопло"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Извлечь филамент"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Извлечь филамент ~"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Выгрузить филамент"); + PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Загрузка %i..."); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Извлечение филамента..."); + #else + PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Извлеч.филамента..."); + #endif + PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Выгрузка...."); + PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Всё"); + PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Филамент ~"); + PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Перезапуск MMU"); + PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Перезапуск MMU..."); + PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Удалите и нажмите"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_MIX = _UxGT("Смешивание"); + #else + PROGMEM Language_Str MSG_MIX = _UxGT("Смешив."); + #endif + PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Компонент ="); + PROGMEM Language_Str MSG_MIXER = _UxGT("Смеситель"); + PROGMEM Language_Str MSG_GRADIENT = _UxGT("Градиент"); + PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Полний градиент"); + PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Цикличное смешивание"); + PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Градиент смешивания"); + PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Сменить градиент"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Переключить смешивание"); + PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Активация В-инструм."); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Начало В-инструмента"); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT("Конец В-инструмента"); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Псевдоним В-инструмента"); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Сброс В-инструментов"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("В-инструменти сброшены"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Смешать В-инструменти"); + #else + PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Перекл. смешивание"); + PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Актив.В-инструм."); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("В-инструм.нач."); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT("В-инструм.кон."); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Псевдоним В-инстр."); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Сброс В-инструм."); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("В-инструм. сброшены"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Смешать В-инструм."); + #endif + PROGMEM Language_Str MSG_START_Z = _UxGT("Начало Z"); + PROGMEM Language_Str MSG_END_Z = _UxGT(" Конец Z"); PROGMEM Language_Str MSG_GAMES = _UxGT("Игры"); PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Кирпичи"); @@ -452,26 +712,40 @@ namespace Language_ru { PROGMEM Language_Str MSG_SNAKE = _UxGT("Змейка"); PROGMEM Language_Str MSG_MAZE = _UxGT("Лабиринт"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_BAD_PAGE = _UxGT("Плохой индекс страницы"); + PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Полохая скорость страницы"); + #else + PROGMEM Language_Str MSG_BAD_PAGE = _UxGT("Полохая страница"); + PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Полохая скор.стран."); + #endif + + PROGMEM Language_Str MSG_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("Парковка...")); // // 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_ADVANCED_PAUSE_WAITING = _UxGT(MSG_3_LINE("Нажмите кнопку", "для продолжения", "печати")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_2_LINE("Ожидайте начала", "смены филамента")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Вставьте филамент", "и нажмите кнопку", "для продолжения")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_3_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_UNLOAD = _UxGT(MSG_3_LINE("Ожидайте", "выгрузки", "филамента")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_3_LINE("Ожидайте", "загрузки", "филамента")); PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_3_LINE("Ожидайте", "экструзии", "филамента")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_3_LINE("Нажмите кнопку", "для завершения", "очистки филамента")); PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_3_LINE("Ожидайте", "возобновления", "печати")); #else + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Продолжить печать")); 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_HEAT = _UxGT(MSG_1_LINE("Нагреть сопло")); PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Нагрев...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _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_CONT_PURGE = _UxGT(MSG_1_LINE("Завершить очистку")); PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Возобновление...")); #endif @@ -482,7 +756,27 @@ namespace Language_ru { PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Режим шага"); PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("Тихий режим вкл"); - // TODO: Service + PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Сброс"); + PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" в:"); + PROGMEM Language_Str MSG_BACKLASH = _UxGT("Люфт"); + PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Исправление"); + PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Сглаживание"); - // TODO: Backlash + PROGMEM Language_Str MSG_LEVEL_X_AXIS = _UxGT("Уровень оси X"); + PROGMEM Language_Str MSG_AUTO_CALIBRATE = _UxGT("Авто калибровка"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Время нагревателя вышло"); + #else + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Время нагрев. вышло"); + #endif + PROGMEM Language_Str MSG_REHEAT = _UxGT("Возобновить нагрев"); + PROGMEM Language_Str MSG_REHEATING = _UxGT("Нагрев..."); } + +#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/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 4205cd5988..321fa5e05f 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -26,10 +26,10 @@ * UTF-8 for Graphical Display * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * * Translated by Michal Holeš, Farma MaM - * http://www.facebook.com/farmamam + * https://www.facebook.com/farmamam * */ #define DISPLAY_CHARSET_ISO10646_SK @@ -47,11 +47,11 @@ namespace Language_sk { 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_KILL_SUBCALL_OVERFLOW = _UxGT("Preteč. podprogramu"); 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"); @@ -74,22 +74,26 @@ namespace Language_sk { 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."); + #if PREHEAT_COUNT + 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_M = _UxGT("Zahriať $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Zahriať $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Zahriať $ hotend"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Zahriať $ hotend ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Zahriať $ všetko"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Zahriať $ podlož"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Zahriať $ nast."); + #endif PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Vlastná teplota"); PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Schladiť"); + PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frekvencia"); 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"); @@ -149,14 +153,14 @@ namespace Language_sk { 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; + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("Sieť bodov $"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Kontrola siete $"); + #endif 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"); @@ -189,8 +193,8 @@ namespace Language_sk { 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_MESH_LOADED = _UxGT("Sieť %i načítaná"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("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"); @@ -240,6 +244,8 @@ namespace Language_sk { 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_NOZZLE_PARKED = _UxGT("Tryska zaparkovná"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Záložná 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."); @@ -247,6 +253,11 @@ namespace Language_sk { PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Ulož. 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_CONTROLLER_FAN = _UxGT("Vent. riad. jedn."); + PROGMEM Language_Str MSG_CONTROLLER_FAN_IDLE_SPEED = _UxGT("Voľno. rýchl."); + PROGMEM Language_Str MSG_CONTROLLER_FAN_AUTO_ON = _UxGT("Auto-režím"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_SPEED = _UxGT("Aktív. rýchl."); + PROGMEM Language_Str MSG_CONTROLLER_FAN_DURATION = _UxGT("Doba nečinnosti"); PROGMEM Language_Str MSG_FLOW = _UxGT("Prietok"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Prietok ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Ovládanie"); @@ -258,6 +269,10 @@ namespace Language_sk { 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_AUTOTUNE_DONE = _UxGT("PID kal. dokončená"); + PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Auto-kal. zlyhala. Zlý extrúder."); + PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("Auto-kal. zlyhala. Príliš vysoká tepl."); + PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Auto-kal. zlyhala! Čas vypršal."); PROGMEM Language_Str MSG_SELECT = _UxGT("Vybrať"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Vybrať *"); PROGMEM Language_Str MSG_ACC = _UxGT("Zrýchlenie"); @@ -283,6 +298,8 @@ namespace Language_sk { 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_XY_FREQUENCY_LIMIT = _UxGT("Max. frekvencia"); + PROGMEM Language_Str MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Min. posun"); 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"); @@ -307,6 +324,7 @@ namespace Language_sk { PROGMEM Language_Str MSG_ERR_EEPROM_CRC = _UxGT("Chyba: EEPROM CRC"); PROGMEM Language_Str MSG_ERR_EEPROM_INDEX = _UxGT("Chyba: EEPROM Index"); PROGMEM Language_Str MSG_ERR_EEPROM_VERSION = _UxGT("Chyba: Verzia EEPROM"); + PROGMEM Language_Str MSG_SETTINGS_STORED = _UxGT("Nastavenie uložené"); 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ť"); @@ -319,10 +337,12 @@ namespace Language_sk { 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_IGNORE = _UxGT("Ignorovať"); 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_PAUSING = _UxGT("Pozastavujem..."); 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č"); @@ -337,6 +357,7 @@ namespace Language_sk { 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_PRINT_DONE = _UxGT("Tlač dokonč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É. "); @@ -350,12 +371,22 @@ namespace Language_sk { 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_SWAP_EXTRA = _UxGT("Vymeniť naviac"); 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_SINGLENOZZLE_PRIME_SPEED = _UxGT("Primárna rýchl."); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Rýchl. retrakcie"); + PROGMEM Language_Str MSG_FILAMENT_PARK_ENABLED = _UxGT("Parkovať hlavu"); + PROGMEM Language_Str MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Rýchl. obnovenia"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Rýchlosť vent."); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Doba fúkania"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_ON = _UxGT("Auto-Zap"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_OFF = _UxGT("Auto-Vyp"); + PROGMEM Language_Str MSG_TOOL_MIGRATION = _UxGT("Výmena nástroja"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_AUTO = _UxGT("Auto-výmena"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_END = _UxGT("Posl. extruder"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_SWAP = _UxGT("Vymeniť za *"); 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"); @@ -369,14 +400,14 @@ namespace Language_sk { 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_SELFTEST = _UxGT("Self-Test"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Reset"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Zasunúť"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Vysunúť"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Režim SW"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Režim 5V"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Režim OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("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"); @@ -411,7 +442,6 @@ namespace Language_sk { 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"); @@ -450,10 +480,11 @@ namespace Language_sk { 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_HOTEND_IDLE_TIMEOUT = _UxGT("Vypr.čas nečinnosti"); 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ň"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Nesprávna tlačiareň"); #if LCD_WIDTH >= 20 PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Počet tlačí"); @@ -489,13 +520,13 @@ namespace Language_sk { 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_KILL_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_KILL_MMU2_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..."); @@ -539,13 +570,16 @@ namespace Language_sk { PROGMEM Language_Str MSG_SNAKE = _UxGT("Had"); PROGMEM Language_Str MSG_MAZE = _UxGT("Bludisko"); + PROGMEM Language_Str MSG_BAD_PAGE = _UxGT("Chyb. index stránky"); + PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Chyb. rých. stránky"); + // // 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_PAUSE_PRINT_PARKING = _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")); @@ -557,7 +591,7 @@ namespace Language_sk { 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_PAUSE_PRINT_PARKING = _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")); @@ -582,4 +616,10 @@ namespace Language_sk { 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"); + + PROGMEM Language_Str MSG_LEVEL_X_AXIS = _UxGT("Vyrovnať os X"); + PROGMEM Language_Str MSG_AUTO_CALIBRATE = _UxGT("Auto-kalibrovať"); + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Vypršal čas ohrevu"); + PROGMEM Language_Str MSG_REHEAT = _UxGT("Zohriať"); + PROGMEM Language_Str MSG_REHEATING = _UxGT("Zohrievanie..."); } diff --git a/Marlin/src/lcd/language/language_test.h b/Marlin/src/lcd/language/language_test.h index 465d3743f3..b15f20619e 100644 --- a/Marlin/src/lcd/language/language_test.h +++ b/Marlin/src/lcd/language/language_test.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * TEST * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index 096fef254c..bb68a61717 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Turkish * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://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; @@ -49,7 +49,6 @@ namespace Language_tr { PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Durduruluyor..."); 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_MEDIA_RELEASED = _UxGT("SD Kart Serbest"); PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("SD Kart Bekleniyor"); PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Kart Okuma Hatası"); PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB Çıkarıldı"); @@ -76,20 +75,23 @@ namespace Language_tr { PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Ofset Ayarla"); PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Ofset 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"); + #if PREHEAT_COUNT + 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_M = _UxGT("Ön Isınma $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Ön Isınma $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Ön Isınma $ Nozul"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Ön Isınma $ Nozul ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Ön Isınma $ Tüm"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Ön Isınma $ Tabla"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Ön Isınma $ Ayarlar"); + #endif PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Özel Ön Isınma"); PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Soğut/(Durdur)"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Lazer Kontrolü"); @@ -151,14 +153,14 @@ namespace Language_tr { 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(")"); + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("Mesh Oluştur ($)"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Doğrulama Mesh ($)"); + #endif 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_G26_HEATING_BED = _UxGT("G26 Isıtma Tablası"); PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 Isıtma Memesi"); @@ -191,8 +193,8 @@ namespace Language_tr { 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_MESH_LOADED = _UxGT("Mesh %i yüklendi"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("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"); @@ -366,8 +368,8 @@ namespace Language_tr { PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Tasfiye uzunluğu"); 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_SINGLENOZZLE_PRIME_SPEED = _UxGT("Birincil Hız"); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Geri Çekme Hızı"); PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Nozul Beklemede"); PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Filaman Değiştir"); PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Filaman Değiştir *"); @@ -383,13 +385,13 @@ namespace Language_tr { 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 K. Test"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Cmd: Reset"); - PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Cmd: Kapat"); - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Cmd: Aç"); - PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Cmd: SW-Modu"); - PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Cmd: 5V-Modu"); - PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Cmd: OD-Modu"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Cmd: Mode-Store"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Reset"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Kapat"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Aç"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("SW-Modu"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("5V-Modu"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("OD-Modu"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Mode-Store"); PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("BLTouch 5V Ayarla"); PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("BLTouch OD Ayarla"); PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Drenaj Raporu"); @@ -424,7 +426,6 @@ namespace Language_tr { PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Hata: MIN.SIC. TABLA"); PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Hata: MAX.SIC ODA"); PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Hata: MIN.SIC ODA"); - 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 @@ -463,7 +464,7 @@ namespace Language_tr { 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ı"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Yanlış Yazıcı"); #if LCD_WIDTH >= 20 PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Baskı Sayısı"); @@ -499,13 +500,13 @@ namespace Language_tr { PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Nozul: "); PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Runout Sensörü"); PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Aşınma Farkı mm"); - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Sıfırlama Başarısız"); + PROGMEM Language_Str MSG_KILL_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"); PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("FILAMAN SEÇ"); PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); - PROGMEM Language_Str MSG_MMU2_WRONG_FIRMWARE = _UxGT("MMU Yaz. Güncelle!"); + PROGMEM Language_Str MSG_KILL_MMU2_FIRMWARE = _UxGT("MMU Yaz. Güncelle!"); PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU Dikkat Gerektirir."); PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Yaz. Devam Et"); PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Sürdürülüyor..."); @@ -549,10 +550,6 @@ namespace Language_tr { 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 Değişim ekranları 4 satırlı ekranda 3 satıra kadar gösterilir // ...veya 3 satırlı ekranda 2 satıra kadar @@ -560,7 +557,7 @@ namespace Language_tr { #if LCD_HEIGHT >= 4 PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Baskıya devam etmek", "için Butona bas")); - PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Park Ediliyor...")); + PROGMEM Language_Str MSG_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("Park Ediliyor...")); 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.")); @@ -572,7 +569,7 @@ namespace Language_tr { PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Baskının devam ", "etmesi için bekle")); #else PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Sürdürmek İçin Tıkla")); - PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Park Ediliyor...")); + PROGMEM Language_Str MSG_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("Park Ediliyor...")); 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")); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 0d473bf0af..686657246f 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Ukrainian * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ @@ -37,205 +37,741 @@ namespace Language_uk { 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 WELCOME_MSG = MACHINE_NAME _UxGT(" Готовий."); + PROGMEM Language_Str MSG_YES = _UxGT("ТАК"); + PROGMEM Language_Str MSG_NO = _UxGT("НІ"); + PROGMEM Language_Str MSG_BACK = _UxGT("Назад"); + PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Переривання..."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("SD-картка вставлена"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("SD-картка видалена"); + PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Вставте SD-картку"); + PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Помилка зчитування"); + PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB диск видалений"); + PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("Помилка USB диску"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Переповнення виклику"); + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Програмні кінцевики"); + #else + PROGMEM Language_Str MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Переповн. виклику"); + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Прогр.кінцевики"); + #endif PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Кінцевик"); // Max length 8 characters - PROGMEM Language_Str MSG_MAIN = _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_DISABLE_STEPPERS = _UxGT("Вимкнути двигуни"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Меню Debug"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Тест Progress Bar"); 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_AUTO_Z_ALIGN = _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_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_Z_FADE_HEIGHT = _UxGT("Висота спаду"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Встанов. зміщення дому"); + #else + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Встанов.зміщ.дому"); + #endif + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Зміщення прийняті"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Встановити ноль"); + #if PREHEAT_COUNT + 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_M = _UxGT("Нагрів $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Нагрів $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Нагрів $ сопло"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Нагрів $ сопло ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Нагрів $ все"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Нагрів $ стіл"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Нагрів $ налашт"); + #endif + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Нагрів Свій"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Вимкнути нагрів"); + PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Частота"); + PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Керування лазером"); + PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Вимкнути лазер"); + PROGMEM Language_Str MSG_LASER_ON = _UxGT("Увімкнути лазер"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Потужність лазера"); + PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Керування шпінделем"); + #else + PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Потуж.лазера"); + PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Керув. шпінделем"); + #endif + PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Вимкнути шпіндель"); + PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Увімкнути шпіндель"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Потуж. шпінделя"); + #else + PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Потуж. шпінд."); + #endif + PROGMEM Language_Str MSG_SPINDLE_REVERSE = _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_BED_LEVELING = _UxGT("Вирівнювання столу"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Вирівняти стіл"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Вирівняти кути"); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Наступний кут"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Зміщення по Z"); + #else + PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Зміщення Z"); + #endif + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Редагувати сітку"); + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Редагув. зупинено"); + PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Точка сітки"); + PROGMEM Language_Str MSG_MESH_X = _UxGT("Індекс X"); + PROGMEM Language_Str MSG_MESH_Y = _UxGT("Індекс Y"); + PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Значення Z"); + PROGMEM Language_Str MSG_USER_MENU = _UxGT("Власні команди"); + PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48 тест зонду"); + PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 точка"); + PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Відхилення"); + PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("Меню IDEX"); + PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Зміщення сопел"); + PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Авто паркування"); + PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Розмноження"); + PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Дзеркальна копія"); + PROGMEM Language_Str MSG_IDEX_MODE_FU1L_CTRL = _UxGT("Повний контроль"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("Друге сопло X"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("Друге сопло Y"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("Друге сопло 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_LCD_TILTING_MESH = _UxGT("Точка розвороту"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Ручне введення сітки"); + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Розмістити шайбу і вимір."); + #else + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Ручне введ. сітки"); + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Розм. шайбу і вимір."); + #endif + 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"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Температура столу"); + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Температура столу"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Температура сопла"); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Температура сопла"); + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Редагувати свою сітку"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Точне редагування сітки"); + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Будувати свою сітку"); + #else + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = LCD_STR_THERMOMETER _UxGT(" столу, ") LCD_STR_DEGREE "C"; + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = LCD_STR_THERMOMETER _UxGT(" столу, ") LCD_STR_DEGREE "C"; + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = LCD_STR_THERMOMETER _UxGT(" сопла, ") LCD_STR_DEGREE "C"; + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = LCD_STR_THERMOMETER _UxGT(" сопла, ") LCD_STR_DEGREE "C"; + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Редагувати свою"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Точне редаг. сітки"); + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Будувати свою"); + #endif + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Редагування сітки"); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Сітка побудована"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Будувати сітку"); + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("Будувати сітку $"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Підтвердити $"); + #endif + 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_CUSTOM_MESH = _UxGT("Підтвердити свою"); + PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 нагрів столу"); + PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 нагрів сопла"); + PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Ручне грунтування"); + PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Грунт фікс. довж."); + PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Грунтув. виконане"); + PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 завершена"); + PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Вийти з G26"); + 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-точкове вирівн."); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Вирівнювання растру"); + #else + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Вирівнюв. растру"); + #endif + 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"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Обсяг заповнювача"); + #else + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Обсяг заповн."); + #endif + 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("Точно налашт. все"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Точно налашт.найближчу"); + #else + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Точно найближчу"); + #endif + 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("Сітка %i завантажена"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("Сітка %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 = _UxGT("Зміщення Z: "); + 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("Керування світлом"); + PROGMEM Language_Str MSG_LEDS = _UxGT("Підсвітка"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Передустановки світла"); + #else + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Передустан. світла"); + #endif + 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("Рух по %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_HOTEND_TOO_COLD = _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 = _UxGT("Сопло, ") LCD_STR_DEGREE "C"; 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_NOZZLE_PARKED = _UxGT("Сопло запарковане"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Сопло очикує"); + PROGMEM Language_Str MSG_BED = _UxGT("Стіл, ") LCD_STR_DEGREE "C"; + PROGMEM Language_Str MSG_CHAMBER = _UxGT("Камера,") LCD_STR_DEGREE "C"; + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Охолодження"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Охолодження ~"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Збережене охолодж. ~"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Додаткове охолодж."); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Додаткове охолодж. ~"); + PROGMEM Language_Str MSG_CONTROLLER_FAN = _UxGT("Контролер охолодження"); + #else + PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Збереж.охолодж. ~"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Додат. охолодж."); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Додат.охолодж ~"); + PROGMEM Language_Str MSG_CONTROLLER_FAN = _UxGT("Контролер охолодж."); + #endif + PROGMEM Language_Str MSG_CONTROLLER_FAN_IDLE_SPEED = _UxGT("Холості оберти"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_SPEED = _UxGT("Робочі оберти"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_AUTO_ON = _UxGT("Авто-режим"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_DURATION = _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_MIN = " " LCD_STR_THERMOMETER ", " LCD_STR_DEGREE _UxGT("С мін"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER ", " LCD_STR_DEGREE _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_ON = _UxGT("Увімк"); PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Вимк."); + + PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("Автопідбір PID"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("Автопідбір PID *"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_DONE = _UxGT("Підбір PID виконано"); + PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Збій автопідбору. Поганий екструдер."); + PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("Збій автопідбору. Температура завищена."); + PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Збій автопідбору! Завершення часу."); + PROGMEM Language_Str MSG_SELECT = _UxGT("Вибрати"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Вибрати *"); - PROGMEM Language_Str MSG_ACC = _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("*кроків/мм"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Відхилення вузла"); + #else + PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Відхил.вузла"); + #endif + PROGMEM Language_Str MSG_VELOCITY = _UxGT("Швидкість, мм/с"); + PROGMEM Language_Str MSG_VMAX_A = _UxGT("Швидк.макс ") LCD_STR_A; + 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("Швидк.макс *"); + PROGMEM Language_Str MSG_VMIN = _UxGT("Швидк.мін"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Переміщення мін"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Прискорення, мм/с2"); + PROGMEM Language_Str MSG_AMAX_A = _UxGT("Приск.макс ") LCD_STR_A; + 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("Приск.макс *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Приск.втягув."); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Приск.переміщ."); + PROGMEM Language_Str MSG_XY_FREQUENCY_LIMIT = _UxGT("Частота макс."); + PROGMEM Language_Str MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Подача мін."); + 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_FILAMENT = _UxGT("Пруток"); PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E в мм³"); - 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_DEFAULTS = _UxGT("Відновити базові"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Поновити"); - PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Інформація"); + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("E обмеж.,мм³"); + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT_E = _UxGT("E обмеж. *"); + 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("Контраст екрану"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Зберегти в EEPROM"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Зчитати з EEPROM"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("На базові параметри"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Ініціалізація EEPROM"); + #else + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Ініціаліз. EEPROM"); + #endif + PROGMEM Language_Str MSG_ERR_EEPROM_CRC = _UxGT("Збій EEPROM: CRC"); + PROGMEM Language_Str MSG_ERR_EEPROM_INDEX = _UxGT("Збій EEPROM: індекс"); + PROGMEM Language_Str MSG_ERR_EEPROM_VERSION = _UxGT("Збій EEPROM: версія"); + PROGMEM Language_Str MSG_SETTINGS_STORED = _UxGT("Параметри збережені"); + PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Оновити SD-картку"); + PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Зкинути принтер"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT(" Поновити"); + PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Головний екран"); PROGMEM Language_Str MSG_PREPARE = _UxGT("Підготувати"); PROGMEM Language_Str MSG_TUNE = _UxGT("Підлаштування"); + PROGMEM Language_Str MSG_POWER_MONITOR = _UxGT("Монітор живлення"); + PROGMEM Language_Str MSG_CURRENT = _UxGT("Струм"); + PROGMEM Language_Str MSG_VOLTAGE = _UxGT("Напруга"); + PROGMEM Language_Str MSG_POWER = _UxGT("Потужність"); + PROGMEM Language_Str MSG_START_PRINT = _UxGT("Почати друк"); + + PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Далі"); //short text for buttons + 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_IGNORE = _UxGT("Ігнорув."); + PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Відміна"); + PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Готово"); + PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Назад"); + PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Продовжити"); + + PROGMEM Language_Str MSG_PAUSING = _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_PRINTING_OBJECT = _UxGT("Друк об'єкта"); + PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Завершити об'єкт"); + PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _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_NO_MEDIA = _UxGT("SD-картки немає"); PROGMEM Language_Str MSG_DWELL = _UxGT("Сплячка..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Очікування дій..."); + PROGMEM Language_Str MSG_USERWAIT = _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_PRINT_DONE = _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_ATTACH_MEDIA = _UxGT("Старт SD картки"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Заміна SD карти"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z дет. не в межах"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Втягування, мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Зміна втягув.,мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Повернення, мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Поверн.зміни, мм"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Автовтягування"); + #else + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Втягув., мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Зміна втяг.мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Поверн., мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Повер.зміни,мм"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Автовтягув."); + #endif + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Втягування V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Підскок, мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Повернення V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("Поверн.зміни V"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Поміняти довжини"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_EXTRA = _UxGT("Поміняти додатково"); + PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Очистити довжину"); + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Зміна сопла"); + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Підняти по Z"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPEED = _UxGT("Початк.швидкість"); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Швидкість втягув."); + #else + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPEED = _UxGT("Початк.швидк."); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Швидк.втягув."); + #endif + PROGMEM Language_Str MSG_FILAMENT_PARK_ENABLED = _UxGT("Паркувати голову"); + PROGMEM Language_Str MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Відновити швидкість"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Оберти охолодження"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Час охолодження"); + #else + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Оберти охолодж."); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Час охолодж."); + #endif + PROGMEM Language_Str MSG_TOOL_MIGRATION_ON = _UxGT("Авто Увімк."); + PROGMEM Language_Str MSG_TOOL_MIGRATION_OFF = _UxGT("Авто Вимкн."); + PROGMEM Language_Str MSG_TOOL_MIGRATION = _UxGT("Заміна інструменту"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_AUTO = _UxGT("Авто заміна"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_END = _UxGT("Останній екструдер"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_SWAP = _UxGT("Заміна на *"); + 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 = _UxGT("Видалити пруток"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Видалити пруток *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Видалити все"); + PROGMEM Language_Str MSG_ATTACH_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("Z-зонд BLTouch"); PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Само-Тест"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Скинути BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Зкинути BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Підняти зонд"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Опустити зонд"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Режим SW"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Режим 5V"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Режим OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Режим збереження"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Встановити на 5V"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Встановити на OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Злив звіту"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("НЕБЕЗПЕКА: Неправильні параметри приводять до пошкоджень! Продовжувати?"); + PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("Z-Зонд TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Ініціалізація"); + PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Тест Z-зміщення"); + PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Зберегти"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Установити TouchMI"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Установити зонд"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Завантажити зонд"); PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Дім %s%s%s перший"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Зміщення Z"); + PROGMEM Language_Str MSG_ZPROBE_OFFSETS = _UxGT("Зміщення зонду"); + PROGMEM Language_Str MSG_ZPROBE_XOFFSET = _UxGT("Тест зміщення X"); + PROGMEM Language_Str MSG_ZPROBE_YOFFSET = _UxGT("Тест зміщення Y"); + 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_BABYSTEP_TOTAL = _UxGT("Сумарно"); + 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_HEATING_FAILED_LCD_CHAMBER = _UxGT("Збій нагріву камери"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("ЗАВИЩЕНА Т") LCD_STR_DEGREE; + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("ВИТІК ТЕПЛА"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("ВИТІК ТЕПЛА СТОЛУ"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("ВИТІК ТЕПЛА КАМЕРИ"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("ПЕРЕГРІВ"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("МІНІМАЛЬНА Т") LCD_STR_DEGREE; + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("ПЕРЕГРІВ СТОЛУ"); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("МІНІМАЛЬНА Т") LCD_STR_DEGREE _UxGT(" СТОЛУ"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("ПЕРЕГРІВ КАМЕРИ"); + PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("МІНІМАЛЬНА Т") LCD_STR_DEGREE _UxGT(" КАМЕРИ"); 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_COOLING = _UxGT("Охолодження..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Нагрів столу..."); + PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Нагрів камери..."); + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Охолодження столу..."); + PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Охолодження камери..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Калібрування Delta"); + #else + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Охол. столу..."); + PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Охол. камери..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Калібрув. Delta"); + #endif + 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"); + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Зондування Z-зміщ."); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Стрижень діагоналі"); + #else + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Зондув. Z-зміщ."); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Стрижень діаг."); + #endif + 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_INFO_STATS_MENU = _UxGT("Статистика"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Данні принтера"); + + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-точкове вирівнювання"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Лінійне вирівнювання"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Білінійне вирівнювання"); + #elif LCD_WIDTH == 20 + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-точкове вирівнюв."); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Лінійне вирівнюван."); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Білінійне вирівнюв."); + #else + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-точк. вирівн."); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Лінійне вирівн."); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Білін. вирівнюв."); + #endif + 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_BAUDRATE = _UxGT("Біт/секунду"); PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Протокол"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Контроль витіку ") LCD_STR_THERMOMETER _UxGT(" Вимк"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Контроль витіку ") LCD_STR_THERMOMETER _UxGT(" Увімк"); + PROGMEM Language_Str MSG_HOTEND_IDLE_TIMEOUT = _UxGT("Час простою хотенду"); + #else + PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Контр.витіку ") LCD_STR_THERMOMETER _UxGT(" Вимк"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Контр.витіку ") LCD_STR_THERMOMETER _UxGT(" Увімк"); + PROGMEM Language_Str MSG_HOTEND_IDLE_TIMEOUT = _UxGT("Час прост. хот-у"); + #endif + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Підсвітка"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Неправильний принтер"); - + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Яскравість світла"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("НЕ ТОЙ ПРИНТЕР"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Завершено"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _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_COUNT = _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("Ексдруд."); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _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_INFO_MIN_TEMP = _UxGT("Мін. ") LCD_STR_THERMOMETER; + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Макс. ") LCD_STR_THERMOMETER; + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Блок жив-ня"); PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Сила мотору"); - PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X % мотору"); - PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y % мотору"); - PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z % мотору"); - PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E % мотору"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Запис ЦАП на ПЗП"); - + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("Драйвер X, %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Драйвер Y, %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Драйвер Z, %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("Драйвер E, %"); + PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("ЗБІЙ ЗВ'ЯЗКУ З TMC"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Запис ЦАП у EEPROM"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("ЗАМІНА ПРУТКА"); + 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("ВИВАНТАЖИТИ ПРУТОК"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("ПАРАМЕТРИ ПРОДОВЖЕННЯ:"); + #else + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("ПАРАМ.ПРОДОВЖЕННЯ:"); + #endif + 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(" Сопло: "); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Датчик закінчення прутка"); + PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Відстань закінч.,мм"); + #else + PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Датчик закінч.прутка"); + PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("До закінч.,мм"); + #endif + PROGMEM Language_Str MSG_KILL_HOMING_FAILED = _UxGT("Помилка паркування"); + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Помилка зондування"); + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: низька Т") LCD_STR_DEGREE; + PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("ОБЕРІТЬ ПРУТОК"); + PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("Налаштування MMU"); + PROGMEM Language_Str MSG_KILL_MMU2_FIRMWARE = _UxGT("Понови прошивку MMU!"); + PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU потребує уваги"); + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Продовжити друк"); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Продовження..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Завантажити пруток"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Завантажити все"); + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Завантажити в сопло"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Звільнити пруток"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Звільнити пруток ~"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Вивантажити пруток"); + PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Завантаження %i..."); + PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Звільнення прутка..."); + PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Вивантаження ...."); + PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Все"); + PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Пруток ~"); + PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Перезапуск MMU"); + PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Перезапуск MMU..."); + PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Видаліть, натисніть"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_MIX = _UxGT("Змішування"); + #else + PROGMEM Language_Str MSG_MIX = _UxGT("Змішув."); + #endif + PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Компонент ="); + PROGMEM Language_Str MSG_MIXER = _UxGT("Змішувач"); + PROGMEM Language_Str MSG_GRADIENT = _UxGT("Градієнт"); + PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Повний градієнт"); + PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Циклічне змішування"); + PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Градієнт змішування"); + PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Змінити градієнт"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Перемкнути змішування"); + PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Активація В-інструменту"); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Початок В-інструменту"); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT("Кінець В-інструменту"); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Псевдонім В-інструменту"); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Зкидання В-інструментів"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("В-інструменти зкинуті"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Змішати В-інструменти"); + #else + PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Перемкнути змішув."); + PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Актив.В-інструм."); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("В-інструм. поч."); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT("В-інструм. кін."); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Псевдонім В-інстр."); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Зкидання В-інструм"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("В-інструм. зкинуті"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Змішати В-інструм."); + #endif + PROGMEM Language_Str MSG_START_Z = _UxGT("Початок Z"); + PROGMEM Language_Str MSG_END_Z = _UxGT(" Кінець Z"); + + 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("Лабіринт"); + + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_BAD_PAGE = _UxGT("Поганий індекс сторінки"); + PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Погана швидкість сторінки"); + #else + PROGMEM Language_Str MSG_BAD_PAGE = _UxGT("Погана сторінка"); + PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Погана швидк.стор"); + #endif + + PROGMEM Language_Str MSG_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("Паркування...")); #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("Зачекайте на", "відновлення", "друку")); + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_3_LINE("Натисніть кнопку", "для продовження", "друку")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _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_UNLOAD = _UxGT(MSG_2_LINE("Зачекайте", "на вивід прутка")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Зачекайте", "на ввід прутка")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Дочекайтесь", "очищення прутка")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_3_LINE("Натисніть кнопку", "для завершення", "очищення прутка")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_3_LINE("Зачекайте", "на відновлення", "друку")); #else // Up to 2 lines allowed + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Продовжити друк")); 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("Відновлення...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Вставте і натисніть")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Нагріти сопло")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Нагрів сопла...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _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_CONT_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("Тихий режим увімк."); + PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Зкидання"); + PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" в:"); + PROGMEM Language_Str MSG_BACKLASH = _UxGT("Люфт"); + PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Виправлення"); + PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Зглажування"); + + PROGMEM Language_Str MSG_LEVEL_X_AXIS = _UxGT("Рівень вісі X"); + PROGMEM Language_Str MSG_AUTO_CALIBRATE = _UxGT("Авто калібрування"); + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Час нагрівача збіг"); + PROGMEM Language_Str MSG_REHEAT = _UxGT("Поновити нагрів"); + PROGMEM Language_Str MSG_REHEATING = _UxGT("Нагрівання..."); } + +#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/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index 330db4b690..227a4950f3 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Vietnamese * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ namespace Language_vi { @@ -39,7 +39,6 @@ namespace Language_vi { 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"); @@ -66,20 +65,23 @@ namespace Language_vi { 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 + #if PREHEAT_COUNT + 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_M = _UxGT("Làm nóng $ trước"); // Preheat + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Làm nóng $ trước ~"); // Preheat + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Làm nóng $ Đầu"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Làm nóng $ Đầu ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Làm nóng $ Tất cả"); // all + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Làm nóng $ Bàn"); // bed -- using vietnamese term for 'table' instead + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Làm nóng $ Cấu hình"); // conf + #endif 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 @@ -125,14 +127,14 @@ namespace Language_vi { 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(")"); + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("Xây dựng lưới ($)"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Thẩm tra lưới ($)"); + #endif 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 @@ -159,8 +161,8 @@ namespace Language_vi { 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_MESH_LOADED = _UxGT("%i lưới được nạp"); // Mesh %i loaded + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("%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 @@ -300,8 +302,8 @@ namespace Language_vi { 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_SINGLENOZZLE_PRIME_SPEED = _UxGT("Tốc Độ Tuôn Ra"); // Prime Speed + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _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 @@ -336,7 +338,6 @@ namespace Language_vi { 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 @@ -403,7 +404,7 @@ namespace Language_vi { 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_KILL_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"); diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index 742375c7d1..cf772caaef 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,29 +25,42 @@ * Simplified Chinese * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://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 LANGUAGE = _UxGT("简体中文"); PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT("已就绪."); //" ready." + PROGMEM Language_Str MSG_MARLIN = _UxGT("马林"); + PROGMEM Language_Str MSG_YES = _UxGT("是"); + PROGMEM Language_Str MSG_NO = _UxGT("否"); PROGMEM Language_Str MSG_BACK = _UxGT("返回"); // ”Back“ + PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("放弃中..."); PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("存储卡已插入"); //"Card inserted" PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("存储卡被拔出"); //"Card removed" + PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("等待存储器"); + PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("存储器读取错误"); + PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB设备已弹出"); + PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("USB启动错误"); + PROGMEM Language_Str MSG_KILL_SUBCALL_OVERFLOW = _UxGT("子响应溢出"); PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("挡块"); //"Endstops" // Max length 8 characters + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("软挡块"); PROGMEM Language_Str MSG_MAIN = _UxGT("主菜单"); //"Main" + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("高级设置"); + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("配置"); 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 = _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_AUTO_Z_ALIGN = _UxGT("自动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" @@ -56,21 +69,35 @@ namespace Language_zh_CN { 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" + #if PREHEAT_COUNT + 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_M = _UxGT("预热 $"); //"Preheat PREHEAT_2_LABEL" + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("预热 $ ~"); //"Preheat PREHEAT_2_LABEL" + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("预热 $ 喷嘴"); //MSG_PREHEAT_1 " " + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("预热 $ 喷嘴 ~"); //MSG_PREHEAT_1 " " + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("预热 $ 全部"); //MSG_PREHEAT_1 " All" + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("预热 $ 热床"); //MSG_PREHEAT_1 " Bed" + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("预热 $ 设置"); //MSG_PREHEAT_1 " conf" + #endif + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("预热自定义"); PROGMEM Language_Str MSG_COOLDOWN = _UxGT("降温"); //"Cooldown" + PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("切割频率"); + PROGMEM Language_Str MSG_LASER_MENU = _UxGT("激光控制"); + PROGMEM Language_Str MSG_LASER_OFF = _UxGT("激光关"); + PROGMEM Language_Str MSG_LASER_ON = _UxGT("激光开"); + PROGMEM Language_Str MSG_LASER_POWER = _UxGT("激光电源"); + PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("主轴控制"); + PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("主轴关"); + PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("主轴开"); + PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("主轴电源"); + PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("主轴反转"); 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" @@ -79,15 +106,31 @@ namespace Language_zh_CN { 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("网格编辑器"); 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("探测点"); + PROGMEM Language_Str MSG_MESH_X = _UxGT("索引X"); + PROGMEM Language_Str MSG_MESH_Y = _UxGT("索引Y"); + PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Z 值"); PROGMEM Language_Str MSG_USER_MENU = _UxGT("定制命令"); // "Custom Commands" - + PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48探测"); + PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48点"); + PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("M48偏差"); + PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("IDEX模式"); + PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("工具偏移量"); + PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("自动停靠"); + PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("复制"); + PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("镜像复制"); + PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("完全控制"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("第二喷头是X"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("第二喷头是Y"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("第二喷头是Z"); 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_LCD_TILTING_MESH = _UxGT("倾斜點"); 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" @@ -95,23 +138,32 @@ namespace Language_zh_CN { 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_BED = _UxGT("热床温度"); // "Bed Temp" + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("热床温度"); PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("热端温度"); // "Hotend Temp" + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("热端温度"); 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" + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("创设 $ 网格"); // "Build PREHEAT_1_LABEL Mesh" + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("批准 $ 网格"); // "Validate PREHEAT_1_LABEL Mesh" + #endif 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_G26_HEATING_BED = _UxGT("G26加热热床"); + PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26加热喷嘴"); + PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("手动填装中..."); + PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("固定距离填装"); + PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("填装完成"); + PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26已取消"); + PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("离开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" @@ -136,11 +188,12 @@ namespace Language_zh_CN { 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_MESH_LOADED = _UxGT("网格 %i 已装载"); // "Mesh %i loaded" + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("网格 %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 = _UxGT("Z偏移量: "); 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. 创设冷网格"); @@ -151,7 +204,7 @@ namespace Language_zh_CN { 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_LED_CONTROL = _UxGT("LED控制"); // "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") @@ -170,26 +223,36 @@ namespace Language_zh_CN { 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_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_HOTEND_TOO_COLD = _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(" 喷嘴 ~"); //"Nozzle" 噴嘴 - PROGMEM Language_Str MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" 热床"); //"Bed" + PROGMEM Language_Str MSG_NOZZLE = _UxGT("喷嘴"); //"Nozzle" 噴嘴 + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("喷嘴 ~"); //"Nozzle" 噴嘴 + PROGMEM Language_Str MSG_NOZZLE_PARKED = _UxGT("喷嘴已停靠"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("喷嘴待命中"); + PROGMEM Language_Str MSG_BED = _UxGT("热床"); //"Bed" + PROGMEM Language_Str MSG_CHAMBER = _UxGT("机箱壳"); 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("存储的风扇 ~"); 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_CONTROLLER_FAN = _UxGT("控制器风扇"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_IDLE_SPEED = _UxGT("空闲速度"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_AUTO_ON = _UxGT("自动模式"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_SPEED = _UxGT("工作速度"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_DURATION = _UxGT("空闲周期"); PROGMEM Language_Str MSG_FLOW = _UxGT("挤出速率"); //"Flow" PROGMEM Language_Str MSG_FLOW_N = _UxGT("挤出速率 ~"); //"Flow" PROGMEM Language_Str MSG_CONTROL = _UxGT("控制"); //"Control" @@ -199,6 +262,22 @@ namespace Language_zh_CN { 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"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("自动PID *"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_DONE = _UxGT("PID调整完成"); + PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("自动调失败. 坏的挤出机"); + PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("自动调失败. 温度太高"); + PROGMEM Language_Str MSG_PID_TIMEOUT = _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_PID_F = _UxGT("PID-F"); + PROGMEM Language_Str MSG_PID_F_E = _UxGT("PID-F *"); PROGMEM Language_Str MSG_SELECT = _UxGT("选择"); //"Select" PROGMEM Language_Str MSG_SELECT_E = _UxGT("选择 *"); PROGMEM Language_Str MSG_ACC = _UxGT("加速度"); //"Accel" acceleration @@ -207,6 +286,7 @@ namespace Language_zh_CN { 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_JUNCTION_DEVIATION = _UxGT("接点差"); 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 @@ -223,38 +303,72 @@ namespace Language_zh_CN { 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_XY_FREQUENCY_LIMIT = _UxGT("频率最大"); + PROGMEM Language_Str MSG_XY_FREQUENCY_FEEDRATE = _UxGT("进给速度"); 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_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("E 步数/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 = _UxGT("料丝"); //"Filament" menu_advanced_filament + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E 在 mm³"); //"E in mm3" volumetric_enabled + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("E 限制 在 mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT_E = _UxGT("E 限制 *"); 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_ADVANCE_K = _UxGT("Advance K"); + PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Advance K *"); 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_DEFAULTS = _UxGT("恢复安全值"); //"Restore Defaults" PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("初始化设置"); // "Initialize EEPROM" - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("刷新"); //"Refresh" + PROGMEM Language_Str MSG_ERR_EEPROM_CRC = _UxGT("EEPROM CRC 错误"); + PROGMEM Language_Str MSG_ERR_EEPROM_INDEX = _UxGT("EEPROM Index 错误"); + PROGMEM Language_Str MSG_ERR_EEPROM_VERSION = _UxGT("EEPROM Version 错误"); + PROGMEM Language_Str MSG_SETTINGS_STORED = _UxGT("设置已保存"); + 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_INFO_SCREEN = _UxGT("信息屏"); //"Info screen" PROGMEM Language_Str MSG_PREPARE = _UxGT("准备"); //"Prepare" PROGMEM Language_Str MSG_TUNE = _UxGT("调整"); //"Tune" + PROGMEM Language_Str MSG_POWER_MONITOR = _UxGT("电源监控"); + PROGMEM Language_Str MSG_CURRENT = _UxGT("电流"); + PROGMEM Language_Str MSG_VOLTAGE = _UxGT("电压"); + PROGMEM Language_Str MSG_POWER = _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_IGNORE = _UxGT("忽略"); + PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("取消"); + PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("完成"); + PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("返回"); + PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("继续"); + PROGMEM Language_Str MSG_PAUSING = _UxGT("暂停中..."); 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("打印物体"); + PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("取消物体"); + PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("取消物体 ="); + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("中断恢复"); 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_PRINTING = _UxGT("打印中..."); PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("已取消打印"); //"Print aborted" + PROGMEM Language_Str MSG_PRINT_DONE = _UxGT("打印已完成"); PROGMEM Language_Str MSG_NO_MOVE = _UxGT("无移动"); //"No move." PROGMEM Language_Str MSG_KILLED = _UxGT("已杀掉"); //"KILLED. " PROGMEM Language_Str MSG_STOPPED = _UxGT("已停止"); //"STOPPED. " @@ -267,6 +381,23 @@ namespace Language_zh_CN { 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_FILAMENT_SWAP_LENGTH = _UxGT("交换长度"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_EXTRA = _UxGT("额外的交换"); + PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("清洗长度"); + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("换工具"); + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Z抬起"); + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPEED = _UxGT("进给速度"); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("回抽速度"); + PROGMEM Language_Str MSG_FILAMENT_PARK_ENABLED = _UxGT("停靠头"); + PROGMEM Language_Str MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("恢复速度"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("风扇速度"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_TIME = _UxGT("风扇时间"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_ON = _UxGT("自动开"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_OFF = _UxGT("自动关"); + PROGMEM Language_Str MSG_TOOL_MIGRATION = _UxGT("工具迁移"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_AUTO = _UxGT("自动迁移"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_END = _UxGT("上一个挤出机"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_SWAP = _UxGT("迁移至 *"); 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" @@ -276,34 +407,63 @@ namespace Language_zh_CN { PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("卸载全部"); // "Unload All" PROGMEM Language_Str MSG_ATTACH_MEDIA = _UxGT("初始化存储卡"); //"Init. SD card" PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("更换存储卡"); //"Change SD card" + PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("释放存储卡"); 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_BLTOUCH_SELFTEST = _UxGT("自检"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("重置"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("装载"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("部署"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("SW模式"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("5V模式"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("OD模式"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("模式保存"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("设置BLTouch为5V"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("设置BLTouch为OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("报告开漏"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("危险: 错误的设置将引起损坏! 是否继续?"); + PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("初始化TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Z偏移量测试"); + PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("保存"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("部署TouchMI"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("部署Z探针"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("收好Z探针"); 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_ZPROBE_OFFSETS = _UxGT("探针偏移量"); + PROGMEM Language_Str MSG_ZPROBE_XOFFSET = _UxGT("探针X偏移"); + PROGMEM Language_Str MSG_ZPROBE_YOFFSET = _UxGT("探针Y偏移"); + 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_BABYSTEP_TOTAL = _UxGT("总计"); 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_HEATING_FAILED_LCD_BED = _UxGT("热床加热失败"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_CHAMBER = _UxGT("机箱加热失败"); + 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("热床热量失控"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("机箱热量失控"); 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_ERR_MAXTEMP_CHAMBER = _UxGT("错误:最高机箱温度"); + PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("错误:最低机箱温度"); 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("冷却中 ..."); PROGMEM Language_Str MSG_BED_HEATING = _UxGT("加热热床中 ..."); //"Bed Heating..." + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("热床冷却中 ..."); + PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("机箱加热中 ..."); + PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("机箱冷却中 ..."); 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" @@ -312,6 +472,7 @@ namespace Language_zh_CN { 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("探针Z偏移量"); 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" @@ -328,10 +489,14 @@ namespace Language_zh_CN { 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("监控温度失控:关"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("监控温度失控:开"); + PROGMEM Language_Str MSG_HOTEND_IDLE_TIMEOUT = _UxGT("热端空闲超时"); + 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" + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("打印机不正确"); // "The printer is incorrect" #if LCD_WIDTH >= 20 PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("打印计数"); //"Print Count" @@ -355,7 +520,9 @@ namespace Language_zh_CN { PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y 驱动 %"); // "Y Driver %" PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z 驱动 %"); // "Z Driver %" PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E 驱动 %"); // "E Driver %" + PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("TMC 连接错误"); PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("保存驱动设置"); // "DAC EEPROM Write" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("更换料"); 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" @@ -363,26 +530,116 @@ namespace Language_zh_CN { 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_RUNOUT_SENSOR = _UxGT("断料传感器"); + PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("断料距离mm"); + PROGMEM Language_Str MSG_KILL_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" + PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("选择料"); + PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); + PROGMEM Language_Str MSG_KILL_MMU2_FIRMWARE = _UxGT("升级MMU固件!"); + PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU需要专注."); + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("MMU恢复"); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("MMU恢复中..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("MMU加载"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("MMU加载全部"); + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("MMU加载到喷嘴"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("MMU弹出"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("MMU弹出 ~"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("MMU卸载"); + PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("加载填充. %i..."); + PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("弹出填充. ..."); + PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("卸载填充...."); + PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("全部"); + PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("料 ~"); + PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("复位MMU"); + PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("MMU复位中..."); + PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("移出, 按下"); + + PROGMEM Language_Str MSG_MIX = _UxGT("混合"); + PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("器件 ="); + PROGMEM Language_Str MSG_MIXER = _UxGT("混合器"); + PROGMEM Language_Str MSG_GRADIENT = _UxGT("梯度"); + PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("全梯度"); + PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("开关混合"); + PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("循环混合"); + PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("梯度混合"); + PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("反向梯度"); + PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("激活 V-tool"); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("开始 V-tool"); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT(" 结束 V-tool"); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("别名 V-tool"); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("复位 V-tools"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("提交 V-tool Mix"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-tools 已复位"); + PROGMEM Language_Str MSG_START_Z = _UxGT("开始 Z:"); + PROGMEM Language_Str MSG_END_Z = _UxGT(" 结束 Z:"); + + 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("迷宫"); + + PROGMEM Language_Str MSG_BAD_PAGE = _UxGT("错误页面索引"); + PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _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_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("按下按钮", "恢复打印")); + PROGMEM Language_Str MSG_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("停靠中...")); 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_INSERT = _UxGT(MSG_3_LINE("插入料", "并按下", "以继续")); 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_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("按下已完成", "料的清洗")); 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("按下继续")); + PROGMEM Language_Str MSG_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("停靠中...")); 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_HEAT = _UxGT(MSG_1_LINE("按下加热")); 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("按下完成")); PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("恢复中 ...")); //"Resuming..." #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("StealthChop已使能"); + PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("复位"); + PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" 在:"); + PROGMEM Language_Str MSG_BACKLASH = _UxGT("回差"); + 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("校正"); + PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("平滑的"); + + PROGMEM Language_Str MSG_LEVEL_X_AXIS = _UxGT("X轴调平"); + PROGMEM Language_Str MSG_AUTO_CALIBRATE = _UxGT("自动校准"); + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("加热器超时"); + PROGMEM Language_Str MSG_REHEAT = _UxGT("重新加热"); + PROGMEM Language_Str MSG_REHEATING = _UxGT("重新加热中..."); } + +#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/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 06b19440f2..94a7944b35 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ * Traditional Chinese * * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html + * See also https://marlinfw.org/docs/development/lcd_language.html * */ namespace Language_zh_TW { @@ -42,7 +42,6 @@ namespace Language_zh_TW { PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("正在中止..."); //"Aborting..." PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("記憶卡已插入"); //"Card inserted" PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("記憶卡被拔出"); //"Card 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裝置已移除"); //"USB device removed" @@ -69,20 +68,23 @@ namespace Language_zh_TW { 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" + #if PREHEAT_COUNT + 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_M = _UxGT("預熱 $"); //"Preheat PREHEAT_1_LABEL" + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("預熱 $ ~"); //"Preheat PREHEAT_1_LABEL" + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("預熱 $ 噴嘴"); //MSG_PREHEAT_1 " " + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("預熱 $ 噴嘴 ~"); //MSG_PREHEAT_1 " " + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("預熱 $ 全部"); //MSG_PREHEAT_1 " All" + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("預熱 $ 熱床"); //MSG_PREHEAT_1 " Bed" + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("預熱 $ 設置"); //MSG_PREHEAT_1 " conf" + #endif 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" @@ -144,14 +146,14 @@ namespace Language_zh_TW { 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" + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("創設 $ 網格"); // "Build PREHEAT_1_LABEL Mesh" + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("批准 $ 網格"); // "Validate PREHEAT_1_LABEL Mesh" + #endif 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_G26_HEATING_BED = _UxGT("G26 加熱熱床"); //"G26 Heating Bed" PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 加熱噴嘴"); //"G26 Heating Nozzle" @@ -184,8 +186,8 @@ namespace Language_zh_TW { 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_MESH_LOADED = _UxGT("網格 %i 已裝載"); // "Mesh %i loaded" + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("網格 %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" @@ -251,18 +253,7 @@ namespace Language_zh_TW { 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"); //"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_PID_F = _UxGT("PID-F"); //"PID-F" - PROGMEM Language_Str MSG_PID_F_E = _UxGT("PID-F *"); + PROGMEM Language_Str MSG_SELECT = _UxGT("選擇"); //"Select" PROGMEM Language_Str MSG_SELECT_E = _UxGT("選擇 *"); PROGMEM Language_Str MSG_ACC = _UxGT("加速度"); //"Accel" acceleration @@ -271,7 +262,7 @@ namespace Language_zh_TW { 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_JUNCTION_DEVIATION = _UxGT("Junction Dev"); + 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; @@ -358,8 +349,8 @@ namespace Language_zh_TW { 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軸提昇"); //"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_SINGLENOZZLE_PRIME_SPEED = _UxGT("最高速度"); //"Prime Speed" + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _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("更換絲料 *"); @@ -374,26 +365,12 @@ namespace Language_zh_TW { PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("釋放媒體"); //"Release Media" 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_STOW = _UxGT("裝載BLTouch"); // "Stow BLTouch" PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("部署BLTouch"); // "Deploy BLTouch" - 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("歸位 %s%s%s 先"); //"Home ... first" PROGMEM Language_Str MSG_ZPROBE_OFFSETS = _UxGT("探針偏移"); //Probe Offsets PROGMEM Language_Str MSG_ZPROBE_XOFFSET = _UxGT("探針X偏移量"); //Probe X Offset @@ -417,7 +394,6 @@ namespace Language_zh_TW { 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("歸位 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 @@ -459,7 +435,7 @@ namespace Language_zh_TW { 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" + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("打印機不正確"); // "The printer is incorrect" #if LCD_WIDTH >= 20 PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("列印計數"); //"Print Count" @@ -496,67 +472,17 @@ namespace Language_zh_TW { 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("絲距離mm"); //"Runout Dist mm" - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("歸原位失敗"); // "Homing failed" + PROGMEM Language_Str MSG_KILL_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" - 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_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("停車中 ...")); //"Parking..." 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..." @@ -568,7 +494,7 @@ namespace Language_zh_TW { PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("等待列印", "恢復")); //"Wait for print to resume" #else // LCD_HEIGHT < 4 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_PAUSE_PRINT_PARKING = _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" @@ -579,21 +505,6 @@ namespace Language_zh_TW { 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 // LCD_HEIGHT < 4 - - 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 diff --git a/Marlin/src/lcd/lcdprint.cpp b/Marlin/src/lcd/lcdprint.cpp index b19ab38edb..c982cfe2aa 100644 --- a/Marlin/src/lcd/lcdprint.cpp +++ b/Marlin/src/lcd/lcdprint.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -29,33 +29,37 @@ #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*/) { +lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const int8_t ind, PGM_P const inStr/*=nullptr*/, const lcd_uint_t maxlen/*=LCD_WIDTH*/) { uint8_t *p = (uint8_t*)pstr; - lcd_uint_t n = maxlen; - for (; n; n--) { + int8_t n = maxlen; + while (n > 0) { 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; + if (ind >= 0) { + if (ch == '*') { lcd_put_wchar('E'); n--; } + if (n) { lcd_put_wchar(ind + ((ch == '=') ? '0' : LCD_FIRST_TOOL)); n--; } + } + else { + PGM_P const b = ind == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED); + n -= lcd_put_u8str_max_P(b, n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH); + } + if (n) n -= lcd_put_u8str_max_P((PGM_P)p, n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH); + continue; } + else if (ch == '$' && inStr) { + n -= lcd_put_u8str_max_P(inStr, n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH); + continue; + } + lcd_put_wchar(ch); + n--; } return n; } diff --git a/Marlin/src/lcd/lcdprint.h b/Marlin/src/lcd/lcdprint.h index 7128d79c57..341cc4f5c2 100644 --- a/Marlin/src/lcd/lcdprint.h +++ b/Marlin/src/lcd/lcdprint.h @@ -13,11 +13,68 @@ #include "../inc/MarlinConfig.h" #if HAS_GRAPHICAL_LCD + #include "dogm/u8g_fontutf8.h" typedef u8g_uint_t lcd_uint_t; + typedef u8g_int_t lcd_int_t; + + // 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 + + #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 _UxGT(a) a typedef uint8_t lcd_uint_t; + typedef int8_t lcd_int_t; + + #define MENU_FONT_WIDTH 1 + #define MENU_FONT_HEIGHT 1 + #define EDIT_FONT_WIDTH 1 + #define EDIT_FONT_HEIGHT 1 + #define INFO_FONT_WIDTH 1 + #define INFO_FONT_HEIGHT 1 + #define LCD_PIXEL_WIDTH LCD_WIDTH + #define LCD_PIXEL_HEIGHT LCD_HEIGHT + + #define SETCURSOR(col, row) lcd_moveto(col, row) + #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_WIDTH - (len), row) + #endif #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u) @@ -71,10 +128,10 @@ inline int lcd_put_u8str_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P con 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_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const int8_t ind, PGM_P const inStr=nullptr, 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 int8_t ind, PGM_P const inStr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH) { lcd_moveto(col, row); - return lcd_put_u8str_ind_P(pstr, ind, maxlen); + return lcd_put_u8str_ind_P(pstr, ind, inStr, maxlen); } inline int lcd_put_u8str(const char* str) { return lcd_put_u8str_max(str, PIXEL_LEN_NOLIMIT); } diff --git a/Marlin/src/lcd/menu/game/brickout.cpp b/Marlin/src/lcd/menu/game/brickout.cpp index 6fe0a31ffa..4bdc924380 100644 --- a/Marlin/src/lcd/menu/game/brickout.cpp +++ b/Marlin/src/lcd/menu/game/brickout.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/menu/game/brickout.h b/Marlin/src/lcd/menu/game/brickout.h index 2d23bf4c6e..cf1fbc6d98 100644 --- a/Marlin/src/lcd/menu/game/brickout.h +++ b/Marlin/src/lcd/menu/game/brickout.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/menu/game/game.cpp b/Marlin/src/lcd/menu/game/game.cpp index 18fb3c63dc..c14bd2a68d 100644 --- a/Marlin/src/lcd/menu/game/game.cpp +++ b/Marlin/src/lcd/menu/game/game.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/menu/game/game.h b/Marlin/src/lcd/menu/game/game.h index 3ebee563de..e788f29805 100644 --- a/Marlin/src/lcd/menu/game/game.h +++ b/Marlin/src/lcd/menu/game/game.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -53,18 +53,10 @@ // 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 + TERN_(MARLIN_BRICKOUT, brickout_data_t brickout); + TERN_(MARLIN_INVADERS, invaders_data_t invaders); + TERN_(MARLIN_SNAKE, snake_data_t snake); + TERN_(MARLIN_MAZE, maze_data_t maze); }; extern MarlinGameData marlin_game_data; diff --git a/Marlin/src/lcd/menu/game/invaders.cpp b/Marlin/src/lcd/menu/game/invaders.cpp index 31df47ce7f..56e4c224dd 100644 --- a/Marlin/src/lcd/menu/game/invaders.cpp +++ b/Marlin/src/lcd/menu/game/invaders.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/menu/game/invaders.h b/Marlin/src/lcd/menu/game/invaders.h index d2b8790ff0..c99e6c16ae 100644 --- a/Marlin/src/lcd/menu/game/invaders.h +++ b/Marlin/src/lcd/menu/game/invaders.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/menu/game/maze.cpp b/Marlin/src/lcd/menu/game/maze.cpp index d92f14ecd8..85f752ee7d 100644 --- a/Marlin/src/lcd/menu/game/maze.cpp +++ b/Marlin/src/lcd/menu/game/maze.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/menu/game/maze.h b/Marlin/src/lcd/menu/game/maze.h index 7917bab0d8..ff5dde09f5 100644 --- a/Marlin/src/lcd/menu/game/maze.h +++ b/Marlin/src/lcd/menu/game/maze.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/menu/game/snake.cpp b/Marlin/src/lcd/menu/game/snake.cpp index d6af224553..f8892a4e7a 100644 --- a/Marlin/src/lcd/menu/game/snake.cpp +++ b/Marlin/src/lcd/menu/game/snake.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/menu/game/snake.h b/Marlin/src/lcd/menu/game/snake.h index c846d56466..09a3a722de 100644 --- a/Marlin/src/lcd/menu/game/snake.h +++ b/Marlin/src/lcd/menu/game/snake.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/menu/game/types.h b/Marlin/src/lcd/menu/game/types.h index 16ff8d82b6..f6e6c78aa0 100644 --- a/Marlin/src/lcd/menu/game/types.h +++ b/Marlin/src/lcd/menu/game/types.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 501120252a..2a9e4766d8 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -34,10 +34,6 @@ #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 @@ -65,7 +61,8 @@ typedef struct { menuPosition screen_history[6]; uint8_t screen_history_depth = 0; -uint8_t MenuItemBase::itemIndex; // Index number for draw and action +int8_t MenuItemBase::itemIndex; // Index number for draw and action +PGM_P MenuItemBase::itemString; // A PSTR for substitution chimera_t editable; // Value Editing // Menu Edit Items @@ -76,9 +73,6 @@ int32_t MenuEditItemBase::minEditValue, screenFunc_t MenuEditItemBase::callbackFunc; bool MenuEditItemBase::liveEdit; -// Prevent recursion into screen handlers -bool no_reentry = false; - //////////////////////////////////////////// //////// Menu Navigation & History ///////// //////////////////////////////////////////// @@ -90,14 +84,9 @@ void MarlinUI::save_previous_screen() { 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 +void MarlinUI::_goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, const bool is_back/*=false*/)) { + TERN(TURBO_BACK_MENU_ITEM,,constexpr bool is_back = false); + TERN_(TOUCH_BUTTONS, on_edit_screen = false); if (screen_history_depth > 0) { menuPosition &sh = screen_history[--screen_history_depth]; goto_screen(sh.menu_function, @@ -144,9 +133,7 @@ void MenuItem_gcode::action(PGM_P const, PGM_P const pgcode) { queue.inject_P(pg * 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 + TERN_(TOUCH_BUTTONS, ui.repeat_delay = BUTTON_DELAY_EDIT); if (int32_t(ui.encoderPosition) < 0) ui.encoderPosition = 0; if (int32_t(ui.encoderPosition) > maxEditValue) ui.encoderPosition = maxEditValue; if (ui.should_draw()) @@ -168,6 +155,7 @@ void MenuEditItemBase::goto_edit_screen( const screenFunc_t cb, // Callback after edit const bool le // Flag to call cb() during editing ) { + TERN_(TOUCH_BUTTONS, ui.on_edit_screen = true); ui.screen_changed = true; ui.save_previous_screen(); ui.refresh(); @@ -198,6 +186,7 @@ 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(float31sign); // +12.3 DEFINE_MENU_EDIT_ITEM(float41sign); // +123.4 DEFINE_MENU_EDIT_ITEM(float51sign); // +1234.5 DEFINE_MENU_EDIT_ITEM(float52sign); // +123.45 @@ -225,13 +214,9 @@ bool printer_busy() { void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, const uint8_t top/*=0*/, const uint8_t items/*=0*/) { if (currentScreen != screen) { - #if ENABLED(TOUCH_BUTTONS) - repeat_delay = BUTTON_DELAY_MENU; - #endif + TERN_(TOUCH_BUTTONS, repeat_delay = BUTTON_DELAY_MENU); - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - progress_reset(); - #endif + TERN_(LCD_SET_PROGRESS_MANUALLY, progress_reset()); #if BOTH(DOUBLECLICK_FOR_Z_BABYSTEPPING, BABYSTEPPING) static millis_t doubleclick_expire_ms = 0; @@ -242,33 +227,15 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co 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; + if ( (ENABLED(BABYSTEP_WITHOUT_HOMING) || all_axes_known()) + && (ENABLED(BABYSTEP_ALWAYS_AVAILABLE) || printer_busy()) ) + screen = TERN(BABYSTEP_ZPROBE_OFFSET, lcd_babystep_zoffset, lcd_babystep_z); + else { + #if ENABLED(MOVE_Z_WHEN_IDLE) + ui.manual_move.menu_scale = MOVE_Z_IDLE_MULTIPLICATOR; screen = lcd_move_z; - } - #endif + #endif + } } #endif @@ -276,11 +243,9 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co encoderPosition = encoder; encoderTopLine = top; screen_items = items; - if (screen == status_screen) { + if (on_status_screen()) { defer_status_screen(false); - #if ENABLED(AUTO_BED_LEVELING_UBL) - ubl.lcd_map_control = false; - #endif + TERN_(AUTO_BED_LEVELING_UBL, ubl.lcd_map_control = false); screen_history_depth = 0; } @@ -288,22 +253,15 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co // 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); + if (TERN1(AUTO_BED_LEVELING_UBL, !ubl.lcd_map_control)) + set_custom_characters(on_status_screen() ? CHARSET_INFO : CHARSET_MENU); #endif refresh(LCDVIEW_CALL_REDRAW_NEXT); screen_changed = true; - #if HAS_GRAPHICAL_LCD - drawing_screen = false; - #endif + TERN_(HAS_GRAPHICAL_LCD, drawing_screen = false); - #if HAS_LCD_MENU - encoder_direction_normal(); - #endif + TERN_(HAS_LCD_MENU, encoder_direction_normal()); set_selection(false); } @@ -314,29 +272,18 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co //////////////////////////////////////////// // -// Display the synchronize screen until moves are -// finished, and don't return to the caller until -// done. ** This blocks the command queue! ** +// Display a "synchronize" screen with a custom message until +// all moves are finished. Go back to calling screen when done. // -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 - const screenFunc_t old_screen = currentScreen; - goto_screen(_synchronize); - no_reentry = true; - 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(); + static PGM_P sync_message = msg ?: GET_TEXT(MSG_MOVING); + save_previous_screen(); + goto_screen([]{ + if (should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, sync_message); + }); + defer_status_screen(); + planner.synchronize(); // idle() is called until moves complete + goto_previous_screen_no_defer(); } /** @@ -398,39 +345,35 @@ void scroll_screen(const uint8_t limit, const bool is_menu) { ui.defer_status_screen(); const bool do_probe = DISABLED(BABYSTEP_HOTEND_Z_OFFSET) || active_extruder == 0; if (ui.encoderPosition) { - const int16_t babystep_increment = int16_t(ui.encoderPosition) * (BABYSTEP_MULTIPLICATOR_Z); + const int16_t babystep_increment = int16_t(ui.encoderPosition) * (BABYSTEP_SIZE_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 - ; + new_offs = TERN(BABYSTEP_HOTEND_Z_OFFSET + , do_probe ? new_probe_offset : hotend_offset[active_extruder].z - diff + , new_probe_offset + ); 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 + if (do_probe) + probe.offset.z = new_offs; + else + TERN(BABYSTEP_HOTEND_Z_OFFSET, hotend_offset[active_extruder].z = new_offs, NOOP); 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), ftostr54sign(hotend_offset[active_extruder].z)); - #endif if (do_probe) { MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_ZPROBE_ZOFFSET), BABYSTEP_TO_STR(probe.offset.z)); - #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) - _lcd_zoffset_overlay_gfx(probe.offset.z); + TERN_(BABYSTEP_ZPROBE_GFX_OVERLAY, _lcd_zoffset_overlay_gfx(probe.offset.z)); + } + else { + #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) + MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_HOTEND_OFFSET_Z), ftostr54sign(hotend_offset[active_extruder].z)); #endif } } @@ -438,39 +381,6 @@ void scroll_screen(const uint8_t limit, const bool is_menu) { #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)); @@ -494,11 +404,16 @@ bool MarlinUI::update_selection() { 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*/) { +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(); } + ui.defer_status_screen(); } } diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index e9ec3b2496..e8edea76d1 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -29,10 +29,6 @@ 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, HEATER_6_MAXTEMP, HEATER_7_MAXTEMP); -#endif - void scroll_screen(const uint8_t limit, const bool is_menu); bool printer_busy(); @@ -67,12 +63,14 @@ typedef void (*selectFunc_t)(); class MenuItemBase { public: - // An index to interject in the item label and for - // use by the action - static uint8_t itemIndex; + // Index to interject in the item label and/or for use by its action. + static int8_t itemIndex; + + // An optional pointer for use in display or by the action + static PGM_P itemString; // Store the index of the item ahead of use by indexed items - FORCE_INLINE static void init(const uint8_t ind) { itemIndex = ind; } + FORCE_INLINE static void init(const int8_t ind=0, PGM_P const pstr=nullptr) { itemIndex = ind; itemString = pstr; } // 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); @@ -225,7 +223,7 @@ class MenuEditItemBase : public MenuItemBase { 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); + static void draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const inStr, const bool pgm=false); // Implemented for HD44780 and DOGM // This low-level method is good to draw from anywhere @@ -298,6 +296,7 @@ DEFINE_MENU_EDIT_ITEM_TYPE(float43 ,float ,ftostr43sign ,1000 ); DEFINE_MENU_EDIT_ITEM_TYPE(float5 ,float ,ftostr5rj , 1 ); // 12345 right-justified DEFINE_MENU_EDIT_ITEM_TYPE(float5_25 ,float ,ftostr5rj , 0.04f ); // 12345 right-justified (25 increment) DEFINE_MENU_EDIT_ITEM_TYPE(float51 ,float ,ftostr51rj , 10 ); // 1234.5 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(float31sign ,float ,ftostr31sign , 10 ); // +12.3 DEFINE_MENU_EDIT_ITEM_TYPE(float41sign ,float ,ftostr41sign , 10 ); // +123.4 DEFINE_MENU_EDIT_ITEM_TYPE(float51sign ,float ,ftostr51sign , 10 ); // +1234.5 DEFINE_MENU_EDIT_ITEM_TYPE(float52sign ,float ,ftostr52sign , 100 ); // +123.45 @@ -323,7 +322,33 @@ class MenuItem_bool : public MenuEditItemBase { //////////////////////////////////////////// /** - * SCREEN_OR_MENU_LOOP generates init code for a screen or menu + * Marlin's native menu screens work by running a loop from the top visible line index + * to the bottom visible line index (according to how much the screen has been scrolled). + * This complete loop is done on every menu screen call. + * + * The menu system is highly dynamic, so it doesn't know ahead of any menu loop which + * items will be visible or hidden, so menu items don't have a fixed index number. + * + * During the loop, each menu item checks to see if its line is the current one. If it is, + * then it checks to see if a click has arrived so it can run its action. If the action + * doesn't redirect to another screen then the menu item calls its draw method. + * + * Menu item add-ons can do whatever they like. + * + * This mixture of drawing and processing inside a loop has the advantage that a single + * line can be used to represent a menu item, and that is the rationale for this design. + * + * One of the pitfalls of this method is that DOGM displays call the screen handler 2x, + * 4x, or 8x per screen update to draw just one segment of the screen. As a result, any + * menu item that exists in two screen segments is drawn and processed twice per screen + * update. With each item processed 5, 10, 20, or 40 times the logic has to be simple. + * + * To avoid repetition and side-effects, function calls for testing menu item conditions + * should be done before the menu loop (START_MENU / START_SCREEN). + */ + +/** + * SCREEN_OR_MENU_LOOP generates header 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) @@ -381,15 +406,15 @@ class MenuItem_bool : public MenuEditItemBase { */ #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); \ + 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 { \ @@ -399,11 +424,31 @@ class MenuItem_bool : public MenuEditItemBase { NEXT_ITEM(); \ }while(0) +// Indexed items set a global index value and optional data +#define _MENU_ITEM_N_S_P(TYPE, N, S, V...) do{ \ + _skipStatic = false; \ + if (_menuLineNr == _thisItemNr) { \ + MenuItemBase::init(N, S); \ + _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); \ + MenuItemBase::itemIndex = N; \ + _MENU_INNER_P(TYPE, ##V); \ + } \ + NEXT_ITEM(); \ +}while(0) + +// Items with a unique string +#define _MENU_ITEM_S_P(TYPE, S, V...) do{ \ + _skipStatic = false; \ + if (_menuLineNr == _thisItemNr) { \ + MenuItemBase::itemString = S; \ _MENU_INNER_P(TYPE, ##V); \ } \ NEXT_ITEM(); \ @@ -435,72 +480,94 @@ class MenuItem_bool : public MenuEditItemBase { 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 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_S_P(TYPE, N, S, PLABEL, V...) _MENU_ITEM_N_S_P(TYPE, N, S, false, PLABEL, ##V) +#define MENU_ITEM_N_S(TYPE, N, S, LABEL, V...) MENU_ITEM_N_S_P(TYPE, N, S, GET_TEXT(LABEL), ##V) +#define MENU_ITEM_S_P(TYPE, S, PLABEL, V...) _MENU_ITEM_S_P(TYPE, S, false, PLABEL, ##V) +#define MENU_ITEM_S(TYPE, S, LABEL, V...) MENU_ITEM_S_P(TYPE, S, 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 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 BACK_ITEM(LABEL) MENU_ITEM(back, LABEL) +#define ACTION_ITEM_N_S_P(N, S, PLABEL, ACTION) MENU_ITEM_N_S_P(function, N, S, PLABEL, ACTION) +#define ACTION_ITEM_N_S(N, S, LABEL, ACTION) ACTION_ITEM_N_S_P(N, S, GET_TEXT(LABEL), ACTION) +#define ACTION_ITEM_S_P(S, PLABEL, ACTION) MENU_ITEM_S_P(function, S, PLABEL, ACTION) +#define ACTION_ITEM_S(S, LABEL, ACTION) ACTION_ITEM_S_P(S, 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 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_P(PLABEL, ACTION) MENU_ITEM_P(function, PLABEL, ACTION) -#define ACTION_ITEM(LABEL, ACTION) ACTION_ITEM_P(GET_TEXT(LABEL), ACTION) +#define GCODES_ITEM_N_S_P(N, S, PLABEL, GCODES) MENU_ITEM_N_S_P(gcode, N, S, PLABEL, GCODES) +#define GCODES_ITEM_N_S(N, S, LABEL, GCODES) GCODES_ITEM_N_S_P(N, S, GET_TEXT(LABEL), GCODES) +#define GCODES_ITEM_S_P(S, PLABEL, GCODES) MENU_ITEM_S_P(gcode, S, PLABEL, GCODES) +#define GCODES_ITEM_S(S, LABEL, GCODES) GCODES_ITEM_S_P(S, 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 GCODES_ITEM_P(PLABEL, GCODES) MENU_ITEM_P(gcode, PLABEL, GCODES) +#define GCODES_ITEM(LABEL, GCODES) GCODES_ITEM_P(GET_TEXT(LABEL), GCODES) -#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 SUBMENU_N_S_P(N, S, PLABEL, DEST) MENU_ITEM_N_S_P(submenu, N, S, PLABEL, DEST) +#define SUBMENU_N_S(N, S, LABEL, DEST) SUBMENU_N_S_P(N, S, GET_TEXT(LABEL), DEST) +#define SUBMENU_S_P(S, PLABEL, DEST) MENU_ITEM_S_P(submenu, S, PLABEL, DEST) +#define SUBMENU_S(S, LABEL, DEST) SUBMENU_S_P(S, 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 SUBMENU_P(PLABEL, DEST) MENU_ITEM_P(submenu, PLABEL, DEST) +#define SUBMENU(LABEL, DEST) SUBMENU_P(GET_TEXT(LABEL), DEST) -#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 EDIT_ITEM_N_S_P(TYPE, N, S, PLABEL, V...) MENU_ITEM_N_S_P(TYPE, N, S, PLABEL, ##V) +#define EDIT_ITEM_N_S(TYPE, N, S, LABEL, V...) EDIT_ITEM_N_S_P(TYPE, N, S, GET_TEXT(LABEL), ##V) +#define EDIT_ITEM_S_P(TYPE, S, PLABEL, V...) MENU_ITEM_S_P(TYPE, S, PLABEL, ##V) +#define EDIT_ITEM_S(TYPE, S, LABEL, V...) EDIT_ITEM_S_P(TYPE, S, 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_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 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 EDIT_ITEM_FAST_N_S_P(TYPE, N, S, PLABEL, V...) _MENU_ITEM_N_S_P(TYPE, N, S, true, PLABEL, ##V) +#define EDIT_ITEM_FAST_N_S(TYPE, N, S, LABEL, V...) EDIT_ITEM_FAST_N_S_P(TYPE, N, S, true, GET_TEXT(LABEL), ##V) +#define EDIT_ITEM_FAST_S_P(TYPE, S, PLABEL, V...) _MENU_ITEM_S_P(TYPE, S, true, PLABEL, ##V) +#define EDIT_ITEM_FAST_S(TYPE, S, LABEL, V...) EDIT_ITEM_FAST_S_P(TYPE, S, 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 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 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); \ +#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 { \ +// Indexed items set a global index value and optional data +#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_S_P(N, S, V...) do{ \ _skipStatic = false; \ - if (_menuLineNr == _thisItemNr) \ - _CONFIRM_ITEM_INNER_P(PLABEL, ##V); \ + if (_menuLineNr == _thisItemNr) { \ + MenuItemBase::init(N, S); \ + _CONFIRM_ITEM_INNER_P(TYPE, ##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_N_P(N, V...) _CONFIRM_ITEM_N_S_P(N, nullptr, V) #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) @@ -508,11 +575,15 @@ class MenuItem_bool : public MenuEditItemBase { #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 CONFIRM_ITEM_N_S_P(N,S,PLABEL,A,B,V...) _CONFIRM_ITEM_N_S_P(N, S, PLABEL, GET_TEXT(A), GET_TEXT(B), ##V) +#define CONFIRM_ITEM_N_S(N,S,LABEL,V...) CONFIRM_ITEM_N_S_P(N, S, 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) +#define YESNO_ITEM_N_S_P(N,S,PLABEL, V...) _CONFIRM_ITEM_N_S_P(N, S, PLABEL, ##V) +#define YESNO_ITEM_N_S(N,S,LABEL, V...) YESNO_ITEM_N_S_P(N, S, 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 /////////////// @@ -526,7 +597,7 @@ void menu_move(); #endif // First Fan Speed title in "Tune" and "Control>Temperature" menus -#if FAN_COUNT > 0 && HAS_FAN0 +#if HAS_FAN && HAS_FAN0 #if FAN_COUNT > 1 #define FAN_SPEED_1_SUFFIX " 1" #else @@ -547,11 +618,6 @@ void _lcd_draw_homing(); 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 @@ -570,11 +636,17 @@ void _lcd_draw_homing(); #else void lcd_babystep_z(); #endif -#endif -#if ENABLED(EEPROM_SETTINGS) - void lcd_store_settings(); - void lcd_load_settings(); + #if ENABLED(BABYSTEP_MILLIMETER_UNITS) + #define BABYSTEP_SIZE_X int32_t((BABYSTEP_MULTIPLICATOR_XY) * planner.settings.axis_steps_per_mm[X_AXIS]) + #define BABYSTEP_SIZE_Y int32_t((BABYSTEP_MULTIPLICATOR_XY) * planner.settings.axis_steps_per_mm[Y_AXIS]) + #define BABYSTEP_SIZE_Z int32_t((BABYSTEP_MULTIPLICATOR_Z) * planner.settings.axis_steps_per_mm[Z_AXIS]) + #else + #define BABYSTEP_SIZE_X BABYSTEP_MULTIPLICATOR_XY + #define BABYSTEP_SIZE_Y BABYSTEP_MULTIPLICATOR_XY + #define BABYSTEP_SIZE_Z BABYSTEP_MULTIPLICATOR_Z + #endif + #endif #if ENABLED(POWER_LOSS_RECOVERY) diff --git a/Marlin/src/lcd/menu/menu_addon.h b/Marlin/src/lcd/menu/menu_addon.h index 5f338c571a..c276c8865b 100644 --- a/Marlin/src/lcd/menu/menu_addon.h +++ b/Marlin/src/lcd/menu/menu_addon.h @@ -16,15 +16,12 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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) { \ diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index f2327b75e5..81baa6156a 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -43,12 +43,11 @@ #include "../../module/temperature.h" #endif -#if ENABLED(FILAMENT_RUNOUT_SENSOR) && FILAMENT_RUNOUT_DISTANCE_MM +#if HAS_FILAMENT_RUNOUT_DISTANCE #include "../../feature/runout.h" - float lcd_runout_distance_mm; #endif -#if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS) +#if ENABLED(SD_FIRMWARE_UPDATE) #include "../../module/configuration_store.h" #endif @@ -98,10 +97,6 @@ void menu_cancelobject(); #endif -#if ENABLED(SD_FIRMWARE_UPDATE) - #include "../../module/configuration_store.h" -#endif - #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) // // Advanced Settings > Filament @@ -122,6 +117,14 @@ void menu_cancelobject(); #if DISABLED(NO_VOLUMETRICS) EDIT_ITEM(bool, MSG_VOLUMETRIC_ENABLED, &parser.volumetric_enabled, planner.calculate_volumetric_multipliers); + #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) + EDIT_ITEM_FAST(float42_52, MSG_VOLUMETRIC_LIMIT, &planner.volumetric_extruder_limit[active_extruder], 0.0f, 20.0f, planner.calculate_volumetric_extruder_limits); + #if EXTRUDERS > 1 + LOOP_L_N(n, EXTRUDERS) + EDIT_ITEM_FAST_N(float42_52, n, MSG_VOLUMETRIC_LIMIT_E, &planner.volumetric_extruder_limit[n], 0.0f, 20.00f, planner.calculate_volumetric_extruder_limits); + #endif + #endif + if (parser.volumetric_enabled) { EDIT_ITEM_FAST(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); #if EXTRUDERS > 1 @@ -132,13 +135,7 @@ void menu_cancelobject(); #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) - constexpr float extrude_maxlength = - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - EXTRUDE_MAXLENGTH - #else - 999 - #endif - ; + constexpr float extrude_maxlength = TERN(PREVENT_LENGTHY_EXTRUDE, EXTRUDE_MAXLENGTH, 999); EDIT_ITEM_FAST(float3, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength); #if EXTRUDERS > 1 @@ -153,10 +150,11 @@ void menu_cancelobject(); #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); - }); + #if HAS_FILAMENT_RUNOUT_DISTANCE + editable.decimal = runout.runout_distance(); + EDIT_ITEM(float3, MSG_RUNOUT_DISTANCE_MM, &editable.decimal, 1, float(FILAMENT_RUNOUT_DISTANCE_MM) * 1.5f, + []{ runout.set_runout_distance(editable.decimal); }, true + ); #endif END_MENU(); @@ -171,25 +169,25 @@ void menu_cancelobject(); #if ENABLED(PID_AUTOTUNE_MENU) #if ENABLED(PIDTEMP) - int16_t autotune_temp[HOTENDS] = ARRAY_BY_HOTENDS1(150); + int16_t autotune_temp[HOTENDS] = ARRAY_BY_HOTENDS1(PREHEAT_1_TEMP_HOTEND); + #endif + #if ENABLED(PIDTEMPBED) + int16_t autotune_temp_bed = PREHEAT_1_TEMP_BED; #endif - #if ENABLED(PIDTEMPBED) - int16_t autotune_temp_bed = 70; - #endif + #include "../../gcode/queue.h" 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] + TERN(PIDTEMPBED, autotune_temp_bed, autotune_temp[e]) #endif ); - lcd_enqueue_one_now(cmd); + queue.inject(cmd); + ui.return_to_status(); } #endif // PID_AUTOTUNE_MENU @@ -201,16 +199,12 @@ void menu_cancelobject(); // 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 + TERN(PID_PARAMS_PER_HOTEND,,UNUSED(e)); 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 + TERN(PID_PARAMS_PER_HOTEND,,UNUSED(e)); PID_PARAM(Kd, e) = scalePID_d(raw_Kd); thermalManager.updatePID(); } @@ -233,14 +227,16 @@ void menu_cancelobject(); #define DEFINE_PIDTEMP_FUNCS(N) _DEFINE_PIDTEMP_BASE_FUNCS(N); #endif -#if HOTENDS +#if HAS_HOTEND DEFINE_PIDTEMP_FUNCS(0); - #if HOTENDS > 1 && ENABLED(PID_PARAMS_PER_HOTEND) + #if ENABLED(PID_PARAMS_PER_HOTEND) REPEAT_S(1, HOTENDS, DEFINE_PIDTEMP_FUNCS) #endif #endif -#define SHOW_MENU_ADVANCED_TEMPERATURE ((ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND) || EITHER(PID_AUTOTUNE_MENU, PID_EDIT_MENU)) +#if BOTH(AUTOTEMP, HAS_TEMP_HOTEND) || EITHER(PID_AUTOTUNE_MENU, PID_EDIT_MENU) + #define SHOW_MENU_ADVANCED_TEMPERATURE 1 +#endif // // Advanced Settings > Temperature @@ -253,10 +249,10 @@ void menu_cancelobject(); // // Autotemp, Min, Max, Fact // - #if ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND + #if BOTH(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(float3, MSG_MIN, &planner.autotemp_min, 0, float(HEATER_0_MAXTEMP) - HOTEND_OVERSHOOT); + EDIT_ITEM(float3, MSG_MAX, &planner.autotemp_max, 0, float(HEATER_0_MAXTEMP) - HOTEND_OVERSHOOT); EDIT_ITEM(float42_52, MSG_FACTOR, &planner.autotemp_factor, 0, 10); #endif @@ -271,11 +267,11 @@ void menu_cancelobject(); #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); }) + raw_Ki = unscalePID_i(TERN(PID_BED_MENU_SECTION, thermalManager.temp_bed.pid.Ki, PID_PARAM(Ki, N))); \ + raw_Kd = unscalePID_d(TERN(PID_BED_MENU_SECTION, thermalManager.temp_bed.pid.Kd, PID_PARAM(Kd, N))); \ + EDIT_ITEM_FAST_N(float41sign, N, MSG_PID_P_E, &TERN(PID_BED_MENU_SECTION, thermalManager.temp_bed.pid.Kp, PID_PARAM(Kp, N)), 1, 9990); \ + EDIT_ITEM_FAST_N(float52sign, N, MSG_PID_I_E, &raw_Ki, 0.01f, 9990, []{ copy_and_scalePID_i(N); }); \ + EDIT_ITEM_FAST_N(float41sign, 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) \ @@ -302,16 +298,27 @@ void menu_cancelobject(); #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); }); + EDIT_ITEM_FAST_N(int3, N, MSG_PID_AUTOTUNE_E, &autotune_temp[N], 150, thermalManager.heater_maxtemp[N] - HOTEND_OVERSHOOT, []{ _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) + #if ENABLED(PID_PARAMS_PER_HOTEND) REPEAT_S(1, HOTENDS, PID_EDIT_MENU_ITEMS) #endif + #if ENABLED(PIDTEMPBED) + #if ENABLED(PID_EDIT_MENU) + #define PID_BED_MENU_SECTION + __PID_BASE_MENU_ITEMS(-1); + #undef PID_BED_MENU_SECTION + #endif + #if ENABLED(PID_AUTOTUNE_MENU) + EDIT_ITEM_FAST_N(int3, -1, MSG_PID_AUTOTUNE_E, &autotune_temp_bed, PREHEAT_1_TEMP_BED, BED_MAX_TARGET, []{ _lcd_autotune(-1); }); + #endif + #endif + END_MENU(); } @@ -331,9 +338,6 @@ void menu_cancelobject(); // 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 @@ -349,6 +353,10 @@ void menu_cancelobject(); #else const xyze_feedrate_t &max_fr_edit_scaled = max_fr_edit; #endif + + START_MENU(); + BACK_ITEM(MSG_ADVANCED_SETTINGS); + #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); @@ -373,18 +381,7 @@ void menu_cancelobject(); // M201 / M204 Accelerations void menu_advanced_acceleration() { - START_MENU(); - BACK_ITEM(MSG_ADVANCED_SETTINGS); - const 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, planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(active_extruder)]); - - // 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 = @@ -402,10 +399,22 @@ void menu_cancelobject(); const xyze_ulong_t &max_accel_edit_scaled = max_accel_edit; #endif + START_MENU(); + BACK_ITEM(MSG_ADVANCED_SETTINGS); + + // 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, planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(active_extruder)]); + + // M204 T Travel Acceleration + EDIT_ITEM_FAST(float5_25, MSG_A_TRAVEL, &planner.settings.travel_acceleration, 25, max_accel); + #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); + EDIT_AMAX(A, 100); + EDIT_AMAX(B, 100); + EDIT_AMAX(C, 10); #if ENABLED(DISTINCT_E_FACTORS) 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(); }); @@ -415,24 +424,31 @@ void menu_cancelobject(); 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 + #ifdef XY_FREQUENCY_LIMIT + EDIT_ITEM(int8, MSG_XY_FREQUENCY_LIMIT, &planner.xy_freq_limit_hz, 0, 100, planner.refresh_frequency_limit, true); + editable.uint8 = uint8_t(LROUND(planner.xy_freq_min_speed_factor * 255)); // percent to u8 + EDIT_ITEM(percent, MSG_XY_FREQUENCY_FEEDRATE, &editable.uint8, 3, 255, []{ planner.set_min_speed_factor_u8(editable.uint8); }, true); + #endif + END_MENU(); } - // M205 Jerk - void menu_advanced_jerk() { - START_MENU(); - BACK_ITEM(MSG_ADVANCED_SETTINGS); + #if HAS_CLASSIC_JERK - #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); + void menu_advanced_jerk() { + START_MENU(); + BACK_ITEM(MSG_ADVANCED_SETTINGS); + + #if HAS_JUNCTION_DEVIATION + #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 - #endif - #if HAS_CLASSIC_JERK + constexpr xyze_float_t max_jerk_edit = - #ifdef MAX_ACCEL_EDIT_VALUES + #ifdef MAX_JERK_EDIT_VALUES MAX_JERK_EDIT_VALUES #elif ENABLED(LIMITED_JERK_EDITING) { (DEFAULT_XJERK) * 2, (DEFAULT_YJERK) * 2, (DEFAULT_ZJERK) * 2, (DEFAULT_EJERK) * 2 } @@ -451,10 +467,11 @@ void menu_cancelobject(); #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(); - } + END_MENU(); + } + + #endif // M851 - Z Probe Offsets #if HAS_BED_PROBE @@ -462,8 +479,8 @@ void menu_cancelobject(); START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); #if HAS_PROBE_XY_OFFSET - EDIT_ITEM(float51sign, MSG_ZPROBE_XOFFSET, &probe.offset.x, -(X_BED_SIZE), X_BED_SIZE); - EDIT_ITEM(float51sign, MSG_ZPROBE_YOFFSET, &probe.offset.y, -(Y_BED_SIZE), Y_BED_SIZE); + EDIT_ITEM(float31sign, MSG_ZPROBE_XOFFSET, &probe.offset.x, -(X_BED_SIZE), X_BED_SIZE); + EDIT_ITEM(float31sign, MSG_ZPROBE_YOFFSET, &probe.offset.y, -(Y_BED_SIZE), Y_BED_SIZE); #endif EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); END_MENU(); @@ -483,7 +500,6 @@ void menu_advanced_steps_per_mm() { EDIT_QSTEPS(C); #if ENABLED(DISTINCT_E_FACTORS) - EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(active_extruder)], 5, 9999, []{ planner.refresh_positioning(); }); LOOP_L_N(n, E_STEPPERS) 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); }); #elif E_STEPPERS @@ -494,9 +510,12 @@ void menu_advanced_steps_per_mm() { } void menu_advanced_settings() { - #if ENABLED(FILAMENT_RUNOUT_SENSOR) && FILAMENT_RUNOUT_DISTANCE_MM - lcd_runout_distance_mm = runout.runout_distance(); + const bool is_busy = printer_busy(); + + #if ENABLED(SD_FIRMWARE_UPDATE) + bool sd_update_state = settings.sd_update_status(); #endif + START_MENU(); BACK_ITEM(MSG_CONFIGURATION); @@ -515,18 +534,26 @@ void menu_advanced_settings() { // M201 - Acceleration items SUBMENU(MSG_ACCELERATION, menu_advanced_acceleration); - // M205 - Max Jerk - SUBMENU(MSG_JERK, menu_advanced_jerk); + #if HAS_CLASSIC_JERK + // M205 - Max Jerk + SUBMENU(MSG_JERK, menu_advanced_jerk); + #elif HAS_JUNCTION_DEVIATION + EDIT_ITEM(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.001f, 0.3f + #if ENABLED(LIN_ADVANCE) + , planner.recalculate_max_e_jerk + #endif + ); + #endif // M851 - Z Probe Offsets #if HAS_BED_PROBE - if (!printer_busy()) - SUBMENU(MSG_ZPROBE_OFFSETS, menu_probe_offsets); + if (!is_busy) SUBMENU(MSG_ZPROBE_OFFSETS, menu_probe_offsets); #endif + #endif // !SLIM_LCD_MENUS // M92 - Steps Per mm - if (!printer_busy()) + if (!is_busy) SUBMENU(MSG_STEPS_PER_MM, menu_advanced_steps_per_mm); #if ENABLED(BACKLASH_GCODE) @@ -569,16 +596,13 @@ void menu_advanced_settings() { #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.completion_feedback(didset); ui.return_to_status(); if (new_state) LCD_MESSAGEPGM(MSG_RESET_PRINTER); else ui.reset_status(); }); @@ -587,15 +611,8 @@ void menu_advanced_settings() { #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("?") + ui.init_eeprom, ui.goto_previous_screen, + GET_TEXT(MSG_INIT_EEPROM), (const char *)nullptr, PSTR("?") ); #endif diff --git a/Marlin/src/lcd/menu/menu_backlash.cpp b/Marlin/src/lcd/menu/menu_backlash.cpp index 720694bfff..2aad9a415f 100644 --- a/Marlin/src/lcd/menu/menu_backlash.cpp +++ b/Marlin/src/lcd/menu/menu_backlash.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU && ENABLED(BACKLASH_GCODE) +#if BOTH(HAS_LCD_MENU, BACKLASH_GCODE) #include "menu.h" diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index 3d0a5bf2aa..6dbe7c6d18 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU && ENABLED(LEVEL_BED_CORNERS) +#if BOTH(HAS_LCD_MENU, LEVEL_BED_CORNERS) #include "menu.h" #include "../../module/motion.h" @@ -70,11 +70,7 @@ static inline void _lcd_goto_next_corner() { } line_to_current_position(manual_feedrate_mm_s.x); line_to_z(LEVEL_CORNERS_HEIGHT); - if (++bed_corner > (3 - #if ENABLED(LEVEL_CENTER_TOO) - + 1 - #endif - )) bed_corner = 0; + if (++bed_corner > 3 + ENABLED(LEVEL_CENTER_TOO)) bed_corner = 0; } static inline void _lcd_level_bed_corners_homing() { @@ -83,21 +79,14 @@ static inline void _lcd_level_bed_corners_homing() { 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("?") + GET_TEXT(MSG_BUTTON_NEXT), GET_TEXT(MSG_BUTTON_DONE) + , _lcd_goto_next_corner + , []{ + TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active)); + ui.goto_previous_screen_no_defer(); + } + , GET_TEXT(TERN(LEVEL_CENTER_TOO, MSG_LEVEL_BED_NEXT_POINT, MSG_NEXT_CORNER)) + , (const char*)nullptr, PSTR("?") ); }); ui.set_selection(true); diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index 5834b73ba4..3796f44ff6 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -48,13 +48,7 @@ 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 - ); + constexpr uint8_t total_probe_points = TERN(AUTO_BED_LEVELING_3POINT, 3, GRID_MAX_POINTS); // // Bed leveling is done. Wait for G29 to complete. @@ -75,9 +69,7 @@ ui.synchronize(GET_TEXT(MSG_LEVEL_BED_DONE)); #endif ui.goto_previous_screen_no_defer(); - #if HAS_BUZZER - ui.completion_feedback(); - #endif + ui.completion_feedback(); } if (ui.should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT(MSG_LEVEL_BED_DONE)); ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); @@ -232,11 +224,12 @@ * Save Settings (Req: EEPROM_SETTINGS) */ void menu_bed_leveling() { + const bool is_homed = all_axes_known(), + is_valid = leveling_is_valid(); + 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); @@ -252,12 +245,11 @@ void menu_bed_leveling() { #endif #if ENABLED(MESH_EDIT_MENU) - if (leveling_is_valid()) - SUBMENU(MSG_EDIT_MESH, menu_edit_mesh); + if (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()) { + if (is_homed && is_valid) { bool show_state = planner.leveling_active; EDIT_ITEM(bool, MSG_BED_LEVELING, &show_state, _lcd_toggle_bed_leveling); } @@ -287,8 +279,8 @@ void menu_bed_leveling() { #endif #if ENABLED(EEPROM_SETTINGS) - ACTION_ITEM(MSG_LOAD_EEPROM, lcd_load_settings); - ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings); + ACTION_ITEM(MSG_LOAD_EEPROM, ui.load_settings); + ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings); #endif END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_cancelobject.cpp b/Marlin/src/lcd/menu/menu_cancelobject.cpp index 4d445a1848..095e4eb7b1 100644 --- a/Marlin/src/lcd/menu/menu_cancelobject.cpp +++ b/Marlin/src/lcd/menu/menu_cancelobject.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU && ENABLED(CANCEL_OBJECTS) +#if BOTH(HAS_LCD_MENU, CANCEL_OBJECTS) #include "menu.h" #include "menu_addon.h" @@ -44,9 +44,7 @@ static void lcd_cancel_object_confirm() { MenuItem_confirm::confirm_screen( []{ cancelable.cancel_object(MenuItemBase::itemIndex - 1); - #if HAS_BUZZER - ui.completion_feedback(); - #endif + ui.completion_feedback(); ui.goto_previous_screen(); }, ui.goto_previous_screen, @@ -55,17 +53,19 @@ static void lcd_cancel_object_confirm() { } void menu_cancelobject() { + const int8_t ao = cancelable.active_object; + 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(); + if (i == ao) continue; // Active is drawn on -1 index + const int8_t j = i < 0 ? ao : i; // Active or index item + if (!cancelable.is_canceled(j)) { // Not canceled already? + SUBMENU_N(j, MSG_CANCEL_OBJECT_N, lcd_cancel_object_confirm); // Offer the option. + if (i < 0) SKIP_ITEM(); // Extra line after active + } } END_MENU(); diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 6dbc680659..ef3ad1ffed 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -30,8 +30,6 @@ #include "menu.h" -#include "../../module/configuration_store.h" - #if HAS_FILAMENT_SENSOR #include "../../feature/runout.h" #endif @@ -104,22 +102,51 @@ void menu_advanced_settings(); 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 - ; + static constexpr float max_extrude = TERN(PREVENT_LENGTHY_EXTRUDE, EXTRUDE_MAXLENGTH, 500); + #if ENABLED(TOOLCHANGE_PARK) + EDIT_ITEM(bool, MSG_FILAMENT_PARK_ENABLED, &toolchange_settings.enable_park); + #endif EDIT_ITEM(float3, MSG_FILAMENT_SWAP_LENGTH, &toolchange_settings.swap_length, 0, max_extrude); + EDIT_ITEM(float41sign, MSG_FILAMENT_SWAP_EXTRA, &toolchange_settings.extra_resume, -10, 10); + EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_RETRACT_SPEED, &toolchange_settings.retract_speed, 10, 5400); + EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_UNRETRACT_SPEED, &toolchange_settings.unretract_speed, 10, 5400); 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); + EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_PRIME_SPEED, &toolchange_settings.prime_speed, 10, 5400); + EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_FAN_SPEED, &toolchange_settings.fan_speed, 0, 255); + EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_FAN_TIME, &toolchange_settings.fan_time, 1, 30); #endif EDIT_ITEM(float3, MSG_TOOL_CHANGE_ZLIFT, &toolchange_settings.z_raise, 0, 10); END_MENU(); } + #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) + + #include "../../module/motion.h" // for active_extruder + + void menu_toolchange_migration() { + PGM_P const msg_migrate = GET_TEXT(MSG_TOOL_MIGRATION_SWAP); + + START_MENU(); + BACK_ITEM(MSG_CONFIGURATION); + + // Auto mode ON/OFF + EDIT_ITEM(bool, MSG_TOOL_MIGRATION_AUTO, &migration.automode); + EDIT_ITEM(uint8, MSG_TOOL_MIGRATION_END, &migration.last, 0, EXTRUDERS - 1); + + // Migrate to a chosen extruder + LOOP_L_N(s, EXTRUDERS) { + if (s != active_extruder) { + ACTION_ITEM_N_P(s, msg_migrate, []{ + char cmd[12]; + sprintf_P(cmd, PSTR("M217 T%i"), int(MenuItemBase::itemIndex)); + queue.inject(cmd); + }); + } + } + END_MENU(); + } + #endif + #endif #if HAS_HOTEND_OFFSET @@ -145,7 +172,7 @@ void menu_advanced_settings(); EDIT_ITEM_FAST(float42_52, MSG_HOTEND_OFFSET_Y, &hotend_offset[1].y, -99.0, 99.0, _recalc_offsets); EDIT_ITEM_FAST(float42_52, 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); + ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings); #endif END_MENU(); } @@ -154,11 +181,12 @@ void menu_advanced_settings(); #if ENABLED(DUAL_X_CARRIAGE) void menu_idex() { + const bool need_g28 = !(TEST(axis_known_position, Y_AXIS) && TEST(axis_known_position, Z_AXIS)); + 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") @@ -178,13 +206,7 @@ void menu_advanced_settings(); #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 - ); + SERIAL_ECHOLNPGM("Configuration BLTouch Mode - " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD")); char mess[21]; strcpy_P(mess, PSTR("BLTouch Mode - ")); strcpy_P(&mess[15], bltouch.last_written_mode ? PSTR("5V") : PSTR("OD")); @@ -215,9 +237,10 @@ void menu_advanced_settings(); #endif #if ENABLED(TOUCH_MI_PROBE) + void menu_touchmi() { - START_MENU(); ui.defer_status_screen(); + START_MENU(); BACK_ITEM(MSG_CONFIGURATION); GCODES_ITEM(MSG_TOUCHMI_INIT, PSTR("M851 Z0\nG28\nG1 F200 Z0")); SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); @@ -225,6 +248,7 @@ void menu_advanced_settings(); GCODES_ITEM(MSG_TOUCHMI_ZTEST, PSTR("G28\nG1 F200 Z0")); END_MENU(); } + #endif #if ENABLED(CONTROLLER_FAN_MENU) @@ -245,24 +269,6 @@ void menu_advanced_settings(); #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" @@ -292,34 +298,38 @@ void menu_advanced_settings(); #endif -#if DISABLED(SLIM_LCD_MENUS) +#if PREHEAT_COUNT && DISABLED(SLIM_LCD_MENUS) - void _menu_configuration_preheat_settings(const uint8_t material) { + void _menu_configuration_preheat_settings() { #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) + const uint8_t m = MenuItemBase::itemIndex; START_MENU(); + STATIC_ITEM_P(ui.get_preheat_label(m), SS_CENTER|SS_INVERT); BACK_ITEM(MSG_CONFIGURATION); - EDIT_ITEM(percent, MSG_FAN_SPEED, &ui.preheat_fan_speed[material], 0, 255); + #if HAS_FAN + editable.uint8 = uint8_t(ui.material_preset[m].fan_speed); + EDIT_ITEM_N(percent, m, MSG_FAN_SPEED, &editable.uint8, 0, 255, []{ ui.material_preset[MenuItemBase::itemIndex].fan_speed = editable.uint8; }); + #endif #if HAS_TEMP_HOTEND - EDIT_ITEM(int3, MSG_NOZZLE, &ui.preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - 15); + EDIT_ITEM(uint16_3, MSG_NOZZLE, &ui.material_preset[m].hotend_temp, MINTEMP_ALL, MAXTEMP_ALL - HOTEND_OVERSHOOT); #endif #if HAS_HEATED_BED - EDIT_ITEM(int3, MSG_BED, &ui.preheat_bed_temp[material], BED_MINTEMP, BED_MAXTEMP - 10); + EDIT_ITEM(uint16_3, MSG_BED, &ui.material_preset[m].bed_temp, BED_MINTEMP, BED_MAX_TARGET); #endif #if ENABLED(EEPROM_SETTINGS) - ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings); + ACTION_ITEM(MSG_STORE_EEPROM, ui.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() { + const bool busy = printer_busy(); + START_MENU(); BACK_ITEM(MSG_MAIN); @@ -345,7 +355,6 @@ void menu_configuration() { SUBMENU(MSG_CONTROLLER_FAN, menu_controller_fan); #endif - const bool busy = printer_busy(); if (!busy) { #if EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) SUBMENU(MSG_DELTA_CALIBRATE, menu_delta_calibrate); @@ -373,22 +382,9 @@ void menu_configuration() { // #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 (true - #if DISABLED(CASE_LIGHT_USE_NEOPIXEL) - && PWM_PIN(CASE_LIGHT_PIN) - #endif - ) - SUBMENU(MSG_CASE_LIGHT, menu_case_light); - else + #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) + SUBMENU(MSG_TOOL_MIGRATION, menu_toolchange_migration); #endif - EDIT_ITEM(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); #endif #if HAS_LCD_CONTRAST @@ -406,25 +402,18 @@ void menu_configuration() { 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); + // Preheat configurations + #if PREHEAT_COUNT && DISABLED(SLIM_LCD_MENUS) + LOOP_L_N(m, PREHEAT_COUNT) + SUBMENU_N_S(m, ui.get_preheat_label(m), MSG_PREHEAT_M_SETTINGS, _menu_configuration_preheat_settings); #endif #if ENABLED(EEPROM_SETTINGS) - ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings); - if (!busy) - ACTION_ITEM(MSG_LOAD_EEPROM, lcd_load_settings); + ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings); + if (!busy) ACTION_ITEM(MSG_LOAD_EEPROM, ui.load_settings); #endif - if (!busy) - ACTION_ITEM(MSG_RESTORE_DEFAULTS, []{ - settings.reset(); - #if HAS_BUZZER - ui.completion_feedback(); - #endif - }); + if (!busy) ACTION_ITEM(MSG_RESTORE_DEFAULTS, ui.reset_settings); END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_custom.cpp b/Marlin/src/lcd/menu/menu_custom.cpp index 55297a8b92..729254cda4 100644 --- a/Marlin/src/lcd/menu/menu_custom.cpp +++ b/Marlin/src/lcd/menu/menu_custom.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU && ENABLED(CUSTOM_USER_MENUS) +#if BOTH(HAS_LCD_MENU, CUSTOM_USER_MENUS) #include "menu.h" #include "../../gcode/queue.h" @@ -39,12 +39,8 @@ 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 + TERN_(USER_SCRIPT_AUDIBLE_FEEDBACK, ui.completion_feedback()); + TERN_(USER_SCRIPT_RETURN, ui.return_to_status()); } void menu_user() { diff --git a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp index ac80870ac8..6b99355a60 100644 --- a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp +++ b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -46,7 +46,7 @@ void _man_probe_pt(const xy_pos_t &xy) { do_blocking_move_to_xy_z(xy, Z_CLEARANCE_BETWEEN_PROBES); ui.wait_for_move = false; ui.synchronize(); - move_menu_scale = _MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT)); + ui.manual_move.menu_scale = _MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT)); ui.goto_screen(lcd_move_z); } } @@ -62,12 +62,8 @@ void _man_probe_pt(const xy_pos_t &xy) { float lcd_probe_pt(const xy_pos_t &xy) { _man_probe_pt(xy); ui.defer_status_screen(); - #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 + TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), CONTINUE_STR)); + TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Delta Calibration in progress"))); wait_for_user_response(); ui.goto_previous_screen_no_defer(); return current_position.z; @@ -102,9 +98,7 @@ void _man_probe_pt(const xy_pos_t &xy) { 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 + TERN_(HAS_LEVELING, reset_bed_level()); // After changing kinematics bed-level data is no longer valid recalc_delta_settings(); }; START_MENU(); @@ -124,14 +118,16 @@ void lcd_delta_settings() { } void menu_delta_calibrate() { + const bool all_homed = all_axes_homed(); + 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); + ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings); + ACTION_ITEM(MSG_LOAD_EEPROM, ui.load_settings); #endif #endif @@ -139,7 +135,7 @@ void menu_delta_calibrate() { #if ENABLED(DELTA_CALIBRATION_MENU) SUBMENU(MSG_AUTO_HOME, _lcd_delta_calibrate_home); - if (all_axes_homed()) { + if (all_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); diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp index 0c8f1f61c8..869935b59a 100644 --- a/Marlin/src/lcd/menu/menu_filament.cpp +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -26,11 +26,12 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU && ENABLED(ADVANCED_PAUSE_FEATURE) +#if BOTH(HAS_LCD_MENU, ADVANCED_PAUSE_FEATURE) #include "menu.h" #include "../../module/temperature.h" #include "../../feature/pause.h" +#include "../../gcode/queue.h" #if HAS_FILAMENT_SENSOR #include "../../feature/runout.h" #endif @@ -38,29 +39,35 @@ // // Change Filament > Change/Unload/Load Filament // -static PauseMode _change_filament_temp_mode; // =PAUSE_MODE_PAUSE_PRINT -static int8_t _change_filament_temp_extruder; // =0 +static PauseMode _change_filament_mode; // = PAUSE_MODE_PAUSE_PRINT +static int8_t _change_filament_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"); +inline PGM_P _change_filament_command() { + switch (_change_filament_mode) { + case PAUSE_MODE_LOAD_FILAMENT: return PSTR("M701 T%d"); + case PAUSE_MODE_UNLOAD_FILAMENT: return _change_filament_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"); + default: break; } - return GET_TEXT(MSG_FILAMENTCHANGE); + return PSTR("M600 B0 T%d"); } // Initiate Filament Load/Unload/Change at the specified temperature -static void _change_filament_temp(const uint16_t temperature) { +static void _change_filament_with_temp(const uint16_t celsius) { 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); + sprintf_P(cmd, _change_filament_command(), _change_filament_extruder); + thermalManager.setTargetHotend(celsius, _change_filament_extruder); + queue.inject(cmd); +} + +static void _change_filament_with_preset() { + _change_filament_with_temp(ui.material_preset[MenuItemBase::itemIndex].hotend_temp); +} + +static void _change_filament_with_custom() { + _change_filament_with_temp(thermalManager.temp_hotend[MenuItemBase::itemIndex].target); } // @@ -69,26 +76,27 @@ static void _change_filament_temp(const uint16_t temperature) { 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); + 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; + _change_filament_mode = mode; + _change_filament_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); - }); + #if PREHEAT_COUNT + LOOP_L_N(m, PREHEAT_COUNT) + ACTION_ITEM_N_S(m, ui.get_preheat_label(m), MSG_PREHEAT_M, _change_filament_with_preset); + #endif + EDIT_ITEM_FAST_N(int3, extruder, MSG_PREHEAT_CUSTOM, &thermalManager.temp_hotend[extruder].target, + EXTRUDE_MINTEMP, thermalManager.heater_maxtemp[extruder] - HOTEND_OVERSHOOT, + _change_filament_with_custom + ); END_MENU(); } @@ -98,13 +106,24 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) { * */ #if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - void menu_change_filament() { - START_MENU(); - BACK_ITEM(MSG_MAIN); + void menu_change_filament() { // Say "filament change" when no print is active editable.int8 = printingIsPaused() ? PAUSE_MODE_PAUSE_PRINT : PAUSE_MODE_CHANGE_FILAMENT; + #if E_STEPPERS > 1 && ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) + bool too_cold = false; + for (uint8_t s = 0; !too_cold && s < E_STEPPERS; s++) + too_cold = thermalManager.targetTooColdToExtrude(s); + #endif + + #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) + const bool is_busy = printer_busy(); + #endif + + START_MENU(); + BACK_ITEM(MSG_MAIN); + // Change filament #if E_STEPPERS == 1 PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE); @@ -121,14 +140,14 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) { ACTION_ITEM_N_P(s, msg, []{ char cmd[13]; sprintf_P(cmd, PSTR("M600 B0 T%i"), int(MenuItemBase::itemIndex)); - lcd_enqueue_one_now(cmd); + queue.inject(cmd); }); } } #endif #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - if (!printer_busy()) { + if (!is_busy) { // Load filament #if E_STEPPERS == 1 PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD); @@ -145,7 +164,7 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) { 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); + queue.inject(cmd); }); } } @@ -160,18 +179,10 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) { GCODES_ITEM_P(msg_unload, PSTR("M702")); #else #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) - { - bool too_cold = false; - LOOP_L_N(s, E_STEPPERS) { - if (thermalManager.targetTooColdToExtrude(s)) { - too_cold = true; break; - } - } - if (!too_cold) - GCODES_ITEM(MSG_FILAMENTUNLOAD_ALL, PSTR("M702")); - else + if (too_cold) SUBMENU(MSG_FILAMENTUNLOAD_ALL, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, -1); }); - } + else + GCODES_ITEM(MSG_FILAMENTUNLOAD_ALL, PSTR("M702")); #endif PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD_E); LOOP_L_N(s, E_STEPPERS) { @@ -181,7 +192,7 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) { 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); + queue.inject(cmd); }); } } @@ -197,12 +208,9 @@ 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); + 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); @@ -230,11 +238,18 @@ void menu_pause_option() { 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) + const bool still_out = runout.filament_ran_out; + if (still_out) EDIT_ITEM(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset); + #else + constexpr bool still_out = false; #endif - ACTION_ITEM(MSG_FILAMENT_CHANGE_OPTION_RESUME, []{ pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; }); + + if (!still_out) + ACTION_ITEM(MSG_FILAMENT_CHANGE_OPTION_RESUME, []{ pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; }); + END_MENU(); } @@ -261,7 +276,7 @@ void _lcd_pause_message(PGM_P const msg) { END_SCREEN(); } -void lcd_pause_pausing_message() { _lcd_pause_message(GET_TEXT(MSG_PAUSE_PRINT_INIT)); } +void lcd_pause_parking_message() { _lcd_pause_message(GET_TEXT(MSG_PAUSE_PRINT_PARKING)); } 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)); } @@ -281,7 +296,7 @@ void lcd_pause_purge_message() { FORCE_INLINE screenFunc_t ap_message_screen(const PauseMessage message) { switch (message) { - case PAUSE_MESSAGE_PAUSING: return lcd_pause_pausing_message; + case PAUSE_MESSAGE_PARKING: return lcd_pause_parking_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; diff --git a/Marlin/src/lcd/menu/menu_game.cpp b/Marlin/src/lcd/menu/menu_game.cpp index c2ac9f62a9..21e101404a 100644 --- a/Marlin/src/lcd/menu/menu_game.cpp +++ b/Marlin/src/lcd/menu/menu_game.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -29,13 +29,7 @@ void menu_game() { START_MENU(); - BACK_ITEM( - #if ENABLED(LCD_INFO_MENU) - MSG_INFO_MENU - #else - MSG_MAIN - #endif - ); + BACK_ITEM(TERN(LCD_INFO_MENU, MSG_INFO_MENU, MSG_MAIN)); #if ENABLED(MARLIN_BRICKOUT) SUBMENU(MSG_BRICKOUT, brickout.enter_game); #endif diff --git a/Marlin/src/lcd/menu/menu_info.cpp b/Marlin/src/lcd/menu/menu_info.cpp index 284c3eb1a5..697d4b767e 100644 --- a/Marlin/src/lcd/menu/menu_info.cpp +++ b/Marlin/src/lcd/menu/menu_info.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU && ENABLED(LCD_INFO_MENU) +#if BOTH(HAS_LCD_MENU, LCD_INFO_MENU) #include "menu.h" @@ -34,8 +34,8 @@ #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) +#define VALUE_ITEM(MSG, VALUE, STYL) do{ char msg[21]; strcpy_P(msg, PSTR(": ")); strcpy(msg + 2, VALUE); STATIC_ITEM(MSG, STYL, msg); }while(0) +#define VALUE_ITEM_P(MSG, PVALUE, STYL) do{ char msg[21]; strcpy_P(msg, PSTR(": ")); strcpy_P(msg + 2, PSTR(PVALUE)); STATIC_ITEM(MSG, STYL, msg); }while(0) #if ENABLED(PRINTCOUNTER) @@ -47,23 +47,26 @@ 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 + char buffer[21]; - STATIC_ITEM(MSG_INFO_PRINT_TIME, SS_LEFT); // Total print Time: + 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(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 + 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)); @@ -95,8 +98,6 @@ void menu_info_thermistors() { if (ui.use_click()) return ui.go_back(); - char buffer[21]; // For macro usage - START_SCREEN(); #if EXTRUDERS @@ -171,54 +172,27 @@ void menu_info_thermistors() { #endif #if EXTRUDERS - { - STATIC_ITEM( - #if WATCH_HOTENDS - MSG_INFO_RUNAWAY_ON - #else - MSG_INFO_RUNAWAY_OFF - #endif - , SS_LEFT - ); - } + STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), 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 - ); - } + STATIC_ITEM(TERN(WATCH_BED, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), 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 - ); - } + STATIC_ITEM(TERN(WATCH_CHAMBER, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); #endif END_SCREEN(); @@ -230,8 +204,6 @@ void menu_info_thermistors() { 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 @@ -270,18 +242,15 @@ void menu_info_board() { 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 + #if HAS_LEVELING + STATIC_ITEM( + TERN_(AUTO_BED_LEVELING_3POINT, MSG_3POINT_LEVELING) // 3-Point Leveling + TERN_(AUTO_BED_LEVELING_LINEAR, MSG_LINEAR_LEVELING) // Linear Leveling + TERN_(AUTO_BED_LEVELING_BILINEAR, MSG_BILINEAR_LEVELING) // Bi-linear Leveling + TERN_(AUTO_BED_LEVELING_UBL, MSG_UBL_LEVELING) // Unified Bed Leveling + TERN_(MESH_BED_LEVELING, MSG_MESH_LEVELING) // Mesh Leveling + ); #endif END_SCREEN(); } @@ -295,13 +264,7 @@ 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 - )); + SUBMENU(MSG_INFO_PRINTER_MENU, TERN(SHOW_CUSTOM_BOOTSCREEN, menu_show_custom_bootscreen, menu_show_marlin_bootscreen)); #else SUBMENU(MSG_INFO_PRINTER_MENU, menu_info_printer); // Printer Info > SUBMENU(MSG_INFO_BOARD_MENU, menu_info_board); // Board Info > @@ -315,27 +278,26 @@ void menu_info() { #endif #if HAS_GAMES + { #if ENABLED(GAMES_EASTER_EGG) - SKIP_ITEM(); - SKIP_ITEM(); - SKIP_ITEM(); + SKIP_ITEM(); SKIP_ITEM(); SKIP_ITEM(); #endif + // Game sub-menu or the individual game - { - SUBMENU( - #if HAS_GAME_MENU - MSG_GAMES, menu_game - #elif ENABLED(MARLIN_BRICKOUT) - MSG_BRICKOUT, brickout.enter_game - #elif ENABLED(MARLIN_INVADERS) - MSG_INVADERS, invaders.enter_game - #elif ENABLED(MARLIN_SNAKE) - MSG_SNAKE, snake.enter_game - #elif ENABLED(MARLIN_MAZE) - MSG_MAZE, maze.enter_game - #endif - ); - } + SUBMENU( + #if HAS_GAME_MENU + MSG_GAMES, menu_game + #elif ENABLED(MARLIN_BRICKOUT) + MSG_BRICKOUT, brickout.enter_game + #elif ENABLED(MARLIN_INVADERS) + MSG_INVADERS, invaders.enter_game + #elif ENABLED(MARLIN_SNAKE) + MSG_SNAKE, snake.enter_game + #elif ENABLED(MARLIN_MAZE) + MSG_MAZE, maze.enter_game + #endif + ); + } #endif END_MENU(); diff --git a/Marlin/src/lcd/menu/menu_job_recovery.cpp b/Marlin/src/lcd/menu/menu_job_recovery.cpp index 31db50fe23..a2743ef58b 100644 --- a/Marlin/src/lcd/menu/menu_job_recovery.cpp +++ b/Marlin/src/lcd/menu/menu_job_recovery.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU && ENABLED(POWER_LOSS_RECOVERY) +#if BOTH(HAS_LCD_MENU, POWER_LOSS_RECOVERY) #include "menu.h" #include "../../gcode/queue.h" diff --git a/Marlin/src/lcd/menu/menu_led.cpp b/Marlin/src/lcd/menu/menu_led.cpp index b9e75422bc..2719b3d850 100644 --- a/Marlin/src/lcd/menu/menu_led.cpp +++ b/Marlin/src/lcd/menu/menu_led.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -26,57 +26,88 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU && ENABLED(LED_CONTROL_MENU) +#if HAS_LCD_MENU && EITHER(LED_CONTROL_MENU, CASE_LIGHT_MENU) #include "menu.h" -#include "../../feature/leds/leds.h" -#if ENABLED(LED_COLOR_PRESETS) +#if ENABLED(LED_CONTROL_MENU) + #include "../../feature/leds/leds.h" - void menu_led_presets() { + #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(); - #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); + 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(); } - #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 +#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 - END_MENU(); -} +#endif + + 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); + #if ENABLED(LED_CONTROL_MENU) + 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); + #endif + // + // Set Case light on/off/brightness + // + #if ENABLED(CASE_LIGHT_MENU) + #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) + if (TERN1(CASE_LIGHT_USE_NEOPIXEL, 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 - SUBMENU(MSG_CUSTOM_LEDS, menu_led_custom); END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index d98670922c..51b67209dc 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -39,8 +39,12 @@ #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 EITHER(SDSUPPORT, HOST_PROMPT_SUPPORT) || defined(ACTION_ON_CANCEL) + #define MACHINE_CAN_STOP 1 +#endif +#if ANY(SDSUPPORT, HOST_PROMPT_SUPPORT, PARK_HEAD_ON_PAUSE) || defined(ACTION_ON_PAUSE) + #define MACHINE_CAN_PAUSE 1 +#endif #if ENABLED(PRUSA_MMU2) #include "../../lcd/menu/menu_mmu2.h" @@ -55,6 +59,14 @@ void menu_configuration(); void menu_user(); #endif +#if HAS_POWER_MONITOR + void menu_power_monitor(); +#endif + +#if ENABLED(MIXING_EXTRUDER) + void menu_mixer(); +#endif + #if ENABLED(ADVANCED_PAUSE_FEATURE) void _menu_temp_filament_op(const PauseMode, const int8_t); void menu_change_filament(); @@ -64,25 +76,17 @@ void menu_configuration(); void menu_info(); #endif -#if ENABLED(LED_CONTROL_MENU) +#if EITHER(LED_CONTROL_MENU, CASE_LIGHT_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_INFO_SCREEN); - const bool busy = printingIsActive() #if ENABLED(SDSUPPORT) , card_detected = card.isMounted() @@ -90,6 +94,9 @@ void menu_main() { #endif ; + START_MENU(); + BACK_ITEM(MSG_INFO_SCREEN); + if (busy) { #if MACHINE_CAN_PAUSE ACTION_ITEM(MSG_PAUSE_PRINT, ui.pause_print); @@ -99,7 +106,7 @@ void menu_main() { 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("?") + GET_TEXT(MSG_STOP_PRINT), (const char *)nullptr, PSTR("?") ); }); #endif @@ -115,7 +122,7 @@ void menu_main() { // Autostart // #if ENABLED(MENU_ADDAUTOSTART) - if (!busy) ACTION_ITEM(MSG_AUTOSTART, card.beginautostart); + ACTION_ITEM(MSG_AUTOSTART, card.beginautostart); #endif if (card_detected) { @@ -135,15 +142,13 @@ void menu_main() { ACTION_ITEM(MSG_NO_MEDIA, nullptr); #else GCODES_ITEM(MSG_ATTACH_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 + if (TERN0(MACHINE_CAN_PAUSE, printingIsPaused())) + ACTION_ITEM(MSG_RESUME_PRINT, ui.resume_print); SUBMENU(MSG_MOTION, menu_motion); } @@ -152,7 +157,13 @@ void menu_main() { SUBMENU(MSG_CUTTER(MENU), menu_spindle_laser); #endif - SUBMENU(MSG_TEMPERATURE, menu_temperature); + #if HAS_TEMPERATURE + SUBMENU(MSG_TEMPERATURE, menu_temperature); + #endif + + #if HAS_POWER_MONITOR + MENU_ITEM(submenu, MSG_POWER_MONITOR, menu_power_monitor); + #endif #if ENABLED(MIXING_EXTRUDER) SUBMENU(MSG_MIXER, menu_mixer); @@ -187,8 +198,8 @@ void menu_main() { SUBMENU(MSG_INFO_MENU, menu_info); #endif - #if ENABLED(LED_CONTROL_MENU) - SUBMENU(MSG_LED_CONTROL, menu_led); + #if EITHER(LED_CONTROL_MENU, CASE_LIGHT_MENU) + SUBMENU(MSG_LEDS, menu_led); #endif // @@ -201,36 +212,38 @@ void menu_main() { GCODES_ITEM(MSG_SWITCH_PS_ON, PSTR("M80")); #endif - #if HAS_ENCODER_WHEEL && ENABLED(SDSUPPORT) + #if BOTH(HAS_ENCODER_WHEEL, SDSUPPORT) - // *** IF THIS SECTION IS CHANGED, REPRODUCE ABOVE *** + if (!busy) { - // - // Autostart - // - #if ENABLED(MENU_ADDAUTOSTART) - if (!busy) ACTION_ITEM(MSG_AUTOSTART, card.beginautostart); - #endif + // *** IF THIS SECTION IS CHANGED, REPRODUCE ABOVE *** - 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_ATTACH_MEDIA, M21_STR); - ACTION_ITEM(MSG_MEDIA_RELEASED, nullptr); + // + // Autostart + // + #if ENABLED(MENU_ADDAUTOSTART) + 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_ATTACH_MEDIA, M21_STR); + #endif + } } #endif // HAS_ENCODER_WHEEL && SDSUPPORT @@ -238,9 +251,7 @@ void menu_main() { #if HAS_SERVICE_INTERVALS static auto _service_reset = [](const int index) { print_job_timer.resetServiceInterval(index); - #if HAS_BUZZER - ui.completion_feedback(); - #endif + ui.completion_feedback(); ui.reset_status(); ui.return_to_status(); }; diff --git a/Marlin/src/lcd/menu/menu_media.cpp b/Marlin/src/lcd/menu/menu_media.cpp index 4e68894add..c22314fa9f 100644 --- a/Marlin/src/lcd/menu/menu_media.cpp +++ b/Marlin/src/lcd/menu/menu_media.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU && ENABLED(SDSUPPORT) +#if BOTH(HAS_LCD_MENU, SDSUPPORT) #include "menu.h" #include "../../sd/cardreader.h" @@ -45,25 +45,11 @@ void lcd_sd_updir() { 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() { @@ -113,9 +99,7 @@ class MenuItem_sdfolder : public MenuItem_sdbase { encoderTopLine = 0; ui.encoderPosition = 2 * (ENCODER_STEPS_PER_MENU_ITEM); ui.screen_changed = true; - #if HAS_GRAPHICAL_LCD - ui.drawing_screen = false; - #endif + TERN_(HAS_GRAPHICAL_LCD, ui.drawing_screen = false); ui.refresh(); } }; @@ -142,22 +126,14 @@ void menu_media() { 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); - + card.getfilename_sorted(SD_ORDER(i, fileCnt)); if (card.flag.filenameIsDir) MENU_ITEM(sdfolder, MSG_MEDIA_MENU, card); else MENU_ITEM(sdfile, MSG_MEDIA_MENU, card); } - else { + else SKIP_ITEM(); - } } END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_mixer.cpp b/Marlin/src/lcd/menu/menu_mixer.cpp index 7230320fa2..3f57d257ad 100644 --- a/Marlin/src/lcd/menu/menu_mixer.cpp +++ b/Marlin/src/lcd/menu/menu_mixer.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -26,14 +26,14 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU && ENABLED(MIXING_EXTRUDER) +#if BOTH(HAS_LCD_MENU, MIXING_EXTRUDER) #include "menu.h" #include "menu_addon.h" #include "../../feature/mixing.h" -#define CHANNEL_MIX_EDITING !DUAL_MIXING_EXTRUDER +#define CHANNEL_MIX_EDITING !HAS_DUAL_MIXING #if ENABLED(GRADIENT_MIX) @@ -120,7 +120,7 @@ static uint8_t v_index; -#if DUAL_MIXING_EXTRUDER +#if HAS_DUAL_MIXING 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])); @@ -131,9 +131,7 @@ static uint8_t v_index; void _lcd_mixer_select_vtool() { mixer.T(v_index); - #if DUAL_MIXING_EXTRUDER - _lcd_draw_mix(LCD_HEIGHT - 1); - #endif + TERN_(HAS_DUAL_MIXING, _lcd_draw_mix(LCD_HEIGHT - 1)); } #if CHANNEL_MIX_EDITING @@ -156,7 +154,7 @@ void _lcd_mixer_select_vtool() { void lcd_mixer_mix_edit() { - #if DUAL_MIXING_EXTRUDER && !CHANNEL_MIX_EDITING + #if HAS_DUAL_MIXING && !CHANNEL_MIX_EDITING // Adjust 2-channel mix from the encoder if (ui.encoderPosition != 0) { @@ -194,7 +192,7 @@ void lcd_mixer_mix_edit() { #endif } -#if DUAL_MIXING_EXTRUDER +#if HAS_DUAL_MIXING // // Toggle Dual-Mix @@ -239,13 +237,9 @@ void menu_mixer() { 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 - ); + EDIT_ITEM(uint8, MSG_ACTIVE_VTOOL, &v_index, 0, MIXING_VIRTUAL_TOOLS - 1, _lcd_mixer_select_vtool, ENABLED(HAS_DUAL_MIXING)); - #if DUAL_MIXING_EXTRUDER + #if HAS_DUAL_MIXING { char tmp[10]; SUBMENU(MSG_MIX, lcd_mixer_mix_edit); @@ -271,7 +265,7 @@ void menu_mixer() { ui.return_to_status(); }, ui.goto_previous_screen, - GET_TEXT(MSG_RESET_VTOOLS), (PGM_P)nullptr, PSTR("?") + GET_TEXT(MSG_RESET_VTOOLS), (const char *)nullptr, PSTR("?") ); #if ENABLED(GRADIENT_MIX) diff --git a/Marlin/src/lcd/menu/menu_mmu2.cpp b/Marlin/src/lcd/menu/menu_mmu2.cpp index e2f5e8d658..e9627b8411 100644 --- a/Marlin/src/lcd/menu/menu_mmu2.cpp +++ b/Marlin/src/lcd/menu/menu_mmu2.cpp @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include "../../inc/MarlinConfig.h" -#if HAS_LCD_MENU && ENABLED(MMU2_MENUS) +#if BOTH(HAS_LCD_MENU, MMU2_MENUS) #include "../../feature/mmu2/mmu2.h" #include "menu_mmu2.h" @@ -54,8 +54,7 @@ void _mmu2_load_filament(uint8_t index) { ui.reset_status(); } void action_mmu2_load_all() { - LOOP_L_N(i, EXTRUDERS) - _mmu2_load_filament(i); + LOOP_L_N(i, EXTRUDERS) _mmu2_load_filament(i); ui.return_to_status(); } @@ -171,4 +170,4 @@ uint8_t mmu2_choose_filament() { return currentTool; } -#endif // HAS_LCD_MENU && ENABLED(PRUSA_MMU2_MENUS) +#endif // HAS_LCD_MENU && MMU2_MENUS diff --git a/Marlin/src/lcd/menu/menu_mmu2.h b/Marlin/src/lcd/menu/menu_mmu2.h index 0221b4c765..4230c01464 100644 --- a/Marlin/src/lcd/menu/menu_mmu2.h +++ b/Marlin/src/lcd/menu/menu_mmu2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index b7f57c8146..9c49a3cdb7 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -46,29 +46,9 @@ #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 @@ -76,7 +56,7 @@ inline void manual_move_to_current(AxisEnum axis 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) { + if (ui.encoderPosition && !ui.manual_move.processing) { // Start with no limits to movement float min = current_position[axis] - 1000, @@ -86,28 +66,16 @@ static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) { #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 + TERN_(MIN_SOFTWARE_ENDSTOP_X, min = soft_endstop.min.x); + TERN_(MAX_SOFTWARE_ENDSTOP_X, max = soft_endstop.max.x); 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 + TERN_(MIN_SOFTWARE_ENDSTOP_Y, min = soft_endstop.min.y); + TERN_(MAX_SOFTWARE_ENDSTOP_Y, max = soft_endstop.max.y); 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 + TERN_(MIN_SOFTWARE_ENDSTOP_Z, min = soft_endstop.min.z); + TERN_(MAX_SOFTWARE_ENDSTOP_Z, max = soft_endstop.max.z); default: break; } #endif // HAS_SOFTWARE_ENDSTOPS @@ -122,13 +90,13 @@ static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) { #endif // Get the new position - const float diff = float(int32_t(ui.encoderPosition)) * move_menu_scale; + const float diff = float(int32_t(ui.encoderPosition)) * ui.manual_move.menu_scale; #if IS_KINEMATIC - manual_move_offset += diff; + ui.manual_move.offset += diff; if (int32_t(ui.encoderPosition) < 0) - NOLESS(manual_move_offset, min - current_position[axis]); + NOLESS(ui.manual_move.offset, min - current_position[axis]); else - NOMORE(manual_move_offset, max - current_position[axis]); + NOMORE(ui.manual_move.offset, max - current_position[axis]); #else current_position[axis] += diff; if (int32_t(ui.encoderPosition) < 0) @@ -137,17 +105,16 @@ static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) { NOMORE(current_position[axis], max); #endif - manual_move_to_current(axis); + ui.manual_move.soon(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)); + const float pos = NATIVE_TO_LOGICAL( + ui.manual_move.processing ? destination[axis] : current_position[axis] + TERN0(IS_KINEMATIC, ui.manual_move.offset), + axis + ); + MenuEditItemBase::draw_edit_screen(name, ui.manual_move.menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr63(pos)); } } void lcd_move_x() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_X), X_AXIS); } @@ -156,22 +123,14 @@ 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 - ) { + static void lcd_move_e(TERN_(MULTI_MANUAL, const int8_t eindex=-1)) { 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 + if (!ui.manual_move.processing) { + const float diff = float(int32_t(ui.encoderPosition)) * ui.manual_move.menu_scale; + TERN(IS_KINEMATIC, ui.manual_move.offset, current_position.e) += diff; + ui.manual_move.soon(E_AXIS + #if MULTI_MANUAL , eindex #endif ); @@ -180,24 +139,12 @@ void lcd_move_z() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Z), Z_AXIS); } ui.encoderPosition = 0; } if (ui.should_draw()) { - #if E_MANUAL > 1 - MenuItemBase::init(eindex); - #endif + TERN_(MULTI_MANUAL, MenuItemBase::init(eindex)); MenuEditItemBase::draw_edit_screen( - GET_TEXT( - #if E_MANUAL > 1 - MSG_MOVE_EN - #else - MSG_MOVE_E - #endif - ), + GET_TEXT(TERN(MULTI_MANUAL, MSG_MOVE_EN, MSG_MOVE_E)), ftostr41sign(current_position.e - #if IS_KINEMATIC - + manual_move_offset - #endif - #if ENABLED(MANUAL_E_MOVES_RELATIVE) - - manual_move_e_origin - #endif + + TERN0(IS_KINEMATIC, ui.manual_move.offset) + - TERN0(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin) ) ); } // should_draw @@ -217,12 +164,17 @@ screenFunc_t _manual_move_func_ptr; void _goto_manual_move(const float scale) { ui.defer_status_screen(); - move_menu_scale = scale; + ui.manual_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; + #if ENABLED(PREVENT_COLD_EXTRUSION) + const bool too_cold = axis == E_AXIS && thermalManager.tooColdToExtrude(eindex >= 0 ? eindex : active_extruder); + #else + constexpr bool too_cold = false; + #endif START_MENU(); if (LCD_HEIGHT >= 4) { switch (axis) { @@ -230,19 +182,14 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int 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 + TERN_(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin = current_position.e); 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 - { + if (too_cold) + BACK_ITEM(MSG_HOTEND_TOO_COLD); + else { BACK_ITEM(MSG_MOVE_AXIS); SUBMENU(MSG_MOVE_10MM, []{ _goto_manual_move(10); }); SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move( 1); }); @@ -250,11 +197,7 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int 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 - #if HAS_CHARACTER_LCD - + 1 - #endif - ); + MENU_ITEM_ADDON_START(0 + ENABLED(HAS_CHARACTER_LCD)); 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 : @@ -271,24 +214,12 @@ void menu_move() { START_MENU(); BACK_ITEM(MSG_MOTION); - #if HAS_SOFTWARE_ENDSTOPS && ENABLED(SOFT_ENDSTOPS_MENU_ITEM) + #if BOTH(HAS_SOFTWARE_ENDSTOPS, 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 - ) { + if (NONE(IS_KINEMATIC, NO_MOTION_BEFORE_HOMING) || all_axes_homed()) { + if (TERN1(DELTA, current_position.z <= delta_clip_start_height)) { SUBMENU(MSG_MOVE_X, []{ _menu_move_distance(X_AXIS, lcd_move_x); }); SUBMENU(MSG_MOVE_Y, []{ _menu_move_distance(Y_AXIS, lcd_move_y); }); } @@ -348,13 +279,11 @@ void menu_move() { #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); + #if E_MANUAL == 7 || E_MANUAL == 5 || E_MANUAL == 3 + SUBMENU_MOVE_E(E_MANUAL - 1); #endif - #elif E_MANUAL > 1 + #elif MULTI_MANUAL // Independent extruders with one E-stepper per hotend LOOP_L_N(n, E_MANUAL) SUBMENU_MOVE_E(n); @@ -383,10 +312,8 @@ void menu_motion() { // // Move Axis // - #if ENABLED(DELTA) - if (all_axes_homed()) - #endif - SUBMENU(MSG_MOVE_AXIS, menu_move); + if (TERN1(DELTA, all_axes_homed())) + SUBMENU(MSG_MOVE_AXIS, menu_move); // // Auto Home @@ -398,6 +325,13 @@ void menu_motion() { GCODES_ITEM(MSG_AUTO_HOME_Z, PSTR("G28Z")); #endif + // + // Auto-calibration + // + #if ENABLED(CALIBRATION_GCODE) + GCODES_ITEM(MSG_AUTO_CALIBRATE, PSTR("G425")); + #endif + // // Auto Z-Align // @@ -405,6 +339,13 @@ void menu_motion() { GCODES_ITEM(MSG_AUTO_Z_ALIGN, PSTR("G34")); #endif + // + // Assisted Bed Tramming + // + #if ENABLED(ASSISTED_TRAMMING) + GCODES_ITEM(MSG_ASSISTED_TRAMMING, PSTR("G35")); + #endif + // // Level Bed // @@ -414,17 +355,20 @@ void menu_motion() { #elif ENABLED(LCD_BED_LEVELING) - if (!g29_in_progress) SUBMENU(MSG_BED_LEVELING, menu_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); }); diff --git a/Marlin/src/lcd/menu/menu_power_monitor.cpp b/Marlin/src/lcd/menu/menu_power_monitor.cpp new file mode 100644 index 0000000000..bacf7f379f --- /dev/null +++ b/Marlin/src/lcd/menu/menu_power_monitor.cpp @@ -0,0 +1,62 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 Monitor Menu +// + +#include "../../inc/MarlinConfigPre.h" + +#if HAS_LCD_MENU && HAS_POWER_MONITOR + +#include "menu.h" +#include "../../feature/power_monitor.h" + +void menu_power_monitor() { + START_MENU(); + BACK_ITEM(MSG_MAIN); + + #if ENABLED(POWER_MONITOR_CURRENT) + { + bool ena = power_monitor.current_display_enabled(); + EDIT_ITEM(bool, MSG_CURRENT, &ena, power_monitor.toggle_current_display); + } + #endif + + #if HAS_POWER_MONITOR_VREF + { + bool ena = power_monitor.voltage_display_enabled(); + EDIT_ITEM(bool, MSG_VOLTAGE, &ena, power_monitor.toggle_voltage_display); + } + #endif + + #if HAS_POWER_MONITOR_WATTS + { + bool ena = power_monitor.power_display_enabled(); + EDIT_ITEM(bool, MSG_POWER, &ena, power_monitor.toggle_power_display); + } + #endif + + END_MENU(); +} + +#endif // HAS_LCD_MENU && HAS_POWER_MONITOR diff --git a/Marlin/src/lcd/menu/menu_spindle_laser.cpp b/Marlin/src/lcd/menu/menu_spindle_laser.cpp index fd42522839..00a98d1244 100644 --- a/Marlin/src/lcd/menu/menu_spindle_laser.cpp +++ b/Marlin/src/lcd/menu/menu_spindle_laser.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -34,20 +34,32 @@ void menu_spindle_laser() { + const bool is_enabled = cutter.enabled() && cutter.isReady; + 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 + + #if ENABLED(SPINDLE_LASER_PWM) + // Change the cutter's "current power" value without turning the cutter on or off + // Power is displayed and set in units and range according to CUTTER_POWER_UNIT + EDIT_ITEM_FAST(CUTTER_MENU_POWER_TYPE, MSG_CUTTER(POWER), &cutter.menuPower, + cutter.mpower_min(), cutter.mpower_max(), cutter.update_from_mpower); + #endif + + if (is_enabled) 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 } + + #if ENABLED(MARLIN_DEV_MODE) + #if ENABLED(HAL_CAN_SET_PWM_FREQ) && defined(SPINDLE_LASER_FREQUENCY) + EDIT_ITEM_FAST(CUTTER_MENU_FREQUENCY_TYPE, MSG_CUTTER_FREQUENCY, &cutter.frequency, 2000, 50000, cutter.refresh_frequency); + #endif + #endif END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index 01cf39d7b3..4be98f132d 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -24,9 +24,9 @@ // Temperature Menu // -#include "../../inc/MarlinConfigPre.h" +#include "../../inc/MarlinConfig.h" -#if HAS_LCD_MENU +#if HAS_LCD_MENU && HAS_TEMPERATURE #include "menu.h" #include "../../module/temperature.h" @@ -39,120 +39,104 @@ #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); +void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb) { + #if HAS_HOTEND + if (indh >= 0 && ui.material_preset[indh].hotend_temp > 0) + setTargetHotend(_MIN(thermalManager.heater_maxtemp[e] - HOTEND_OVERSHOOT, ui.material_preset[indh].hotend_temp), e); + #else + UNUSED(e); UNUSED(indh); #endif #if HAS_HEATED_BED - if (tempb >= 0) thermalManager.setTargetBed(tempb); + if (indb >= 0 && ui.material_preset[indb].bed_temp > 0) setTargetBed(ui.material_preset[indb].bed_temp); #else - UNUSED(tempb); + UNUSED(indb); #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); + #if HAS_FAN + set_fan_speed(( + #if FAN_COUNT > 1 + active_extruder < FAN_COUNT ? active_extruder : + #endif + 0), ui.material_preset[indh].fan_speed + ); #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]); - } +#if PREHEAT_COUNT + + #if HAS_TEMP_HOTEND + inline void _preheat_end(const uint8_t m, const uint8_t e) { thermalManager.lcd_preheat(e, m, -1); } + #if HAS_HEATED_BED + inline void _preheat_both(const uint8_t m, const uint8_t e) { thermalManager.lcd_preheat(e, m, m); } + #endif #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_HEATED_BED + inline void _preheat_bed(const uint8_t m) { thermalManager.lcd_preheat(-1, -1, m); } + #endif + + #if HAS_TEMP_HOTEND && HAS_HEATED_BED + + // Indexed "Preheat ABC" and "Heat Bed" items + #define PREHEAT_ITEMS(M,E) do{ \ + ACTION_ITEM_N_S(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_both(M, MenuItemBase::itemIndex); }); \ + ACTION_ITEM_N_S(E, ui.get_preheat_label(M), MSG_PREHEAT_M_END_E, []{ _preheat_end(M, MenuItemBase::itemIndex); }); \ + }while(0) + + #elif HAS_MULTI_HOTEND + + // No heated bed, so just indexed "Preheat ABC" items + #define PREHEAT_ITEMS(M,E) ACTION_ITEM_N_S(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_end(M, MenuItemBase::itemIndex); }) + + #endif + + void do_preheat_end_m() { _preheat_end(editable.int8, 0); } + + #if HAS_MULTI_HOTEND || HAS_HEATED_BED + + // Set editable.int8 to the Material index before entering this menu + // because MenuItemBase::itemIndex will be re-used by PREHEAT_ITEMS + void menu_preheat_m() { + const uint8_t m = editable.int8; // Don't re-use 'editable' in this menu + + START_MENU(); + BACK_ITEM(MSG_TEMPERATURE); + + #if HOTENDS == 1 + + #if HAS_HEATED_BED + ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M, []{ _preheat_both(editable.int8, 0); }); + ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M_END, do_preheat_end_m); + #else + ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m); + #endif + + #elif HAS_MULTI_HOTEND + + HOTEND_LOOP() PREHEAT_ITEMS(editable.int8, e); + ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M_ALL, []() { + TERN_(HAS_HEATED_BED, []{ _preheat_bed(editable.int8); }); + HOTEND_LOOP() thermalManager.setTargetHotend(ui.material_preset[editable.int8].hotend_temp, e); + }); + + #endif + + #if HAS_HEATED_BED + ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M_BEDONLY, []{ _preheat_bed(editable.int8); }); + #endif + + END_MENU(); + } + + #endif // HAS_MULTI_HOTEND || HAS_HEATED_BED + +#endif // PREHEAT_COUNT #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 - LOOP_S_L_N(n, 1, HOTENDS) 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 - LOOP_S_L_N(n, 1, HOTENDS) 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(); @@ -162,6 +146,13 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb #endif // HAS_TEMP_HOTEND || HAS_HEATED_BED void menu_temperature() { + #if HAS_TEMP_HOTEND || HAS_HEATED_BED + bool has_heat = false; + #if HAS_TEMP_HOTEND + HOTEND_LOOP() if (thermalManager.temp_hotend[HOTEND_INDEX].target) { has_heat = true; break; } + #endif + #endif + START_MENU(); BACK_ITEM(MSG_MAIN); @@ -170,21 +161,22 @@ void menu_temperature() { // 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 + EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - (HOTEND_OVERSHOOT), []{ thermalManager.start_watching_hotend(0); }); + #elif HAS_MULTI_HOTEND HOTEND_LOOP() - EDIT_ITEM_FAST_N(int3, e, MSG_NOZZLE_N, &thermalManager.temp_hotend[e].target, 0, heater_maxtemp[e] - 15, []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); }); + EDIT_ITEM_FAST_N(int3, e, MSG_NOZZLE_N, &thermalManager.temp_hotend[e].target, 0, thermalManager.heater_maxtemp[e] - (HOTEND_OVERSHOOT), []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); }); #endif - #if ENABLED(SINGLENOZZLE) - EDIT_ITEM_FAST(uint16_3, MSG_NOZZLE_STANDBY, &singlenozzle_temp[active_extruder ? 0 : 1], 0, HEATER_0_MAXTEMP - 15); + #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) + LOOP_S_L_N(e, 1, EXTRUDERS) + EDIT_ITEM_FAST_N(uint16_3, e, MSG_NOZZLE_STANDBY, &singlenozzle_temp[e], 0, thermalManager.heater_maxtemp[0] - (HOTEND_OVERSHOOT)); #endif // // Bed: // #if HAS_HEATED_BED - EDIT_ITEM_FAST(int3, MSG_BED, &thermalManager.temp_bed.target, 0, BED_MAXTEMP - 10, thermalManager.start_watching_bed); + EDIT_ITEM_FAST(int3, MSG_BED, &thermalManager.temp_bed.target, 0, BED_MAX_TARGET, thermalManager.start_watching_bed); #endif // @@ -197,26 +189,30 @@ void menu_temperature() { // // Fan Speed: // - #if FAN_COUNT > 0 + #if HAS_FAN auto on_fan_update = []{ thermalManager.set_fan_speed(MenuItemBase::itemIndex, editable.uint8); }; - #if HAS_FAN1 || HAS_FAN2 || HAS_FAN3 || HAS_FAN4 || HAS_FAN5 || HAS_FAN6 || HAS_FAN7 - auto fan_edit_items = [&](const uint8_t f) { - editable.uint8 = thermalManager.fan_speed[f]; - EDIT_ITEM_FAST_N(percent, f, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, on_fan_update); - #if ENABLED(EXTRA_FAN_SPEED) - EDIT_ITEM_FAST_N(percent, f, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[f], 3, 255); - #endif - }; + #if ENABLED(EXTRA_FAN_SPEED) + #define EDIT_EXTRA_FAN_SPEED(V...) EDIT_ITEM_FAST_N(V) + #else + #define EDIT_EXTRA_FAN_SPEED(...) #endif - #define SNFAN(N) (ENABLED(SINGLENOZZLE) && !HAS_FAN##N && EXTRUDERS > N) + #if FAN_COUNT > 1 + #define FAN_EDIT_ITEMS(F) do{ \ + editable.uint8 = thermalManager.fan_speed[F]; \ + EDIT_ITEM_FAST_N(percent, F, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, on_fan_update); \ + EDIT_EXTRA_FAN_SPEED(percent, F, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[F], 3, 255); \ + }while(0) + #endif + + #define SNFAN(N) (ENABLED(SINGLENOZZLE_STANDBY_FAN) && !HAS_FAN##N && EXTRUDERS > N) #if SNFAN(1) || SNFAN(2) || SNFAN(3) || SNFAN(4) || SNFAN(5) || SNFAN(6) || SNFAN(7) auto singlenozzle_item = [&](const uint8_t f) { - editable.uint8 = thermalManager.fan_speed[f]; + editable.uint8 = singlenozzle_fan_speed[f]; EDIT_ITEM_FAST_N(percent, f, MSG_STORED_FAN_N, &editable.uint8, 0, 255, on_fan_update); }; #endif @@ -229,69 +225,66 @@ void menu_temperature() { #endif #endif #if HAS_FAN1 - fan_edit_items(1); + FAN_EDIT_ITEMS(1); #elif SNFAN(1) singlenozzle_item(1); #endif #if HAS_FAN2 - fan_edit_items(2); + FAN_EDIT_ITEMS(2); #elif SNFAN(2) singlenozzle_item(1); #endif #if HAS_FAN3 - fan_edit_items(3); + FAN_EDIT_ITEMS(3); #elif SNFAN(3) singlenozzle_item(1); #endif #if HAS_FAN4 - fan_edit_items(4); + FAN_EDIT_ITEMS(4); #elif SNFAN(4) singlenozzle_item(1); #endif #if HAS_FAN5 - fan_edit_items(5); + FAN_EDIT_ITEMS(5); #elif SNFAN(5) singlenozzle_item(1); #endif #if HAS_FAN6 - fan_edit_items(6); + FAN_EDIT_ITEMS(6); #elif SNFAN(6) singlenozzle_item(1); #endif #if HAS_FAN7 - fan_edit_items(7); + FAN_EDIT_ITEMS(7); #elif SNFAN(7) singlenozzle_item(1); #endif - #endif // FAN_COUNT > 0 - - #if HAS_TEMP_HOTEND + #endif // HAS_FAN + #if PREHEAT_COUNT // - // Preheat for Material 1 and 2 + // Preheat for Materials 1 to 5 // - #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || TEMP_SENSOR_5 != 0 || TEMP_SENSOR_6 != 0 || TEMP_SENSOR_7 != 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 + LOOP_L_N(m, PREHEAT_COUNT) { + editable.int8 = m; + #if HOTENDS > 1 || HAS_HEATED_BED + SUBMENU_S(ui.get_preheat_label(m), MSG_PREHEAT_M, menu_preheat_m); + #else + ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m); + #endif + } + #endif + #if HAS_TEMP_HOTEND || HAS_HEATED_BED // // 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 (TERN0(HAS_HEATED_BED, thermalManager.temp_bed.target)) has_heat = true; if (has_heat) ACTION_ITEM(MSG_COOLDOWN, lcd_cooldown); - - #endif // HAS_TEMP_HOTEND + #endif END_MENU(); } -#endif // HAS_LCD_MENU +#endif // HAS_LCD_MENU && HAS_TEMPERATURE diff --git a/Marlin/src/lcd/menu/menu_tmc.cpp b/Marlin/src/lcd/menu/menu_tmc.cpp index 296a132e14..e74619d295 100644 --- a/Marlin/src/lcd/menu/menu_tmc.cpp +++ b/Marlin/src/lcd/menu/menu_tmc.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -157,15 +157,27 @@ void menu_tmc_current() { BACK_ITEM(MSG_TMC_DRIVERS); #if X_SENSORLESS TMC_EDIT_STORED_SGT(X); - #endif - #if X2_SENSORLESS - TMC_EDIT_STORED_SGT(X2); + #if X2_SENSORLESS + TMC_EDIT_STORED_SGT(X2); + #endif #endif #if Y_SENSORLESS TMC_EDIT_STORED_SGT(Y); + #if Y2_SENSORLESS + TMC_EDIT_STORED_SGT(Y2); + #endif #endif #if Z_SENSORLESS TMC_EDIT_STORED_SGT(Z); + #if Z2_SENSORLESS + TMC_EDIT_STORED_SGT(Z2); + #endif + #if Z3_SENSORLESS + TMC_EDIT_STORED_SGT(Z3); + #endif + #if Z4_SENSORLESS + TMC_EDIT_STORED_SGT(Z4); + #endif #endif END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index ac18e89df4..2d40318156 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -55,9 +55,10 @@ if (ui.encoderPosition) { const int16_t steps = int16_t(ui.encoderPosition) * ( #if ENABLED(BABYSTEP_XY) - axis != Z_AXIS ? BABYSTEP_MULTIPLICATOR_XY : + axis == X_AXIS ? BABYSTEP_SIZE_X : + axis == Y_AXIS ? BABYSTEP_SIZE_Y : #endif - BABYSTEP_MULTIPLICATOR_Z + BABYSTEP_SIZE_Z ); ui.encoderPosition = 0; ui.refresh(LCDVIEW_REDRAW_NOW); @@ -67,18 +68,10 @@ const float spm = planner.steps_to_mm[axis]; MenuEditItemBase::draw_edit_screen(msg, BABYSTEP_TO_STR(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 - ); + const bool in_view = TERN1(HAS_GRAPHICAL_LCD, PAGE_CONTAINS(LCD_PIXEL_HEIGHT - MENU_FONT_HEIGHT, LCD_PIXEL_HEIGHT - 1)); 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 + TERN_(HAS_GRAPHICAL_LCD, ui.set_font(FONT_MENU)); + lcd_moveto(0, TERN(HAS_GRAPHICAL_LCD, LCD_PIXEL_HEIGHT - MENU_FONT_DESCENT, LCD_HEIGHT - 1)); lcd_put_u8str_P(GET_TEXT(MSG_BABYSTEP_TOTAL)); lcd_put_wchar(':'); lcd_put_u8str(BABYSTEP_TO_STR(spm * babystep.axis_total[BS_TOTAL_IND(axis)])); @@ -126,27 +119,28 @@ void menu_tune() { // 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 + EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - HOTEND_OVERSHOOT, []{ thermalManager.start_watching_hotend(0); }); + #elif HAS_MULTI_HOTEND HOTEND_LOOP() - EDIT_ITEM_FAST_N(int3, e, MSG_NOZZLE_N, &thermalManager.temp_hotend[e].target, 0, heater_maxtemp[e] - 15, []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); }); + EDIT_ITEM_FAST_N(int3, e, MSG_NOZZLE_N, &thermalManager.temp_hotend[e].target, 0, thermalManager.heater_maxtemp[e] - HOTEND_OVERSHOOT, []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); }); #endif - #if ENABLED(SINGLENOZZLE) - EDIT_ITEM_FAST(uint16_3, MSG_NOZZLE_STANDBY, &singlenozzle_temp[active_extruder ? 0 : 1], 0, HEATER_0_MAXTEMP - 15); + #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) + LOOP_S_L_N(e, 1, EXTRUDERS) + EDIT_ITEM_FAST_N(uint16_3, e, MSG_NOZZLE_STANDBY, &singlenozzle_temp[e], 0, thermalManager.heater_maxtemp[0] - HOTEND_OVERSHOOT); #endif // // Bed: // #if HAS_HEATED_BED - EDIT_ITEM_FAST(int3, MSG_BED, &thermalManager.temp_bed.target, 0, BED_MAXTEMP - 10, thermalManager.start_watching_bed); + EDIT_ITEM_FAST(int3, MSG_BED, &thermalManager.temp_bed.target, 0, BED_MAX_TARGET, thermalManager.start_watching_bed); #endif // // Fan Speed: // - #if FAN_COUNT > 0 + #if HAS_FAN auto on_fan_update = []{ thermalManager.set_fan_speed(MenuItemBase::itemIndex, editable.uint8); @@ -162,10 +156,10 @@ void menu_tune() { }; #endif - #define SNFAN(N) (ENABLED(SINGLENOZZLE) && !HAS_FAN##N && EXTRUDERS > N) + #define SNFAN(N) (ENABLED(SINGLENOZZLE_STANDBY_FAN) && !HAS_FAN##N && EXTRUDERS > N) #if SNFAN(1) || SNFAN(2) || SNFAN(3) || SNFAN(4) || SNFAN(5) || SNFAN(6) || SNFAN(7) auto singlenozzle_item = [&](const uint8_t f) { - editable.uint8 = thermalManager.fan_speed[f]; + editable.uint8 = singlenozzle_fan_speed[f]; EDIT_ITEM_FAST_N(percent, f, MSG_STORED_FAN_N, &editable.uint8, 0, 255, on_fan_update); }; #endif @@ -213,7 +207,7 @@ void menu_tune() { singlenozzle_item(1); #endif - #endif // FAN_COUNT > 0 + #endif // HAS_FAN // // Flow: diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index 8488c11c7d..705b19869a 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -26,9 +26,12 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL) +#if BOTH(HAS_LCD_MENU, AUTO_BED_LEVELING_UBL) #include "menu.h" +#include "../../gcode/gcode.h" +#include "../../gcode/queue.h" +#include "../../module/motion.h" #include "../../module/planner.h" #include "../../module/configuration_store.h" #include "../../feature/bedlevel/bedlevel.h" @@ -39,53 +42,43 @@ static int16_t ubl_storage_slot = 0, ubl_fillin_amount = 5, ubl_height_amount = 1; -static uint8_t n_edit_pts = 1, x_plot = 0, y_plot = 0; +static uint8_t n_edit_pts = 1; +static int8_t x_plot = 0, y_plot = 0; // May be negative during move #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; +float mesh_edit_accumulator; // Rounded to 2.5 decimal places on use -static void _lcd_mesh_fine_tune(PGM_P msg) { +inline float rounded_mesh_value() { + const int32_t rounded = int32_t(mesh_edit_accumulator * 1000); + return float(rounded - (rounded % 5L)) / 1000; +} + +static void _lcd_mesh_fine_tune(PGM_P const msg) { ui.defer_status_screen(); if (ubl.encoder_diff) { - ubl_encoderPosition = (ubl.encoder_diff > 0) ? 1 : -1; + mesh_edit_accumulator += ubl.encoder_diff > 0 ? 0.005f : -0.005f; 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 + const float rounded_f = rounded_mesh_value(); + MenuEditItemBase::draw_edit_screen(msg, ftostr43sign(rounded_f)); + TERN_(MESH_EDIT_GFX_OVERLAY, _lcd_zoffset_overlay_gfx(rounded_f)); } } -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; -} +// +// Called external to the menu system to acquire the result of an edit. +// +float lcd_mesh_edit() { return rounded_mesh_value(); } void lcd_mesh_edit_setup(const float &initial) { - mesh_edit_value = mesh_edit_accumulator = initial; - ui.goto_screen(_lcd_mesh_edit_NOP); + mesh_edit_accumulator = initial; + ui.goto_screen([]{ _lcd_mesh_fine_tune(GET_TEXT(MSG_MESH_EDIT_Z)); }); } void _lcd_z_offset_edit() { @@ -94,11 +87,11 @@ void _lcd_z_offset_edit() { float lcd_z_offset_edit() { ui.goto_screen(_lcd_z_offset_edit); - return mesh_edit_value; + return rounded_mesh_value(); } void lcd_z_offset_edit_setup(const float &initial) { - mesh_edit_value = mesh_edit_accumulator = initial; + mesh_edit_accumulator = initial; ui.goto_screen(_lcd_z_offset_edit); } @@ -106,15 +99,13 @@ void lcd_z_offset_edit_setup(const float &initial) { * UBL Build Custom Mesh Command */ void _lcd_ubl_build_custom_mesh() { - char ubl_lcd_gcode[20]; - queue.inject_P(G28_STR); + char ubl_lcd_gcode[64]; #if HAS_HEATED_BED - sprintf_P(ubl_lcd_gcode, PSTR("M190 S%i"), custom_bed_temp); - lcd_enqueue_one_now(ubl_lcd_gcode); + sprintf_P(ubl_lcd_gcode, PSTR("G28\nM190 S%i\nM109 S%i\nG29 P1"), custom_bed_temp, custom_hotend_temp); + #else + sprintf_P(ubl_lcd_gcode, PSTR("G28\nM109 S%i\nG29 P1"), custom_hotend_temp); #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")); + queue.inject(ubl_lcd_gcode); } /** @@ -128,9 +119,11 @@ void _lcd_ubl_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_HOTEND + EDIT_ITEM(int3, MSG_UBL_HOTEND_TEMP_CUSTOM, &custom_hotend_temp, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - HOTEND_OVERSHOOT); + #endif #if HAS_HEATED_BED - EDIT_ITEM(int3, MSG_UBL_BED_TEMP_CUSTOM, &custom_bed_temp, BED_MINTEMP, (BED_MAXTEMP - 10)); + EDIT_ITEM(int3, MSG_UBL_BED_TEMP_CUSTOM, &custom_bed_temp, BED_MINTEMP, BED_MAX_TARGET); #endif ACTION_ITEM(MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_build_custom_mesh); END_MENU(); @@ -144,7 +137,7 @@ void _lcd_ubl_adjust_height_cmd() { 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); + queue.inject(ubl_lcd_gcode); } /** @@ -182,46 +175,63 @@ void _lcd_ubl_edit_mesh() { 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); -} +#if ENABLED(G26_MESH_VALIDATION) -/** - * 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_INFO_SCREEN, ui.return_to_status); - END_MENU(); -} + /** + * UBL Validate Custom Mesh Command + */ + void _lcd_ubl_validate_custom_mesh() { + char ubl_lcd_gcode[24]; + const int16_t temp = TERN(HAS_HEATED_BED, custom_bed_temp, 0); + sprintf_P(ubl_lcd_gcode, PSTR("G28\nG26 C P H%" PRIi16 TERN_(HAS_HEATED_BED, " B%" PRIi16)) + , custom_hotend_temp + #if HAS_HEATED_BED + , temp + #endif + ); + queue.inject(ubl_lcd_gcode); + } + + /** + * UBL Validate Mesh submenu + * + * << UBL Tools + * Mesh Validation with Material 1 up to 5 + * Validate Custom Mesh + * << Info Screen + */ + void _lcd_ubl_validate_mesh() { + START_MENU(); + BACK_ITEM(MSG_UBL_TOOLS); + #if PREHEAT_COUNT + #if HAS_HEATED_BED + #define VALIDATE_MESH_GCODE_ITEM(M) \ + GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26 C P I" STRINGIFY(M))) + #else + #define VALIDATE_MESH_GCODE_ITEM(M) \ + GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26 C P B0 I" STRINGIFY(M))) + #endif + + VALIDATE_MESH_GCODE_ITEM(0); + #if PREHEAT_COUNT > 1 + VALIDATE_MESH_GCODE_ITEM(1); + #if PREHEAT_COUNT > 2 + VALIDATE_MESH_GCODE_ITEM(2); + #if PREHEAT_COUNT > 3 + VALIDATE_MESH_GCODE_ITEM(3); + #if PREHEAT_COUNT > 4 + VALIDATE_MESH_GCODE_ITEM(4); + #endif + #endif + #endif + #endif + #endif // PREHEAT_COUNT + ACTION_ITEM(MSG_UBL_VALIDATE_CUSTOM_MESH, _lcd_ubl_validate_custom_mesh); + ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status); + END_MENU(); + } + +#endif /** * UBL Grid Leveling submenu @@ -237,7 +247,7 @@ void _lcd_ubl_grid_level() { 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); + queue.inject(ubl_lcd_gcode); }); END_MENU(); } @@ -265,7 +275,7 @@ void _lcd_ubl_mesh_leveling() { 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); + gcode.process_subcommands_now(ubl_lcd_gcode); } /** @@ -297,8 +307,7 @@ void _lcd_ubl_invalidate() { * UBL Build Mesh submenu * * << UBL Tools - * Build Mesh with Material 1 - * Build Mesh with Material 2 + * Build Mesh with Material 1 up to 5 * - Build Custom Mesh >> * Build Cold Mesh * - Fill-in Mesh >> @@ -310,37 +319,36 @@ void _lcd_ubl_invalidate() { 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 + #if PREHEAT_COUNT + #if HAS_HEATED_BED + #define PREHEAT_BED_GCODE(M) "M190 I" STRINGIFY(M) "\n" + #else + #define PREHEAT_BED_GCODE(M) "" + #endif + #define BUILD_MESH_GCODE_ITEM(M) GCODES_ITEM_S(ui.get_preheat_label(M), MSG_UBL_BUILD_MESH_M, \ + PSTR( \ + "G28\n" \ + PREHEAT_BED_GCODE(M) \ + "M109 I" STRINGIFY(M) "\n" \ + "G29 P1\n" \ + "M104 S0\n" \ + "M140 S0" \ + ) ) + BUILD_MESH_GCODE_ITEM(0); + #if PREHEAT_COUNT > 1 + BUILD_MESH_GCODE_ITEM(1); + #if PREHEAT_COUNT > 2 + BUILD_MESH_GCODE_ITEM(2); + #if PREHEAT_COUNT > 3 + BUILD_MESH_GCODE_ITEM(3); + #if PREHEAT_COUNT > 4 + BUILD_MESH_GCODE_ITEM(4); + #endif + #endif + #endif + #endif + #endif // PREHEAT_COUNT + 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); @@ -352,26 +360,16 @@ void _lcd_ubl_build_mesh() { } /** - * UBL Load Mesh Command + * UBL Load / Save Mesh Commands */ -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); +inline void _lcd_ubl_load_save_cmd(const char loadsave, PGM_P const msg) { + char ubl_lcd_gcode[40]; + sprintf_P(ubl_lcd_gcode, PSTR("G29 %c%i\nM117 "), loadsave, ubl_storage_slot); + sprintf_P(&ubl_lcd_gcode[strlen(ubl_lcd_gcode)], msg, ubl_storage_slot); + gcode.process_subcommands_now(ubl_lcd_gcode); } +void _lcd_ubl_load_mesh_cmd() { _lcd_ubl_load_save_cmd('L', GET_TEXT(MSG_MESH_LOADED)); } +void _lcd_ubl_save_mesh_cmd() { _lcd_ubl_load_save_cmd('S', GET_TEXT(MSG_MESH_SAVED)); } /** * UBL Mesh Storage submenu @@ -385,9 +383,8 @@ 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)) { + 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); @@ -396,132 +393,137 @@ void _lcd_ubl_storage_mesh() { 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() { +void _lcd_ubl_map_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); + queue.inject(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) { + if (current_position.z > delta_clip_start_height) { // Make sure the delta has fully free motion + destination = current_position; destination.z = delta_clip_start_height; - prepare_internal_move_to_destination(fr_mm_s); + prepare_internal_fast_move_to_destination(homing_feedrate(Z_AXIS)); // Set current_position from destination } #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); + // Set the nozzle position to the mesh point + current_position.set(ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot)); + + // Use the built-in manual move handler + ui.manual_move.soon(ALL_AXES); +} + +inline int32_t grid_index(const uint8_t x, const uint8_t y) { + return (GRID_MAX_POINTS_X) * y + x; } /** * UBL LCD "radar" map */ -void set_current_from_steppers_for_axis(const AxisEnum axis); -void sync_plan_position(); +void ubl_map_screen() { + // static millis_t next_move = 0; + // const millis_t ms = millis(); -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(); -} + uint8_t x, y; -void _lcd_ubl_output_map_lcd() { - static int16_t step_scaler = 0; + if (ui.first_page) { - if (ui.use_click()) return _lcd_ubl_map_lcd_edit_cmd(); + // On click send "G29 P4 ..." to edit the Z value + if (ui.use_click()) { + _lcd_ubl_map_edit_cmd(); + return; + } - 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; + ui.defer_status_screen(); #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; + // Index of the mesh point upon entry + const uint32_t old_pos_index = grid_index(x_plot, y_plot); + // Direction from new (unconstrained) encoder value + const int8_t step_dir = int32_t(ui.encoderPosition) < old_pos_index ? -1 : 1; #endif - } while(KEEP_LOOPING); + do { + // Now, keep the encoder position within range + if (int32_t(ui.encoderPosition) < 0) ui.encoderPosition = GRID_MAX_POINTS - 1; + if (int32_t(ui.encoderPosition) > GRID_MAX_POINTS - 1) ui.encoderPosition = 0; - // 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 + // Draw the grid point based on the encoder + x = ui.encoderPosition % (GRID_MAX_POINTS_X); + y = ui.encoderPosition / (GRID_MAX_POINTS_X); - // Cleanup - if (ABS(step_scaler) >= ENCODER_STEPS_PER_MENU_ITEM) step_scaler = 0; + // Validate if needed + #if IS_KINEMATIC + const xy_pos_t xy = { ubl.mesh_index_to_xpos(x), ubl.mesh_index_to_ypos(y) }; + if (position_is_reachable(xy)) break; // Found a valid point + ui.encoderPosition += step_dir; // Test the next point + #endif + } while(ENABLED(IS_KINEMATIC)); - if (ui.should_draw()) { - ui.ubl_plot(x_plot, y_plot); + // Determine number of points to edit + #if IS_KINEMATIC + n_edit_pts = 9; // TODO: Delta accessible edit points + #else + const bool xc = WITHIN(x, 1, GRID_MAX_POINTS_X - 2), + yc = WITHIN(y, 1, GRID_MAX_POINTS_Y - 2); + n_edit_pts = yc ? (xc ? 9 : 6) : (xc ? 6 : 4); // Corners + #endif - if (planner.movesplanned()) // If the nozzle is already moving, cancel the move. - _lcd_hard_stop(); + // Refresh is also set by encoder movement + //if (int32_t(ui.encoderPosition) != grid_index(x, y)) + // ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); + } - ubl_map_move_to_xy(); // Move to new location + // Draw the grid point based on the encoder + x = ui.encoderPosition % (GRID_MAX_POINTS_X); + y = ui.encoderPosition / (GRID_MAX_POINTS_X); + + if (ui.should_draw()) ui.ubl_plot(x, y); + + // Add a move if needed to match the grid point + if (x != x_plot || y != y_plot) { + x_plot = x; y_plot = y; // The move is always posted, so update the grid point now + ubl_map_move_to_xy(); // Sets up a "manual move" + ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); // Clean up a half drawn box + } +} + +/** + * UBL LCD "radar" map homing + */ +void _ubl_map_screen_homing() { + ui.defer_status_screen(); + _lcd_draw_homing(); + if (all_axes_homed()) { + ubl.lcd_map_control = true; // Return to the map screen after editing Z + ui.goto_screen(ubl_map_screen, grid_index(x_plot, y_plot)); // Pre-set the encoder value + ui.manual_move.menu_scale = 0; // Immediate move + ubl_map_move_to_xy(); // Move to current mesh point + ui.manual_move.menu_scale = 1; // Delayed moves } } /** * UBL Homing before LCD map */ -void _lcd_ubl_output_map_lcd_cmd() { +void _ubl_goto_map_screen() { + if (planner.movesplanned()) return; // The ACTION_ITEM will do nothing if (!all_axes_known()) { set_all_unhomed(); queue.inject_P(G28_STR); } - ui.goto_screen(_lcd_ubl_map_homing); + ui.goto_screen(_ubl_map_screen_homing); // Go to the "Homing" screen } /** @@ -555,36 +557,42 @@ void _menu_ubl_tools() { 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); + #if ENABLED(G26_MESH_VALIDATION) + SUBMENU(MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); + #endif 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(); -} +#if ENABLED(G26_MESH_VALIDATION) + + /** + * 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(); + } + +#endif /** * UBL System submenu @@ -599,7 +607,6 @@ void _lcd_ubl_step_by_step() { * - UBL Tools >> * - Output UBL Info >> */ - void _lcd_ubl_level_bed() { START_MENU(); BACK_ITEM(MSG_MOTION); @@ -607,8 +614,10 @@ void _lcd_ubl_level_bed() { 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); + #if ENABLED(G26_MESH_VALIDATION) + SUBMENU(MSG_UBL_STEP_BY_STEP_MENU, _lcd_ubl_step_by_step); + #endif + ACTION_ITEM(MSG_UBL_MESH_EDIT, _ubl_goto_map_screen); 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); diff --git a/Marlin/src/lcd/thermistornames.h b/Marlin/src/lcd/thermistornames.h index 7a464c30ab..bd0ca0e554 100644 --- a/Marlin/src/lcd/thermistornames.h +++ b/Marlin/src/lcd/thermistornames.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -50,8 +50,14 @@ // Standard thermistors #elif THERMISTOR_ID == 1 #define THERMISTOR_NAME "EPCOS 100K" +#elif THERMISTOR_ID == 331 + #define THERMISTOR_NAME "3.3V EPCOS 100K (MEGA)" +#elif THERMISTOR_ID == 332 + #define THERMISTOR_NAME "3.3V EPCOS 100K (DUE)" #elif THERMISTOR_ID == 2 #define THERMISTOR_NAME "ATC 204GT-2" +#elif THERMISTOR_ID == 202 + #define THERMISTOR_NAME "200k Copymaster 3D" #elif THERMISTOR_ID == 3 #define THERMISTOR_NAME "Mendel-parts" #elif THERMISTOR_ID == 4 @@ -60,6 +66,8 @@ #define THERMISTOR_NAME "ATC 104GT-2" #elif THERMISTOR_ID == 501 #define THERMISTOR_NAME "Zonestar (Tronxy X3A)" +#elif THERMISTOR_ID == 502 + #define THERMISTOR_NAME "Zonestar (P802M Hot Bed)" #elif THERMISTOR_ID == 512 #define THERMISTOR_NAME "RPW-Ultra" #elif THERMISTOR_ID == 6 @@ -96,6 +104,8 @@ #define THERMISTOR_NAME "Hephestos 2" #elif THERMISTOR_ID == 75 #define THERMISTOR_NAME "MGB18" +#elif THERMISTOR_ID == 99 + #define THERMISTOR_NAME "100k with 10k pull-up" // Modified thermistors #elif THERMISTOR_ID == 51 diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index bbcb678dd8..88a9c36b36 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -16,11 +16,11 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ -#include "../inc/MarlinConfigPre.h" +#include "../inc/MarlinConfig.h" #ifdef LED_BACKLIGHT_TIMEOUT #include "../feature/leds/leds.h" @@ -40,7 +40,7 @@ MarlinUI ui; #include "../gcode/queue.h" #include "fontutils.h" #include "../sd/cardreader.h" - #if ENABLED(EXTENSIBLE_UI) + #if EITHER(EXTENSIBLE_UI, DWIN_CREALITY_LCD) #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u) #endif #endif @@ -49,6 +49,8 @@ MarlinUI ui; bool MarlinUI::wait_for_move; // = false #endif +constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; + #if HAS_SPI_LCD #if ENABLED(STATUS_MESSAGE_SCROLLING) uint8_t MarlinUI::status_scroll_offset; // = 0 @@ -56,11 +58,11 @@ MarlinUI ui; #else constexpr uint8_t MAX_MESSAGE_LENGTH = MAX_LANG_CHARSIZE * (LCD_WIDTH); #endif -#elif ENABLED(EXTENSIBLE_UI) +#elif EITHER(EXTENSIBLE_UI, DWIN_CREALITY_LCD) constexpr uint8_t MAX_MESSAGE_LENGTH = 63; #endif -#if HAS_SPI_LCD || ENABLED(EXTENSIBLE_UI) +#if EITHER(HAS_SPI_LCD, EXTENSIBLE_UI) uint8_t MarlinUI::alert_level; // = 0 char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1]; #endif @@ -86,6 +88,32 @@ MarlinUI ui; } #endif +#if PREHEAT_COUNT + preheat_t MarlinUI::material_preset[PREHEAT_COUNT]; // Initialized by settings.load() + PGM_P MarlinUI::get_preheat_label(const uint8_t m) { + #ifdef PREHEAT_1_LABEL + static PGMSTR(preheat_0_label, PREHEAT_1_LABEL); + #endif + #ifdef PREHEAT_2_LABEL + static PGMSTR(preheat_1_label, PREHEAT_2_LABEL); + #endif + #ifdef PREHEAT_3_LABEL + static PGMSTR(preheat_2_label, PREHEAT_3_LABEL); + #endif + #ifdef PREHEAT_4_LABEL + static PGMSTR(preheat_3_label, PREHEAT_4_LABEL); + #endif + #ifdef PREHEAT_5_LABEL + static PGMSTR(preheat_4_label, PREHEAT_5_LABEL); + #endif + + #define _PLBL(N) preheat_##N##_label, + static PGM_P const preheat_labels[PREHEAT_COUNT] PROGMEM = { REPEAT(PREHEAT_COUNT, _PLBL) }; + + return (PGM_P)pgm_read_ptr(&preheat_labels[m]); + } +#endif + #if HAS_SPI_LCD #if HAS_GRAPHICAL_LCD @@ -95,6 +123,7 @@ MarlinUI ui; #include "lcdprint.h" #include "../sd/cardreader.h" +#include "../module/configuration_store.h" #include "../module/temperature.h" #include "../module/planner.h" #include "../module/motion.h" @@ -111,6 +140,10 @@ MarlinUI ui; #include "../module/thermistor/thermistors.h" #endif +#if HAS_POWER_MONITOR + #include "../feature/power_monitor.h" +#endif + #if HAS_ENCODER_ACTION volatile uint8_t MarlinUI::buttons; #if HAS_SLOW_BUTTONS @@ -118,14 +151,11 @@ MarlinUI ui; #endif #if ENABLED(TOUCH_BUTTONS) #include "../feature/touch/xpt2046.h" + bool MarlinUI::on_edit_screen = false; #endif #endif -#if ENABLED(INIT_SDCARD_ON_BOOT) - uint8_t lcd_sd_status; -#endif - -#if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS +#if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS > 0 bool MarlinUI::defer_return_to_status; #endif @@ -147,41 +177,42 @@ millis_t MarlinUI::next_button_update_ms; // = 0 volatile int8_t encoderDiff; // Updated in update_buttons, added to encoderPosition every LCD update #endif -#if HAS_LCD_MENU - #include "menu/menu.h" +#if ENABLED(SDSUPPORT) + #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; - } - + #if MARLINUI_SCROLL_NAME + 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 MARLINUI_SCROLL_NAME + 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 + +#if HAS_LCD_MENU + #include "menu/menu.h" + screenFunc_t MarlinUI::currentScreen; // Initialized in CTOR bool MarlinUI::screen_changed; @@ -204,7 +235,6 @@ millis_t MarlinUI::next_button_update_ms; // = 0 #endif bool MarlinUI::lcd_clicked; - float move_menu_scale; bool MarlinUI::use_click() { const bool click = lcd_clicked; @@ -342,26 +372,17 @@ void MarlinUI::init() { #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 + #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) + SET_INPUT_PULLUP(SD_DETECT_PIN); #endif - #if HAS_ENCODER_ACTION - #if HAS_SLOW_BUTTONS - slow_buttons = 0; - #endif + #if HAS_ENCODER_ACTION && HAS_SLOW_BUTTONS + slow_buttons = 0; #endif update_buttons(); - #if HAS_ENCODER_ACTION - encoderDiff = 0; - #endif + TERN_(HAS_ENCODER_ACTION, encoderDiff = 0); } bool MarlinUI::get_blink() { @@ -379,7 +400,7 @@ bool MarlinUI::get_blink() { ///////////// Keypad Handling ////////////// //////////////////////////////////////////// -#if ENABLED(REPRAPWORLD_KEYPAD) && HAS_ENCODER_ACTION +#if BOTH(REPRAPWORLD_KEYPAD, HAS_ENCODER_ACTION) volatile uint8_t MarlinUI::keypad_buttons; @@ -390,7 +411,7 @@ bool MarlinUI::get_blink() { void lcd_move_z(); void _reprapworld_keypad_move(const AxisEnum axis, const int16_t dir) { - move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; + ui.manual_move.menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; ui.encoderPosition = dir; switch (axis) { case X_AXIS: lcd_move_x(); break; @@ -421,13 +442,13 @@ bool MarlinUI::get_blink() { #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; + if (RRK(EN_KEYPAD_UP)) encoderPosition -= epps; + else if (RRK(EN_KEYPAD_DOWN)) encoderPosition += epps; 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; + if (RRK(EN_KEYPAD_UP) || RRK(EN_KEYPAD_LEFT)) encoderPosition -= epps; + else if (RRK(EN_KEYPAD_DOWN) || RRK(EN_KEYPAD_RIGHT)) encoderPosition += epps; #endif } #endif @@ -498,9 +519,7 @@ bool MarlinUI::get_blink() { void MarlinUI::status_screen() { - #if HAS_LCD_MENU - ENCODER_RATE_MULTIPLY(false); - #endif + TERN_(HAS_LCD_MENU, ENCODER_RATE_MULTIPLY(false)); #if ENABLED(LCD_PROGRESS_BAR) @@ -545,7 +564,6 @@ void MarlinUI::status_screen() { #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 @@ -581,7 +599,7 @@ void MarlinUI::status_screen() { if (old_frm != new_frm) { feedrate_percentage = new_frm; encoderPosition = 0; - #if HAS_BUZZER && ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #if BOTH(HAS_BUZZER, BEEP_ON_FEEDRATE_CHANGE) static millis_t next_beep; #ifndef GOT_MS const millis_t ms = millis(); @@ -601,9 +619,7 @@ void MarlinUI::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 + TERN_(HAS_LCD_MENU, return_to_status()); // RED ALERT. RED ALERT. #ifdef LED_BACKLIGHT_TIMEOUT @@ -619,9 +635,7 @@ void MarlinUI::kill_screen(PGM_P lcd_error, PGM_P lcd_component) { void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { - #if HAS_LCD_MENU - refresh(); - #endif + TERN_(HAS_LCD_MENU, refresh()); #if HAS_ENCODER_ACTION if (clear_buttons) buttons = 0; @@ -630,15 +644,12 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { 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 + #if HAS_CHIRP + chirp(); // Buzz and wait. Is the delay needed for buttons to settle? + #if BOTH(HAS_LCD_MENU, USE_BEEPER) + for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } + #elif HAS_LCD_MENU + delay(10); #endif #endif } @@ -649,53 +660,65 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { #if HAS_LCD_MENU - extern bool no_reentry; // Flag to prevent recursion into menu handlers + ManualMove MarlinUI::manual_move{}; - 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 + millis_t ManualMove::start_time = 0; + float ManualMove::menu_scale = 1; + TERN_(IS_KINEMATIC, float ManualMove::offset = 0); + TERN_(IS_KINEMATIC, bool ManualMove::processing = false); + TERN_(MULTI_MANUAL, int8_t ManualMove::e_index = 0); + uint8_t ManualMove::axis = (uint8_t)NO_AXIS; /** - * If the most recent manual move hasn't been fed to the planner yet, - * and the planner can accept one, send a move immediately. + * If a manual move has been posted and its time has arrived, and if the planner + * has a space for it, then add a linear move to current_position the planner. + * + * If any manual move needs to be interrupted, make sure to force a manual move + * by setting manual_move.start_time to millis() after updating current_position. + * + * To post a manual move: + * - Update current_position to the new place you want to go. + * - Set manual_move.axis to an axis like X_AXIS. Use ALL_AXES for diagonal moves. + * - Set manual_move.start_time to a point in the future (in ms) when the move should be done. + * + * For kinematic machines: + * - Set manual_move.offset to modify one axis and post the move. + * This is used to achieve more rapid stepping on kinematic machines. + * + * Currently used by the _lcd_move_xyz function in menu_motion.cpp + * and the ubl_map_move_to_xy funtion in menu_ubl.cpp. */ - void MarlinUI::manage_manual_move() { + void ManualMove::task() { - if (processing_manual_move) return; + if (processing) return; // Prevent re-entry from idle() calls - if (manual_move_axis != (int8_t)NO_AXIS && ELAPSED(millis(), manual_move_start_time) && !planner.is_full()) { + // Add a manual move to the queue? + if (axis != (uint8_t)NO_AXIS && ELAPSED(millis(), start_time) && !planner.is_full()) { + + const feedRate_t fr_mm_s = (uint8_t(axis) <= E_AXIS) ? manual_feedrate_mm_s[axis] : XY_PROBE_FEEDRATE_MM_S; - const feedRate_t fr_mm_s = manual_feedrate_mm_s[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; + if (axis == E_AXIS) active_extruder = e_index; #endif - // Set movement on a single axis + // Apply a linear offset to a single axis destination = current_position; - destination[manual_move_axis] += manual_move_offset; + if (axis <= XYZE) destination[axis] += offset; // Reset for the next move - manual_move_offset = 0; - manual_move_axis = (int8_t)NO_AXIS; + offset = 0; + axis = (uint8_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; + // previous invocation is being blocked. Modifications to offset shouldn't be made while + // processing is true or the planner will get out of sync. + processing = true; prepare_internal_move_to_destination(fr_mm_s); // will set current_position from destination - processing_manual_move = false; + processing = false; #if EXTRUDERS > 1 active_extruder = old_extruder; @@ -703,13 +726,45 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { #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; + // For Cartesian / Core motion simply move to the current_position + planner.buffer_line(current_position, fr_mm_s, axis == E_AXIS ? e_index : active_extruder); + + //SERIAL_ECHOLNPAIR("Add planner.move with Axis ", int(axis), " at FR ", fr_mm_s); + + axis = (uint8_t)NO_AXIS; #endif } } + // + // Tell ui.update() to start a move to current_position after a short delay. + // + void ManualMove::soon(AxisEnum move_axis + #if MULTI_MANUAL + , const int8_t eindex/*=-1*/ + #endif + ) { + #if MULTI_MANUAL + if (move_axis == E_AXIS) e_index = eindex >= 0 ? eindex : active_extruder; + #endif + start_time = millis() + (menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves + axis = (uint8_t)move_axis; + //SERIAL_ECHOLNPAIR("Post Move with Axis ", int(axis), " soon."); + } + + #if ENABLED(AUTO_BED_LEVELING_UBL) + + void MarlinUI::external_encoder() { + if (external_control && encoderDiff) { + ubl.encoder_diff += encoderDiff; // Encoder for UBL G29 mesh editing + encoderDiff = 0; // Hide encoder events from the screen handler + refresh(LCDVIEW_REDRAW_NOW); // ...but keep the refresh. + } + } + + #endif + #endif // HAS_LCD_MENU /** @@ -746,14 +801,14 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { */ LCDViewAction MarlinUI::lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; +millis_t next_lcd_update_ms; 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 + #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS > 0 static millis_t return_to_status_ms = 0; #define RESET_STATUS_TIMEOUT() (return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS) #else @@ -767,7 +822,7 @@ void MarlinUI::update() { #if HAS_LCD_MENU // Handle any queued Move Axis motion - manage_manual_move(); + manual_move.task(); // Update button states for button_pressed(), etc. // If the state changes the next update may be delayed 300-500ms. @@ -778,7 +833,7 @@ void MarlinUI::update() { auto do_click = [&]{ 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 + lcd_clicked = !wait_for_user; // - 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 }; @@ -788,18 +843,14 @@ void MarlinUI::update() { RESET_STATUS_TIMEOUT(); if (touch_buttons & (EN_A | EN_B)) { // Menu arrows, in priority if (ELAPSED(ms, next_button_update_ms)) { - encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * (ENCODER_PULSES_PER_STEP) * encoderDirection; + encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * epps * encoderDirection; if (touch_buttons & EN_A) encoderDiff *= -1; - #if ENABLED(AUTO_BED_LEVELING_UBL) - if (external_control) ubl.encoder_diff = encoderDiff; - #endif + TERN_(AUTO_BED_LEVELING_UBL, external_encoder()); next_button_update_ms = ms + repeat_delay; // Assume the repeat delay if (!wait_for_unclick) { next_button_update_ms += 250; // Longer delay on first press wait_for_unclick = true; // Avoid Back/Select click while repeating - #if HAS_BUZZER - buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - #endif + chirp(); } } } @@ -826,58 +877,7 @@ void MarlinUI::update() { #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 - ) { + if (ELAPSED(ms, next_lcd_update_ms) || TERN0(HAS_GRAPHICAL_LCD, drawing_screen)) { next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL; @@ -885,37 +885,48 @@ void MarlinUI::update() { if (on_status_screen()) next_lcd_update_ms += (LCD_UPDATE_INTERVAL) * 2; - #if HAS_ENCODER_ACTION - touch_buttons = touch.read_buttons(); - #endif + TERN_(HAS_ENCODER_ACTION, touch_buttons = touch.read_buttons()); #endif - #if ENABLED(LCD_HAS_STATUS_INDICATORS) - update_indicators(); - #endif + TERN_(LCD_HAS_STATUS_INDICATORS, update_indicators()); #if HAS_ENCODER_ACTION - #if HAS_SLOW_BUTTONS - slow_buttons = read_slow_buttons(); // Buttons that take too long to read in interrupt context + TERN_(HAS_SLOW_BUTTONS, slow_buttons = read_slow_buttons()); // Buttons that take too long to read in interrupt context + + if (TERN0(REPRAPWORLD_KEYPAD, handle_keypad())) + RESET_STATUS_TIMEOUT(); + + uint8_t abs_diff = ABS(encoderDiff); + + #if ENCODER_PULSES_PER_STEP > 1 + // When reversing the encoder direction, a movement step can be missed because + // encoderDiff has a non-zero residual value, making the controller unresponsive. + // The fix clears the residual value when the encoder is idle. + // Also check if past half the threshold to compensate for missed single steps. + static int8_t lastEncoderDiff; + + // Timeout? No decoder change since last check. 10 or 20 times per second. + if (encoderDiff == lastEncoderDiff && abs_diff <= epps / 2) // Same direction & size but not over a half-step? + encoderDiff = 0; // Clear residual pulses. + else if (WITHIN(abs_diff, epps / 2 + 1, epps - 1)) { // Past half of threshold? + abs_diff = epps; // Treat as a full step size + encoderDiff = (encoderDiff < 0 ? -1 : 1) * abs_diff; // ...in the spin direction. + } + lastEncoderDiff = encoderDiff; #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)); + const bool encoderPastThreshold = (abs_diff >= epps); if (encoderPastThreshold || lcd_clicked) { if (encoderPastThreshold) { - #if HAS_LCD_MENU && ENABLED(ENCODER_RATE_MULTIPLIER) + #if BOTH(HAS_LCD_MENU, ENCODER_RATE_MULTIPLIER) int32_t encoderMultiplier = 1; if (encoderRateMultiplierEnabled) { - const float encoderMovementSteps = abs_diff / (ENCODER_PULSES_PER_STEP); + const float encoderMovementSteps = float(abs_diff) / epps; if (lastEncoderMovementMillis) { // Note that the rate is always calculated between two passes through the @@ -944,7 +955,7 @@ void MarlinUI::update() { #endif // ENCODER_RATE_MULTIPLIER - encoderPosition += (encoderDiff * encoderMultiplier) / (ENCODER_PULSES_PER_STEP); + encoderPosition += (encoderDiff * encoderMultiplier) / epps; encoderDiff = 0; } @@ -962,16 +973,12 @@ void MarlinUI::update() { // 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--; + lcd_status_update_delay = TERN(HAS_GRAPHICAL_LCD, 12, 9); + if (max_display_update_time) max_display_update_time--; // Be sure never go to a very big number refresh(LCDVIEW_REDRAW_NOW); } - #if HAS_LCD_MENU && ENABLED(SCROLL_LONG_FILENAMES) + #if BOTH(HAS_LCD_MENU, 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--) { @@ -985,8 +992,8 @@ void MarlinUI::update() { } #endif - // then we want to use 1/2 of the time only. - uint16_t bbr2 = planner.block_buffer_runtime() >> 1; + // Then we want to use only 50% of the time + const uint16_t bbr2 = planner.block_buffer_runtime() >> 1; if ((should_draw() || drawing_screen) && (!bbr2 || bbr2 > max_display_update_time)) { @@ -1003,9 +1010,7 @@ void MarlinUI::update() { break; } // switch - #if HAS_ADC_BUTTONS - keypad_buttons = 0; - #endif + TERN_(HAS_ADC_BUTTONS, keypad_buttons = 0); #if HAS_GRAPHICAL_LCD @@ -1044,9 +1049,7 @@ void MarlinUI::update() { #endif - #if HAS_LCD_MENU - lcd_clicked = false; - #endif + TERN_(HAS_LCD_MENU, lcd_clicked = false); // Keeping track of the longest time for an individual LCD update. // Used to do screen throttling when the planner starts to fill up. @@ -1054,7 +1057,7 @@ void MarlinUI::update() { NOLESS(max_display_update_time, millis() - ms); } - #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS + #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS > 0 // Return to Status Screen after a timeout if (on_status_screen() || defer_return_to_status) RESET_STATUS_TIMEOUT(); @@ -1185,7 +1188,7 @@ void MarlinUI::update() { // #if ANY_BUTTON(UP, DWN, LFT, RT) - const int8_t pulses = (ENCODER_PULSES_PER_STEP) * encoderDirection; + const int8_t pulses = epps * encoderDirection; if (false) { // for the else-ifs below @@ -1221,12 +1224,8 @@ void MarlinUI::update() { #if HAS_SLOW_BUTTONS | slow_buttons #endif - #if ENABLED(TOUCH_BUTTONS) && HAS_ENCODER_ACTION - | (touch_buttons - #if HAS_ENCODER_WHEEL - & (~(EN_A | EN_B)) - #endif - ) + #if BOTH(TOUCH_BUTTONS, HAS_ENCODER_ACTION) + | (touch_buttons & TERN(HAS_ENCODER_WHEEL, ~(EN_A | EN_B), 0xFF)) #endif ); @@ -1258,11 +1257,7 @@ void MarlinUI::update() { WRITE(SHIFT_CLK, HIGH); WRITE(SHIFT_CLK, LOW); } - #if ENABLED(REPRAPWORLD_KEYPAD) - keypad_buttons = ~val; - #else - buttons = ~val; - #endif + TERN(REPRAPWORLD_KEYPAD, keypad_buttons, buttons) = ~val; #endif } // next_button_update_ms @@ -1288,12 +1283,9 @@ void MarlinUI::update() { 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. - } + #if BOTH(HAS_LCD_MENU, AUTO_BED_LEVELING_UBL) + external_encoder(); + #endif lastEncoderBits = enc; } @@ -1331,7 +1323,7 @@ void MarlinUI::update() { void MarlinUI::finish_status(const bool persist) { - #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0)) + #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE) > 0) UNUSED(persist); #endif @@ -1350,13 +1342,11 @@ void MarlinUI::update() { next_filament_display = ms + 5000UL; // Show status message for 5s #endif - #if HAS_SPI_LCD && ENABLED(STATUS_MESSAGE_SCROLLING) + #if BOTH(HAS_SPI_LCD, STATUS_MESSAGE_SCROLLING) status_scroll_offset = 0; #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onStatusChanged(status_message); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(status_message)); } bool MarlinUI::has_status() { return (status_message[0] != '\0'); } @@ -1364,9 +1354,7 @@ void MarlinUI::update() { 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 + TERN_(HOST_PROMPT_SUPPORT, host_action_notify(message)); // Here we have a problem. The message is encoded in UTF8, so // arbitrarily cutting it will be a problem. We MUST be sure @@ -1407,9 +1395,7 @@ void MarlinUI::update() { if (level < alert_level) return; alert_level = level; - #if ENABLED(HOST_PROMPT_SUPPORT) - host_action_notify(message); - #endif + TERN_(HOST_PROMPT_SUPPORT, host_action_notify_P(message)); // Since the message is encoded in UTF8 it must // only be cut on a character boundary. @@ -1434,9 +1420,7 @@ void MarlinUI::update() { void MarlinUI::set_alert_status_P(PGM_P const message) { set_status_P(message, 1); - #if HAS_LCD_MENU - return_to_status(); - #endif + TERN_(HAS_LCD_MENU, return_to_status()); } PGM_P print_paused = GET_TEXT(MSG_PRINT_PAUSED); @@ -1448,13 +1432,13 @@ void MarlinUI::update() { 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 "!" }; + static PGMSTR(service1, "> " SERVICE_NAME_1 "!"); #endif #if SERVICE_INTERVAL_2 > 0 - static const char service2[] PROGMEM = { "> " SERVICE_NAME_2 "!" }; + static PGMSTR(service2, "> " SERVICE_NAME_2 "!"); #endif #if SERVICE_INTERVAL_3 > 0 - static const char service3[] PROGMEM = { "> " SERVICE_NAME_3 "!" }; + static PGMSTR(service3, "> " SERVICE_NAME_3 "!"); #endif PGM_P msg; if (printingIsPaused()) @@ -1496,14 +1480,10 @@ void MarlinUI::update() { #ifdef ACTION_ON_CANCEL host_action_cancel(); #endif - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_INFO, PSTR("UI Aborted"), DISMISS_STR); - #endif + TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, PSTR("UI Aborted"), DISMISS_STR)); print_job_timer.stop(); set_status_P(GET_TEXT(MSG_PRINT_ABORTED)); - #if HAS_LCD_MENU - return_to_status(); - #endif + TERN_(HAS_LCD_MENU, return_to_status()); } #if ANY(PARK_HEAD_ON_PAUSE, SDSUPPORT) @@ -1512,19 +1492,16 @@ void MarlinUI::update() { void MarlinUI::pause_print() { #if HAS_LCD_MENU - synchronize(GET_TEXT(MSG_PAUSE_PRINT)); + synchronize(GET_TEXT(MSG_PAUSING)); + defer_status_screen(); #endif - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_PAUSE_RESUME, PSTR("UI Pause"), PSTR("Resume")); - #endif + TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_PAUSE_RESUME, PSTR("UI Pause"), PSTR("Resume"))); 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 + TERN_(HAS_SPI_LCD, lcd_pause_show_message(PAUSE_MESSAGE_PARKING, PAUSE_MODE_PAUSE_PRINT)); // Show message immediately to let user know about pause in progress queue.inject_P(PSTR("M25 P\nM24")); #elif ENABLED(SDSUPPORT) queue.inject_P(PSTR("M25")); @@ -1535,9 +1512,7 @@ void MarlinUI::update() { void MarlinUI::resume_print() { reset_status(); - #if ENABLED(PARK_HEAD_ON_PAUSE) - wait_for_heatup = wait_for_user = false; - #endif + TERN_(PARK_HEAD_ON_PAUSE, wait_for_heatup = wait_for_user = false); if (IS_SD_PAUSED()) queue.inject_P(M24_STR); #ifdef ACTION_ON_RESUME host_action_resume(); @@ -1548,52 +1523,157 @@ void MarlinUI::update() { #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 + return ( + TERN0(LCD_SET_PROGRESS_MANUALLY, (progress_override & PROGRESS_MASK)) #if ENABLED(SDSUPPORT) - #if HAS_PRINT_PROGRESS_PERMYRIAD - ?: card.permyriadDone() - #else - ?: card.percentDone() - #endif + ?: TERN(HAS_PRINT_PROGRESS_PERMYRIAD, card.permyriadDone(), card.percentDone()) #endif ); } #endif + #if ENABLED(TOUCH_BUTTONS) + + // + // Screen Click + // - On menu screens move directly to the touched item + // - On menu screens, right side (last 3 cols) acts like a scroll - half up => prev page, half down = next page + // - On select screens (and others) touch the Right Half for +, Left Half for - + // - On edit screens, touch Up Half for -, Bottom Half to + + // + void MarlinUI::screen_click(const uint8_t row, const uint8_t col, const uint8_t, const uint8_t) { + const int8_t xdir = col < (LCD_WIDTH ) / 2 ? -1 : 1, + ydir = row < (LCD_HEIGHT) / 2 ? -1 : 1; + if (on_edit_screen) + encoderDiff = epps * ydir; + else if (screen_items > 0) { + // Last 3 cols act as a scroll :-) + if (col > (LCD_WIDTH) - 5) + // 2 * LCD_HEIGHT to scroll to bottom of next page. (LCD_HEIGHT would only go 1 item down.) + encoderDiff = epps * (encoderLine - encoderTopLine + 2 * (LCD_HEIGHT)) * ydir; + else + encoderDiff = epps * (row - encoderPosition + encoderTopLine); + } + else if (!on_status_screen()) + encoderDiff = epps * xdir; + } + + #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 + TERN(HOST_PROMPT_SUPPORT, host_action_notify(message), UNUSED(message)); } - void MarlinUI::set_status_P(PGM_P message, const int8_t) { - #if ENABLED(HOST_PROMPT_SUPPORT) - host_action_notify(message); - #else - UNUSED(message); - #endif + TERN(HOST_PROMPT_SUPPORT, host_action_notify_P(message), UNUSED(message)); } - 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 + TERN(HOST_PROMPT_SUPPORT, host_action_notify_P(message), UNUSED(message)); } #endif // !HAS_DISPLAY + +#if ENABLED(SDSUPPORT) + + void MarlinUI::media_changed(const uint8_t old_status, const uint8_t status) { + if (old_status == status) { + TERN_(EXTENSIBLE_UI, ExtUI::onMediaError()); // Failed to mount/unmount + return; + } + + if (status) { + if (old_status < 2) { + TERN_(EXTENSIBLE_UI, ExtUI::onMediaInserted()); // ExtUI response + set_status_P(GET_TEXT(MSG_MEDIA_INSERTED)); + } + } + else { + if (old_status < 2) { + TERN_(EXTENSIBLE_UI, ExtUI::onMediaRemoved()); // ExtUI response + #if PIN_EXISTS(SD_DETECT) + set_status_P(GET_TEXT(MSG_MEDIA_REMOVED)); + #if HAS_LCD_MENU + if (!defer_return_to_status) return_to_status(); + #endif + #endif + } + } + + #if PIN_EXISTS(SD_DETECT) && DISABLED(NO_LCD_REINIT) + init_lcd(); // Revive a noisy shared SPI LCD + #endif + + refresh(); + + #if HAS_SPI_LCD || defined(LED_BACKLIGHT_TIMEOUT) + const millis_t ms = millis(); + #endif + + TERN_(HAS_SPI_LCD, next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL); // Delay LCD update for SD activity + + #ifdef LED_BACKLIGHT_TIMEOUT + leds.reset_timeout(ms); + #endif + } + +#endif // SDSUPPORT + +#if HAS_LCD_MENU + void MarlinUI::reset_settings() { settings.reset(); completion_feedback(); } +#endif + +#if ENABLED(EEPROM_SETTINGS) + + #if HAS_LCD_MENU + void MarlinUI::init_eeprom() { + const bool good = settings.init_eeprom(); + completion_feedback(good); + return_to_status(); + } + void MarlinUI::load_settings() { + const bool good = settings.load(); + completion_feedback(good); + } + void MarlinUI::store_settings() { + const bool good = settings.save(); + completion_feedback(good); + } + #endif + + #if DISABLED(EEPROM_AUTO_INIT) + + static inline PGM_P eeprom_err(const uint8_t msgid) { + switch (msgid) { + default: + case 0: return GET_TEXT(MSG_ERR_EEPROM_CRC); + case 1: return GET_TEXT(MSG_ERR_EEPROM_INDEX); + case 2: return GET_TEXT(MSG_ERR_EEPROM_VERSION); + } + } + + void MarlinUI::eeprom_alert(const uint8_t msgid) { + #if HAS_LCD_MENU + editable.uint8 = msgid; + goto_screen([]{ + PGM_P const restore_msg = GET_TEXT(MSG_INIT_EEPROM); + char msg[utf8_strlen_P(restore_msg) + 1]; + strcpy_P(msg, restore_msg); + MenuItem_confirm::select_screen( + GET_TEXT(MSG_BUTTON_RESET), GET_TEXT(MSG_BUTTON_IGNORE), + init_eeprom, return_to_status, + eeprom_err(editable.uint8), msg, PSTR("?") + ); + }); + #else + set_status_P(eeprom_err(msgid)); + #endif + } + + #endif // EEPROM_AUTO_INIT + +#endif // EEPROM_SETTINGS diff --git a/Marlin/src/lcd/ultralcd.h b/Marlin/src/lcd/ultralcd.h index 1bcf9956fe..f3c06177bb 100644 --- a/Marlin/src/lcd/ultralcd.h +++ b/Marlin/src/lcd/ultralcd.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -27,7 +27,11 @@ #include "../libs/buzzer.h" #endif -#if HAS_LCD_MENU || ENABLED(ULTIPANEL_FEEDMULTIPLY) +#if ENABLED(SDSUPPORT) + #include "../sd/cardreader.h" +#endif + +#if EITHER(HAS_LCD_MENU, ULTIPANEL_FEEDMULTIPLY) #define HAS_ENCODER_ACTION 1 #endif #if (!HAS_ADC_BUTTONS && ENABLED(NEWPANEL)) || BUTTONS_EXIST(EN1, EN2) @@ -41,7 +45,13 @@ #endif // I2C buttons must be read in the main thread -#define HAS_SLOW_BUTTONS EITHER(LCD_I2C_VIKI, LCD_I2C_PANELOLU2) +#if EITHER(LCD_I2C_VIKI, LCD_I2C_PANELOLU2) + #define HAS_SLOW_BUTTONS 1 +#endif + +#if E_MANUAL > 1 + #define MULTI_MANUAL 1 +#endif #if HAS_SPI_LCD @@ -64,22 +74,10 @@ uint8_t get_ADC_keyValue(); #endif - #if ENABLED(TOUCH_BUTTONS) - #define LCD_UPDATE_INTERVAL 50 - #else - #define LCD_UPDATE_INTERVAL 100 - #endif + #define LCD_UPDATE_INTERVAL TERN(TOUCH_BUTTONS, 50, 100) #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); @@ -93,9 +91,6 @@ 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, @@ -109,7 +104,7 @@ #endif // HAS_LCD_MENU -#endif +#endif // HAS_SPI_LCD // REPRAPWORLD_KEYPAD (and ADC_KEYPAD) #if ENABLED(REPRAPWORLD_KEYPAD) @@ -207,12 +202,12 @@ #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 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)) @@ -250,6 +245,43 @@ }; #endif +#if PREHEAT_COUNT + typedef struct { + TERN_(HAS_HOTEND, uint16_t hotend_temp); + TERN_(HAS_HEATED_BED, uint16_t bed_temp ); + TERN_(HAS_FAN, uint16_t fan_speed ); + } preheat_t; +#endif + +#if HAS_LCD_MENU + + // Manual Movement class + class ManualMove { + public: + static millis_t start_time; + static float menu_scale; + TERN_(IS_KINEMATIC, static float offset); + #if IS_KINEMATIC + static bool processing; + #else + static bool constexpr processing = false; + #endif + #if MULTI_MANUAL + static int8_t e_index; + #else + static int8_t constexpr e_index = 0; + #endif + static uint8_t axis; + static void task(); + static void soon(AxisEnum axis + #if MULTI_MANUAL + , const int8_t eindex=-1 + #endif + ); + }; + +#endif + //////////////////////////////////////////// //////////// MarlinUI Singleton //////////// //////////////////////////////////////////// @@ -258,22 +290,41 @@ class MarlinUI { public: MarlinUI() { - #if HAS_LCD_MENU - currentScreen = status_screen; - #endif + TERN_(HAS_LCD_MENU, currentScreen = status_screen); } #if HAS_BUZZER static void buzz(const long duration, const uint16_t freq); #endif + FORCE_INLINE static void chirp() { + TERN_(HAS_CHIRP, buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ)); + } + #if ENABLED(LCD_HAS_STATUS_INDICATORS) static void update_indicators(); #endif // LCD implementations static void clear_lcd(); - static void init_lcd(); + + #if ENABLED(SDSUPPORT) + static void media_changed(const uint8_t old_stat, const uint8_t stat); + #endif + + #if HAS_SPI_LCD + static bool detected(); + static void init_lcd(); + FORCE_INLINE static void refresh() { refresh(LCDVIEW_CLEAR_CALL_REDRAW); } + #else + #if ENABLED(DWIN_CREALITY_LCD) + static void refresh(); + #else + static inline void refresh() {} + #endif + static inline bool detected() { return true; } + static inline void init_lcd() {} + #endif #if HAS_DISPLAY @@ -332,12 +383,9 @@ public: 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); @@ -391,6 +439,8 @@ public: static void quick_feedback(const bool clear_buttons=true); #if HAS_BUZZER static void completion_feedback(const bool good=true); + #else + static inline void completion_feedback(const bool=true) {} #endif #if DISABLED(LIGHTWEIGHT_UI) @@ -401,10 +451,13 @@ public: static void draw_hotend_status(const uint8_t row, const uint8_t extruder); #endif + #if ENABLED(TOUCH_BUTTONS) + static bool on_edit_screen; + static void screen_click(const uint8_t row, const uint8_t col, const uint8_t x, const uint8_t y); + #endif + static void status_screen(); - #else - static void refresh() {} #endif static bool get_blink(); @@ -418,13 +471,12 @@ public: #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 void set_status(const char* message, const bool=false); + static void set_status_P(PGM_P message, const int8_t=0); + static 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(const bool=false) {} @@ -433,6 +485,21 @@ public: #endif + #if ENABLED(SDSUPPORT) + #if BOTH(SCROLL_LONG_FILENAMES, HAS_LCD_MENU) + #define MARLINUI_SCROLL_NAME 1 + #endif + #if MARLINUI_SCROLL_NAME + 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 PREHEAT_COUNT + static preheat_t material_preset[PREHEAT_COUNT]; + static PGM_P get_preheat_label(const uint8_t m); + #endif + #if HAS_LCD_MENU #if ENABLED(TOUCH_BUTTONS) @@ -446,35 +513,14 @@ public: 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]; + // Manual Movement + static ManualMove manual_move; // 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(); @@ -486,15 +532,9 @@ public: 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 _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, const bool is_back)); + static inline void goto_previous_screen() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, false)); } + static inline void go_back() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, true)); } static void return_to_status(); static inline bool on_status_screen() { return currentScreen == status_screen; } @@ -505,7 +545,7 @@ public: #endif FORCE_INLINE static void defer_status_screen(const bool defer=true) { - #if LCD_TIMEOUT_TO_STATUS + #if LCD_TIMEOUT_TO_STATUS > 0 defer_return_to_status = defer; #else UNUSED(defer); @@ -521,14 +561,6 @@ public: 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 @@ -543,18 +575,47 @@ public: #endif - #define LCD_HAS_WAIT_FOR_MOVE EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) || (ENABLED(LCD_BED_LEVELING) && EITHER(PROBE_MANUALLY, MESH_BED_LEVELING)) + // + // EEPROM: Reset / Init / Load / Store + // + #if HAS_LCD_MENU + static void reset_settings(); + #endif - #if LCD_HAS_WAIT_FOR_MOVE + #if ENABLED(EEPROM_SETTINGS) + #if HAS_LCD_MENU + static void init_eeprom(); + static void load_settings(); + static void store_settings(); + #endif + #if DISABLED(EEPROM_AUTO_INIT) + static void eeprom_alert(const uint8_t msgid); + static inline void eeprom_alert_crc() { eeprom_alert(0); } + static inline void eeprom_alert_index() { eeprom_alert(1); } + static inline void eeprom_alert_version() { eeprom_alert(2); } + #endif + #endif + + // + // Special handling if a move is underway + // + #if EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) || (ENABLED(LCD_BED_LEVELING) && EITHER(PROBE_MANUALLY, MESH_BED_LEVELING)) + #define LCD_HAS_WAIT_FOR_MOVE 1 static bool wait_for_move; #else static constexpr bool wait_for_move = false; #endif + // + // Block interaction while under external control + // #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; } + #if ENABLED(AUTO_BED_LEVELING_UBL) + static void external_encoder(); + #endif #else static constexpr bool external_control = false; #endif @@ -579,11 +640,7 @@ public: static uint32_t encoderPosition; - #if ENABLED(REVERSE_ENCODER_DIRECTION) - #define ENCODERBASE -1 - #else - #define ENCODERBASE +1 - #endif + #define ENCODERBASE (TERN(REVERSE_ENCODER_DIRECTION, -1, +1)) #if EITHER(REVERSE_MENU_DIRECTION, REVERSE_SELECT_DIRECTION) static int8_t encoderDirection; @@ -598,15 +655,11 @@ public: } FORCE_INLINE static void encoder_direction_menus() { - #if ENABLED(REVERSE_MENU_DIRECTION) - encoderDirection = -(ENCODERBASE); - #endif + TERN_(REVERSE_MENU_DIRECTION, encoderDirection = -(ENCODERBASE)); } FORCE_INLINE static void encoder_direction_select() { - #if ENABLED(REVERSE_SELECT_DIRECTION) - encoderDirection = -(ENCODERBASE); - #endif + TERN_(REVERSE_SELECT_DIRECTION, encoderDirection = -(ENCODERBASE)); } #else @@ -617,19 +670,15 @@ public: 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 + #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS > 0 + static bool defer_return_to_status; + #else + static constexpr bool defer_return_to_status = false; #endif static void draw_status_screen(); #endif diff --git a/Marlin/src/libs/BL24CXX.cpp b/Marlin/src/libs/BL24CXX.cpp new file mode 100644 index 0000000000..d34ed8340f --- /dev/null +++ b/Marlin/src/libs/BL24CXX.cpp @@ -0,0 +1,273 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2020 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" + +#if ENABLED(IIC_BL24CXX_EEPROM) + +/** + * PersistentStore for Arduino-style EEPROM interface + * with simple implementations supplied by Marlin. + */ + +#include "BL24CXX.h" +#include + +#ifndef EEPROM_WRITE_DELAY + #define EEPROM_WRITE_DELAY 10 +#endif +#ifndef EEPROM_DEVICE_ADDRESS + #define EEPROM_DEVICE_ADDRESS (0x50 << 1) +#endif + +// IO direction setting +#define SDA_IN() do{ PIN_MAP[IIC_EEPROM_SDA].gpio_device->regs->CRH &= 0XFFFF0FFF; PIN_MAP[IIC_EEPROM_SDA].gpio_device->regs->CRH |= 8 << 12; }while(0) +#define SDA_OUT() do{ PIN_MAP[IIC_EEPROM_SDA].gpio_device->regs->CRH &= 0XFFFF0FFF; PIN_MAP[IIC_EEPROM_SDA].gpio_device->regs->CRH |= 3 << 12; }while(0) + +// IO ops +#define IIC_SCL_0() WRITE(IIC_EEPROM_SCL, LOW) +#define IIC_SCL_1() WRITE(IIC_EEPROM_SCL, HIGH) +#define IIC_SDA_0() WRITE(IIC_EEPROM_SDA, LOW) +#define IIC_SDA_1() WRITE(IIC_EEPROM_SDA, HIGH) +#define READ_SDA() READ(IIC_EEPROM_SDA) + +// +// Simple IIC interface via libmaple +// + +// Initialize IIC +void IIC::init() { + SET_OUTPUT(IIC_EEPROM_SDA); + SET_OUTPUT(IIC_EEPROM_SCL); + IIC_SCL_1(); + IIC_SDA_1(); +} + +// Generate IIC start signal +void IIC::start() { + SDA_OUT(); // SDA line output + IIC_SDA_1(); + IIC_SCL_1(); + delay_us(4); + IIC_SDA_0(); // START:when CLK is high, DATA change from high to low + delay_us(4); + IIC_SCL_0(); // Clamp the I2C bus, ready to send or receive data +} + +// Generate IIC stop signal +void IIC::stop() { + SDA_OUT(); // SDA line output + IIC_SCL_0(); + IIC_SDA_0(); // STOP:when CLK is high DATA change from low to high + delay_us(4); + IIC_SCL_1(); + IIC_SDA_1(); // Send I2C bus end signal + delay_us(4); +} + +// Wait for the response signal to arrive +// 1 = failed to receive response +// 0 = response received +uint8_t IIC::wait_ack() { + uint8_t ucErrTime = 0; + SDA_IN(); // SDA is set as input + IIC_SDA_1(); delay_us(1); + IIC_SCL_1(); delay_us(1); + while (READ_SDA()) { + if (++ucErrTime > 250) { + stop(); + return 1; + } + } + IIC_SCL_0(); // Clock output 0 + return 0; +} + +// Generate ACK response +void IIC::ack() { + IIC_SCL_0(); + SDA_OUT(); + IIC_SDA_0(); + delay_us(2); + IIC_SCL_1(); + delay_us(2); + IIC_SCL_0(); +} + +// No ACK response +void IIC::nAck() { + IIC_SCL_0(); + SDA_OUT(); + IIC_SDA_1(); + delay_us(2); + IIC_SCL_1(); + delay_us(2); + IIC_SCL_0(); +} + +// Send one IIC byte +// Return whether the slave responds +// 1 = there is a response +// 0 = no response +void IIC::send_byte(uint8_t txd) { + SDA_OUT(); + IIC_SCL_0(); // Pull down the clock to start data transmission + LOOP_L_N(t, 8) { + // IIC_SDA = (txd & 0x80) >> 7; + if (txd & 0x80) IIC_SDA_1(); else IIC_SDA_0(); + txd <<= 1; + delay_us(2); // All three delays are necessary for TEA5767 + IIC_SCL_1(); + delay_us(2); + IIC_SCL_0(); + delay_us(2); + } +} + +// Read 1 byte, when ack=1, send ACK, ack=0, send nACK +uint8_t IIC::read_byte(unsigned char ack_chr) { + unsigned char receive = 0; + SDA_IN(); // SDA is set as input + LOOP_L_N(i, 8) { + IIC_SCL_0(); + delay_us(2); + IIC_SCL_1(); + receive <<= 1; + if (READ_SDA()) receive++; + delay_us(1); + } + ack_chr ? ack() : nAck(); // Send ACK / send nACK + return receive; +} + +/******************** EEPROM ********************/ + +// Initialize the IIC interface +void BL24CXX::init() { IIC::init(); } + +// Read a byte at the specified address +// ReadAddr: the address to start reading +// Return: the byte read +uint8_t BL24CXX::readOneByte(uint16_t ReadAddr) { + uint8_t temp = 0; + IIC::start(); + if (EE_TYPE > BL24C16) { + IIC::send_byte(EEPROM_DEVICE_ADDRESS); // Send write command + IIC::wait_ack(); + IIC::send_byte(ReadAddr >> 8); // Send high address + IIC::wait_ack(); + } + else + IIC::send_byte(EEPROM_DEVICE_ADDRESS + ((ReadAddr >> 8) << 1)); // Send device address 0xA0, write data + + IIC::wait_ack(); + IIC::send_byte(ReadAddr & 0xFF); // Send low address + IIC::wait_ack(); + IIC::start(); + IIC::send_byte(EEPROM_DEVICE_ADDRESS | 0x01); // Send byte + IIC::wait_ack(); + temp = IIC::read_byte(0); + IIC::stop(); // Generate a stop condition + return temp; +} + +// Write a data at the address specified by BL24CXX +// WriteAddr: The destination address for writing data +// DataToWrite: the data to be written +void BL24CXX::writeOneByte(uint16_t WriteAddr, uint8_t DataToWrite) { + IIC::start(); + if (EE_TYPE > BL24C16) { + IIC::send_byte(EEPROM_DEVICE_ADDRESS); // Send write command + IIC::wait_ack(); + IIC::send_byte(WriteAddr >> 8); // Send high address + } + else + IIC::send_byte(EEPROM_DEVICE_ADDRESS + ((WriteAddr >> 8) << 1)); // Send device address 0xA0, write data + + IIC::wait_ack(); + IIC::send_byte(WriteAddr & 0xFF); // Send low address + IIC::wait_ack(); + IIC::send_byte(DataToWrite); // Receiving mode + IIC::wait_ack(); + IIC::stop(); // Generate a stop condition + delay(10); +} + +// Start writing data of length Len at the specified address in BL24CXX +// This function is used to write 16bit or 32bit data. +// WriteAddr: the address to start writing +// DataToWrite: the first address of the data array +// Len: The length of the data to be written 2, 4 +void BL24CXX::writeLenByte(uint16_t WriteAddr, uint32_t DataToWrite, uint8_t Len) { + LOOP_L_N(t, Len) + writeOneByte(WriteAddr + t, (DataToWrite >> (8 * t)) & 0xFF); +} + +// Start reading data of length Len from the specified address in BL24CXX +// This function is used to read 16bit or 32bit data. +// ReadAddr: the address to start reading +// Return value: data +// Len: The length of the data to be read 2,4 +uint32_t BL24CXX::readLenByte(uint16_t ReadAddr, uint8_t Len) { + uint32_t temp = 0; + LOOP_L_N(t, Len) { + temp <<= 8; + temp += readOneByte(ReadAddr + Len - t - 1); + } + return temp; +} + +// Check if BL24CXX is normal +// Return 1: Detection failed +// return 0: detection is successful +#define BL24CXX_TEST_ADDRESS 0x00 +#define BL24CXX_TEST_VALUE 0x55 + +bool BL24CXX::_check() { + return (readOneByte(BL24CXX_TEST_ADDRESS) != BL24CXX_TEST_VALUE); // false = success! +} + +bool BL24CXX::check() { + if (_check()) { // Value was written? Good EEPROM! + writeOneByte(BL24CXX_TEST_ADDRESS, BL24CXX_TEST_VALUE); // Write now and check. + return _check(); + } + return false; // success! +} + +// Start reading the specified number of data at the specified address in BL24CXX +// ReadAddr: The address to start reading is 0~255 for 24c02 +// pBuffer: the first address of the data array +// NumToRead: the number of data to be read +void BL24CXX::read(uint16_t ReadAddr, uint8_t *pBuffer, uint16_t NumToRead) { + for (; NumToRead; NumToRead--) + *pBuffer++ = readOneByte(ReadAddr++); +} + +// Start writing the specified number of data at the specified address in BL24CXX +// WriteAddr: the address to start writing, 0~255 for 24c02 +// pBuffer: the first address of the data array +// NumToWrite: the number of data to be written +void BL24CXX::write(uint16_t WriteAddr, uint8_t *pBuffer, uint16_t NumToWrite) { + for (; NumToWrite; NumToWrite--, WriteAddr++) + writeOneByte(WriteAddr, *pBuffer++); +} + +#endif // IIC_BL24CXX_EEPROM diff --git a/Marlin/src/libs/BL24CXX.h b/Marlin/src/libs/BL24CXX.h new file mode 100644 index 0000000000..b069c196c0 --- /dev/null +++ b/Marlin/src/libs/BL24CXX.h @@ -0,0 +1,72 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 BL24CXX.h + * @brief i2c EEPROM for Ender 3 v2 board (4.2.2) + ********************************************************************************/ + +/******************** IIC ********************/ + +class BL24CXX; + +// All operation functions of IIC +class IIC { +friend class BL24CXX; +protected: + static void init(); // Initialize the IO port of IIC + static void start(); // Send IIC start signal + static void stop(); // Send IIC stop signal + static void send_byte(uint8_t txd); // IIC sends a byte + static uint8_t read_byte(unsigned char ack); // IIC reads a byte + static uint8_t wait_ack(); // IIC waits for ACK signal + static void ack(); // IIC sends ACK signal + static void nAck(); // IIC does not send ACK signal +}; + +/******************** EEPROM ********************/ + +#define BL24C01 127 +#define BL24C02 255 +#define BL24C04 511 +#define BL24C08 1023 +#define BL24C16 2047 +#define BL24C32 4095 +#define BL24C64 8191 +#define BL24C128 16383 +#define BL24C256 32767 +#define EE_TYPE BL24C16 + +class BL24CXX { +private: + static bool _check(); // Check the device +public: + static void init(); // Initialize IIC + static bool check(); // Check / recheck the device + static uint8_t readOneByte(uint16_t ReadAddr); // Read a byte at the specified address + static void writeOneByte(uint16_t WriteAddr, uint8_t DataToWrite); // Write a byte at the specified address + static void writeLenByte(uint16_t WriteAddr, uint32_t DataToWrite, uint8_t Len); // The specified address begins to write the data of the specified length + static uint32_t readLenByte(uint16_t ReadAddr, uint8_t Len); // The specified address starts to read the data of the specified length + static void write(uint16_t WriteAddr, uint8_t *pBuffer, uint16_t NumToWrite); // Write the specified length of data from the specified address + static void read(uint16_t ReadAddr, uint8_t *pBuffer, uint16_t NumToRead); // Read the data of the specified length from the specified address +}; diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp index ad70537141..dd85473e98 100644 --- a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp +++ b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -923,9 +923,7 @@ void L64XX_Marlin::say_axis(const L64XX_axis_t axis, const uint8_t label/*=true* monitor_update(E5); #endif - #if ENABLED(L6470_DEBUG) - if (report_L6470_status) DEBUG_EOL(); - #endif + if (TERN0(L6470_DEBUG, report_L6470_status)) DEBUG_EOL(); spi_active = false; // done with all SPI transfers - clear handshake flags spi_abort = false; diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.h b/Marlin/src/libs/L64XX/L64XX_Marlin.h index 371f0991c2..c8d273990f 100644 --- a/Marlin/src/libs/L64XX/L64XX_Marlin.h +++ b/Marlin/src/libs/L64XX/L64XX_Marlin.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/libs/bresenham.h b/Marlin/src/libs/bresenham.h index e18531498b..ade231e26d 100644 --- a/Marlin/src/libs/bresenham.h +++ b/Marlin/src/libs/bresenham.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/libs/buzzer.cpp b/Marlin/src/libs/buzzer.cpp index 3b0a239178..8459695359 100644 --- a/Marlin/src/libs/buzzer.cpp +++ b/Marlin/src/libs/buzzer.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -66,7 +66,8 @@ void Buzzer::tick() { CRITICAL_SECTION_START(); ExtUI::onPlayTone(state.tone.frequency, state.tone.duration); CRITICAL_SECTION_END(); - #elif ENABLED(SPEAKER) + #endif + #if ENABLED(SPEAKER) && (DISABLED(EXTENSIBLE_UI) || ENABLED(EXTUI_LOCAL_BEEPER)) CRITICAL_SECTION_START(); ::tone(BEEPER_PIN, state.tone.frequency, state.tone.duration); CRITICAL_SECTION_END(); diff --git a/Marlin/src/libs/buzzer.h b/Marlin/src/libs/buzzer.h index 3a72a0bd86..022d94deaf 100644 --- a/Marlin/src/libs/buzzer.h +++ b/Marlin/src/libs/buzzer.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/libs/circularqueue.h b/Marlin/src/libs/circularqueue.h index 54a6edaabe..4d4a464b9c 100644 --- a/Marlin/src/libs/circularqueue.h +++ b/Marlin/src/libs/circularqueue.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/libs/crc16.cpp b/Marlin/src/libs/crc16.cpp index 71cda50aeb..c2195619c7 100644 --- a/Marlin/src/libs/crc16.cpp +++ b/Marlin/src/libs/crc16.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/libs/crc16.h b/Marlin/src/libs/crc16.h index 65e036d089..1760ecd6f8 100644 --- a/Marlin/src/libs/crc16.h +++ b/Marlin/src/libs/crc16.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/libs/duration_t.h b/Marlin/src/libs/duration_t.h index 897ea1e869..31d8bab385 100644 --- a/Marlin/src/libs/duration_t.h +++ b/Marlin/src/libs/duration_t.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/libs/hex_print_routines.cpp b/Marlin/src/libs/hex_print_routines.cpp index 293192e6ef..5909ffd7d0 100644 --- a/Marlin/src/libs/hex_print_routines.cpp +++ b/Marlin/src/libs/hex_print_routines.cpp @@ -16,14 +16,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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) +#if ANY(AUTO_BED_LEVELING_UBL, M100_FREE_MEMORY_WATCHER, DEBUG_GCODE_PARSER, TMC_DEBUG, MARLIN_DEV_MODE) #include "hex_print_routines.h" diff --git a/Marlin/src/libs/hex_print_routines.h b/Marlin/src/libs/hex_print_routines.h index ac47ed7701..2fac6c9892 100644 --- a/Marlin/src/libs/hex_print_routines.h +++ b/Marlin/src/libs/hex_print_routines.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/libs/least_squares_fit.cpp b/Marlin/src/libs/least_squares_fit.cpp index aac83f9aca..ce3a342b92 100644 --- a/Marlin/src/libs/least_squares_fit.cpp +++ b/Marlin/src/libs/least_squares_fit.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/libs/least_squares_fit.h b/Marlin/src/libs/least_squares_fit.h index 721c499dec..5cd6a02514 100644 --- a/Marlin/src/libs/least_squares_fit.h +++ b/Marlin/src/libs/least_squares_fit.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/libs/nozzle.cpp b/Marlin/src/libs/nozzle.cpp index ecbfeb331e..21e6ffb7cd 100644 --- a/Marlin/src/libs/nozzle.cpp +++ b/Marlin/src/libs/nozzle.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -42,9 +42,7 @@ Nozzle nozzle; * @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 + TERN_(NOZZLE_CLEAN_GOBACK, const xyz_pos_t oldpos = current_position); // Move to the starting point #if ENABLED(NOZZLE_CLEAN_NO_Z) @@ -59,9 +57,7 @@ Nozzle nozzle; do_blocking_move_to_xy(start); } - #if ENABLED(NOZZLE_CLEAN_GOBACK) - do_blocking_move_to(oldpos); - #endif + TERN_(NOZZLE_CLEAN_GOBACK, do_blocking_move_to(oldpos)); } /** @@ -77,9 +73,7 @@ Nozzle nozzle; 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 + TERN_(NOZZLE_CLEAN_GOBACK, const xyz_pos_t back = current_position); #if ENABLED(NOZZLE_CLEAN_NO_Z) do_blocking_move_to_xy(start); @@ -108,9 +102,7 @@ Nozzle nozzle; } } - #if ENABLED(NOZZLE_CLEAN_GOBACK) - do_blocking_move_to(back); - #endif + TERN_(NOZZLE_CLEAN_GOBACK, do_blocking_move_to(back)); } /** @@ -124,15 +116,8 @@ Nozzle nozzle; 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 + TERN_(NOZZLE_CLEAN_GOBACK, const xyz_pos_t back = current_position); + TERN(NOZZLE_CLEAN_NO_Z, do_blocking_move_to_xy, do_blocking_move_to)(start); LOOP_L_N(s, strokes) LOOP_L_N(i, NOZZLE_CLEAN_CIRCLE_FN) @@ -144,9 +129,7 @@ Nozzle nozzle; // Let's be safe do_blocking_move_to_xy(start); - #if ENABLED(NOZZLE_CLEAN_GOBACK) - do_blocking_move_to(back); - #endif + TERN_(NOZZLE_CLEAN_GOBACK, do_blocking_move_to(back)); } /** @@ -159,22 +142,50 @@ Nozzle nozzle; 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[HOTENDS] = NOZZLE_CLEAN_START_POINT, end[HOTENDS] = NOZZLE_CLEAN_END_POINT, middle[HOTENDS] = NOZZLE_CLEAN_CIRCLE_MIDDLE; + const uint8_t arrPos = ANY(SINGLENOZZLE, MIXING_EXTRUDER) ? 0 : active_extruder; + + #if HAS_SOFTWARE_ENDSTOPS + + #define LIMIT_AXIS(A) do{ \ + LIMIT( start[arrPos].A, soft_endstop.min.A, soft_endstop.max.A); \ + LIMIT(middle[arrPos].A, soft_endstop.min.A, soft_endstop.max.A); \ + LIMIT( end[arrPos].A, soft_endstop.min.A, soft_endstop.max.A); \ + }while(0) + + if (soft_endstops_enabled) { + + LIMIT_AXIS(x); + LIMIT_AXIS(y); + LIMIT_AXIS(z); + const bool radiusOutOfRange = (middle[arrPos].x + radius > soft_endstop.max.x) + || (middle[arrPos].x - radius < soft_endstop.min.x) + || (middle[arrPos].y + radius > soft_endstop.max.y) + || (middle[arrPos].y - radius < soft_endstop.min.y); + if (radiusOutOfRange && pattern == 2) { + SERIAL_ECHOLNPGM("Warning: Radius Out of Range"); + return; + } + + } + + #endif + if (pattern == 2) { if (!(cleans & (_BV(X_AXIS) | _BV(Y_AXIS)))) { - SERIAL_ECHOLNPGM("Warning : Clean Circle requires XY"); + SERIAL_ECHOLNPGM("Warning: Clean Circle requires XY"); return; } } else { - if (!TEST(cleans, X_AXIS)) start[active_extruder].x = end[active_extruder].x = current_position.x; - if (!TEST(cleans, Y_AXIS)) start[active_extruder].y = end[active_extruder].y = current_position.y; + if (!TEST(cleans, X_AXIS)) start[arrPos].x = end[arrPos].x = current_position.x; + if (!TEST(cleans, Y_AXIS)) start[arrPos].y = end[arrPos].y = current_position.y; } - if (!TEST(cleans, Z_AXIS)) start[active_extruder].z = end[active_extruder].z = current_position.z; + if (!TEST(cleans, Z_AXIS)) start[arrPos].z = end[arrPos].z = current_position.z; switch (pattern) { - case 1: zigzag(start[active_extruder], end[active_extruder], strokes, objects); break; - case 2: circle(start[active_extruder], middle[active_extruder], strokes, radius); break; - default: stroke(start[active_extruder], end[active_extruder], strokes); + case 1: zigzag(start[arrPos], end[arrPos], strokes, objects); break; + case 2: circle(start[arrPos], middle[arrPos], strokes, radius); break; + default: stroke(start[arrPos], end[arrPos], strokes); } } @@ -194,11 +205,22 @@ Nozzle nozzle; 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); + default: { + // Apply a minimum raise, overriding G27 Z + const float min_raised_z =_MIN(Z_MAX_POS, current_position.z + #ifdef NOZZLE_PARK_Z_RAISE_MIN + + NOZZLE_PARK_Z_RAISE_MIN + #endif + ); + do_blocking_move_to_z(_MAX(park.z, min_raised_z), fr_z); + } break; } - do_blocking_move_to_xy(park, fr_xy); + do_blocking_move_to_xy( + TERN(NOZZLE_PARK_Y_ONLY, current_position, park).x, + TERN(NOZZLE_PARK_X_ONLY, current_position, park).y, + fr_xy + ); report_current_position(); } diff --git a/Marlin/src/libs/nozzle.h b/Marlin/src/libs/nozzle.h index 3ff0670ce8..81594b1381 100644 --- a/Marlin/src/libs/nozzle.h +++ b/Marlin/src/libs/nozzle.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/libs/numtostr.cpp b/Marlin/src/libs/numtostr.cpp index 1ed315ae07..3b36c180e8 100644 --- a/Marlin/src/libs/numtostr.cpp +++ b/Marlin/src/libs/numtostr.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -31,6 +31,8 @@ char conv[8] = { 0 }; #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, '-')) +#define INTFLOAT(V,N) (((V) * 10 * pow(10, N) + ((V) < 0 ? -5: 5)) / 10) // pow10? +#define UINTFLOAT(V,N) INTFLOAT((V) < 0 ? -(V) : (V), N) // Convert a full-range unsigned 8bit int to a percentage const char* ui8tostr4pctrj(const uint8_t i) { @@ -166,7 +168,7 @@ const char* i16tostr4signrj(const int16_t i) { // 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; + const long i = UINTFLOAT(f, 2); conv[3] = DIGIMOD(i, 100); conv[4] = '.'; conv[5] = DIGIMOD(i, 10); @@ -174,10 +176,31 @@ const char* ftostr12ns(const float &f) { return &conv[3]; } +// Convert unsigned float to string with 12.3 format +const char* ftostr31ns(const float &f) { + const long i = UINTFLOAT(f, 1); + conv[3] = DIGIMOD(i, 100); + conv[4] = DIGIMOD(i, 10); + conv[5] = '.'; + conv[6] = DIGIMOD(i, 1); + return &conv[3]; +} + +// Convert unsigned float to string with 123.4 format +const char* ftostr41ns(const float &f) { + const long i = UINTFLOAT(f, 1); + conv[2] = DIGIMOD(i, 1000); + conv[3] = DIGIMOD(i, 100); + conv[4] = DIGIMOD(i, 10); + conv[5] = '.'; + conv[6] = DIGIMOD(i, 1); + return &conv[2]; +} + // Convert signed float to fixed-length string with 12.34 / _2.34 / -2.34 or -23.45 / 123.45 format const char* ftostr42_52(const float &f) { if (f <= -10 || f >= 100) return ftostr52(f); // -23.45 / 123.45 - long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; + long i = INTFLOAT(f, 2); conv[2] = (f >= 0 && f < 10) ? ' ' : MINUSOR(i, DIGIMOD(i, 1000)); conv[3] = DIGIMOD(i, 100); conv[4] = '.'; @@ -188,7 +211,7 @@ const char* ftostr42_52(const float &f) { // 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; + long i = INTFLOAT(f, 2); conv[1] = MINUSOR(i, DIGIMOD(i, 10000)); conv[2] = DIGIMOD(i, 1000); conv[3] = DIGIMOD(i, 100); @@ -201,7 +224,7 @@ const char* ftostr52(const float &f) { // Convert signed float to fixed-length string with 12.345 / _2.345 / -2.345 or -23.45 / 123.45 format const char* ftostr53_63(const float &f) { if (f <= -10 || f >= 100) return ftostr63(f); // -23.456 / 123.456 - long i = (f * 10000 + (f < 0 ? -5: 5)) / 10; + long i = INTFLOAT(f, 3); conv[1] = (f >= 0 && f < 10) ? ' ' : MINUSOR(i, DIGIMOD(i, 10000)); conv[2] = DIGIMOD(i, 1000); conv[3] = '.'; @@ -213,7 +236,7 @@ const char* ftostr53_63(const float &f) { // Convert signed float to fixed-length string with 023.456 / -23.456 format const char* ftostr63(const float &f) { - long i = (f * 10000 + (f < 0 ? -5: 5)) / 10; + long i = INTFLOAT(f, 3); conv[0] = MINUSOR(i, DIGIMOD(i, 100000)); conv[1] = DIGIMOD(i, 10000); conv[2] = DIGIMOD(i, 1000); @@ -228,7 +251,7 @@ const char* ftostr63(const float &f) { // 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; + const int i = INTFLOAT(f, 1); if (!WITHIN(i, -99, 999)) return i16tostr4signrj((int)f); const bool neg = i < 0; const int ii = neg ? -i : i; @@ -241,9 +264,20 @@ const char* ftostr63(const float &f) { #endif +// Convert float to fixed-length string with +12.3 / -12.3 format +const char* ftostr31sign(const float &f) { + int i = INTFLOAT(f, 1); + conv[2] = MINUSOR(i, '+'); + conv[3] = DIGIMOD(i, 100); + conv[4] = DIGIMOD(i, 10); + conv[5] = '.'; + conv[6] = DIGIMOD(i, 1); + return &conv[2]; +} + // 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; + int i = INTFLOAT(f, 1); conv[1] = MINUSOR(i, '+'); conv[2] = DIGIMOD(i, 1000); conv[3] = DIGIMOD(i, 100); @@ -255,7 +289,7 @@ const char* ftostr41sign(const float &f) { // 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; + long i = INTFLOAT(f, 3); conv[1] = i ? MINUSOR(i, plus) : ' '; conv[2] = DIGIMOD(i, 1000); conv[3] = '.'; @@ -267,7 +301,7 @@ const char* ftostr43sign(const float &f, char plus/*=' '*/) { // 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; + long i = INTFLOAT(f, 4); conv[0] = i ? MINUSOR(i, plus) : ' '; conv[1] = DIGIMOD(i, 10000); conv[2] = '.'; @@ -280,13 +314,13 @@ const char* ftostr54sign(const float &f, char plus/*=' '*/) { // 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; + const long i = UINTFLOAT(f, 0); return ui16tostr5rj(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; + long i = INTFLOAT(f, 1); conv[0] = MINUSOR(i, '+'); conv[1] = DIGIMOD(i, 10000); conv[2] = DIGIMOD(i, 1000); @@ -299,7 +333,7 @@ const char* ftostr51sign(const float &f) { // Convert signed float to string with +123.45 format const char* ftostr52sign(const float &f) { - long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; + long i = INTFLOAT(f, 2); conv[0] = MINUSOR(i, '+'); conv[1] = DIGIMOD(i, 10000); conv[2] = DIGIMOD(i, 1000); @@ -312,7 +346,7 @@ const char* ftostr52sign(const float &f) { // Convert signed float to string with +12.345 format const char* ftostr53sign(const float &f) { - long i = (f * 10000 + (f < 0 ? -5: 5)) / 10; + long i = INTFLOAT(f, 3); conv[0] = MINUSOR(i, '+'); conv[1] = DIGIMOD(i, 10000); conv[2] = DIGIMOD(i, 1000); @@ -325,7 +359,7 @@ const char* ftostr53sign(const float &f) { // Convert unsigned float to string with ____4.5, __34.5, _234.5, 1234.5 format const char* ftostr51rj(const float &f) { - const long i = ((f < 0 ? -f : f) * 100 + 5) / 10; + const long i = UINTFLOAT(f, 1); conv[0] = ' '; conv[1] = RJDIGIT(i, 10000); conv[2] = RJDIGIT(i, 1000); @@ -338,7 +372,7 @@ const char* ftostr51rj(const float &f) { // 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; + long i = INTFLOAT(f, 2); uint8_t dig; conv[0] = MINUSOR(i, ' '); conv[1] = RJDIGIT(i, 10000); diff --git a/Marlin/src/libs/numtostr.h b/Marlin/src/libs/numtostr.h index 8b6b83391f..e52a7d9889 100644 --- a/Marlin/src/libs/numtostr.h +++ b/Marlin/src/libs/numtostr.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -58,6 +58,12 @@ const char* i16tostr4signrj(const int16_t x); // Convert unsigned float to string with 1.23 format const char* ftostr12ns(const float &x); +// Convert unsigned float to string with 12.3 format +const char* ftostr31ns(const float &x); + +// Convert unsigned float to string with 123.4 format +const char* ftostr41ns(const float &x); + // Convert signed float to fixed-length string with 12.34 / _2.34 / -2.34 or -23.45 / 123.45 format const char* ftostr42_52(const float &x); @@ -70,6 +76,9 @@ const char* ftostr53_63(const float &x); // Convert signed float to fixed-length string with 023.456 / -23.456 format const char* ftostr63(const float &x); +// Convert float to fixed-length string with +12.3 / -12.3 format +const char* ftostr31sign(const float &x); + // Convert float to fixed-length string with +123.4 / -123.4 format const char* ftostr41sign(const float &x); diff --git a/Marlin/src/libs/private_spi.h b/Marlin/src/libs/private_spi.h index 9ce68c4909..c2a054235b 100644 --- a/Marlin/src/libs/private_spi.h +++ b/Marlin/src/libs/private_spi.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/libs/softspi.h b/Marlin/src/libs/softspi.h index 300eb93871..5d48f9fd8c 100644 --- a/Marlin/src/libs/softspi.h +++ b/Marlin/src/libs/softspi.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/libs/stopwatch.cpp b/Marlin/src/libs/stopwatch.cpp index 6b01158cb9..601efe5517 100644 --- a/Marlin/src/libs/stopwatch.cpp +++ b/Marlin/src/libs/stopwatch.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -34,14 +34,10 @@ millis_t Stopwatch::startTimestamp; millis_t Stopwatch::stopTimestamp; bool Stopwatch::stop() { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("stop")); - #endif + Stopwatch::debug(PSTR("stop")); if (isRunning() || isPaused()) { - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPrintTimerStopped(); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onPrintTimerStopped()); state = STOPPED; stopTimestamp = millis(); return true; @@ -50,14 +46,10 @@ bool Stopwatch::stop() { } bool Stopwatch::pause() { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("pause")); - #endif + Stopwatch::debug(PSTR("pause")); if (isRunning()) { - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPrintTimerPaused(); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onPrintTimerPaused()); state = PAUSED; stopTimestamp = millis(); return true; @@ -66,13 +58,9 @@ bool Stopwatch::pause() { } bool Stopwatch::start() { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("start")); - #endif + Stopwatch::debug(PSTR("start")); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPrintTimerStarted(); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onPrintTimerStarted()); if (!isRunning()) { if (isPaused()) accumulator = duration(); @@ -86,18 +74,14 @@ bool Stopwatch::start() { } void Stopwatch::resume(const millis_t with_time) { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("resume")); - #endif + Stopwatch::debug(PSTR("resume")); reset(); if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("reset")); - #endif + Stopwatch::debug(PSTR("reset")); state = STOPPED; startTimestamp = 0; @@ -106,8 +90,7 @@ void Stopwatch::reset() { } millis_t Stopwatch::duration() { - return ((isRunning() ? millis() : stopTimestamp) - - startTimestamp) / 1000UL + accumulator; + return accumulator + MS_TO_SEC((isRunning() ? millis() : stopTimestamp) - startTimestamp); } #if ENABLED(DEBUG_STOPWATCH) diff --git a/Marlin/src/libs/stopwatch.h b/Marlin/src/libs/stopwatch.h index 4aac815c8d..6e8e95a9a5 100644 --- a/Marlin/src/libs/stopwatch.h +++ b/Marlin/src/libs/stopwatch.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -114,5 +114,9 @@ class Stopwatch { */ static void debug(const char func[]); + #else + + static inline void debug(const char[]) {} + #endif }; diff --git a/Marlin/src/libs/vector_3.cpp b/Marlin/src/libs/vector_3.cpp index c0da29e702..75a30aef82 100644 --- a/Marlin/src/libs/vector_3.cpp +++ b/Marlin/src/libs/vector_3.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/libs/vector_3.h b/Marlin/src/libs/vector_3.h index bd596f2343..58428314d9 100644 --- a/Marlin/src/libs/vector_3.h +++ b/Marlin/src/libs/vector_3.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index 2ecc9299c9..72ff057628 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -37,7 +37,7 @@ */ // Change EEPROM version if the structure changes -#define EEPROM_VERSION "V76" +#define EEPROM_VERSION "V81" #define EEPROM_OFFSET 100 // Check the integrity of data offsets. @@ -50,8 +50,12 @@ #include "planner.h" #include "stepper.h" #include "temperature.h" + +#if ENABLED(DWIN_CREALITY_LCD) + #include "../lcd/dwin/dwin.h" +#endif + #include "../lcd/ultralcd.h" -#include "../core/language.h" #include "../libs/vector_3.h" // for matrix_3x3 #include "../gcode/gcode.h" #include "../MarlinCore.h" @@ -90,6 +94,10 @@ #include "../feature/powerloss.h" #endif +#if HAS_POWER_MONITOR + #include "../feature/power_monitor.h" +#endif + #include "../feature/pause.h" #if ENABLED(BACKLASH_COMPENSATION) @@ -127,20 +135,20 @@ void M710_report(const bool forReplay); #endif -#define HAS_CASE_LIGHT_BRIGHTNESS (ENABLED(CASE_LIGHT_MENU) && DISABLED(CASE_LIGHT_NO_BRIGHTNESS)) -#if HAS_CASE_LIGHT_BRIGHTNESS +#if ENABLED(CASE_LIGHT_MENU) && DISABLED(CASE_LIGHT_NO_BRIGHTNESS) #include "../feature/caselight.h" + #define HAS_CASE_LIGHT_BRIGHTNESS 1 #endif #pragma pack(push, 1) // No padding between variables -typedef struct { uint16_t X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5; } tmc_stepper_current_t; -typedef struct { uint32_t X, Y, Z, X2, Y2, Z2, Z3, Z4, 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, Z4, E0, E1, E2, E3, E4, E5; } tmc_stealth_enabled_t; +typedef struct { uint16_t X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5, E6, E7; } tmc_stepper_current_t; +typedef struct { uint32_t X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5, E6, E7; } tmc_hybrid_threshold_t; +typedef struct { int16_t X, Y, Z, X2, Y2, Z2, Z3, Z4; } tmc_sgt_t; +typedef struct { bool X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5, E6, E7; } tmc_stealth_enabled_t; // Limit an index to an array size -#define ALIM(I,ARR) _MIN(I, COUNT(ARR) - 1) +#define ALIM(I,ARR) _MIN(I, signed(COUNT(ARR) - 1)) // Defaults for reset / fill in on load static const uint32_t _DMA[] PROGMEM = DEFAULT_MAX_ACCELERATION; @@ -236,7 +244,7 @@ typedef struct SettingsDataStruct { #if ENABLED(USE_TEMP_EXT_COMPENSATION) , z_offsets_ext[COUNT(temp_comp.z_offsets_ext)] // M871 E I V #endif - ; + ; #endif // @@ -249,11 +257,12 @@ typedef struct SettingsDataStruct { // #if ENABLED(DELTA) float delta_height; // M666 H - abc_float_t delta_endstop_adj; // M666 XYZ + abc_float_t delta_endstop_adj; // M666 X Y Z 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 + abc_float_t delta_tower_angle_trim, // M665 X Y Z + delta_diagonal_rod_trim; // M665 A B C #elif HAS_EXTRA_ENDSTOPS float x2_endstop_adj, // M666 X y2_endstop_adj, // M666 Y @@ -273,11 +282,11 @@ typedef struct SettingsDataStruct { #endif // - // ULTIPANEL + // Material Presets // - 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 + #if PREHEAT_COUNT + preheat_t ui_material_preset[PREHEAT_COUNT]; // M145 S0 H B F + #endif // // PIDTEMP @@ -297,6 +306,11 @@ typedef struct SettingsDataStruct { user_thermistor_t user_thermistor[USER_THERMISTORS]; // M305 P0 R4700 T100000 B3950 #endif + // + // Power monitor + // + uint8_t power_monitor_flags; // M430 I V W + // // HAS_LCD_CONTRAST // @@ -321,15 +335,16 @@ typedef struct SettingsDataStruct { // // !NO_VOLUMETRIC // - bool parser_volumetric_enabled; // M200 D parser.volumetric_enabled + bool parser_volumetric_enabled; // M200 S parser.volumetric_enabled float planner_filament_size[EXTRUDERS]; // M200 T D planner.filament_size[] + float planner_volumetric_extruder_limit[EXTRUDERS]; // M200 T L planner.volumetric_extruder_limit[] // // HAS_TRINAMIC_CONFIG // tmc_stepper_current_t tmc_stepper_current; // M906 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5 tmc_hybrid_threshold_t tmc_hybrid_threshold; // M913 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5 - tmc_sgt_t tmc_sgt; // M914 X Y Z X2 + tmc_sgt_t tmc_sgt; // M914 X Y Z X2 Y2 Z2 Z3 Z4 tmc_stealth_enabled_t tmc_stealth_enabled; // M569 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5 // @@ -390,7 +405,7 @@ typedef struct SettingsDataStruct { } SettingsData; -//static_assert(sizeof(SettingsData) <= E2END + 1, "EEPROM too small to contain SettingsData!"); +//static_assert(sizeof(SettingsData) <= MARLIN_EEPROM_SIZE, "EEPROM too small to contain SettingsData!"); MarlinSettings settings; @@ -412,13 +427,9 @@ void MarlinSettings::postprocess() { // 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 + TERN_(DELTA, recalc_delta_settings()); - #if ENABLED(PIDTEMP) - thermalManager.updatePID(); - #endif + TERN_(PIDTEMP, thermalManager.updatePID()); #if DISABLED(NO_VOLUMETRICS) planner.calculate_volumetric_multipliers(); @@ -433,29 +444,17 @@ void MarlinSettings::postprocess() { update_software_endstops((AxisEnum)i); } - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - set_z_fade_height(new_z_fade_height, false); // false = no report - #endif + TERN_(ENABLE_LEVELING_FADE_HEIGHT, set_z_fade_height(new_z_fade_height, false)); // false = no report - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - refresh_bed_level(); - #endif + TERN_(AUTO_BED_LEVELING_BILINEAR, refresh_bed_level()); - #if HAS_MOTOR_CURRENT_PWM - stepper.refresh_motor_power(); - #endif + TERN_(HAS_MOTOR_CURRENT_PWM, stepper.refresh_motor_power()); - #if ENABLED(FWRETRACT) - fwretract.refresh_autoretract(); - #endif + TERN_(FWRETRACT, fwretract.refresh_autoretract()); - #if HAS_LINEAR_E_JERK - planner.recalculate_max_e_jerk(); - #endif + TERN_(HAS_LINEAR_E_JERK, planner.recalculate_max_e_jerk()); - #if HAS_CASE_LIGHT_BRIGHTNESS - update_case_light(); - #endif + TERN_(HAS_CASE_LIGHT_BRIGHTNESS, update_case_light()); // Refresh steps_to_mm with the reciprocal of axis_steps_per_mm // and init stepper.count[], planner.position[] with current_position @@ -586,9 +585,7 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(planner_max_jerk); #endif - #if ENABLED(CLASSIC_JERK) - dummyf = 0.02f; - #endif + TERN_(CLASSIC_JERK, dummyf = 0.02f); EEPROM_WRITE(TERN(CLASSIC_JERK, dummyf, planner.junction_deviation_mm)); } @@ -623,7 +620,7 @@ void MarlinSettings::postprocess() { #else constexpr bool runout_sensor_enabled = true; #endif - #if HAS_FILAMENT_SENSOR && defined(FILAMENT_RUNOUT_DISTANCE_MM) + #if HAS_FILAMENT_RUNOUT_DISTANCE const float &runout_distance_mm = runout.runout_distance(); #else constexpr float runout_distance_mm = 0; @@ -779,6 +776,7 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(delta_diagonal_rod); // 1 float EEPROM_WRITE(delta_segments_per_second); // 1 float EEPROM_WRITE(delta_tower_angle_trim); // 3 floats + EEPROM_WRITE(delta_diagonal_rod_trim); // 3 floats #elif HAS_EXTRA_ENDSTOPS @@ -815,23 +813,10 @@ void MarlinSettings::postprocess() { // // 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); - } + #if PREHEAT_COUNT + _FIELD_TEST(ui_material_preset); + EEPROM_WRITE(ui.material_preset); + #endif // // PIDTEMP @@ -890,6 +875,19 @@ void MarlinSettings::postprocess() { } #endif + // + // Power monitor + // + { + #if HAS_POWER_MONITOR + const uint8_t &power_monitor_flags = power_monitor.flags; + #else + constexpr uint8_t power_monitor_flags = 0x00; + #endif + _FIELD_TEST(power_monitor_flags); + EEPROM_WRITE(power_monitor_flags); + } + // // LCD Contrast // @@ -954,12 +952,20 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(parser.volumetric_enabled); EEPROM_WRITE(planner.filament_size); + #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) + EEPROM_WRITE(planner.volumetric_extruder_limit); + #else + dummyf = DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT; + for (uint8_t q = EXTRUDERS; q--;) EEPROM_WRITE(dummyf); + #endif #else const bool volumetric_enabled = false; - dummyf = DEFAULT_NOMINAL_FILAMENT_DIA; EEPROM_WRITE(volumetric_enabled); + dummyf = DEFAULT_NOMINAL_FILAMENT_DIA; + for (uint8_t q = EXTRUDERS; q--;) EEPROM_WRITE(dummyf); + dummyf = DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT; for (uint8_t q = EXTRUDERS; q--;) EEPROM_WRITE(dummyf); #endif @@ -1131,18 +1137,14 @@ void MarlinSettings::postprocess() { { 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 + TERN_(X_SENSORLESS, tmc_sgt.X = stepperX.homing_threshold()); + TERN_(X2_SENSORLESS, tmc_sgt.X2 = stepperX2.homing_threshold()); + TERN_(Y_SENSORLESS, tmc_sgt.Y = stepperY.homing_threshold()); + TERN_(Y2_SENSORLESS, tmc_sgt.Y2 = stepperY2.homing_threshold()); + TERN_(Z_SENSORLESS, tmc_sgt.Z = stepperZ.homing_threshold()); + TERN_(Z2_SENSORLESS, tmc_sgt.Z2 = stepperZ2.homing_threshold()); + TERN_(Z3_SENSORLESS, tmc_sgt.Z3 = stepperZ3.homing_threshold()); + TERN_(Z4_SENSORLESS, tmc_sgt.Z4 = stepperZ4.homing_threshold()); #endif EEPROM_WRITE(tmc_sgt); } @@ -1361,9 +1363,9 @@ void MarlinSettings::postprocess() { store_mesh(ubl.storage_slot); #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onConfigurationStoreWritten(!eeprom_error); - #endif + if (!eeprom_error) LCD_MESSAGEPGM(MSG_SETTINGS_STORED); + + TERN_(EXTENSIBLE_UI, ExtUI::onConfigurationStoreWritten(!eeprom_error)); return !eeprom_error; } @@ -1390,9 +1392,7 @@ void MarlinSettings::postprocess() { } DEBUG_ECHO_START(); DEBUG_ECHOLNPAIR("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")"); - #if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT) - ui.set_status_P(GET_TEXT(MSG_ERR_EEPROM_VERSION)); - #endif + TERN(EEPROM_AUTO_INIT,,ui.eeprom_alert_version()); eeprom_error = true; } else { @@ -1485,7 +1485,7 @@ void MarlinSettings::postprocess() { float runout_distance_mm; EEPROM_READ(runout_distance_mm); - #if HAS_FILAMENT_SENSOR && defined(FILAMENT_RUNOUT_DISTANCE_MM) + #if HAS_FILAMENT_RUNOUT_DISTANCE if (!validating) runout.set_runout_distance(runout_distance_mm); #endif } @@ -1640,6 +1640,7 @@ void MarlinSettings::postprocess() { EEPROM_READ(delta_diagonal_rod); // 1 float EEPROM_READ(delta_segments_per_second); // 1 float EEPROM_READ(delta_tower_angle_trim); // 3 floats + EEPROM_READ(delta_diagonal_rod_trim); // 3 floats #elif HAS_EXTRA_ENDSTOPS @@ -1673,21 +1674,10 @@ void MarlinSettings::postprocess() { // // 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 - } + #if PREHEAT_COUNT + _FIELD_TEST(ui_material_preset); + EEPROM_READ(ui.material_preset); + #endif // // Hotend PID @@ -1702,12 +1692,8 @@ void MarlinSettings::postprocess() { 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 + TERN_(PID_EXTRUSION_SCALING, PID_PARAM(Kc, e) = pidcf.Kc); + TERN_(PID_FAN_SCALING, PID_PARAM(Kf, e) = pidcf.Kf); } #endif } @@ -1752,6 +1738,19 @@ void MarlinSettings::postprocess() { } #endif + // + // Power monitor + // + { + #if HAS_POWER_MONITOR + uint8_t &power_monitor_flags = power_monitor.flags; + #else + uint8_t power_monitor_flags; + #endif + _FIELD_TEST(power_monitor_flags); + EEPROM_READ(power_monitor_flags); + } + // // LCD Contrast // @@ -1760,9 +1759,7 @@ void MarlinSettings::postprocess() { int16_t lcd_contrast; EEPROM_READ(lcd_contrast); - #if HAS_LCD_CONTRAST - ui.set_contrast(lcd_contrast); - #endif + TERN_(HAS_LCD_CONTRAST, ui.set_contrast(lcd_contrast)); } // @@ -1818,6 +1815,7 @@ void MarlinSettings::postprocess() { struct { bool volumetric_enabled; float filament_size[EXTRUDERS]; + float volumetric_extruder_limit[EXTRUDERS]; } storage; _FIELD_TEST(parser_volumetric_enabled); @@ -1827,6 +1825,9 @@ void MarlinSettings::postprocess() { if (!validating) { parser.volumetric_enabled = storage.volumetric_enabled; COPY(planner.filament_size, storage.filament_size); + #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) + COPY(planner.volumetric_extruder_limit, storage.volumetric_extruder_limit); + #endif } #endif } @@ -1962,9 +1963,6 @@ void MarlinSettings::postprocess() { // // TMC StallGuard threshold. - // X and X2 use the same value - // Y and Y2 use the same value - // Z, Z2, Z3 and Z4 use the same value // { tmc_sgt_t tmc_sgt; @@ -1972,39 +1970,14 @@ void MarlinSettings::postprocess() { 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 - #if AXIS_HAS_STALLGUARD(Z4) - stepperZ4.homing_threshold(tmc_sgt.Z); - #endif - #endif + TERN_(X_SENSORLESS, stepperX.homing_threshold(tmc_sgt.X)); + TERN_(X2_SENSORLESS, stepperX2.homing_threshold(tmc_sgt.X2)); + TERN_(Y_SENSORLESS, stepperY.homing_threshold(tmc_sgt.Y)); + TERN_(Y2_SENSORLESS, stepperY2.homing_threshold(tmc_sgt.Y2)); + TERN_(Z_SENSORLESS, stepperZ.homing_threshold(tmc_sgt.Z)); + TERN_(Z2_SENSORLESS, stepperZ2.homing_threshold(tmc_sgt.Z2)); + TERN_(Z3_SENSORLESS, stepperZ3.homing_threshold(tmc_sgt.Z3)); + TERN_(Z4_SENSORLESS, stepperZ4.homing_threshold(tmc_sgt.Z4)); } #endif } @@ -2198,17 +2171,13 @@ void MarlinSettings::postprocess() { if (eeprom_error) { DEBUG_ECHO_START(); DEBUG_ECHOLNPAIR("Index: ", int(eeprom_index - (EEPROM_OFFSET)), " Size: ", datasize()); - #if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT) - ui.set_status_P(GET_TEXT(MSG_ERR_EEPROM_INDEX)); - #endif + TERN(EEPROM_AUTO_INIT,,ui.eeprom_alert_index()); } else if (working_crc != stored_crc) { eeprom_error = true; DEBUG_ERROR_START(); DEBUG_ECHOLNPAIR("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!"); - #if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT) - ui.set_status_P(GET_TEXT(MSG_ERR_EEPROM_CRC)); - #endif + TERN(EEPROM_AUTO_INIT,,ui.eeprom_alert_crc()); } else if (!validating) { DEBUG_ECHO_START(); @@ -2283,9 +2252,7 @@ void MarlinSettings::postprocess() { bool MarlinSettings::load() { if (validate()) { const bool success = _load(); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onConfigurationStoreRead(success); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onConfigurationStoreRead(success)); return success; } reset(); @@ -2427,12 +2394,10 @@ void MarlinSettings::reset() { #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 + TERN_(HAS_CLASSIC_E_JERK, planner.max_jerk.e = DEFAULT_EJERK;); #endif - #if DISABLED(CLASSIC_JERK) + #if HAS_JUNCTION_DEVIATION planner.junction_deviation_mm = float(JUNCTION_DEVIATION_MM); #endif @@ -2442,9 +2407,7 @@ void MarlinSettings::reset() { home_offset.reset(); #endif - #if HAS_HOTEND_OFFSET - reset_hotend_offsets(); - #endif + TERN_(HAS_HOTEND_OFFSET, reset_hotend_offsets()); // // Filament Runout Sensor @@ -2453,9 +2416,7 @@ void MarlinSettings::reset() { #if HAS_FILAMENT_SENSOR runout.enabled = true; runout.reset(); - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - runout.set_runout_distance(FILAMENT_RUNOUT_DISTANCE_MM); - #endif + TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, runout.set_runout_distance(FILAMENT_RUNOUT_DISTANCE_MM)); #endif // @@ -2464,16 +2425,32 @@ void MarlinSettings::reset() { #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; + toolchange_settings.swap_length = TOOLCHANGE_FS_LENGTH; + toolchange_settings.extra_resume = TOOLCHANGE_FS_EXTRA_RESUME_LENGTH; + toolchange_settings.retract_speed = TOOLCHANGE_FS_RETRACT_SPEED; + toolchange_settings.unretract_speed = TOOLCHANGE_FS_UNRETRACT_SPEED; + toolchange_settings.extra_prime = TOOLCHANGE_FS_EXTRA_PRIME; + toolchange_settings.prime_speed = TOOLCHANGE_FS_PRIME_SPEED; + toolchange_settings.fan_speed = TOOLCHANGE_FS_FAN_SPEED; + toolchange_settings.fan_time = TOOLCHANGE_FS_FAN_TIME; #endif + + #if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED) + enable_first_prime = false; + #endif + #if ENABLED(TOOLCHANGE_PARK) constexpr xyz_pos_t tpxy = TOOLCHANGE_PARK_XY; + toolchange_settings.enable_park = true; toolchange_settings.change_point = tpxy; #endif + toolchange_settings.z_raise = TOOLCHANGE_ZRAISE; + + #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) + migration = migration_defaults; + #endif + #endif #if ENABLED(BACKLASH_GCODE) @@ -2485,37 +2462,23 @@ void MarlinSettings::reset() { #endif #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onFactoryReset(); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onFactoryReset()); // // Case Light Brightness // - - #if HAS_CASE_LIGHT_BRIGHTNESS - case_light_brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS; - #endif + TERN_(HAS_CASE_LIGHT_BRIGHTNESS, case_light_brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS); // // Magnetic Parking Extruder // - - #if ENABLED(MAGNETIC_PARKING_EXTRUDER) - mpe_settings_init(); - #endif + TERN_(MAGNETIC_PARKING_EXTRUDER, mpe_settings_init()); // // Global Leveling // - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - new_z_fade_height = 0.0; - #endif - - #if HAS_LEVELING - reset_bed_level(); - #endif + TERN_(ENABLE_LEVELING_FADE_HEIGHT, new_z_fade_height = 0.0); + TERN_(HAS_LEVELING, reset_bed_level()); #if HAS_BED_PROBE constexpr float dpo[] = NOZZLE_TO_PROBE_OFFSET; @@ -2531,18 +2494,12 @@ void MarlinSettings::reset() { // // Z Stepper Auto-alignment points // - - #if ENABLED(Z_STEPPER_AUTO_ALIGN) - z_stepper_align.reset_to_default(); - #endif + TERN_(Z_STEPPER_AUTO_ALIGN, z_stepper_align.reset_to_default()); // // Servo Angles // - - #if ENABLED(EDITABLE_SERVO_ANGLES) - COPY(servo_angles, base_servo_angles); // When not editable only one copy of servo angles exists - #endif + TERN_(EDITABLE_SERVO_ANGLES, COPY(servo_angles, base_servo_angles)); // When not editable only one copy of servo angles exists // // BLTOUCH @@ -2556,14 +2513,14 @@ void MarlinSettings::reset() { // #if ENABLED(DELTA) - const abc_float_t adj = DELTA_ENDSTOP_ADJ, dta = DELTA_TOWER_ANGLE_TRIM; + const abc_float_t adj = DELTA_ENDSTOP_ADJ, dta = DELTA_TOWER_ANGLE_TRIM, ddr = DELTA_DIAGONAL_ROD_TRIM_TOWER; 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; - + delta_diagonal_rod_trim = ddr; #endif #if ENABLED(X_DUAL_ENDSTOPS) @@ -2602,14 +2559,27 @@ void MarlinSettings::reset() { // // 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; + #if PREHEAT_COUNT + #if HAS_HOTEND + constexpr uint16_t hpre[] = ARRAY_N(PREHEAT_COUNT, PREHEAT_1_TEMP_HOTEND, PREHEAT_2_TEMP_HOTEND, PREHEAT_3_TEMP_HOTEND, PREHEAT_4_TEMP_HOTEND, PREHEAT_5_TEMP_HOTEND); + #endif + #if HAS_HEATED_BED + constexpr uint16_t bpre[] = ARRAY_N(PREHEAT_COUNT, PREHEAT_1_TEMP_BED, PREHEAT_2_TEMP_BED, PREHEAT_3_TEMP_BED, PREHEAT_4_TEMP_BED, PREHEAT_5_TEMP_BED); + #endif + #if HAS_FAN + constexpr uint8_t fpre[] = ARRAY_N(PREHEAT_COUNT, PREHEAT_1_FAN_SPEED, PREHEAT_2_FAN_SPEED, PREHEAT_3_FAN_SPEED, PREHEAT_4_FAN_SPEED, PREHEAT_5_FAN_SPEED); + #endif + LOOP_L_N(i, PREHEAT_COUNT) { + #if HAS_HOTEND + ui.material_preset[i].hotend_temp = hpre[i]; + #endif + #if HAS_HEATED_BED + ui.material_preset[i].bed_temp = bpre[i]; + #endif + #if HAS_FAN + ui.material_preset[i].fan_speed = fpre[i]; + #endif + } #endif // @@ -2617,27 +2587,66 @@ void MarlinSettings::reset() { // #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_PARAMS_PER_HOTEND) + constexpr float defKp[] = + #ifdef DEFAULT_Kp_LIST + DEFAULT_Kp_LIST + #else + ARRAY_BY_HOTENDS1(DEFAULT_Kp) + #endif + , defKi[] = + #ifdef DEFAULT_Ki_LIST + DEFAULT_Ki_LIST + #else + ARRAY_BY_HOTENDS1(DEFAULT_Ki) + #endif + , defKd[] = + #ifdef DEFAULT_Kd_LIST + DEFAULT_Kd_LIST + #else + ARRAY_BY_HOTENDS1(DEFAULT_Kd) + #endif + ; + static_assert(WITHIN(COUNT(defKp), 1, HOTENDS), "DEFAULT_Kp_LIST must have between 1 and HOTENDS items."); + static_assert(WITHIN(COUNT(defKi), 1, HOTENDS), "DEFAULT_Ki_LIST must have between 1 and HOTENDS items."); + static_assert(WITHIN(COUNT(defKd), 1, HOTENDS), "DEFAULT_Kd_LIST must have between 1 and HOTENDS items."); #if ENABLED(PID_EXTRUSION_SCALING) - PID_PARAM(Kc, e) = DEFAULT_Kc; + constexpr float defKc[] = + #ifdef DEFAULT_Kc_LIST + DEFAULT_Kc_LIST + #else + ARRAY_BY_HOTENDS1(DEFAULT_Kc) + #endif + ; + static_assert(WITHIN(COUNT(defKc), 1, HOTENDS), "DEFAULT_Kc_LIST must have between 1 and HOTENDS items."); #endif - #if ENABLED(PID_FAN_SCALING) - PID_PARAM(Kf, e) = DEFAULT_Kf; + constexpr float defKf[] = + #ifdef DEFAULT_Kf_LIST + DEFAULT_Kf_LIST + #else + ARRAY_BY_HOTENDS1(DEFAULT_Kf) + #endif + ; + static_assert(WITHIN(COUNT(defKf), 1, HOTENDS), "DEFAULT_Kf_LIST must have between 1 and HOTENDS items."); #endif + #define PID_DEFAULT(N,E) def##N[E] + #else + #define PID_DEFAULT(N,E) DEFAULT_##N + #endif + HOTEND_LOOP() { + PID_PARAM(Kp, e) = float(PID_DEFAULT(Kp, ALIM(e, defKp))); + PID_PARAM(Ki, e) = scalePID_i(PID_DEFAULT(Ki, ALIM(e, defKi))); + PID_PARAM(Kd, e) = scalePID_d(PID_DEFAULT(Kd, ALIM(e, defKd))); + TERN_(PID_EXTRUSION_SCALING, PID_PARAM(Kc, e) = float(PID_DEFAULT(Kc, ALIM(e, defKc)))); + TERN_(PID_FAN_SCALING, PID_PARAM(Kf, e) = float(PID_DEFAULT(Kf, ALIM(e, defKf)))); } #endif // // PID Extrusion Scaling // - - #if ENABLED(PID_EXTRUSION_SCALING) - thermalManager.lpq_len = 20; // Default last-position-queue size - #endif + TERN_(PID_EXTRUSION_SCALING, thermalManager.lpq_len = 20); // Default last-position-queue size // // Heated Bed PID @@ -2652,67 +2661,48 @@ void MarlinSettings::reset() { // // User-Defined Thermistors // + TERN_(HAS_USER_THERMISTORS, thermalManager.reset_user_thermistors()); - #if HAS_USER_THERMISTORS - thermalManager.reset_user_thermistors(); - #endif + // + // Power Monitor + // + TERN_(POWER_MONITOR, power_monitor.reset()); // // LCD Contrast // - - #if HAS_LCD_CONTRAST - ui.set_contrast(DEFAULT_LCD_CONTRAST); - #endif + TERN_(HAS_LCD_CONTRAST, ui.set_contrast(DEFAULT_LCD_CONTRAST)); // // Controller Fan // - #if ENABLED(USE_CONTROLLER_FAN) - controllerFan.reset(); - #endif + TERN_(USE_CONTROLLER_FAN, controllerFan.reset()); // // Power-Loss Recovery // - - #if ENABLED(POWER_LOSS_RECOVERY) - recovery.enable(ENABLED(PLR_ENABLED_DEFAULT)); - #endif + TERN_(POWER_LOSS_RECOVERY, recovery.enable(ENABLED(PLR_ENABLED_DEFAULT))); // // Firmware Retraction // - - #if ENABLED(FWRETRACT) - fwretract.reset(); - #endif + TERN_(FWRETRACT, fwretract.reset()); // // Volumetric & Filament Size // #if DISABLED(NO_VOLUMETRICS) - - parser.volumetric_enabled = - #if ENABLED(VOLUMETRIC_DEFAULT_ON) - true - #else - false - #endif - ; + parser.volumetric_enabled = ENABLED(VOLUMETRIC_DEFAULT_ON); LOOP_L_N(q, COUNT(planner.filament_size)) planner.filament_size[q] = DEFAULT_NOMINAL_FILAMENT_DIA; - + #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) + LOOP_L_N(q, COUNT(planner.volumetric_extruder_limit)) + planner.volumetric_extruder_limit[q] = DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT; + #endif #endif - endstops.enable_globally( - #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) - true - #else - false - #endif - ); + endstops.enable_globally(ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT)); reset_stepper_drivers(); @@ -2723,9 +2713,7 @@ void MarlinSettings::reset() { #if ENABLED(LIN_ADVANCE) LOOP_L_N(i, EXTRUDERS) { planner.extruder_advance_K[i] = LIN_ADVANCE_K; - #if ENABLED(EXTRA_LIN_ADVANCE_K) - other_extruder_advance_K[i] = LIN_ADVANCE_K; - #endif + TERN_(EXTRA_LIN_ADVANCE_K, other_extruder_advance_K[i] = LIN_ADVANCE_K); } #endif @@ -2742,15 +2730,11 @@ void MarlinSettings::reset() { // // CNC Coordinate System // - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - (void)gcode.select_coordinate_system(-1); // Go back to machine space - #endif + TERN_(CNC_COORDINATE_SYSTEMS, (void)gcode.select_coordinate_system(-1)); // Go back to machine space // // Skew Correction // - #if ENABLED(SKEW_CORRECTION_GCODE) planner.skew_factor.xy = XY_SKEW_FACTOR; #if ENABLED(SKEW_CORRECTION_FOR_Z) @@ -2762,7 +2746,6 @@ void MarlinSettings::reset() { // // Advanced Pause filament load & unload lengths // - #if ENABLED(ADVANCED_PAUSE_FEATURE) LOOP_L_N(e, EXTRUDERS) { fc_settings[e].unload_length = FILAMENT_CHANGE_UNLOAD_LENGTH; @@ -2775,9 +2758,7 @@ void MarlinSettings::reset() { DEBUG_ECHO_START(); DEBUG_ECHOLNPGM("Hardcoded Default Settings Loaded"); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onFactoryReset(); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onFactoryReset()); } #if DISABLED(DISABLE_M503) @@ -2871,7 +2852,7 @@ void MarlinSettings::reset() { SERIAL_EOL(); - #if DISABLED(NO_VOLUMETRICS) + #if EXTRUDERS && DISABLED(NO_VOLUMETRICS) /** * Volumetric extrusion M200 @@ -2886,20 +2867,26 @@ void MarlinSettings::reset() { #if EXTRUDERS == 1 CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR(" M200 D", LINEAR_UNIT(planner.filament_size[0])); - #elif EXTRUDERS + SERIAL_ECHOLNPAIR(" M200 S", int(parser.volumetric_enabled) + , " D", LINEAR_UNIT(planner.filament_size[0]) + #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) + , " L", LINEAR_UNIT(planner.volumetric_extruder_limit[0]) + #endif + ); + #else LOOP_L_N(i, EXTRUDERS) { CONFIG_ECHO_START(); - SERIAL_ECHOPGM(" M200"); - if (i) SERIAL_ECHOPAIR_P(SP_T_STR, int(i)); - SERIAL_ECHOLNPAIR(" D", LINEAR_UNIT(planner.filament_size[i])); + SERIAL_ECHOLNPAIR(" M200 T", int(i) + , " D", LINEAR_UNIT(planner.filament_size[i]) + #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) + , " L", LINEAR_UNIT(planner.volumetric_extruder_limit[i]) + #endif + ); } + CONFIG_ECHO_START(); + SERIAL_ECHOLNPAIR(" M200 S", int(parser.volumetric_enabled)); #endif - - if (!parser.volumetric_enabled) - CONFIG_ECHO_MSG(" M200 D0"); - - #endif // !NO_VOLUMETRICS + #endif // EXTRUDERS && !NO_VOLUMETRICS CONFIG_ECHO_HEADING("Steps per unit:"); report_M92(!forReplay); @@ -2915,8 +2902,8 @@ void MarlinSettings::reset() { #endif ); #if ENABLED(DISTINCT_E_FACTORS) - CONFIG_ECHO_START(); LOOP_L_N(i, E_STEPPERS) { + CONFIG_ECHO_START(); SERIAL_ECHOLNPAIR_P( PSTR(" M203 T"), (int)i , SP_E_STR, VOLUMETRIC_UNIT(planner.settings.max_feedrate_mm_s[E_AXIS_N(i)]) @@ -2935,12 +2922,13 @@ void MarlinSettings::reset() { #endif ); #if ENABLED(DISTINCT_E_FACTORS) - CONFIG_ECHO_START(); - LOOP_L_N(i, E_STEPPERS) + LOOP_L_N(i, E_STEPPERS) { + CONFIG_ECHO_START(); 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"); @@ -2953,14 +2941,12 @@ void MarlinSettings::reset() { CONFIG_ECHO_HEADING( "Advanced: B S T" - #if DISABLED(CLASSIC_JERK) + #if HAS_JUNCTION_DEVIATION " J" #endif #if HAS_CLASSIC_JERK " X Y Z" - #if HAS_CLASSIC_E_JERK - " E" - #endif + TERN_(HAS_CLASSIC_E_JERK, " E") #endif ); CONFIG_ECHO_START(); @@ -2968,7 +2954,7 @@ void MarlinSettings::reset() { PSTR(" M205 B"), LINEAR_UNIT(planner.settings.min_segment_time_us) , PSTR(" S"), LINEAR_UNIT(planner.settings.min_feedrate_mm_s) , SP_T_STR, LINEAR_UNIT(planner.settings.min_travel_feedrate_mm_s) - #if DISABLED(CLASSIC_JERK) + #if HAS_JUNCTION_DEVIATION , PSTR(" J"), LINEAR_UNIT(planner.junction_deviation_mm) #endif #if HAS_CLASSIC_JERK @@ -3130,7 +3116,7 @@ void MarlinSettings::reset() { , SP_Z_STR, LINEAR_UNIT(delta_endstop_adj.c) ); - CONFIG_ECHO_HEADING("Delta settings: L R H S XYZ"); + CONFIG_ECHO_HEADING("Delta settings: L R H S XYZ ABC"); CONFIG_ECHO_START(); SERIAL_ECHOLNPAIR_P( PSTR(" M665 L"), LINEAR_UNIT(delta_diagonal_rod) @@ -3140,6 +3126,9 @@ void MarlinSettings::reset() { , 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) + , PSTR(" A"), LINEAR_UNIT(delta_diagonal_rod_trim.a) + , PSTR(" B"), LINEAR_UNIT(delta_diagonal_rod_trim.b) + , PSTR(" C"), LINEAR_UNIT(delta_diagonal_rod_trim.c) ); #elif HAS_EXTRA_ENDSTOPS @@ -3169,16 +3158,22 @@ void MarlinSettings::reset() { #endif // [XYZ]_DUAL_ENDSTOPS - #if HOTENDS && HAS_LCD_MENU + #if PREHEAT_COUNT CONFIG_ECHO_HEADING("Material heatup parameters:"); - LOOP_L_N(i, COUNT(ui.preheat_hotend_temp)) { + LOOP_L_N(i, PREHEAT_COUNT) { 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]) + SERIAL_ECHOLNPAIR_P( + PSTR(" M145 S"), (int)i + #if HAS_HOTEND + , PSTR(" H"), TEMP_UNIT(ui.material_preset[i].hotend_temp) + #endif + #if HAS_HEATED_BED + , SP_B_STR, TEMP_UNIT(ui.material_preset[i].bed_temp) + #endif + #if HAS_FAN + , PSTR(" F"), ui.material_preset[i].fan_speed + #endif ); } @@ -3192,7 +3187,7 @@ void MarlinSettings::reset() { HOTEND_LOOP() { CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P( - #if HOTENDS > 1 && ENABLED(PID_PARAMS_PER_HOTEND) + #if ENABLED(PID_PARAMS_PER_HOTEND) PSTR(" M301 E"), e, SP_P_STR #else @@ -3203,7 +3198,7 @@ void MarlinSettings::reset() { , PSTR(" D"), unscalePID_d(PID_PARAM(Kd, e)) ); #if ENABLED(PID_EXTRUSION_SCALING) - SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, e)); + SERIAL_ECHOPAIR_P(SP_C_STR, PID_PARAM(Kc, e)); if (e == 0) SERIAL_ECHOPAIR(" L", thermalManager.lpq_len); #endif #if ENABLED(PID_FAN_SCALING) @@ -3236,9 +3231,7 @@ void MarlinSettings::reset() { SERIAL_ECHOLNPAIR(" M250 C", ui.contrast); #endif - #if ENABLED(CONTROLLER_FAN_EDITABLE) - M710_report(forReplay); - #endif + TERN_(CONTROLLER_FAN_EDITABLE, M710_report(forReplay)); #if ENABLED(POWER_LOSS_RECOVERY) CONFIG_ECHO_HEADING("Power-Loss Recovery:"); @@ -3396,34 +3389,30 @@ void MarlinSettings::reset() { 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) + #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 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) + #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 SERIAL_EOL(); #endif @@ -3545,9 +3534,9 @@ void MarlinSettings::reset() { 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); + if (chop_x) SERIAL_ECHOPGM_P(SP_X_STR); + if (chop_y) SERIAL_ECHOPGM_P(SP_Y_STR); + if (chop_z) SERIAL_ECHOPGM_P(SP_Z_STR); SERIAL_EOL(); } @@ -3569,9 +3558,9 @@ void MarlinSettings::reset() { 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); + if (chop_x2) SERIAL_ECHOPGM_P(SP_X_STR); + if (chop_y2) SERIAL_ECHOPGM_P(SP_Y_STR); + if (chop_z2) SERIAL_ECHOPGM_P(SP_Z_STR); SERIAL_EOL(); } @@ -3617,12 +3606,14 @@ void MarlinSettings::reset() { */ #if ENABLED(LIN_ADVANCE) CONFIG_ECHO_HEADING("Linear Advance:"); - CONFIG_ECHO_START(); #if EXTRUDERS < 2 + CONFIG_ECHO_START(); SERIAL_ECHOLNPAIR(" M900 K", planner.extruder_advance_K[0]); #else - LOOP_L_N(i, EXTRUDERS) + LOOP_L_N(i, EXTRUDERS) { + CONFIG_ECHO_START(); SERIAL_ECHOLNPAIR(" M900 T", int(i), " K", planner.extruder_advance_K[i]); + } #endif #endif @@ -3675,7 +3666,7 @@ void MarlinSettings::reset() { CONFIG_ECHO_START(); SERIAL_ECHOLNPAIR( " M412 S", int(runout.enabled) - #ifdef FILAMENT_RUNOUT_DISTANCE_MM + #if HAS_FILAMENT_RUNOUT_DISTANCE , " D", LINEAR_UNIT(runout.runout_distance()) #endif ); diff --git a/Marlin/src/module/configuration_store.h b/Marlin/src/module/configuration_store.h index f2e84c9664..c654b11bd5 100644 --- a/Marlin/src/module/configuration_store.h +++ b/Marlin/src/module/configuration_store.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -38,9 +38,7 @@ class MarlinSettings { reset(); #if ENABLED(EEPROM_SETTINGS) const bool success = save(); - #if ENABLED(EEPROM_CHITCHAT) - if (success) report(); - #endif + if (TERN0(EEPROM_CHITCHAT, success)) report(); return success; #else return true; diff --git a/Marlin/src/module/delta.cpp b/Marlin/src/module/delta.cpp index 8821236fd1..9361729462 100644 --- a/Marlin/src/module/delta.cpp +++ b/Marlin/src/module/delta.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -59,6 +59,7 @@ 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; +abc_float_t delta_diagonal_rod_trim; float delta_safe_distance_from_top(); @@ -67,17 +68,16 @@ float delta_safe_distance_from_top(); * 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; + constexpr abc_float_t trt = DELTA_RADIUS_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)); + delta_diagonal_rod_2_tower.set(sq(delta_diagonal_rod + delta_diagonal_rod_trim.a), + sq(delta_diagonal_rod + delta_diagonal_rod_trim.b), + sq(delta_diagonal_rod + delta_diagonal_rod_trim.c)); update_software_endstops(Z_AXIS); set_all_unhomed(); } @@ -95,7 +95,7 @@ void recalc_delta_settings() { float delta_calibration_radius() { return calibration_radius_factor * ( #if HAS_BED_PROBE - FLOOR((DELTA_PRINTABLE_RADIUS) - _MAX(HYPOT(probe.offset_xy.x, probe.offset_xy.y), MIN_PROBE_EDGE)) + FLOOR((DELTA_PRINTABLE_RADIUS) - _MAX(HYPOT(probe.offset_xy.x, probe.offset_xy.y), PROBING_MARGIN)) #else DELTA_PRINTABLE_RADIUS #endif @@ -122,7 +122,7 @@ void recalc_delta_settings() { #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); \ + SERIAL_ECHOLNPAIR_P(PSTR("Delta A"), delta.a, SP_B_STR, delta.b, SP_C_STR, delta.c); \ }while(0) void inverse_kinematics(const xyz_pos_t &raw) { @@ -233,7 +233,8 @@ void forward_kinematics_DELTA(const float &z1, const float &z2, const float &z3) * This is like quick_home_xy() but for 3 towers. */ void home_delta() { - if (DEBUGGING(LEVELING)) DEBUG_POS(">>> home_delta", current_position); + DEBUG_SECTION(log_home_delta, "home_delta", DEBUGGING(LEVELING)); + // Init the current position of all carriages to 0,0,0 current_position.reset(); destination.reset(); @@ -249,11 +250,7 @@ void home_delta() { #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 - ); + current_position.z = (delta_height + 10 - TERN0(HAS_BED_PROBE, probe.offset.z)); line_to_current_position(homing_feedrate(Z_AXIS)); planner.synchronize(); @@ -280,15 +277,13 @@ void home_delta() { sync_plan_position(); - #if DISABLED(DELTA_HOME_TO_SAFE_ZONE) && defined(HOMING_BACKOFF_MM) - constexpr xyz_float_t endstop_backoff = HOMING_BACKOFF_MM; + #if DISABLED(DELTA_HOME_TO_SAFE_ZONE) && defined(HOMING_BACKOFF_POST_MM) + constexpr xyz_float_t endstop_backoff = HOMING_BACKOFF_POST_MM; if (endstop_backoff.z) { current_position.z -= ABS(endstop_backoff.z) * Z_HOME_DIR; line_to_current_position(homing_feedrate(Z_AXIS)); } #endif - - if (DEBUGGING(LEVELING)) DEBUG_POS("<<< home_delta", current_position); } #endif // DELTA diff --git a/Marlin/src/module/delta.h b/Marlin/src/module/delta.h index f263a28ddd..5e9a78bd86 100644 --- a/Marlin/src/module/delta.h +++ b/Marlin/src/module/delta.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -37,6 +37,7 @@ 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; +extern abc_float_t delta_diagonal_rod_trim; /** * Recalculate factors used for delta kinematics whenever diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 1c8384cc53..289270072d 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -276,27 +276,17 @@ void Endstops::init() { #endif #endif - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - setup_endstop_interrupts(); - #endif + TERN_(ENDSTOP_INTERRUPTS_FEATURE, setup_endstop_interrupts()); // Enable endstops - enable_globally( - #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) - true - #else - false - #endif - ); + enable_globally(ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT)); } // 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 + TERN_(PINS_DEBUGGING, run_monitor()); // Report changes in endstop status #if DISABLED(ENDSTOP_INTERRUPTS_FEATURE) update(); @@ -325,7 +315,7 @@ void Endstops::not_homing() { // 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)); + else kill(GET_TEXT(MSG_KILL_HOMING_FAILED)); } #endif @@ -341,14 +331,9 @@ void Endstops::not_homing() { 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 + // Wait for Temperature ISR to run at least once (runs at 1KHz) + TERN(ENDSTOP_INTERRUPTS_FEATURE, update(), safe_delay(2)); + while (TERN0(ENDSTOP_NOISE_THRESHOLD, endstop_poll_count)) safe_delay(1); } #if ENABLED(PINS_DEBUGGING) @@ -397,9 +382,7 @@ void Endstops::event_handler() { #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 + TERN_(HAS_SPI_LCD, ui.status_printf_P(0, PSTR(S_FMT " %c %c %c %c"), GET_TEXT(MSG_LCD_ENDSTOPS), chrX, chrY, chrZ, chrP)); #if BOTH(SD_ABORT_ON_ENDSTOP_HIT, SDSUPPORT) if (planner.abort_on_endstop_hit) { @@ -420,9 +403,7 @@ static void print_es_state(const bool is_hit, PGM_P const label=nullptr) { } void _O2 Endstops::report_states() { - #if ENABLED(BLTOUCH) - bltouch._set_SW_mode(); - #endif + TERN_(BLTOUCH, bltouch._set_SW_mode()); SERIAL_ECHOLNPGM(STR_M119_REPORT); #define ES_REPORT(S) print_es_state(READ(S##_PIN) != S##_ENDSTOP_INVERTING, PSTR(STR_##S)) #if HAS_X_MIN @@ -478,7 +459,7 @@ void _O2 Endstops::report_states() { #endif #if HAS_FILAMENT_SENSOR #if NUM_RUNOUT_SENSORS == 1 - print_es_state(READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_INVERTING, PSTR(STR_FILAMENT_RUNOUT_SENSOR)); + print_es_state(READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE, PSTR(STR_FILAMENT_RUNOUT_SENSOR)); #else #define _CASE_RUNOUT(N) case N: pin = FIL_RUNOUT##N##_PIN; break; LOOP_S_LE_N(i, 1, NUM_RUNOUT_SENSORS) { @@ -489,18 +470,14 @@ void _O2 Endstops::report_states() { } SERIAL_ECHOPGM(STR_FILAMENT_RUNOUT_SENSOR); if (i > 1) SERIAL_CHAR(' ', '0' + i); - print_es_state(extDigitalRead(pin) != FIL_RUNOUT_INVERTING); + print_es_state(extDigitalRead(pin) != FIL_RUNOUT_STATE); } #undef _CASE_RUNOUT #endif #endif - #if ENABLED(BLTOUCH) - bltouch._reset_SW_mode(); - #endif - #if ENABLED(JOYSTICK_DEBUG) - joystick.report(); - #endif + TERN_(BLTOUCH, bltouch._reset_SW_mode()); + TERN_(JOYSTICK_DEBUG, joystick.report()); } // Endstops::report_states @@ -697,6 +674,15 @@ void Endstops::update() { } \ }while(0) + // Core Sensorless Homing needs to test an Extra Pin + #define CORE_DIAG(QQ,A,MM) (CORE_IS_##QQ && A##_SENSORLESS && !A##_SPI_SENSORLESS && HAS_##A##_##MM) + #define PROCESS_CORE_ENDSTOP(A1,M1,A2,M2) do { \ + if (TEST_ENDSTOP(_ENDSTOP(A1,M1))) { \ + _ENDSTOP_HIT(A2,M2); \ + planner.endstop_triggered(_AXIS(A2)); \ + } \ + }while(0) + // Call the endstop triggered routine for dual endstops #define PROCESS_DUAL_ENDSTOP(A, MINMAX) do { \ const byte dual_hit = TEST_ENDSTOP(_ENDSTOP(A, MINMAX)) | (TEST_ENDSTOP(_ENDSTOP(A##2, MINMAX)) << 1); \ @@ -765,16 +751,35 @@ void Endstops::update() { } #endif - // Now, we must signal, after validation, if an endstop limit is pressed or not + // 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) PROCESS_ENDSTOP_X(MIN); + #if CORE_DIAG(XY, Y, MIN) + PROCESS_CORE_ENDSTOP(Y,MIN,X,MIN); + #elif CORE_DIAG(XY, Y, MAX) + PROCESS_CORE_ENDSTOP(Y,MAX,X,MIN); + #elif CORE_DIAG(XZ, Z, MIN) + PROCESS_CORE_ENDSTOP(Z,MIN,X,MIN); + #elif CORE_DIAG(XZ, Z, MAX) + PROCESS_CORE_ENDSTOP(Z,MAX,X,MIN); + #endif #endif } else { // +direction #if HAS_X_MAX || (X_SPI_SENSORLESS && X_HOME_DIR > 0) PROCESS_ENDSTOP_X(MAX); + #if CORE_DIAG(XY, Y, MIN) + PROCESS_CORE_ENDSTOP(Y,MIN,X,MAX); + #elif CORE_DIAG(XY, Y, MAX) + PROCESS_CORE_ENDSTOP(Y,MAX,X,MAX); + #elif CORE_DIAG(XZ, Z, MIN) + PROCESS_CORE_ENDSTOP(Z,MIN,X,MAX); + #elif CORE_DIAG(XZ, Z, MAX) + PROCESS_CORE_ENDSTOP(Z,MAX,X,MAX); + #endif #endif } } @@ -783,11 +788,29 @@ void Endstops::update() { if (stepper.motor_direction(Y_AXIS_HEAD)) { // -direction #if HAS_Y_MIN || (Y_SPI_SENSORLESS && Y_HOME_DIR < 0) PROCESS_ENDSTOP_Y(MIN); + #if CORE_DIAG(XY, X, MIN) + PROCESS_CORE_ENDSTOP(X,MIN,Y,MIN); + #elif CORE_DIAG(XY, X, MAX) + PROCESS_CORE_ENDSTOP(X,MAX,Y,MIN); + #elif CORE_DIAG(YZ, Z, MIN) + PROCESS_CORE_ENDSTOP(Z,MIN,Y,MIN); + #elif CORE_DIAG(YZ, Z, MAX) + PROCESS_CORE_ENDSTOP(Z,MAX,Y,MIN); + #endif #endif } else { // +direction #if HAS_Y_MAX || (Y_SPI_SENSORLESS && Y_HOME_DIR > 0) PROCESS_ENDSTOP_Y(MAX); + #if CORE_DIAG(XY, X, MIN) + PROCESS_CORE_ENDSTOP(X,MIN,Y,MAX); + #elif CORE_DIAG(XY, X, MAX) + PROCESS_CORE_ENDSTOP(X,MAX,Y,MAX); + #elif CORE_DIAG(YZ, Z, MIN) + PROCESS_CORE_ENDSTOP(Z,MIN,Y,MAX); + #elif CORE_DIAG(YZ, Z, MAX) + PROCESS_CORE_ENDSTOP(Z,MAX,Y,MAX); + #endif #endif } } @@ -796,13 +819,18 @@ void Endstops::update() { 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 (true - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - && z_probe_enabled - #elif HAS_CUSTOM_PROBE_PIN - && !z_probe_enabled - #endif + if ( TERN1(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, z_probe_enabled) + && TERN1(HAS_CUSTOM_PROBE_PIN, !z_probe_enabled) ) PROCESS_ENDSTOP_Z(MIN); + #if CORE_DIAG(XZ, X, MIN) + PROCESS_CORE_ENDSTOP(X,MIN,Z,MIN); + #elif CORE_DIAG(XZ, X, MAX) + PROCESS_CORE_ENDSTOP(X,MAX,Z,MIN); + #elif CORE_DIAG(YZ, Y, MIN) + PROCESS_CORE_ENDSTOP(Y,MIN,Z,MIN); + #elif CORE_DIAG(YZ, Y, MAX) + PROCESS_CORE_ENDSTOP(Y,MAX,Z,MIN); + #endif #endif // When closing the gap check the enabled probe @@ -817,6 +845,15 @@ void Endstops::update() { #elif !HAS_CUSTOM_PROBE_PIN || Z_MAX_PIN != Z_MIN_PROBE_PIN // No probe or probe is Z_MIN || Probe is not Z_MAX PROCESS_ENDSTOP(Z, MAX); #endif + #if CORE_DIAG(XZ, X, MIN) + PROCESS_CORE_ENDSTOP(X,MIN,Z,MAX); + #elif CORE_DIAG(XZ, X, MAX) + PROCESS_CORE_ENDSTOP(X,MAX,Z,MAX); + #elif CORE_DIAG(YZ, Y, MIN) + PROCESS_CORE_ENDSTOP(Y,MIN,Z,MAX); + #elif CORE_DIAG(YZ, Y, MAX) + PROCESS_CORE_ENDSTOP(Y,MAX,Z,MAX); + #endif #endif } } @@ -824,27 +861,41 @@ void 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); + if (tmc_spi_homing.x && (stepperX.test_stall_status() + #if CORE_IS_XY && Y_SPI_SENSORLESS + || stepperY.test_stall_status() + #elif CORE_IS_XZ && Z_SPI_SENSORLESS + || stepperZ.test_stall_status() + #endif + )) { + SBI(live_state, X_ENDSTOP); hit = true; } #endif #if Y_SPI_SENSORLESS - if (tmc_spi_homing.y && stepperY.test_stall_status()) { - SBI(live_state, Y_STOP); + if (tmc_spi_homing.y && (stepperY.test_stall_status() + #if CORE_IS_XY && X_SPI_SENSORLESS + || stepperX.test_stall_status() + #elif CORE_IS_YZ && Z_SPI_SENSORLESS + || stepperZ.test_stall_status() + #endif + )) { + SBI(live_state, Y_ENDSTOP); hit = true; } #endif #if Z_SPI_SENSORLESS - if (tmc_spi_homing.z && stepperZ.test_stall_status()) { - SBI(live_state, Z_STOP); + if (tmc_spi_homing.z && (stepperZ.test_stall_status() + #if CORE_IS_XZ && X_SPI_SENSORLESS + || stepperX.test_stall_status() + #elif CORE_IS_YZ && Y_SPI_SENSORLESS + || stepperY.test_stall_status() + #endif + )) { + SBI(live_state, Z_ENDSTOP); hit = true; } #endif @@ -852,15 +903,9 @@ void Endstops::update() { } 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 + TERN_(X_SPI_SENSORLESS, CBI(live_state, X_ENDSTOP)); + TERN_(Y_SPI_SENSORLESS, CBI(live_state, Y_ENDSTOP)); + TERN_(Z_SPI_SENSORLESS, CBI(live_state, Z_ENDSTOP)); } #endif // SPI_ENDSTOPS diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h index 71353abb34..888d25a8bd 100644 --- a/Marlin/src/module/endstops.h +++ b/Marlin/src/module/endstops.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -38,19 +38,17 @@ enum EndstopEnum : char { Z4_MIN, Z4_MAX }; +#define X_ENDSTOP (X_HOME_DIR < 0 ? X_MIN : X_MAX) +#define Y_ENDSTOP (Y_HOME_DIR < 0 ? Y_MIN : Y_MAX) +#define Z_ENDSTOP (Z_HOME_DIR < 0 ? TERN(HOMING_Z_WITH_PROBE, Z_MIN, Z_MIN_PROBE) : Z_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 ENABLED(Z_MULTI_ENDSTOPS) - static float z2_endstop_adj; - #endif + TERN_(X_DUAL_ENDSTOPS, static float x2_endstop_adj); + TERN_(Y_DUAL_ENDSTOPS, static float y2_endstop_adj); + TERN_(Z_MULTI_ENDSTOPS, static float z2_endstop_adj); #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3 static float z3_endstop_adj; #endif @@ -83,11 +81,7 @@ class Endstops { * 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 - ); + return enabled || TERN0(HAS_BED_PROBE, z_probe_enabled); } static inline bool global_enabled() { return enabled_globally; } diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 1cc0a04712..9b8c1c60ff 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -74,15 +74,6 @@ #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. @@ -213,9 +204,7 @@ xyz_pos_t cartes; inline void report_more_positions() { stepper.report_positions(); - #if IS_SCARA - scara_report_positions(); - #endif + TERN_(IS_SCARA, scara_report_positions()); } // Report the logical position for a given machine position @@ -232,11 +221,7 @@ void report_real_position() { npos.e = planner.get_axis_position_mm(E_AXIS); #if HAS_POSITION_MODIFIERS - planner.unapply_modifiers(npos - #if HAS_LEVELING - , true - #endif - ); + planner.unapply_modifiers(npos, true); #endif report_logical_position(npos); @@ -315,11 +300,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { pos.e = planner.get_axis_position_mm(E_AXIS); #if HAS_POSITION_MODIFIERS - planner.unapply_modifiers(pos - #if HAS_LEVELING - , true - #endif - ); + planner.unapply_modifiers(pos, true); #endif if (axis == ALL_AXES) @@ -338,9 +319,7 @@ void line_to_current_position(const feedRate_t &fr_mm_s/*=feedrate_mm_s*/) { #if EXTRUDERS void unscaled_e_move(const float &length, const feedRate_t &fr_mm_s) { - #if HAS_FILAMENT_SENSOR - runout.reset(); - #endif + TERN_(HAS_FILAMENT_SENSOR, runout.reset()); current_position.e += length / planner.e_factor[active_extruder]; line_to_current_position(fr_mm_s); planner.synchronize(); @@ -369,6 +348,11 @@ void line_to_current_position(const feedRate_t &fr_mm_s/*=feedrate_mm_s*/) { #endif // IS_KINEMATIC +/** + * Do a fast or normal move to 'destination' with an optional FR. + * - Move at normal speed regardless of feedrate percentage. + * - Extrude the specified length regardless of flow percentage. + */ void _internal_move_to_destination(const feedRate_t &fr_mm_s/*=0.0f*/ #if IS_KINEMATIC , const bool is_fast/*=false*/ @@ -381,8 +365,8 @@ void _internal_move_to_destination(const feedRate_t &fr_mm_s/*=0.0f*/ feedrate_percentage = 100; #if EXTRUDERS - const float old_fac = planner.e_factor[active_extruder]; - planner.e_factor[active_extruder] = 1.0f; + const float old_fac = planner.e_factor[active_extruder]; + planner.e_factor[active_extruder] = 1.0f; #endif #if IS_KINEMATIC @@ -403,7 +387,8 @@ void _internal_move_to_destination(const feedRate_t &fr_mm_s/*=0.0f*/ * 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); + DEBUG_SECTION(log_move, "do_blocking_move_to", DEBUGGING(LEVELING)); + if (DEBUGGING(LEVELING)) DEBUG_XYZ("> ", 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); @@ -487,8 +472,6 @@ void do_blocking_move_to(const float rx, const float ry, const float rz, const f #endif - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< do_blocking_move_to"); - planner.synchronize(); } @@ -523,6 +506,13 @@ void do_blocking_move_to_xy_z(const xy_pos_t &raw, const float &z, const feedRat do_blocking_move_to(raw.x, raw.y, z, fr_mm_s); } +void do_z_clearance(const float &zclear, const bool z_known/*=true*/, const bool raise_on_unknown/*=true*/, const bool lower_allowed/*=false*/) { + const bool rel = raise_on_unknown && !z_known; + float zdest = zclear + (rel ? current_position.z : 0.0f); + if (!lower_allowed) NOLESS(zdest, current_position.z); + do_blocking_move_to_z(_MIN(zdest, Z_MAX_POS), MMM_TO_MMS(Z_PROBE_SPEED_FAST)); +} + // // Prepare to do endstop or probe moves with custom feedrates. // - Save / restore current feedrate and multiplier @@ -563,7 +553,8 @@ void restore_feedrate_and_scaling() { */ 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*/ + , const uint8_t old_tool_index/*=0*/ + , const uint8_t new_tool_index/*=0*/ #endif ) { @@ -596,11 +587,7 @@ void restore_feedrate_and_scaling() { #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)); + soft_endstop.max[axis] = (axis == Z_AXIS) ? delta_height - TERN0(HAS_BED_PROBE, probe.offset.z) : base_max_pos(axis); switch (axis) { case X_AXIS: @@ -653,11 +640,9 @@ void restore_feedrate_and_scaling() { #if IS_KINEMATIC - #if ENABLED(DELTA) - if (!all_axes_homed()) return; - #endif + if (TERN0(DELTA, !all_axes_homed())) return; - #if HAS_HOTEND_OFFSET && ENABLED(DELTA) + #if BOTH(HAS_HOTEND_OFFSET, DELTA) // The effector center position will be the target minus the hotend offset. const xy_pos_t offs = hotend_offset[active_extruder]; #else @@ -665,11 +650,7 @@ void restore_feedrate_and_scaling() { constexpr xy_pos_t offs{0}; #endif - if (true - #if IS_SCARA - && TEST(axis_homed, X_AXIS) && TEST(axis_homed, Y_AXIS) - #endif - ) { + if (TERN1(IS_SCARA, TEST(axis_homed, X_AXIS) && TEST(axis_homed, Y_AXIS))) { const float dist_2 = HYPOT2(target.x - offs.x, target.y - offs.y); if (dist_2 > delta_max_radius_2) target *= float(delta_max_radius / SQRT(dist_2)); // 200 / 300 = 0.66 @@ -820,8 +801,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif - )) - break; + )) break; } // Ensure last segment arrives at target location. @@ -892,8 +872,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif - )) - break; + )) break; } // Since segment_distance is only approximate, @@ -967,7 +946,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { 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) { + float x_home_pos(const uint8_t extruder) { if (extruder == 0) return base_home_pos(X_AXIS); else @@ -1099,9 +1078,7 @@ void prepare_line_to_destination() { #endif // PREVENT_COLD_EXTRUSION || PREVENT_LENGTHY_EXTRUDE - #if ENABLED(DUAL_X_CARRIAGE) - if (dual_x_carriage_unpark()) return; - #endif + if (TERN0(DUAL_X_CARRIAGE, dual_x_carriage_unpark())) return; if ( #if UBL_SEGMENTED @@ -1121,11 +1098,7 @@ void prepare_line_to_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 + #define HOMED_FLAGS TERN(HOME_AFTER_DEACTIVATE, axis_known_position, axis_homed) // 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); @@ -1144,9 +1117,7 @@ bool axis_unhomed_error(uint8_t axis_bits/*=0x07*/) { ); SERIAL_ECHO_START(); SERIAL_ECHOLN(msg); - #if HAS_DISPLAY - ui.set_status(msg); - #endif + TERN_(HAS_DISPLAY, ui.set_status(msg)); return true; } return false; @@ -1156,9 +1127,8 @@ bool axis_unhomed_error(uint8_t axis_bits/*=0x07*/) { * 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 + if (TERN0(HOMING_Z_WITH_PROBE, axis == Z_AXIS)) + return MMM_TO_MMS(Z_PROBE_SPEED_SLOW); static const uint8_t homing_bump_divisor[] PROGMEM = HOMING_BUMP_DIVISOR; uint8_t hbd = pgm_read_byte(&homing_bump_divisor[axis]); if (hbd < 1) { @@ -1233,9 +1203,7 @@ feedRate_t get_homing_bump_feedrate(const AxisEnum axis) { } #endif - #if ENABLED(IMPROVE_HOMING_RELIABILITY) - sg_guard_period = millis() + default_sg_guard_duration; - #endif + TERN_(IMPROVE_HOMING_RELIABILITY, sg_guard_period = millis() + default_sg_guard_duration); return stealth_states; } @@ -1306,11 +1274,12 @@ feedRate_t get_homing_bump_feedrate(const AxisEnum axis) { * Home an individual linear axis */ void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t fr_mm_s=0.0) { + DEBUG_SECTION(log_move, "do_homing_move", DEBUGGING(LEVELING)); const feedRate_t real_fr_mm_s = fr_mm_s ?: homing_feedrate(axis); if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR(">>> do_homing_move(", axis_codes[axis], ", ", distance, ", "); + DEBUG_ECHOPAIR("...(", axis_codes[axis], ", ", distance, ", "); if (fr_mm_s) DEBUG_ECHO(fr_mm_s); else @@ -1318,18 +1287,15 @@ void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t DEBUG_ECHOLNPGM(")"); } - #if HOMING_Z_WITH_PROBE && HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) + #if ALL(HOMING_Z_WITH_PROBE, HAS_HEATED_BED, WAIT_FOR_BED_HEATER) // Wait for bed to heat back up between probing points if (axis == Z_AXIS && distance < 0) thermalManager.wait_for_bed_heating(); #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 int8_t axis_home_dir = TERN0(DUAL_X_CARRIAGE, axis == X_AXIS) + ? x_home_dir(active_extruder) : home_dir(axis); const bool is_home_dir = (axis_home_dir > 0) == (distance > 0); #if ENABLED(SENSORLESS_HOMING) @@ -1343,9 +1309,7 @@ void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t #endif // Disable stealthChop if used. Enable diag1 pin on driver. - #if ENABLED(SENSORLESS_HOMING) - stealth_states = start_sensorless_homing_per_axis(axis); - #endif + TERN_(SENSORLESS_HOMING, stealth_states = start_sensorless_homing_per_axis(axis)); } #if IS_SCARA @@ -1355,16 +1319,18 @@ void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t current_position[axis] = distance; line_to_current_position(real_fr_mm_s); #else + // Get the ABC or XYZ positions in mm abce_pos_t target = planner.get_axis_positions_mm(); - target[axis] = 0; - planner.set_machine_position_mm(target); - target[axis] = distance; + + target[axis] = 0; // Set the single homing axis to 0 + planner.set_machine_position_mm(target); // Update the machine position #if HAS_DIST_MM_ARG const xyze_float_t cart_dist_mm{0}; #endif // Set delta/cartesian axes directly + target[axis] = distance; // The move will be towards the endstop planner.buffer_segment(target #if HAS_DIST_MM_ARG , cart_dist_mm @@ -1384,12 +1350,8 @@ void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t 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 + TERN_(SENSORLESS_HOMING, end_sensorless_homing_per_axis(axis, stealth_states)); } - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("<<< do_homing_move(", axis_codes[axis], ")"); } /** @@ -1426,11 +1388,7 @@ void set_axis_is_at_home(const AxisEnum axis) { #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)); + current_position[axis] = (axis == Z_AXIS) ? delta_height - TERN0(HAS_BED_PROBE, probe.offset.z) : base_home_pos(axis); #else current_position[axis] = base_home_pos(axis); #endif @@ -1454,13 +1412,9 @@ void set_axis_is_at_home(const AxisEnum axis) { } #endif - #if ENABLED(I2C_POSITION_ENCODERS) - I2CPEM.homed(axis); - #endif + TERN_(I2C_POSITION_ENCODERS, I2CPEM.homed(axis)); - #if ENABLED(BABYSTEP_DISPLAY_TOTAL) - babystep.reset_total(axis); - #endif + TERN_(BABYSTEP_DISPLAY_TOTAL, babystep.reset_total(axis)); #if HAS_POSITION_SHIFT position_shift[axis] = 0; @@ -1487,11 +1441,86 @@ void set_axis_not_trusted(const AxisEnum axis) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("<<< set_axis_not_trusted(", axis_codes[axis], ")"); - #if ENABLED(I2C_POSITION_ENCODERS) - I2CPEM.unhomed(axis); - #endif + TERN_(I2C_POSITION_ENCODERS, I2CPEM.unhomed(axis)); } +#ifdef TMC_HOME_PHASE + /** + * Move the axis back to its home_phase if set and driver is capable (TMC) + * + * Improves homing repeatability by homing to stepper coil's nearest absolute + * phase position. Trinamic drivers use a stepper phase table with 1024 values + * spanning 4 full steps with 256 positions each (ergo, 1024 positions). + */ + void backout_to_tmc_homing_phase(const AxisEnum axis) { + const xyz_long_t home_phase = TMC_HOME_PHASE; + + // check if home phase is disabled for this axis. + if (home_phase[axis] < 0) return; + + int16_t phasePerUStep, // TMC µsteps(phase) per Marlin µsteps + phaseCurrent, // The TMC µsteps(phase) count of the current position + effectorBackoutDir, // Direction in which the effector mm coordinates move away from endstop. + stepperBackoutDir; // Direction in which the TMC µstep count(phase) move away from endstop. + + switch (axis) { + #ifdef X_MICROSTEPS + case X_AXIS: + phasePerUStep = 256 / (X_MICROSTEPS); + phaseCurrent = stepperX.get_microstep_counter(); + effectorBackoutDir = -X_HOME_DIR; + stepperBackoutDir = INVERT_X_DIR ? effectorBackoutDir : -effectorBackoutDir; + break; + #endif + #ifdef Y_MICROSTEPS + case Y_AXIS: + phasePerUStep = 256 / (Y_MICROSTEPS); + phaseCurrent = stepperY.get_microstep_counter(); + effectorBackoutDir = -Y_HOME_DIR; + stepperBackoutDir = INVERT_Y_DIR ? effectorBackoutDir : -effectorBackoutDir; + break; + #endif + #ifdef Z_MICROSTEPS + case Z_AXIS: + phasePerUStep = 256 / (Z_MICROSTEPS); + phaseCurrent = stepperZ.get_microstep_counter(); + effectorBackoutDir = -Z_HOME_DIR; + stepperBackoutDir = INVERT_Z_DIR ? effectorBackoutDir : -effectorBackoutDir; + break; + #endif + default: return; + } + + // Phase distance to nearest home phase position when moving in the backout direction from endstop(may be negative). + int16_t phaseDelta = (home_phase[axis] - phaseCurrent) * stepperBackoutDir; + + // Check if home distance within endstop assumed repeatability noise of .05mm and warn. + if (ABS(phaseDelta) * planner.steps_to_mm[axis] / phasePerUStep < 0.05f) + SERIAL_ECHOLNPAIR("Selected home phase ", home_phase[axis], + " too close to endstop trigger phase ", phaseCurrent, + ". Pick a different phase for ", axis_codes[axis]); + + // Skip to next if target position is behind current. So it only moves away from endstop. + if (phaseDelta < 0) phaseDelta += 1024; + + // Convert TMC µsteps(phase) to whole Marlin µsteps to effector backout direction to mm + const float mmDelta = int16_t(phaseDelta / phasePerUStep) * effectorBackoutDir * planner.steps_to_mm[axis]; + + // Optional debug messages + if (DEBUGGING(LEVELING)) { + DEBUG_ECHOLNPAIR( + "Endstop ", axis_codes[axis], " hit at Phase:", phaseCurrent, + " Delta:", phaseDelta, " Distance:", mmDelta + ); + } + + if (mmDelta != 0) { + // Retrace by the amount computed in mmDelta. + do_homing_move(axis, mmDelta, get_homing_bump_feedrate(axis)); + } + } +#endif + /** * Home an individual "raw axis" to its endstop. * This applies to XYZ on Cartesian and Core robots, and @@ -1509,53 +1538,31 @@ void homeaxis(const AxisEnum axis) { // 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; + #define _CAN_HOME(A) (axis == _AXIS(A) && ( \ + ENABLED(A##_SPI_SENSORLESS) \ + || (_AXIS(A) == Z_AXIS && ENABLED(HOMING_Z_WITH_PROBE)) \ + || (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 (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) - ); + const int axis_home_dir = TERN0(DUAL_X_CARRIAGE, axis == X_AXIS) + ? x_home_dir(active_extruder) : home_dir(axis); // Homing Z towards the bed? Deploy the Z probe or endstop. - #if HOMING_Z_WITH_PROBE - if (axis == Z_AXIS && probe.deploy()) return; - #endif + if (TERN0(HOMING_Z_WITH_PROBE, axis == Z_AXIS && probe.deploy())) + return; // 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 ENABLED(Z_MULTI_ENDSTOPS) - case Z_AXIS: - #endif - stepper.set_separate_multi_axis(true); + TERN_(X_DUAL_ENDSTOPS, case X_AXIS:) + TERN_(Y_DUAL_ENDSTOPS, case Y_AXIS:) + TERN_(Z_MULTI_ENDSTOPS, case Z_AXIS:) + stepper.set_separate_multi_axis(true); default: break; } #endif @@ -1563,34 +1570,31 @@ void homeaxis(const AxisEnum axis) { // Fast move towards endstop until triggered if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Home 1 Fast:"); - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) + #if BOTH(HOMING_Z_WITH_PROBE, 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 DISABLED(DELTA) && defined(SENSORLESS_BACKOFF_MM) + const xy_float_t backoff = SENSORLESS_BACKOFF_MM; + if (((ENABLED(X_SENSORLESS) && axis == X_AXIS) || (ENABLED(Y_SENSORLESS) && axis == Y_AXIS)) && backoff[axis]) + do_homing_move(axis, -ABS(backoff[axis]) * axis_home_dir, homing_feedrate(axis)); + #endif - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE) + do_homing_move(axis, 1.5f * max_length(TERN(DELTA, Z_AXIS, axis)) * axis_home_dir); + + #if BOTH(HOMING_Z_WITH_PROBE, 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 bool use_probe_bump = TERN0(HOMING_Z_WITH_PROBE, axis == Z_AXIS && home_bump_mm(Z_AXIS)); 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) + use_probe_bump ? _MAX(Z_CLEARANCE_BETWEEN_PROBES, home_bump_mm(Z_AXIS)) : home_bump_mm(axis) ); // If a second homing move is configured... if (bump) { - // Move away from the endstop by the axis HOME_BUMP_MM + // Move away from the endstop by the axis HOMING_BUMP_MM if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Move Away:"); do_homing_move(axis, -bump #if HOMING_Z_WITH_PROBE @@ -1598,16 +1602,31 @@ void homeaxis(const AxisEnum axis) { #endif ); + #if ENABLED(DETECT_BROKEN_ENDSTOP) + // Check for a broken endstop + EndstopEnum es; + switch (axis) { + default: + case X_AXIS: es = X_ENDSTOP; break; + case Y_AXIS: es = Y_ENDSTOP; break; + case Z_AXIS: es = Z_ENDSTOP; break; + } + if (TEST(endstops.state(), es)) { + SERIAL_ECHO_MSG("Bad ", axis_codes[axis], " Endstop?"); + kill(GET_TEXT(MSG_KILL_HOMING_FAILED)); + } + #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 BOTH(HOMING_Z_WITH_PROBE, 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 BOTH(HOMING_Z_WITH_PROBE, BLTOUCH) if (axis == Z_AXIS) bltouch.stow(); // The final STOW #endif } @@ -1644,9 +1663,9 @@ void homeaxis(const AxisEnum 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); + if (pos_dir ? (endstops.z2_endstop_adj > 0) : (endstops.z2_endstop_adj < 0)) stepper.set_z1_lock(true); else stepper.set_z2_lock(true); do_homing_move(axis, pos_dir ? -adj : adj); - stepper.set_z_lock(false); + stepper.set_z1_lock(false); stepper.set_z2_lock(false); } @@ -1657,7 +1676,7 @@ void homeaxis(const AxisEnum axis) { typedef void (*adjustFunc_t)(const bool); adjustFunc_t lock[] = { - stepper.set_z_lock, stepper.set_z2_lock, stepper.set_z3_lock + stepper.set_z1_lock, stepper.set_z2_lock, stepper.set_z3_lock #if NUM_Z_STEPPER_DRIVERS >= 4 , stepper.set_z4_lock #endif @@ -1725,7 +1744,7 @@ void homeaxis(const AxisEnum axis) { do_homing_move(axis, adj[0] - adj[1]); } - stepper.set_z_lock(false); + stepper.set_z1_lock(false); stepper.set_z2_lock(false); stepper.set_z3_lock(false); #if NUM_Z_STEPPER_DRIVERS >= 4 @@ -1739,19 +1758,18 @@ void homeaxis(const AxisEnum axis) { // Reset flags for X, Y, Z motor locking switch (axis) { default: break; - #if ENABLED(X_DUAL_ENDSTOPS) - case X_AXIS: - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - case Y_AXIS: - #endif - #if ENABLED(Z_MULTI_ENDSTOPS) - case Z_AXIS: - #endif - stepper.set_separate_multi_axis(false); + TERN_(X_DUAL_ENDSTOPS, case X_AXIS:) + TERN_(Y_DUAL_ENDSTOPS, case Y_AXIS:) + TERN_(Z_MULTI_ENDSTOPS, case Z_AXIS:) + stepper.set_separate_multi_axis(false); } #endif + #ifdef TMC_HOME_PHASE + // move back to homing phase if configured and capable + backout_to_tmc_homing_phase(axis); + #endif + #if IS_SCARA set_axis_is_at_home(axis); @@ -1763,10 +1781,13 @@ void homeaxis(const AxisEnum axis) { // 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); + const float adjDistance = delta_endstop_adj[axis], + minDistance = (MIN_STEPS_PER_SEGMENT) * planner.steps_to_mm[axis]; + + // Retrace by the amount specified in delta_endstop_adj if more than min steps. + if (adjDistance * (Z_HOME_DIR) < 0 && ABS(adjDistance) > minDistance) { // away from endstop, more than min distance + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("adjDistance:", adjDistance); + do_homing_move(axis, adjDistance, get_homing_bump_feedrate(axis)); } #else // CARTESIAN / CORE @@ -1785,8 +1806,8 @@ void homeaxis(const AxisEnum axis) { if (axis == Z_AXIS && probe.stow()) return; #endif - #if DISABLED(DELTA) && defined(HOMING_BACKOFF_MM) - const xyz_float_t endstop_backoff = HOMING_BACKOFF_MM; + #if DISABLED(DELTA) && defined(HOMING_BACKOFF_POST_MM) + const xyz_float_t endstop_backoff = HOMING_BACKOFF_POST_MM; if (endstop_backoff[axis]) { current_position[axis] -= ABS(endstop_backoff[axis]) * axis_home_dir; line_to_current_position( @@ -1798,9 +1819,8 @@ void homeaxis(const AxisEnum axis) { #if ENABLED(SENSORLESS_HOMING) planner.synchronize(); - #if IS_CORE - if (axis != NORMAL_AXIS) safe_delay(200); // Short delay to allow belts to spring back - #endif + if (TERN0(IS_CORE, axis != NORMAL_AXIS)) + safe_delay(200); // Short delay to allow belts to spring back #endif } #endif diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index e504f187f9..d33ce623a4 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -44,13 +44,7 @@ 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 - ); + return !TERN(HOME_AFTER_DEACTIVATE, all_axes_known, all_axes_homed)(); } // Error margin to work around float imprecision @@ -114,24 +108,29 @@ extern int16_t feedrate_percentage; 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); } +inline float pgm_read_any(const float *p) { return pgm_read_float(p); } +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]); } - + inline T NAME(const AxisEnum axis) { \ + static const XYZval NAME##_P PROGMEM = { X_##OPT, Y_##OPT, Z_##OPT }; \ + 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); +inline float home_bump_mm(const AxisEnum axis) { + static const xyz_pos_t home_bump_mm_P PROGMEM = HOMING_BUMP_MM; + return pgm_read_any(&home_bump_mm_P[axis]); +} + #if HAS_WORKSPACE_OFFSET void update_workspace_offset(const AxisEnum axis); #else - #define update_workspace_offset(x) NOOP + inline void update_workspace_offset(const AxisEnum) {} #endif #if HAS_HOTEND_OFFSET @@ -153,6 +152,7 @@ typedef struct { xyz_pos_t min, max; } axis_limits_t; , const uint8_t old_tool_index=0, const uint8_t new_tool_index=0 #endif ); + #define TEMPORARY_SOFT_ENDSTOP_STATE(enable) REMEMBER(tes, soft_endstops_enabled, enable); #else constexpr bool soft_endstops_enabled = false; //constexpr axis_limits_t soft_endstop = { @@ -160,6 +160,7 @@ typedef struct { xyz_pos_t min, max; } axis_limits_t; // { X_MAX_POS, Y_MAX_POS, Z_MAX_POS } }; #define apply_motion_limits(V) NOOP #define update_software_endstops(...) NOOP + #define TEMPORARY_SOFT_ENDSTOP_STATE(...) NOOP #endif void report_real_position(); @@ -233,6 +234,8 @@ void remember_feedrate_and_scaling(); void remember_feedrate_scaling_off(); void restore_feedrate_and_scaling(); +void do_z_clearance(const float &zclear, const bool z_known=true, const bool raise_on_unknown=true, const bool lower_allowed=false); + // // Homing // @@ -375,7 +378,7 @@ void homeaxis(const AxisEnum axis); FORCE_INLINE bool dxc_is_duplicating() { return dual_x_carriage_mode >= DXC_DUPLICATION_MODE; } - float x_home_pos(const int extruder); + float x_home_pos(const uint8_t extruder); FORCE_INLINE int x_home_dir(const uint8_t extruder) { return extruder ? X2_HOME_DIR : X_HOME_DIR; } diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index e1a050a459..65a9e4e059 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -67,7 +67,6 @@ #include "motion.h" #include "temperature.h" #include "../lcd/ultralcd.h" -#include "../core/language.h" #include "../gcode/parser.h" #include "../MarlinCore.h" @@ -92,6 +91,10 @@ #include "../feature/power.h" #endif +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + #include "../feature/closedloop.h" +#endif + #if ENABLED(BACKLASH_COMPENSATION) #include "../feature/backlash.h" #endif @@ -114,7 +117,7 @@ Planner planner; - // public: +// public: /** * A ring buffer of moves described in steps @@ -129,26 +132,23 @@ uint8_t Planner::delay_before_delivering; // This counter delays delivery planner_settings_t Planner::settings; // Initialized by settings.load() +#if ENABLED(LASER_POWER_INLINE) + laser_state_t Planner::laser_inline; // Current state for blocks +#endif + 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 +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 +#if HAS_JUNCTION_DEVIATION + float Planner::junction_deviation_mm; // (mm) M205 J + #if HAS_LINEAR_E_JERK + float Planner::max_e_jerk[DISTINCT_E]; // Calculated from junction_deviation_mm #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 + TERN(HAS_LINEAR_E_JERK, xyz_pos_t, xyze_pos_t) Planner::max_jerk; #endif #if ENABLED(SD_ABORT_ON_ENDSTOP_HIT) @@ -159,6 +159,11 @@ float Planner::steps_to_mm[XYZE_N]; // (mm) Millimeters per step uint8_t Planner::last_extruder = 0; // Respond to extruder change #endif +#if ENABLED(DIRECT_STEPPING) + uint32_t Planner::last_page_step_rate = 0; + xyze_bool_t Planner::last_page_dir{0}; +#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 @@ -170,6 +175,11 @@ float Planner::steps_to_mm[XYZE_N]; // (mm) Millimeters per step Planner::volumetric_multiplier[EXTRUDERS]; // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner #endif +#if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) + float Planner::volumetric_extruder_limit[EXTRUDERS], // max mm^3/sec the extruder is able to handle + Planner::volumetric_extruder_feedrate_limit[EXTRUDERS]; // pre calculated extruder feedrate limit based on volumetric_extruder_limit; 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 @@ -207,10 +217,9 @@ float Planner::previous_nominal_speed_sqr; #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 } }; + int8_t Planner::xy_freq_limit_hz = XY_FREQUENCY_LIMIT; + float Planner::xy_freq_min_speed_factor = (XY_FREQUENCY_MIN_PERCENT) * 0.01f; + int32_t Planner::xy_freq_min_interval_us = LROUND(1000000.0 / (XY_FREQUENCY_LIMIT)); #endif #if ENABLED(LIN_ADVANCE) @@ -237,19 +246,17 @@ Planner::Planner() { init(); } void Planner::init() { position.reset(); - #if HAS_POSITION_FLOAT - position_float.reset(); - #endif - #if IS_KINEMATIC - position_cart.reset(); - #endif + TERN_(HAS_POSITION_FLOAT, position_float.reset()); + TERN_(IS_KINEMATIC, position_cart.reset()); previous_speed.reset(); previous_nominal_speed_sqr = 0; - #if ABL_PLANAR - bed_level_matrix.set_to_identity(); - #endif + TERN_(ABL_PLANAR, bed_level_matrix.set_to_identity()); clear_block_buffer(); delay_before_delivering = 0; + #if ENABLED(DIRECT_STEPPING) + last_page_step_rate = 0; + last_page_dir.reset(); + #endif } #if ENABLED(S_CURVE_ACCELERATION) @@ -739,9 +746,8 @@ block_t* Planner::get_current_block() { // 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 + // We can't be sure how long an active block will take, so don't count it. + TERN_(HAS_SPI_LCD, block_buffer_runtime_us -= block->segment_time_us); // As this block is busy, advance the nonbusy block pointer block_buffer_nonbusy = next_block_index(block_buffer_tail); @@ -755,9 +761,7 @@ block_t* Planner::get_current_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 + TERN_(HAS_SPI_LCD, clear_block_buffer_runtime()); // paranoia. Buffer is empty now - so reset accumulated time to zero. return nullptr; } @@ -815,11 +819,10 @@ void Planner::calculate_trapezoid_for_block(block_t* const block, const float &e #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); - + 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); + acceleration_time_inverse = get_period_inverse(acceleration_time), + deceleration_time_inverse = get_period_inverse(deceleration_time); #endif // Store new block parameters @@ -834,6 +837,47 @@ void Planner::calculate_trapezoid_for_block(block_t* const block, const float &e block->cruise_rate = cruise_rate; #endif block->final_rate = final_rate; + + /** + * Laser trapezoid calculations + * + * Approximate the trapezoid with the laser, incrementing the power every `entry_per` while accelerating + * and decrementing it every `exit_power_per` while decelerating, thus ensuring power is related to feedrate. + * + * LASER_POWER_INLINE_TRAPEZOID_CONT doesn't need this as it continuously approximates + * + * Note this may behave unreliably when running with S_CURVE_ACCELERATION + */ + #if ENABLED(LASER_POWER_INLINE_TRAPEZOID) + if (block->laser.power > 0) { // No need to care if power == 0 + const uint8_t entry_power = block->laser.power * entry_factor; // Power on block entry + #if DISABLED(LASER_POWER_INLINE_TRAPEZOID_CONT) + // Speedup power + const uint8_t entry_power_diff = block->laser.power - entry_power; + if (entry_power_diff) { + block->laser.entry_per = accelerate_steps / entry_power_diff; + block->laser.power_entry = entry_power; + } + else { + block->laser.entry_per = 0; + block->laser.power_entry = block->laser.power; + } + // Slowdown power + const uint8_t exit_power = block->laser.power * exit_factor, // Power on block entry + exit_power_diff = block->laser.power - exit_power; + if (exit_power_diff) { + block->laser.exit_per = (block->step_event_count - block->decelerate_after) / exit_power_diff; + block->laser.power_exit = exit_power; + } + else { + block->laser.exit_per = 0; + block->laser.power_exit = block->laser.power; + } + #else + block->laser.power_entry = entry_power; + #endif + } + #endif } /* PLANNER SPEED DEFINITION @@ -884,7 +928,7 @@ void Planner::calculate_trapezoid_for_block(block_t* const block, const float &e 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. + this requirement when encountered by the Planner::release_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 @@ -972,8 +1016,8 @@ void Planner::reverse_pass() { // Perform the reverse pass block_t *current = &block_buffer[block_index]; - // Only consider non sync blocks - if (!TEST(current->flag, BLOCK_BIT_SYNC_POSITION)) { + // Only consider non sync and page blocks + if (!TEST(current->flag, BLOCK_BIT_SYNC_POSITION) && !IS_PAGE(current)) { reverse_pass_kernel(current, next); next = current; } @@ -1067,8 +1111,8 @@ void Planner::forward_pass() { // Perform the forward pass block = &block_buffer[block_index]; - // Skip SYNC blocks - if (!TEST(block->flag, BLOCK_BIT_SYNC_POSITION)) { + // Skip SYNC and page blocks + if (!TEST(block->flag, BLOCK_BIT_SYNC_POSITION) && !IS_PAGE(block)) { // 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 @@ -1117,8 +1161,8 @@ void Planner::recalculate_trapezoids() { next = &block_buffer[block_index]; - // Skip sync blocks - if (!TEST(next->flag, BLOCK_BIT_SYNC_POSITION)) { + // Skip sync and page blocks + if (!TEST(next->flag, BLOCK_BIT_SYNC_POSITION) && !IS_PAGE(next)) { next_entry_speed = SQRT(next->entry_speed_sqr); if (block) { @@ -1240,7 +1284,7 @@ void Planner::check_axes_activity() { xyze_bool_t axis_active = { false }; #endif - #if FAN_COUNT > 0 + #if HAS_FAN uint8_t tail_fan_speed[FAN_COUNT]; #endif @@ -1255,22 +1299,18 @@ void Planner::check_axes_activity() { if (has_blocks_queued()) { - #if FAN_COUNT > 0 || ENABLED(BARICUDA) + #if HAS_FAN || ENABLED(BARICUDA) block_t *block = &block_buffer[block_buffer_tail]; #endif - #if FAN_COUNT > 0 + #if HAS_FAN 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 + TERN_(HAS_HEATER_1, tail_valve_pressure = block->valve_pressure); + TERN_(HAS_HEATER_2, tail_e_to_p_pressure = block->e_to_p_pressure); #endif #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_E) @@ -1282,45 +1322,31 @@ void Planner::check_axes_activity() { } else { - #if HAS_CUTTER - cutter.refresh(); - #endif + TERN_(HAS_CUTTER, cutter.refresh()); - #if FAN_COUNT > 0 + #if HAS_FAN 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 + TERN_(HAS_HEATER_1, tail_valve_pressure = baricuda_valve_pressure); + TERN_(HAS_HEATER_2, tail_e_to_p_pressure = baricuda_e_to_p_pressure); #endif } // // Disable inactive axes // - #if ENABLED(DISABLE_X) - if (!axis_active.x) DISABLE_AXIS_X(); - #endif - #if ENABLED(DISABLE_Y) - if (!axis_active.y) DISABLE_AXIS_Y(); - #endif - #if ENABLED(DISABLE_Z) - if (!axis_active.z) DISABLE_AXIS_Z(); - #endif - #if ENABLED(DISABLE_E) - if (!axis_active.e) disable_e_steppers(); - #endif + if (TERN0(DISABLE_X, !axis_active.x)) DISABLE_AXIS_X(); + if (TERN0(DISABLE_Y, !axis_active.y)) DISABLE_AXIS_Y(); + if (TERN0(DISABLE_Z, !axis_active.z)) DISABLE_AXIS_Z(); + if (TERN0(DISABLE_E, !axis_active.e)) disable_e_steppers(); // // Update Fan speeds // - #if FAN_COUNT > 0 + #if HAS_FAN #if FAN_KICKSTART_TIME > 0 static millis_t fan_kick_end[FAN_COUNT] = { 0 }; @@ -1352,43 +1378,21 @@ void Planner::check_axes_activity() { #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 - #if HAS_FAN3 - FAN_SET(3); - #endif - #if HAS_FAN4 - FAN_SET(4); - #endif - #if HAS_FAN5 - FAN_SET(5); - #endif - #if HAS_FAN6 - FAN_SET(6); - #endif - #if HAS_FAN7 - FAN_SET(7); - #endif - #endif // FAN_COUNT > 0 + TERN_(HAS_FAN0, FAN_SET(0)); + TERN_(HAS_FAN1, FAN_SET(1)); + TERN_(HAS_FAN2, FAN_SET(2)); + TERN_(HAS_FAN3, FAN_SET(3)); + TERN_(HAS_FAN4, FAN_SET(4)); + TERN_(HAS_FAN5, FAN_SET(5)); + TERN_(HAS_FAN6, FAN_SET(6)); + TERN_(HAS_FAN7, FAN_SET(7)); + #endif // HAS_FAN - #if ENABLED(AUTOTEMP) - getHighESpeed(); - #endif + TERN_(AUTOTEMP, getHighESpeed()); #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 + TERN_(HAS_HEATER_1, analogWrite(pin_t(HEATER_1_PIN), tail_valve_pressure)); + TERN_(HAS_HEATER_2, analogWrite(pin_t(HEATER_2_PIN), tail_e_to_p_pressure)); #endif } @@ -1412,10 +1416,28 @@ void Planner::check_axes_activity() { volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]); refresh_e_factor(i); } + #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) + calculate_volumetric_extruder_limits(); // update volumetric_extruder_limits as well. + #endif } #endif // !NO_VOLUMETRICS +#if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) + + /** + * Convert volumetric based limits into pre calculated extruder feedrate limits. + */ + void Planner::calculate_volumetric_extruder_limit(const uint8_t e) { + const float &lim = volumetric_extruder_limit[e], &siz = filament_size[e]; + volumetric_extruder_feedrate_limit[e] = (lim && siz) ? lim / CIRCLE_AREA(siz * 0.5f) : 0; + } + void Planner::calculate_volumetric_extruder_limits() { + LOOP_L_N(e, EXTRUDERS) calculate_volumetric_extruder_limit(e); + } + +#endif + #if ENABLED(FILAMENT_WIDTH_SENSOR) /** * Convert the ratio value given by the filament width sensor @@ -1438,11 +1460,8 @@ void Planner::check_axes_activity() { #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 + TERN(Z_SAFE_HOMING, Z_SAFE_HOMING_X_POINT, X_HOME_POS), + TERN(Z_SAFE_HOMING, Z_SAFE_HOMING_Y_POINT, Y_HOME_POS) }; /** @@ -1561,8 +1580,8 @@ void Planner::quick_stop() { clear_block_buffer_runtime(); #endif - // Make sure to drop any attempt of queuing moves for at least 1 second - cleaning_buffer_counter = 1000; + // Make sure to drop any attempt of queuing moves for 1 second + cleaning_buffer_counter = TEMP_TIMER_FREQUENCY; // Reenable Stepper ISR if (was_enabled) stepper.wake_up(); @@ -1619,11 +1638,8 @@ float Planner::get_axis_position_mm(const AxisEnum 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 + while (has_blocks_queued() || cleaning_buffer_counter + || TERN0(EXTERNAL_CLOSED_LOOP_CONTROLLER, CLOSED_LOOP_WAITING()) ) idle(); } @@ -1638,7 +1654,7 @@ void Planner::synchronize() { * extruder - target extruder * millimeters - the length of the movement, if known * - * Returns true if movement was properly queued, false otherwise + * Returns true if movement was properly queued, false otherwise (if cleaning) */ bool Planner::_buffer_steps(const xyze_long_t &target #if HAS_POSITION_FLOAT @@ -1701,7 +1717,7 @@ bool Planner::_buffer_steps(const xyze_long_t &target * fr_mm_s - (target) speed of the move * extruder - target extruder * - * Returns true is movement is acceptable, false otherwise + * Returns true if movement is acceptable, false otherwise */ bool Planner::_populate_block(block_t * const block, bool split_move, const abce_long_t &target @@ -1740,9 +1756,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #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 + TERN_(HAS_POSITION_FLOAT, position_float.e = target_float.e); de = 0; // no difference SERIAL_ECHO_MSG(STR_ERR_COLD_EXTRUDE_STOP); } @@ -1762,9 +1776,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #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 + TERN_(HAS_POSITION_FLOAT, position_float.e = target_float.e); de = 0; // no difference SERIAL_ECHO_MSG(STR_ERR_LONG_EXTRUDE_STOP); } @@ -1813,8 +1825,15 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // Set direction bits block->direction_bits = dm; + // Update block laser power + #if ENABLED(LASER_POWER_INLINE) + laser_inline.status.isPlanned = true; + block->laser.status = laser_inline.status; + block->laser.power = laser_inline.power; + #endif + // Number of steps for each axis - // See http://www.corexy.com/theory.html + // See https://www.corexy.com/theory.html #if CORE_IS_XY block->steps.set(ABS(da + db), ABS(da - db), ABS(dc)); #elif CORE_IS_XZ @@ -1837,9 +1856,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, * Having the real displacement of the head, we can calculate the total movement length and apply the desired speed. */ struct DistanceMM : abce_float_t { - #if IS_CORE - xyz_pos_t head; - #endif + TERN_(IS_CORE, xyz_pos_t head); } steps_dist_mm; #if IS_CORE #if CORE_IS_XY @@ -1873,9 +1890,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, steps_dist_mm.e = 0.0f; #endif - #if ENABLED(LCD_SHOW_E_TOTAL) - e_move_accumulator += steps_dist_mm.e; - #endif + TERN_(LCD_SHOW_E_TOTAL, e_move_accumulator += steps_dist_mm.e); 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 @@ -1909,9 +1924,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, * 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 + TERN_(BACKLASH_COMPENSATION, backlash.add_correction_steps(da, db, dc, dm, block)); } #if EXTRUDERS @@ -1927,11 +1940,9 @@ bool Planner::_populate_block(block_t * const block, bool split_move, MIXER_POPULATE_BLOCK(); #endif - #if HAS_CUTTER - block->cutter_power = cutter.power; - #endif + TERN_(HAS_CUTTER, block->cutter_power = cutter.power); - #if FAN_COUNT > 0 + #if HAS_FAN FANS_LOOP(i) block->fan_speed[i] = thermalManager.fan_speed[i]; #endif @@ -1981,9 +1992,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // Enable extruder(s) #if EXTRUDERS if (esteps) { - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif + TERN_(AUTO_POWER_CONTROL, powerManager.power_on()); #if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Enable only the selected extruder @@ -2031,9 +2040,9 @@ bool Planner::_populate_block(block_t * const block, bool split_move, 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) + #if EITHER(SLOWDOWN, HAS_SPI_LCD) || defined(XY_FREQUENCY_LIMIT) // Segment time im micro seconds - uint32_t segment_time_us = LROUND(1000000.0f / inverse_secs); + int32_t segment_time_us = LROUND(1000000.0f / inverse_secs); #endif #if ENABLED(SLOWDOWN) @@ -2041,9 +2050,10 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #define SLOWDOWN_DIVISOR 2 #endif if (WITHIN(moves_queued, 2, (BLOCK_BUFFER_SIZE) / (SLOWDOWN_DIVISOR) - 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); + const int32_t time_diff = settings.min_segment_time_us - segment_time_us; + if (time_diff > 0) { + // Buffer is draining so add extra time. The amount of time added increases if the buffer is still emptied more. + const int32_t nst = segment_time_us + LROUND(2 * time_diff / moves_queued); inverse_secs = 1000000.0f / nst; #if defined(XY_FREQUENCY_LIMIT) || HAS_SPI_LCD segment_time_us = nst; @@ -2087,57 +2097,71 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #if EXTRUDERS { current_speed.e = steps_dist_mm.e * inverse_secs; - #if BOTH(MIXING_EXTRUDER, RETRACT_SYNC_MIXING) + #if HAS_MIXER_SYNC_CHANNEL // 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); + max_fr = settings.max_feedrate_mm_s[E_AXIS_N(extruder)] + * TERN(HAS_MIXER_SYNC_CHANNEL, MIXING_STEPPERS, 1); + + if (cs > max_fr) NOMORE(speed_factor, max_fr / cs); //respect max feedrate on any movement (doesn't matter if E axes only or not) + + #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) + const feedRate_t max_vfr = volumetric_extruder_feedrate_limit[extruder] + * TERN(HAS_MIXER_SYNC_CHANNEL, MIXING_STEPPERS, 1); + + // TODO: Doesn't work properly for joined segments. Set MIN_STEPS_PER_SEGMENT 1 as workaround. + + if (block->steps.a || block->steps.b || block->steps.c) { + + if (max_vfr > 0 && cs > max_vfr) { + NOMORE(speed_factor, max_vfr / cs); // respect volumetric extruder limit (if any) + /* <-- add a slash to enable + SERIAL_ECHOPAIR("volumetric extruder limit enforced: ", (cs * CIRCLE_AREA(filament_size[extruder] * 0.5f))); + SERIAL_ECHOPAIR(" mm^3/s (", cs); + SERIAL_ECHOPAIR(" mm/s) limited to ", (max_vfr * CIRCLE_AREA(filament_size[extruder] * 0.5f))); + SERIAL_ECHOPAIR(" mm^3/s (", max_vfr); + SERIAL_ECHOLNPGM(" mm/s)"); + //*/ + } + } + #endif } #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); + static uint8_t old_direction_bits; // = 0 - 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 (xy_freq_limit_hz) { + // Check and limit the xy direction change frequency + const uint8_t direction_change = block->direction_bits ^ old_direction_bits; + old_direction_bits = block->direction_bits; + segment_time_us = LROUND(float(segment_time_us) / speed_factor); - if (TEST(direction_change, X_AXIS)) { - xs2 = axis_segment_time_us[2].x = xs1; - xs1 = axis_segment_time_us[1].x = xs0; - xs0 = 0; + static int32_t xs0, xs1, xs2, ys0, ys1, ys2; + if (segment_time_us > xy_freq_min_interval_us) + xs2 = xs1 = ys2 = ys1 = xy_freq_min_interval_us; + else { + xs2 = xs1; xs1 = xs0; + ys2 = ys1; ys1 = ys0; + } + xs0 = TEST(direction_change, X_AXIS) ? segment_time_us : xy_freq_min_interval_us; + ys0 = TEST(direction_change, Y_AXIS) ? segment_time_us : xy_freq_min_interval_us; + + if (segment_time_us < xy_freq_min_interval_us) { + const int32_t least_xy_segment_time = _MIN(_MAX(xs0, xs1, xs2), _MAX(ys0, ys1, ys2)); + if (least_xy_segment_time < xy_freq_min_interval_us) { + float freq_xy_feedrate = (speed_factor * least_xy_segment_time) / xy_freq_min_interval_us; + NOLESS(freq_xy_feedrate, xy_freq_min_speed_factor); + NOMORE(speed_factor, freq_xy_feedrate); + } + } } - 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 @@ -2153,9 +2177,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, 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 + TERN_(LIN_ADVANCE, block->use_advance_lead = false); } else { #define LIMIT_ACCEL_LONG(AXIS,INDX) do{ \ @@ -2177,15 +2199,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #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 + #define MAX_E_JERK(N) TERN(HAS_LINEAR_E_JERK, max_e_jerk[E_INDEX_N(N)], max_jerk.e) /** * @@ -2217,33 +2231,26 @@ bool Planner::_populate_block(block_t * const block, bool split_move, 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 + const uint32_t max_accel_steps_per_s2 = MAX_E_JERK(extruder) / (extruder_advance_K[active_extruder] * block->e_D_ratio) * steps_per_mm; + if (TERN0(LA_DEBUG, accel > max_accel_steps_per_s2)) + SERIAL_ECHOLNPGM("Acceleration limited."); 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); + LIMIT_ACCEL_LONG(E_AXIS, E_INDEX_N(extruder)); } 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); + LIMIT_ACCEL_FLOAT(E_AXIS, E_INDEX_N(extruder)); } } block->acceleration_steps_per_s2 = accel; @@ -2265,7 +2272,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, float vmax_junction_sqr; // Initial limit on the segment entry velocity (mm/s)^2 - #if DISABLED(CLASSIC_JERK) + #if HAS_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 @@ -2310,16 +2317,17 @@ bool Planner::_populate_block(block_t * const block, bool split_move, { steps_dist_mm.x, steps_dist_mm.y, steps_dist_mm.z, steps_dist_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 + /** + * 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. + * Elsewise, when needed JD factors in the E component + */ + if (ENABLED(IS_CORE) || esteps > 0) + normalize_junction_vector(unit_vec); // Normalize with XYZE components + else + unit_vec *= inverse_millimeters; // Use pre-calculated (1 / SQRT(x^2 + y^2 + z^2)) // 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)) { @@ -2343,18 +2351,95 @@ bool Planner::_populate_block(block_t * const block, bool split_move, 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) { + vmax_junction_sqr = junction_acceleration * junction_deviation_mm * sin_theta_d2 / (1.0f - sin_theta_d2); - // 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 ENABLED(JD_HANDLE_SMALL_SEGMENTS) - // 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; + // For small moves with >135° junction (octagon) find speed for approximate arc + if (block->millimeters < 1 && junction_cos_theta < -0.7071067812f) { + + #if ENABLED(JD_USE_MATH_ACOS) + + #error "TODO: Inline maths with the MCU / FPU." + + #elif ENABLED(JD_USE_LOOKUP_TABLE) + + // Fast acos approximation (max. error +-0.01 rads) + // Based on LUT table and linear interpolation + + /** + * // Generate the JD Lookup Table + * constexpr float c = 1.00751495f; // Correction factor to center error around 0 + * for (int i = 0; i < jd_lut_count - 1; ++i) { + * const float x0 = (sq(i) - 1) / sq(i), + * y0 = acos(x0) * (i == 0 ? 1 : c), + * x1 = i < jd_lut_count - 1 ? 0.5 * x0 + 0.5 : 0.999999f, + * y1 = acos(x1) * (i < jd_lut_count - 1 ? c : 1); + * jd_lut_k[i] = (y0 - y1) / (x0 - x1); + * jd_lut_b[i] = (y1 * x0 - y0 * x1) / (x0 - x1); + * } + * + * // Compute correction factor (Set c to 1.0f first!) + * float min = INFINITY, max = -min; + * for (float t = 0; t <= 1; t += 0.0003f) { + * const float e = acos(t) / approx(t); + * if (isfinite(e)) { + * if (e < min) min = e; + * if (e > max) max = e; + * } + * } + * fprintf(stderr, "%.9gf, ", (min + max) / 2); + */ + static constexpr int16_t jd_lut_count = 16; + static constexpr uint16_t jd_lut_tll = _BV(jd_lut_count - 1); + static constexpr int16_t jd_lut_tll0 = __builtin_clz(jd_lut_tll) + 1; // i.e., 16 - jd_lut_count + 1 + static constexpr float jd_lut_k[jd_lut_count] PROGMEM = { + -1.03145837f, -1.30760646f, -1.75205851f, -2.41705704f, + -3.37769222f, -4.74888992f, -6.69649887f, -9.45661736f, + -13.3640480f, -18.8928222f, -26.7136841f, -37.7754593f, + -53.4201813f, -75.5458374f, -106.836761f, -218.532821f }; + static constexpr float jd_lut_b[jd_lut_count] PROGMEM = { + 1.57079637f, 1.70887053f, 2.04220939f, 2.62408352f, + 3.52467871f, 4.85302639f, 6.77020454f, 9.50875854f, + 13.4009285f, 18.9188995f, 26.7321243f, 37.7885055f, + 53.4293975f, 75.5523529f, 106.841369f, 218.534011f }; + + const float neg = junction_cos_theta < 0 ? -1 : 1, + t = neg * junction_cos_theta; + + const int16_t idx = (t < 0.00000003f) ? 0 : __builtin_clz(uint16_t((1.0f - t) * jd_lut_tll)) - jd_lut_tll0; + + float junction_theta = t * pgm_read_float(&jd_lut_k[idx]) + pgm_read_float(&jd_lut_b[idx]); + if (neg > 0) junction_theta = RADIANS(180) - junction_theta; // acos(-t) + + #else + + // Fast acos(-t) approximation (max. error +-0.033rad = 1.89°) + // Based on MinMax polynomial published by W. Randolph Franklin, see + // https://wrf.ecse.rpi.edu/Research/Short_Notes/arcsin/onlyelem.html + // acos( t) = pi / 2 - asin(x) + // acos(-t) = pi - acos(t) ... pi / 2 + asin(x) + + const float neg = junction_cos_theta < 0 ? -1 : 1, + t = neg * junction_cos_theta, + asinx = 0.032843707f + + t * (-1.451838349f + + t * ( 29.66153956f + + t * (-131.1123477f + + t * ( 262.8130562f + + t * (-242.7199627f + + t * ( 84.31466202f ) ))))), + junction_theta = RADIANS(90) + neg * asinx; // acos(-t) + + // NOTE: junction_theta bottoms out at 0.033 which avoids divide by 0. + + #endif + + const float limit_sqr = (block->millimeters * junction_acceleration) / junction_theta; NOMORE(vmax_junction_sqr, limit_sqr); } - } + + #endif // JD_HANDLE_SMALL_SEGMENTS } // Get the lowest speed @@ -2389,19 +2474,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // Start with a safe speed (from which the machine may halt to stop immediately). float safe_speed = nominal_speed; - #ifdef TRAVEL_EXTRA_XYJERK - const float extra_xyjerk = (de <= 0) ? TRAVEL_EXTRA_XYJERK : 0; - #else - constexpr float extra_xyjerk = 0; + #ifndef TRAVEL_EXTRA_XYJERK + #define TRAVEL_EXTRA_XYJERK 0 #endif + const float extra_xyjerk = (de <= 0) ? TRAVEL_EXTRA_XYJERK : 0; uint8_t limited = 0; - #if HAS_LINEAR_E_JERK - LOOP_XYZ(i) - #else - LOOP_XYZE(i) - #endif - { + TERN(HAS_LINEAR_E_JERK, LOOP_XYZ, LOOP_XYZE)(i) { const float jerk = ABS(current_speed[i]), // cs : Starting from zero, change in speed for this axis maxj = (max_jerk[i] + (i == X_AXIS || i == Y_AXIS ? extra_xyjerk : 0.0f)); // mj : The max jerk setting for this axis if (jerk > maxj) { // cs > mj : New current speed too fast? @@ -2430,16 +2509,16 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // 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); + float smaller_speed_factor = 1.0f; + if (nominal_speed < previous_nominal_speed) { + vmax_junction = nominal_speed; + smaller_speed_factor = vmax_junction / previous_nominal_speed; + } + else + vmax_junction = 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 - { + TERN(HAS_LINEAR_E_JERK, LOOP_XYZ, 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]; @@ -2474,10 +2553,10 @@ bool Planner::_populate_block(block_t * const block, bool split_move, previous_safe_speed = safe_speed; - #if DISABLED(CLASSIC_JERK) - vmax_junction_sqr = _MIN(vmax_junction_sqr, sq(vmax_junction)); + #if HAS_JUNCTION_DEVIATION + NOMORE(vmax_junction_sqr, sq(vmax_junction)); // Throttle down to max speed #else - vmax_junction_sqr = sq(vmax_junction); + vmax_junction_sqr = sq(vmax_junction); // Go up or down to the new speed #endif #endif // Classic Jerk Limiting @@ -2506,22 +2585,14 @@ bool Planner::_populate_block(block_t * const block, bool split_move, 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 + position = target; // Update the position - #if ENABLED(GRADIENT_MIX) - mixer.gradient_control(target_float.z); - #endif + TERN_(HAS_POSITION_FLOAT, position_float = target_float); + TERN_(GRADIENT_MIX, mixer.gradient_control(target_float.z)); + TERN_(POWER_LOSS_RECOVERY, block->sdpos = recovery.command_sdpos()); - #if ENABLED(POWER_LOSS_RECOVERY) - block->sdpos = recovery.command_sdpos(); - #endif + return true; // Movement was accepted - // Movement was accepted - return true; } // _populate_block() /** @@ -2566,6 +2637,8 @@ void Planner::buffer_sync_block() { * fr_mm_s - (target) speed of the move * extruder - target extruder * millimeters - the length of the movement, if known + * + * Return 'false' if no segment was queued due to cleaning, cold extrusion, full queue, etc. */ bool Planner::buffer_segment(const float &a, const float &b, const float &c, const float &e #if HAS_DIST_MM_ARG @@ -2599,15 +2672,9 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con #endif // DRYRUN prevents E moves from taking place - if (DEBUGGING(DRYRUN) - #if ENABLED(CANCEL_OBJECTS) - || cancelable.skipping - #endif - ) { + if (DEBUGGING(DRYRUN) || TERN0(CANCEL_OBJECTS, cancelable.skipping)) { position.e = target.e; - #if HAS_POSITION_FLOAT - position_float.e = e; - #endif + TERN_(HAS_POSITION_FLOAT, position_float.e = e); } /* <-- add a slash to enable @@ -2641,17 +2708,15 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con SERIAL_ECHOLNPGM(")"); //*/ - // Queue the movement - if ( - !_buffer_steps(target + // Queue the movement. Return 'false' if the move was not queued. + if (!_buffer_steps(target #if HAS_POSITION_FLOAT , target_float #endif #if HAS_DIST_MM_ARG , cart_dist_mm #endif - , fr_mm_s, extruder, millimeters - ) + , fr_mm_s, extruder, millimeters) ) return false; stepper.wake_up(); @@ -2675,13 +2740,11 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con #endif ) { xyze_pos_t machine = { rx, ry, rz, e }; - #if HAS_POSITION_MODIFIERS - apply_modifiers(machine); - #endif + TERN_(HAS_POSITION_MODIFIERS, apply_modifiers(machine)); #if IS_KINEMATIC - #if DISABLED(CLASSIC_JERK) + #if HAS_JUNCTION_DEVIATION const xyze_pos_t cart_dist_mm = { rx - position_cart.x, ry - position_cart.y, rz - position_cart.z, e - position_cart.e @@ -2707,7 +2770,7 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con const feedRate_t feedrate = fr_mm_s; #endif if (buffer_segment(delta.a, delta.b, delta.c, machine.e - #if DISABLED(CLASSIC_JERK) + #if HAS_JUNCTION_DEVIATION , cart_dist_mm #endif , feedrate, extruder, mm @@ -2722,6 +2785,69 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con #endif } // buffer_line() +#if ENABLED(DIRECT_STEPPING) + + void Planner::buffer_page(const page_idx_t page_idx, const uint8_t extruder, const uint16_t num_steps) { + if (!last_page_step_rate) { + kill(GET_TEXT(MSG_BAD_PAGE_SPEED)); + return; + } + + uint8_t next_buffer_head; + block_t * const block = get_next_free_block(next_buffer_head); + + block->flag = BLOCK_FLAG_IS_PAGE; + + #if FAN_COUNT > 0 + FANS_LOOP(i) block->fan_speed[i] = thermalManager.fan_speed[i]; + #endif + + #if EXTRUDERS > 1 + block->extruder = extruder; + #endif + + block->page_idx = page_idx; + + block->step_event_count = num_steps; + block->initial_rate = + block->final_rate = + block->nominal_rate = last_page_step_rate; // steps/s + + block->accelerate_until = 0; + block->decelerate_after = block->step_event_count; + + // Will be set to last direction later if directional format. + block->direction_bits = 0; + + #define PAGE_UPDATE_DIR(AXIS) \ + if (!last_page_dir[_AXIS(AXIS)]) SBI(block->direction_bits, _AXIS(AXIS)); + + if (!DirectStepping::Config::DIRECTIONAL) { + PAGE_UPDATE_DIR(X); + PAGE_UPDATE_DIR(Y); + PAGE_UPDATE_DIR(Z); + PAGE_UPDATE_DIR(E); + } + + // 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; + + enable_all_steppers(); + stepper.wake_up(); + } + +#endif // DIRECT_STEPPING + /** * Directly set the planner ABC position (and stepper positions) * converting mm (or angles for SCARA) into steps. @@ -2730,12 +2856,8 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con */ 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 + TERN_(DISTINCT_E_FACTORS, last_extruder = active_extruder); + TERN_(HAS_POSITION_FLOAT, position_float.set(a, b, c, e)); 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]), @@ -2752,13 +2874,7 @@ void Planner::set_machine_position_mm(const float &a, const float &b, const floa 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 - ); - } + apply_modifiers(machine, true); #endif #if IS_KINEMATIC position_cart.set(rx, ry, rz, e); @@ -2774,21 +2890,13 @@ void Planner::set_position_mm(const float &rx, const float &ry, const float &rz, */ 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 + TERN_(DISTINCT_E_FACTORS, last_extruder = active_extruder); + + const float e_new = e - TERN0(FWRETRACT, fwretract.current_retract[active_extruder]); 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 + TERN_(HAS_POSITION_FLOAT, position_float.e = e_new); + TERN_(IS_KINEMATIC, position_cart.e = e); + if (has_blocks_queued()) buffer_sync_block(); else @@ -2808,9 +2916,7 @@ void Planner::reset_acceleration_rates() { 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 + TERN_(HAS_LINEAR_E_JERK, recalculate_max_e_jerk()); } // Recalculate position, steps_to_mm if settings.axis_steps_per_mm changes! @@ -2839,7 +2945,7 @@ void Planner::set_max_acceleration(const uint8_t axis, float targetValue) { const xyze_float_t &max_acc_edit_scaled = max_accel_edit; #else constexpr xyze_float_t max_accel_edit = DEFAULT_MAX_ACCELERATION; - constexpr xyze_float_t max_acc_edit_scaled = max_accel_edit * 2; + const xyze_float_t max_acc_edit_scaled = max_accel_edit * 2; #endif limit_and_warn(targetValue, axis, PSTR("Acceleration"), max_acc_edit_scaled); #endif @@ -2856,7 +2962,7 @@ void Planner::set_max_feedrate(const uint8_t axis, float targetValue) { const xyze_float_t &max_fr_edit_scaled = max_fr_edit; #else constexpr xyze_float_t max_fr_edit = DEFAULT_MAX_FEEDRATE; - constexpr xyze_float_t max_fr_edit_scaled = max_fr_edit * 2; + const xyze_float_t max_fr_edit_scaled = max_fr_edit * 2; #endif limit_and_warn(targetValue, axis, PSTR("Feedrate"), max_fr_edit_scaled); #endif @@ -2891,7 +2997,7 @@ void Planner::set_max_jerk(const AxisEnum axis, float targetValue) { const bool was_enabled = stepper.suspend(); #endif - millis_t bbru = block_buffer_runtime_us; + uint32_t bbru = block_buffer_runtime_us; #ifdef __AVR__ // Reenable Stepper ISR @@ -2903,7 +3009,7 @@ void Planner::set_max_jerk(const AxisEnum axis, float targetValue) { // Doesn't matter because block_buffer_runtime_us is already too small an estimation. bbru >>= 10; // limit to about a minute. - NOMORE(bbru, 0xFFFFul); + NOMORE(bbru, 0x0000FFFFUL); return bbru; } @@ -2926,10 +3032,30 @@ void Planner::set_max_jerk(const AxisEnum axis, float targetValue) { #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(); - } +void Planner::autotemp_update() { + #if ENABLED(AUTOTEMP_PROPORTIONAL) + const int16_t target = thermalManager.degTargetHotend(active_extruder); + autotemp_min = target + AUTOTEMP_MIN_P; + autotemp_max = target + AUTOTEMP_MAX_P; + #endif + autotemp_factor = TERN(AUTOTEMP_PROPORTIONAL, AUTOTEMP_FACTOR_P, 0); + autotemp_enabled = autotemp_factor != 0; +} + void Planner::autotemp_M104_M109() { + + #if ENABLED(AUTOTEMP_PROPORTIONAL) + const int16_t target = thermalManager.degTargetHotend(active_extruder); + autotemp_min = target + AUTOTEMP_MIN_P; + autotemp_max = target + AUTOTEMP_MAX_P; + #endif + + if (parser.seenval('S')) autotemp_min = parser.value_celsius(); + if (parser.seenval('B')) autotemp_max = parser.value_celsius(); + + // When AUTOTEMP_PROPORTIONAL is enabled, F0 disables autotemp. + // Normally, leaving off F also disables autotemp. + autotemp_factor = parser.seen('F') ? parser.value_float() : TERN(AUTOTEMP_PROPORTIONAL, AUTOTEMP_FACTOR_P, 0); + autotemp_enabled = autotemp_factor != 0; + } #endif diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 24c02c01c5..f3a3a0e0fc 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -32,6 +32,17 @@ #include "../MarlinCore.h" +#if ENABLED(JD_HANDLE_SMALL_SEGMENTS) + // Enable this option for perfect accuracy but maximum + // computation. Should be fine on ARM processors. + //#define JD_USE_MATH_ACOS + + // Disable this option to save 120 bytes of PROGMEM, + // but incur increased computation and a reduction + // in accuracy. + #define JD_USE_LOOKUP_TABLE +#endif + #include "motion.h" #include "../gcode/queue.h" @@ -52,7 +63,14 @@ #endif #if HAS_CUTTER - #include "../feature/spindle_laser.h" + #include "../feature/spindle_laser_types.h" +#endif + +#if ENABLED(DIRECT_STEPPING) + #include "../feature/direct_stepping.h" + #define IS_PAGE(B) TEST(B->flag, BLOCK_BIT_IS_PAGE) +#else + #define IS_PAGE(B) false #endif // Feedrate for manual moves @@ -61,7 +79,7 @@ manual_feedrate_mm_s { _mf.x / 60.0f, _mf.y / 60.0f, _mf.z / 60.0f, _mf.e / 60.0f }; #endif -#if IS_KINEMATIC && DISABLED(CLASSIC_JERK) +#if IS_KINEMATIC && HAS_JUNCTION_DEVIATION #define HAS_DIST_MM_ARG 1 #endif @@ -79,15 +97,47 @@ enum BlockFlagBit : char { // Sync the stepper counts from the block BLOCK_BIT_SYNC_POSITION + + // Direct stepping page + #if ENABLED(DIRECT_STEPPING) + , BLOCK_BIT_IS_PAGE + #endif }; 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) + 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) + #if ENABLED(DIRECT_STEPPING) + , BLOCK_FLAG_IS_PAGE = _BV(BLOCK_BIT_IS_PAGE) + #endif }; +#if ENABLED(LASER_POWER_INLINE) + + typedef struct { + bool isPlanned:1; + bool isEnabled:1; + bool dir:1; + bool Reserved:6; + } power_status_t; + + typedef struct { + power_status_t status; // See planner settings for meaning + uint8_t power; // Ditto; When in trapezoid mode this is nominal power + #if ENABLED(LASER_POWER_INLINE_TRAPEZOID) + uint8_t power_entry; // Entry power for the laser + #if DISABLED(LASER_POWER_INLINE_TRAPEZOID_CONT) + uint8_t power_exit; // Exit power for the laser + uint32_t entry_per, // Steps per power increment (to avoid floats in stepper calcs) + exit_per; // Steps per power decrement + #endif + #endif + } block_laser_t; + +#endif + /** * struct block_t * @@ -120,9 +170,7 @@ typedef struct block_t { static constexpr uint8_t extruder = 0; #endif - #if ENABLED(MIXING_EXTRUDER) - MIXER_BLOCK_FIELD; // Normalized color for the mixing steppers - #endif + TERN_(MIXING_EXTRUDER, MIXER_BLOCK_FIELD); // Normalized color for the mixing steppers // Settings for the trapezoid generator uint32_t accelerate_until, // The index of the step event on which to stop acceleration @@ -154,11 +202,15 @@ typedef struct block_t { final_rate, // The minimal rate at exit acceleration_steps_per_s2; // acceleration steps/sec^2 + #if ENABLED(DIRECT_STEPPING) + page_idx_t page_idx; // Page index used for direct stepping + #endif + #if HAS_CUTTER cutter_power_t cutter_power; // Power level for Spindle, Laser, etc. #endif - #if FAN_COUNT > 0 + #if HAS_FAN uint8_t fan_speed[FAN_COUNT]; #endif @@ -174,12 +226,35 @@ typedef struct block_t { uint32_t sdpos; #endif + #if ENABLED(LASER_POWER_INLINE) + block_laser_t laser; + #endif + } block_t; -#define HAS_POSITION_FLOAT ANY(LIN_ADVANCE, SCARA_FEEDRATE_SCALING, GRADIENT_MIX, LCD_SHOW_E_TOTAL) +#if ANY(LIN_ADVANCE, SCARA_FEEDRATE_SCALING, GRADIENT_MIX, LCD_SHOW_E_TOTAL) + #define HAS_POSITION_FLOAT 1 +#endif #define BLOCK_MOD(n) ((n)&(BLOCK_BUFFER_SIZE-1)) +#if ENABLED(LASER_POWER_INLINE) + typedef struct { + /** + * Laser status flags + */ + power_status_t status; + /** + * Laser power: 0 or 255 in case of PWM-less laser, + * or the OCR (oscillator count register) value; + * + * Using OCR instead of raw power, because it avoids + * floating point operations during the move loop. + */ + uint8_t power; + } laser_state_t; +#endif + typedef struct { uint32_t max_acceleration_mm_per_s2[XYZE_N], // (mm/s^2) M201 XYZE min_segment_time_us; // (µs) M205 B @@ -241,6 +316,11 @@ class Planner { static uint8_t last_extruder; // Respond to extruder change #endif + #if ENABLED(DIRECT_STEPPING) + static uint32_t last_page_step_rate; // Last page step rate given + static xyze_bool_t last_page_dir; // Last page direction given + #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 @@ -253,28 +333,30 @@ class Planner { // May be auto-adjusted by a filament width sensor #endif + #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) + static float volumetric_extruder_limit[EXTRUDERS], // Maximum mm^3/sec the extruder can handle + volumetric_extruder_feedrate_limit[EXTRUDERS]; // Feedrate limit (mm/s) calculated from volume limit + #endif + static planner_settings_t settings; + #if ENABLED(LASER_POWER_INLINE) + static laser_state_t laser_inline; + #endif + 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) + #if HAS_JUNCTION_DEVIATION 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 - ; + #if HAS_LINEAR_E_JERK + static float max_e_jerk[DISTINCT_E]; // Calculated from junction_deviation_mm #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 + // (mm/s^2) M205 XYZ(E) - The largest speed change requiring no acceleration. + static TERN(HAS_LINEAR_E_JERK, xyz_pos_t, xyze_pos_t) max_jerk; #endif #if HAS_LEVELING @@ -312,6 +394,23 @@ class Planner { #if ENABLED(SD_ABORT_ON_ENDSTOP_HIT) static bool abort_on_endstop_hit; #endif + #ifdef XY_FREQUENCY_LIMIT + static int8_t xy_freq_limit_hz; // Minimum XY frequency setting + static float xy_freq_min_speed_factor; // Minimum speed factor setting + static int32_t xy_freq_min_interval_us; // Minimum segment time based on xy_freq_limit_hz + static inline void refresh_frequency_limit() { + //xy_freq_min_interval_us = xy_freq_limit_hz ?: LROUND(1000000.0f / xy_freq_limit_hz); + if (xy_freq_limit_hz) + xy_freq_min_interval_us = LROUND(1000000.0f / xy_freq_limit_hz); + } + static inline void set_min_speed_factor_u8(const uint8_t v255) { + xy_freq_min_speed_factor = float(ui8_to_percent(v255)) / 100; + } + static inline void set_frequency_limit(const uint8_t hz) { + xy_freq_limit_hz = constrain(hz, 0, 100); + refresh_frequency_limit(); + } + #endif private: @@ -335,23 +434,12 @@ class Planner { #endif #if ENABLED(DISABLE_INACTIVE_EXTRUDER) - /** - * Counters to manage disabling inactive extruders - */ + // 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 + volatile static uint32_t block_buffer_runtime_us; // Theoretical block buffer runtime in µs #endif public: @@ -377,20 +465,19 @@ class Planner { #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 - ); + e_factor[e] = flow_percentage[e] * 0.01f * TERN(NO_VOLUMETRICS, 1.0f, volumetric_multiplier[e]); } + + static inline void set_flow(const uint8_t e, const int16_t flow) { + flow_percentage[e] = flow; + refresh_e_factor(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 apply_filament_width_sensor(const int8_t encoded_ratio); @@ -404,8 +491,18 @@ class Planner { #if DISABLED(NO_VOLUMETRICS) + // Update multipliers based on new diameter measurements + static void calculate_volumetric_multipliers(); + + #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) + // Update pre calculated extruder feedrate limits based on volumetric values + static void calculate_volumetric_extruder_limit(const uint8_t e); + static void calculate_volumetric_extruder_limits(); + #endif + FORCE_INLINE static void set_filament_size(const uint8_t e, const float &v) { filament_size[e] = v; + if (v > 0) volumetric_area_nominal = CIRCLE_AREA(v * 0.5); //TODO: should it be per extruder // make sure all extruders have some sane value for the filament size LOOP_L_N(i, COUNT(filament_size)) if (!filament_size[i]) filament_size[i] = DEFAULT_NOMINAL_FILAMENT_DIA; @@ -413,6 +510,13 @@ class Planner { #endif + #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) + FORCE_INLINE static void set_volumetric_extruder_limit(const uint8_t e, const float &v) { + volumetric_extruder_limit[e] = v; + calculate_volumetric_extruder_limit(e); + } + #endif + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) /** @@ -491,6 +595,9 @@ class Planner { unapply_leveling(raw); leveling_active = false; } + #else + FORCE_INLINE static void apply_leveling(xyz_pos_t&) {} + FORCE_INLINE static void unapply_leveling(xyz_pos_t&) {} #endif #if ENABLED(FWRETRACT) @@ -501,46 +608,16 @@ class Planner { #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 apply_modifiers(xyze_pos_t &pos, bool leveling=ENABLED(PLANNER_LEVELING)) { + TERN_(SKEW_CORRECTION, skew(pos)); + if (leveling) apply_leveling(pos); + TERN_(FWRETRACT, apply_retract(pos)); } - 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 + FORCE_INLINE static void unapply_modifiers(xyze_pos_t &pos, bool leveling=ENABLED(PLANNER_LEVELING)) { + TERN_(FWRETRACT, unapply_retract(pos)); + if (leveling) unapply_leveling(pos); + TERN_(SKEW_CORRECTION, unskew(pos)); } #endif // HAS_POSITION_MODIFIERS @@ -697,6 +774,10 @@ class Planner { ); } + #if ENABLED(DIRECT_STEPPING) + static void buffer_page(const page_idx_t page_idx, const uint8_t extruder, const uint16_t num_steps); + #endif + /** * Set the planner.position and individual stepper positions. * Used by G92, G28, G29, and other procedures. @@ -763,12 +844,7 @@ class Planner { // 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 - } + if (cleaning_buffer_counter) --cleaning_buffer_counter; } /** @@ -787,10 +863,10 @@ class Planner { static block_t* get_current_block(); /** - * "Discard" the block and "release" the memory. + * "Release" the current block so its slot can be reused. * Called when the current block is no longer needed. */ - FORCE_INLINE static void discard_current_block() { + FORCE_INLINE static void release_current_block() { if (has_blocks_queued()) block_buffer_tail = next_block_index(block_buffer_tail); } @@ -805,17 +881,14 @@ class Planner { static bool autotemp_enabled; static void getHighESpeed(); static void autotemp_M104_M109(); + static void autotemp_update(); #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) - LOOP_L_N(i, EXTRUDERS) - 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 + const float prop = junction_deviation_mm * SQRT(0.5) / (1.0f - SQRT(0.5)); + LOOP_L_N(i, EXTRUDERS) + max_e_jerk[E_INDEX_N(i)] = SQRT(prop * settings.max_acceleration_mm_per_s2[E_INDEX_N(i)]); } #endif @@ -879,7 +952,7 @@ class Planner { static void recalculate(); - #if DISABLED(CLASSIC_JERK) + #if HAS_JUNCTION_DEVIATION FORCE_INLINE static void normalize_junction_vector(xyze_float_t &vector) { float magnitude_sq = 0; @@ -889,8 +962,12 @@ class Planner { 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])); + LOOP_XYZE(idx) { + if (unit_vec[idx]) { + if (limit_value * ABS(unit_vec[idx]) > settings.max_acceleration_mm_per_s2[idx]) + limit_value = ABS(settings.max_acceleration_mm_per_s2[idx] / unit_vec[idx]); + } + } return limit_value; } diff --git a/Marlin/src/module/planner_bezier.cpp b/Marlin/src/module/planner_bezier.cpp index 7ea3956436..4025b773ed 100644 --- a/Marlin/src/module/planner_bezier.cpp +++ b/Marlin/src/module/planner_bezier.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -36,7 +36,6 @@ #include "temperature.h" #include "../MarlinCore.h" -#include "../core/language.h" #include "../gcode/queue.h" // See the meaning in the documentation of cubic_b_spline(). diff --git a/Marlin/src/module/planner_bezier.h b/Marlin/src/module/planner_bezier.h index e7ef4719e1..41a88b4058 100644 --- a/Marlin/src/module/planner_bezier.h +++ b/Marlin/src/module/planner_bezier.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/module/printcounter.cpp b/Marlin/src/module/printcounter.cpp index 3623c88a13..86aedf2161 100644 --- a/Marlin/src/module/printcounter.cpp +++ b/Marlin/src/module/printcounter.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -70,19 +70,14 @@ millis_t PrintCounter::lastDuration; bool PrintCounter::loaded = false; millis_t PrintCounter::deltaDuration() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("deltaDuration")); - #endif - + TERN_(DEBUG_PRINTCOUNTER, debug(PSTR("deltaDuration"))); millis_t tmp = lastDuration; lastDuration = duration(); return lastDuration - tmp; } void PrintCounter::incFilamentUsed(float const &amount) { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("incFilamentUsed")); - #endif + TERN_(DEBUG_PRINTCOUNTER, debug(PSTR("incFilamentUsed"))); // Refuses to update data if object is not loaded if (!isLoaded()) return; @@ -91,9 +86,7 @@ void PrintCounter::incFilamentUsed(float const &amount) { } void PrintCounter::initStats() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("initStats")); - #endif + TERN_(DEBUG_PRINTCOUNTER, debug(PSTR("initStats"))); loaded = true; data = { 0, 0, 0, 0, 0.0 @@ -129,9 +122,7 @@ void PrintCounter::initStats() { #endif void PrintCounter::loadStats() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("loadStats")); - #endif + TERN_(DEBUG_PRINTCOUNTER, debug(PSTR("loadStats"))); // Check if the EEPROM block is initialized uint8_t value = 0; @@ -164,9 +155,7 @@ void PrintCounter::loadStats() { } void PrintCounter::saveStats() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("saveStats")); - #endif + TERN_(DEBUG_PRINTCOUNTER, debug(PSTR("saveStats"))); // Refuses to save data if object is not loaded if (!isLoaded()) return; @@ -176,9 +165,7 @@ void PrintCounter::saveStats() { persistentStore.write_data(address + sizeof(uint8_t), (uint8_t*)&data, sizeof(printStatistics)); persistentStore.access_finish(); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onConfigurationStoreWritten(true); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onConfigurationStoreWritten(true)); } #if HAS_SERVICE_INTERVALS @@ -239,9 +226,7 @@ void PrintCounter::tick() { static uint32_t update_next; // = 0 if (ELAPSED(now, update_next)) { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("tick")); - #endif + TERN_(DEBUG_PRINTCOUNTER, debug(PSTR("tick"))); millis_t delta = deltaDuration(); data.printTime += delta; @@ -267,9 +252,7 @@ void PrintCounter::tick() { // @Override bool PrintCounter::start() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("start")); - #endif + TERN_(DEBUG_PRINTCOUNTER, debug(PSTR("start"))); bool paused = isPaused(); @@ -286,9 +269,7 @@ bool PrintCounter::start() { // @Override bool PrintCounter::stop() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("stop")); - #endif + TERN_(DEBUG_PRINTCOUNTER, debug(PSTR("stop"))); if (super::stop()) { data.finishedPrints++; @@ -305,9 +286,7 @@ bool PrintCounter::stop() { // @Override void PrintCounter::reset() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("stop")); - #endif + TERN_(DEBUG_PRINTCOUNTER, debug(PSTR("stop"))); super::reset(); lastDuration = 0; diff --git a/Marlin/src/module/printcounter.h b/Marlin/src/module/printcounter.h index 39a237cc44..66d8cbb7b3 100644 --- a/Marlin/src/module/printcounter.h +++ b/Marlin/src/module/printcounter.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -28,12 +28,8 @@ // Print debug messages with M111 S2 //#define DEBUG_PRINTCOUNTER -#if USE_WIRED_EEPROM - // round up address to next page boundary (assuming 32 byte pages) - #define STATS_EEPROM_ADDRESS 0x40 -#else - #define STATS_EEPROM_ADDRESS 0x32 -#endif +// Round up I2C / SPI address to next page boundary (assuming 32 byte pages) +#define STATS_EEPROM_ADDRESS TERN(USE_WIRED_EEPROM, 0x40, 0x32) struct printStatistics { // 16 bytes //const uint8_t magic; // Magic header, it will always be 0x16 @@ -57,7 +53,7 @@ class PrintCounter: public Stopwatch { private: typedef Stopwatch super; - #if USE_WIRED_EEPROM || defined(CPU_32_BIT) + #if EITHER(USE_WIRED_EEPROM, CPU_32_BIT) typedef uint32_t eeprom_address_t; #else typedef uint16_t eeprom_address_t; diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 6e3f2baa66..4fab4ec27b 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -134,9 +134,7 @@ xyz_pos_t Probe::offset; // Initialized by settings.load() LCD_MESSAGEPGM(MSG_MANUAL_DEPLOY_TOUCHMI); ui.return_to_status(); - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Deploy TouchMI"), CONTINUE_STR); - #endif + TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Deploy TouchMI"), CONTINUE_STR)); wait_for_user_response(); ui.reset_status(); ui.goto_screen(prev_screen); @@ -241,23 +239,17 @@ xyz_pos_t Probe::offset; // Initialized by settings.load() #if QUIET_PROBING void Probe::set_probing_paused(const bool p) { - #if ENABLED(PROBING_HEATERS_OFF) - thermalManager.pause(p); - #endif - #if ENABLED(PROBING_FANS_OFF) - thermalManager.set_fans_paused(p); - #endif + TERN_(PROBING_HEATERS_OFF, thermalManager.pause(p)); + TERN_(PROBING_FANS_OFF, thermalManager.set_fans_paused(p)); #if ENABLED(PROBING_STEPPERS_OFF) disable_e_steppers(); #if NONE(DELTA, HOME_AFTER_DEACTIVATE) DISABLE_AXIS_X(); DISABLE_AXIS_Y(); #endif #endif - if (p) safe_delay( + if (p) safe_delay(25 #if DELAY_BEFORE_PROBING > 25 - DELAY_BEFORE_PROBING - #else - 25 + - 25 + DELAY_BEFORE_PROBING #endif ); } @@ -268,15 +260,10 @@ xyz_pos_t Probe::offset; // Initialized by settings.load() * Raise Z to a minimum height to make room for a probe to move */ void Probe::do_z_raise(const float z_raise) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Probe::move_z(", z_raise, ")"); - + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Probe::do_z_raise(", z_raise, ")"); float z_dest = z_raise; if (offset.z < 0) z_dest -= offset.z; - - NOMORE(z_dest, Z_MAX_POS); - - if (z_dest > current_position.z) - do_blocking_move_to_z(z_dest); + do_z_clearance(z_dest); } FORCE_INLINE void probe_specific_action(const bool deploy) { @@ -295,22 +282,13 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { serialprintPGM(ds_str); SERIAL_EOL(); - #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 + TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Stow Probe"), CONTINUE_STR)); + TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Stow Probe"))); + wait_for_user_response(); ui.reset_status(); - } while( - #if ENABLED(PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED) - true - #else - false - #endif - ); + } while (ENABLED(PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED)); #endif // PAUSE_BEFORE_DEPLOY_STOW @@ -324,15 +302,13 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { dock_sled(!deploy); + #elif ENABLED(BLTOUCH) + + deploy ? bltouch.deploy() : bltouch.stow(); + #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 + MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][deploy ? 0 : 1]); #elif EITHER(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY) @@ -383,11 +359,7 @@ bool Probe::set_deployed(const bool deploy) { do_z_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 - )) { + if (axis_unhomed_error(TERN_(Z_PROBE_SLED, _BV(X_AXIS)))) { SERIAL_ERROR_MSG(STR_STOP_UNHOMED); stop(); return true; @@ -433,16 +405,6 @@ bool Probe::set_deployed(const bool deploy) { return false; } -#ifdef Z_AFTER_PROBING - // After probing move to a preferred Z position - void Probe::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. * @@ -462,9 +424,9 @@ bool Probe::set_deployed(const bool deploy) { * @return TRUE if the probe failed to trigger. */ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) { - if (DEBUGGING(LEVELING)) DEBUG_POS(">>> Probe::probe_down_to_z", current_position); + DEBUG_SECTION(log_probe, "Probe::probe_down_to_z", DEBUGGING(LEVELING)); - #if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) + #if BOTH(HAS_HEATED_BED, WAIT_FOR_BED_HEATER) thermalManager.wait_for_bed_heating(); #endif @@ -483,9 +445,7 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) { endstops.enable(true); #endif - #if QUIET_PROBING - set_probing_paused(true); - #endif + TERN_(QUIET_PROBING, set_probing_paused(true)); // Move down until the probe is triggered do_blocking_move_to_z(z, fr_mm_s); @@ -495,19 +455,11 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) { #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 - ) + TEST(endstops.trigger_state(), TERN(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, Z_MIN, Z_MIN_PROBE)) #endif ; - #if QUIET_PROBING - set_probing_paused(false); - #endif + TERN_(QUIET_PROBING, set_probing_paused(false)); // Re-enable stealthChop if used. Disable diag1 pin on driver. #if ENABLED(SENSORLESS_PROBING) @@ -532,8 +484,6 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) { // Tell the planner where we actually are sync_plan_position(); - if (DEBUGGING(LEVELING)) DEBUG_POS("<<< Probe::probe_down_to_z", current_position); - return !probe_triggered; } @@ -546,8 +496,25 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) { * @return The Z position of the bed at the current XY or NAN on error. */ float Probe::run_z_probe(const bool sanity_check/*=true*/) { + DEBUG_SECTION(log_probe, "Probe::run_z_probe", DEBUGGING(LEVELING)); - if (DEBUGGING(LEVELING)) DEBUG_POS(">>> Probe::run_z_probe", current_position); + auto try_to_probe = [&](PGM_P const plbl, const float &z_probe_low_point, const feedRate_t fr_mm_s, const bool scheck, const float clearance) { + // Do a first probe at the fast speed + const bool probe_fail = probe_down_to_z(z_probe_low_point, fr_mm_s), // No probe trigger? + early_fail = (scheck && current_position.z > -offset.z + clearance); // Probe triggered too high? + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING) && (probe_fail || early_fail)) { + DEBUG_PRINT_P(plbl); + DEBUG_ECHOPGM(" Probe fail! -"); + if (probe_fail) DEBUG_ECHOPGM(" No trigger."); + if (early_fail) DEBUG_ECHOPGM(" Triggered early."); + DEBUG_EOL(); + } + #else + UNUSED(plbl); + #endif + return probe_fail || early_fail; + }; // Stop the probe before it goes too low to prevent damage. // If Z isn't known then probe to -10mm. @@ -557,15 +524,8 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { #if TOTAL_PROBING == 2 // Do a first probe at the fast speed - if (probe_down_to_z(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_FAST)) // No probe trigger? - || (sanity_check && current_position.z > -offset.z + _MAX(Z_CLEARANCE_BETWEEN_PROBES, 4) / 2) // Probe triggered too high? - ) { - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPGM("FAST Probe fail!"); - DEBUG_POS("<<< run_z_probe", current_position); - } - return NAN; - } + if (try_to_probe(PSTR("FAST"), z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_FAST), + sanity_check, Z_CLEARANCE_BETWEEN_PROBES) ) return NAN; const float first_probe_z = current_position.z; @@ -586,14 +546,14 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { } #endif - #ifdef EXTRA_PROBING + #if EXTRA_PROBING > 0 float probes[TOTAL_PROBING]; #endif #if TOTAL_PROBING > 2 float probes_z_sum = 0; for ( - #if EXTRA_PROBING + #if EXTRA_PROBING > 0 uint8_t p = 0; p < TOTAL_PROBING; p++ #else uint8_t p = TOTAL_PROBING; p--; @@ -602,23 +562,14 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { #endif { // Probe downward slowly to find the bed - if (probe_down_to_z(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_SLOW)) // No probe trigger? - || (sanity_check && current_position.z > -offset.z + _MAX(Z_CLEARANCE_MULTI_PROBE, 4) / 2) // Probe triggered too high? - ) { - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPGM("SLOW Probe fail!"); - DEBUG_POS("<<< run_z_probe", current_position); - } - return NAN; - } + if (try_to_probe(PSTR("SLOW"), z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_SLOW), + sanity_check, Z_CLEARANCE_MULTI_PROBE) ) return NAN; - #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - backlash.measure_with_probe(); - #endif + TERN_(MEASURE_BACKLASH_WHEN_PROBING, backlash.measure_with_probe()); const float z = current_position.z; - #if EXTRA_PROBING + #if EXTRA_PROBING > 0 // Insert Z measurement into probes[]. Keep it sorted ascending. LOOP_LE_N(i, p) { // 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 @@ -636,7 +587,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { #if TOTAL_PROBING > 2 // Small Z raise after all but the last probe if (p - #if EXTRA_PROBING + #if EXTRA_PROBING > 0 < TOTAL_PROBING - 1 #endif ) do_blocking_move_to_z(z + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); @@ -645,7 +596,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { #if TOTAL_PROBING > 2 - #if EXTRA_PROBING + #if EXTRA_PROBING > 0 // 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], @@ -681,8 +632,6 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { #endif - if (DEBUGGING(LEVELING)) DEBUG_POS("<<< run_z_probe", current_position); - return measured_z; } @@ -696,9 +645,11 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { * - Return the probed Z position */ float Probe::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*/, const bool sanity_check/*=true*/) { + DEBUG_SECTION(log_probe, "Probe::probe_at_point", DEBUGGING(LEVELING)); + if (DEBUGGING(LEVELING)) { DEBUG_ECHOLNPAIR( - ">>> Probe::probe_at_point(", LOGICAL_X_POSITION(rx), ", ", LOGICAL_Y_POSITION(ry), + "...(", 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)" @@ -745,11 +696,8 @@ float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise else if (raise_after == PROBE_PT_STOW) if (stow()) measured_z = NAN; // Error on stow? - 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); - } + if (verbose_level > 2) + SERIAL_ECHOLNPAIR("Bed X: ", LOGICAL_X_POSITION(rx), " Y: ", LOGICAL_Y_POSITION(ry), " Z: ", measured_z); } feedrate_mm_s = old_feedrate_mm_s; @@ -757,11 +705,11 @@ float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise if (isnan(measured_z)) { stow(); LCD_MESSAGEPGM(MSG_LCD_PROBING_FAILED); - SERIAL_ERROR_MSG(STR_ERR_PROBING_FAILED); + #if DISABLED(G29_RETRY_AND_RECOVER) + SERIAL_ERROR_MSG(STR_ERR_PROBING_FAILED); + #endif } - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< Probe::probe_at_point"); - return measured_z; } diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 083867ab48..14036a18d9 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -47,7 +47,6 @@ public: static bool set_deployed(const bool deploy); - #if IS_KINEMATIC #if HAS_PROBE_XY_OFFSET @@ -55,11 +54,11 @@ public: // Note: This won't work on SCARA since the probe offset rotates with the arm. static inline bool can_reach(const float &rx, const float &ry) { return position_is_reachable(rx - offset_xy.x, ry - offset_xy.y) // The nozzle can go where it needs to go? - && position_is_reachable(rx, ry, ABS(MIN_PROBE_EDGE)); // Can the nozzle also go near there? + && position_is_reachable(rx, ry, ABS(PROBING_MARGIN)); // Can the nozzle also go near there? } #else FORCE_INLINE static bool can_reach(const float &rx, const float &ry) { - return position_is_reachable(rx, ry, MIN_PROBE_EDGE); + return position_is_reachable(rx, ry, PROBING_MARGIN); } #endif @@ -80,9 +79,18 @@ public: #endif - #ifdef Z_AFTER_PROBING - static void move_z_after_probing(); - #endif + static inline void move_z_after_probing() { + #ifdef Z_AFTER_PROBING + do_z_clearance(Z_AFTER_PROBING, true, true, true); // Move down still permitted + #endif + } + static inline void move_z_after_homing() { + #ifdef Z_AFTER_HOMING + do_z_clearance(Z_AFTER_HOMING, true, true, true); + #elif defined(Z_AFTER_PROBING) + move_z_after_probing(); + #endif + } static 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, const bool sanity_check=true); static 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, const bool sanity_check=true) { return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative, sanity_check); @@ -90,6 +98,8 @@ public: #else + FORCE_INLINE static void move_z_after_homing() {} + static constexpr xyz_pos_t offset = xyz_pos_t({ 0, 0, 0 }); // See #16767 static bool set_deployed(const bool) { return false; } @@ -132,7 +142,7 @@ public: ); static inline float probe_radius() { - return printable_radius - _MAX(MIN_PROBE_EDGE, HYPOT(offset_xy.x, offset_xy.y)); + return printable_radius - _MAX(PROBING_MARGIN, HYPOT(offset_xy.x, offset_xy.y)); } #endif @@ -141,7 +151,7 @@ public: #if IS_KINEMATIC (X_CENTER) - probe_radius() #else - _MAX((X_MIN_BED) + (MIN_PROBE_EDGE_LEFT), (X_MIN_POS) + offset_xy.x) + _MAX((X_MIN_BED) + (PROBING_MARGIN_LEFT), (X_MIN_POS) + offset_xy.x) #endif ); } @@ -150,7 +160,7 @@ public: #if IS_KINEMATIC (X_CENTER) + probe_radius() #else - _MIN((X_MAX_BED) - (MIN_PROBE_EDGE_RIGHT), (X_MAX_POS) + offset_xy.x) + _MIN((X_MAX_BED) - (PROBING_MARGIN_RIGHT), (X_MAX_POS) + offset_xy.x) #endif ); } @@ -159,7 +169,7 @@ public: #if IS_KINEMATIC (Y_CENTER) - probe_radius() #else - _MAX((Y_MIN_BED) + (MIN_PROBE_EDGE_FRONT), (Y_MIN_POS) + offset_xy.y) + _MAX((Y_MIN_BED) + (PROBING_MARGIN_FRONT), (Y_MIN_POS) + offset_xy.y) #endif ); } @@ -168,7 +178,7 @@ public: #if IS_KINEMATIC (Y_CENTER) + probe_radius() #else - _MIN((Y_MAX_BED) - (MIN_PROBE_EDGE_BACK), (Y_MAX_POS) + offset_xy.y) + _MIN((Y_MAX_BED) - (PROBING_MARGIN_BACK), (Y_MAX_POS) + offset_xy.y) #endif ); } @@ -191,7 +201,7 @@ public: #else points[0].set(min_x(), min_y()); points[1].set(max_x(), min_y()); - points[2].set((max_x() - min_x()) / 2, max_y()); + points[2].set((min_x() + max_x()) / 2, max_y()); #endif #endif } diff --git a/Marlin/src/module/scara.cpp b/Marlin/src/module/scara.cpp index 0bb8757a6d..e4b2f0b75c 100644 --- a/Marlin/src/module/scara.cpp +++ b/Marlin/src/module/scara.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/module/scara.h b/Marlin/src/module/scara.h index 2f60ebbf15..e2acaf3082 100644 --- a/Marlin/src/module/scara.h +++ b/Marlin/src/module/scara.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/module/servo.cpp b/Marlin/src/module/servo.cpp index c49f939d0f..27e5a2af2e 100644 --- a/Marlin/src/module/servo.cpp +++ b/Marlin/src/module/servo.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -32,9 +32,7 @@ HAL_SERVO_LIB servo[NUM_SERVOS]; -#if ENABLED(EDITABLE_SERVO_ANGLES) - uint16_t servo_angles[NUM_SERVOS][2]; -#endif +TERN_(EDITABLE_SERVO_ANGLES, uint16_t servo_angles[NUM_SERVOS][2]); void servo_init() { #if NUM_SERVOS >= 1 && HAS_SERVO_0 diff --git a/Marlin/src/module/servo.h b/Marlin/src/module/servo.h index 335ce698e0..29bd3b8798 100644 --- a/Marlin/src/module/servo.h +++ b/Marlin/src/module/servo.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/module/speed_lookuptable.h b/Marlin/src/module/speed_lookuptable.h index 088cb23c7f..b173ebec08 100644 --- a/Marlin/src/module/speed_lookuptable.h +++ b/Marlin/src/module/speed_lookuptable.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index ed48b83d5a..c9d87486f8 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -38,7 +38,7 @@ * 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 . + * along with Grbl. If not, see . */ /** @@ -97,7 +97,6 @@ Stepper stepper; // Singleton #include "temperature.h" #include "../lcd/ultralcd.h" -#include "../core/language.h" #include "../gcode/queue.h" #include "../sd/cardreader.h" #include "../MarlinCore.h" @@ -119,7 +118,7 @@ Stepper stepper; // Singleton #include "../feature/mixing.h" #endif -#ifdef FILAMENT_RUNOUT_DISTANCE_MM +#if HAS_FILAMENT_RUNOUT_DISTANCE #include "../feature/runout.h" #endif @@ -133,9 +132,13 @@ Stepper stepper; // Singleton #include "../feature/powerloss.h" #endif +#if HAS_CUTTER + #include "../feature/spindle_laser.h" +#endif + // public: -#if HAS_EXTRA_ENDSTOPS || ENABLED(Z_STEPPER_AUTO_ALIGN) +#if EITHER(HAS_EXTRA_ENDSTOPS, Z_STEPPER_AUTO_ALIGN) bool Stepper::separate_multi_axis = false; #endif @@ -165,22 +168,19 @@ bool Stepper::abort_current_block; #if EITHER(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN) bool Stepper::locked_Z_motor = false, Stepper::locked_Z2_motor = false - #if NUM_Z_STEPPER_DRIVERS >= 3 - , Stepper::locked_Z3_motor = false - #if NUM_Z_STEPPER_DRIVERS >= 4 - , Stepper::locked_Z4_motor = false - #endif - #endif - ; + #if NUM_Z_STEPPER_DRIVERS >= 3 + , Stepper::locked_Z3_motor = false + #if NUM_Z_STEPPER_DRIVERS >= 4 + , Stepper::locked_Z4_motor = false + #endif + #endif + ; #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; +TERN(ADAPTIVE_STEP_SMOOTHING,,constexpr) uint8_t Stepper::oversampling_factor; xyze_long_t Stepper::delta_error{0}; @@ -227,6 +227,10 @@ uint32_t Stepper::advance_divisor = 0, uint32_t Stepper::nextBabystepISR = BABYSTEP_NEVER; #endif +#if ENABLED(DIRECT_STEPPING) + page_step_state_t Stepper::page_step_state; +#endif + int32_t Stepper::ticks_nominal = -1; #if DISABLED(S_CURVE_ACCELERATION) uint32_t Stepper::acc_step_rate; // needed for deceleration start point @@ -236,6 +240,20 @@ xyz_long_t Stepper::endstops_trigsteps; xyze_long_t Stepper::count_position{0}; xyze_int8_t Stepper::count_direction{0}; +#if ENABLED(LASER_POWER_INLINE_TRAPEZOID) + Stepper::stepper_laser_t Stepper::laser_trap = { + .enabled = false, + .cur_power = 0, + .cruise_set = false, + #if DISABLED(LASER_POWER_INLINE_TRAPEZOID_CONT) + .last_step_count = 0, + .acc_step_count = 0 + #else + .till_update = 0 + #endif + }; +#endif + #define DUAL_ENDSTOP_APPLY_STEP(A,V) \ if (separate_multi_axis) { \ if (A##_HOME_DIR < 0) { \ @@ -399,10 +417,10 @@ xyze_int8_t Stepper::count_direction{0}; #endif #define CYCLES_TO_NS(CYC) (1000UL * (CYC) / ((F_CPU) / 1000000)) -constexpr uint32_t NS_PER_PULSE_TIMER_TICK = 1000000000UL / (STEPPER_TIMER_RATE); +#define NS_PER_PULSE_TIMER_TICK (1000000000UL / (STEPPER_TIMER_RATE)) // Round up when converting from ns to timer ticks -constexpr uint32_t NS_TO_PULSE_TIMER_TICKS(uint32_t NS) { return (NS + (NS_PER_PULSE_TIMER_TICK) / 2) / (NS_PER_PULSE_TIMER_TICK); } +#define NS_TO_PULSE_TIMER_TICKS(NS) (((NS) + (NS_PER_PULSE_TIMER_TICK) / 2) / (NS_PER_PULSE_TIMER_TICK)) #define TIMER_SETUP_NS (CYCLES_TO_NS(TIMER_READ_ADD_AND_STORE_CYCLES)) @@ -453,11 +471,9 @@ void Stepper::set_directions() { #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 @@ -1486,8 +1502,12 @@ void Stepper::isr() { ENABLE_ISRS(); } -#define ISR_PULSE_CONTROL (MINIMUM_STEPPER_PULSE || MAXIMUM_STEPPER_RATE) -#define ISR_MULTI_STEPS (ISR_PULSE_CONTROL && DISABLED(I2S_STEPPER_STREAM)) +#if MINIMUM_STEPPER_PULSE || MAXIMUM_STEPPER_RATE + #define ISR_PULSE_CONTROL 1 +#endif +#if ISR_PULSE_CONTROL && DISABLED(I2S_STEPPER_STREAM) + #define ISR_MULTI_STEPS 1 +#endif /** * This phase of the ISR should ONLY create the pulses for the steppers. @@ -1501,11 +1521,7 @@ void 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 (current_block) discard_current_block(); } // If there is no current block, do nothing @@ -1539,46 +1555,160 @@ void Stepper::pulse_phase_isr() { } \ }while(0) - // Start an active pulse, if Bresenham says so, and update position + // Start an active pulse if needed #define PULSE_START(AXIS) do{ \ if (step_needed[_AXIS(AXIS)]) { \ _APPLY_STEP(AXIS, !_INVERT_STEP_PIN(AXIS), 0); \ } \ }while(0) - // Stop an active pulse, if any, and adjust error term + // Stop an active pulse if needed #define PULSE_STOP(AXIS) do { \ if (step_needed[_AXIS(AXIS)]) { \ _APPLY_STEP(AXIS, _INVERT_STEP_PIN(AXIS), 0); \ } \ }while(0) - // Determine if pulses are needed - #if HAS_X_STEP - PULSE_PREP(X); - #endif - #if HAS_Y_STEP - PULSE_PREP(Y); - #endif - #if HAS_Z_STEP - PULSE_PREP(Z); - #endif + // Direct Stepping page? + const bool is_page = IS_PAGE(current_block); + + #if ENABLED(DIRECT_STEPPING) + + if (is_page) { + + #if STEPPER_PAGE_FORMAT == SP_4x4D_128 + + #define PAGE_SEGMENT_UPDATE(AXIS, VALUE, MID) do{ \ + if ((VALUE) == MID) {} \ + else if ((VALUE) < MID) SBI(dm, _AXIS(AXIS)); \ + else CBI(dm, _AXIS(AXIS)); \ + page_step_state.sd[_AXIS(AXIS)] = VALUE; \ + page_step_state.bd[_AXIS(AXIS)] += VALUE; \ + }while(0) + + #define PAGE_PULSE_PREP(AXIS) do{ \ + step_needed[_AXIS(AXIS)] = \ + pgm_read_byte(&segment_table[page_step_state.sd[_AXIS(AXIS)]][page_step_state.segment_steps & 0x7]); \ + }while(0) + + switch (page_step_state.segment_steps) { + case 8: + page_step_state.segment_idx += 2; + page_step_state.segment_steps = 0; + // fallthru + case 0: { + const uint8_t low = page_step_state.page[page_step_state.segment_idx], + high = page_step_state.page[page_step_state.segment_idx + 1]; + uint8_t dm = last_direction_bits; + + PAGE_SEGMENT_UPDATE(X, low >> 4, 7); + PAGE_SEGMENT_UPDATE(Y, low & 0xF, 7); + PAGE_SEGMENT_UPDATE(Z, high >> 4, 7); + PAGE_SEGMENT_UPDATE(E, high & 0xF, 7); + + if (dm != last_direction_bits) { + last_direction_bits = dm; + set_directions(); + } + } break; + + default: break; + } + + PAGE_PULSE_PREP(X), + PAGE_PULSE_PREP(Y), + PAGE_PULSE_PREP(Z), + PAGE_PULSE_PREP(E); + + page_step_state.segment_steps++; + + #elif STEPPER_PAGE_FORMAT == SP_4x2_256 + + #define PAGE_SEGMENT_UPDATE(AXIS, VALUE) \ + page_step_state.sd[_AXIS(AXIS)] = VALUE; \ + page_step_state.bd[_AXIS(AXIS)] += VALUE; + + #define PAGE_PULSE_PREP(AXIS) do{ \ + step_needed[_AXIS(AXIS)] = \ + pgm_read_byte(&segment_table[page_step_state.sd[_AXIS(AXIS)]][page_step_state.segment_steps & 0x3]); \ + }while(0) + + switch (page_step_state.segment_steps) { + case 4: + page_step_state.segment_idx++; + page_step_state.segment_steps = 0; + // fallthru + case 0: { + const uint8_t b = page_step_state.page[page_step_state.segment_idx]; + PAGE_SEGMENT_UPDATE(X, (b >> 6) & 0x3); + PAGE_SEGMENT_UPDATE(Y, (b >> 4) & 0x3); + PAGE_SEGMENT_UPDATE(Z, (b >> 2) & 0x3); + PAGE_SEGMENT_UPDATE(E, (b >> 0) & 0x3); + } break; + default: break; + } + + PAGE_PULSE_PREP(X); + PAGE_PULSE_PREP(Y); + PAGE_PULSE_PREP(Z); + PAGE_PULSE_PREP(E); + + page_step_state.segment_steps++; + + #elif STEPPER_PAGE_FORMAT == SP_4x1_512 + + #define PAGE_PULSE_PREP(AXIS, BITS) do{ \ + step_needed[_AXIS(AXIS)] = (steps >> BITS) & 0x1; \ + if (step_needed[_AXIS(AXIS)]) \ + page_step_state.bd[_AXIS(AXIS)]++; \ + }while(0) + + uint8_t steps = page_step_state.page[page_step_state.segment_idx >> 1]; + + if (page_step_state.segment_idx & 0x1) steps >>= 4; + + PAGE_PULSE_PREP(X, 3); + PAGE_PULSE_PREP(Y, 2); + PAGE_PULSE_PREP(Z, 1); + PAGE_PULSE_PREP(E, 0); + + page_step_state.segment_idx++; - #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 - step_needed.e = true; + #error "Unknown direct stepping page format!" #endif } - #elif HAS_E0_STEP - PULSE_PREP(E); - #endif + + #endif // DIRECT_STEPPING + + if (!is_page) { + // Determine if pulses are needed + #if HAS_X_STEP + PULSE_PREP(X); + #endif + #if HAS_Y_STEP + PULSE_PREP(Y); + #endif + #if HAS_Z_STEP + PULSE_PREP(Z); + #endif + + #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 + step_needed.e = true; + #endif + } + #elif HAS_E0_STEP + PULSE_PREP(E); + #endif + } #if ISR_MULTI_STEPS if (firstStep) @@ -1657,14 +1787,26 @@ uint32_t Stepper::block_phase_isr() { // If there is a current block if (current_block) { - // If current block is finished, reset pointer + // If current block is finished, reset pointer and finalize state if (step_events_completed >= step_event_count) { - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - runout.block_completed(current_block); + #if ENABLED(DIRECT_STEPPING) + #if STEPPER_PAGE_FORMAT == SP_4x4D_128 + #define PAGE_SEGMENT_UPDATE_POS(AXIS) \ + count_position[_AXIS(AXIS)] += page_step_state.bd[_AXIS(AXIS)] - 128 * 7; + #elif STEPPER_PAGE_FORMAT == SP_4x1_512 || STEPPER_PAGE_FORMAT == SP_4x2_256 + #define PAGE_SEGMENT_UPDATE_POS(AXIS) \ + count_position[_AXIS(AXIS)] += page_step_state.bd[_AXIS(AXIS)] * count_direction[_AXIS(AXIS)]; + #endif + + if (IS_PAGE(current_block)) { + PAGE_SEGMENT_UPDATE_POS(X); + PAGE_SEGMENT_UPDATE_POS(Y); + PAGE_SEGMENT_UPDATE_POS(Z); + PAGE_SEGMENT_UPDATE_POS(E); + } #endif - axis_did_move = 0; - current_block = nullptr; - planner.discard_current_block(); + TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, runout.block_completed(current_block)); + discard_current_block(); } else { // Step events not completed yet... @@ -1674,10 +1816,9 @@ uint32_t Stepper::block_phase_isr() { #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; + 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); @@ -1690,9 +1831,40 @@ uint32_t Stepper::block_phase_isr() { acceleration_time += interval; #if ENABLED(LIN_ADVANCE) - // Fire ISR if final adv_rate is reached - if (LA_steps && (!LA_use_advance_lead || LA_isr_rate != current_block->advance_speed)) - initiateLA(); + 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 + + // Update laser - Accelerating + #if ENABLED(LASER_POWER_INLINE_TRAPEZOID) + if (laser_trap.enabled) { + #if DISABLED(LASER_POWER_INLINE_TRAPEZOID_CONT) + if (current_block->laser.entry_per) { + laser_trap.acc_step_count -= step_events_completed - laser_trap.last_step_count; + laser_trap.last_step_count = step_events_completed; + + // Should be faster than a divide, since this should trip just once + if (laser_trap.acc_step_count < 0) { + while (laser_trap.acc_step_count < 0) { + laser_trap.acc_step_count += current_block->laser.entry_per; + if (laser_trap.cur_power < current_block->laser.power) laser_trap.cur_power++; + } + cutter.set_ocr_power(laser_trap.cur_power); + } + } + #else + if (laser_trap.till_update) + laser_trap.till_update--; + else { + laser_trap.till_update = LASER_POWER_INLINE_TRAPEZOID_CONT_PER; + laser_trap.cur_power = (current_block->laser.power * acc_step_rate) / current_block->nominal_rate; + cutter.set_ocr_power(laser_trap.cur_power); // Cycle efficiency is irrelevant it the last line was many cycles + } + #endif + } #endif } // Are we in Deceleration phase ? @@ -1740,10 +1912,39 @@ uint32_t Stepper::block_phase_isr() { LA_isr_rate = current_block->advance_speed; } } - else if (LA_steps) initiateLA(); + else if (LA_steps) nextAdvanceISR = 0; + #endif // LIN_ADVANCE + + // Update laser - Decelerating + #if ENABLED(LASER_POWER_INLINE_TRAPEZOID) + if (laser_trap.enabled) { + #if DISABLED(LASER_POWER_INLINE_TRAPEZOID_CONT) + if (current_block->laser.exit_per) { + laser_trap.acc_step_count -= step_events_completed - laser_trap.last_step_count; + laser_trap.last_step_count = step_events_completed; + + // Should be faster than a divide, since this should trip just once + if (laser_trap.acc_step_count < 0) { + while (laser_trap.acc_step_count < 0) { + laser_trap.acc_step_count += current_block->laser.exit_per; + if (laser_trap.cur_power > current_block->laser.power_exit) laser_trap.cur_power--; + } + cutter.set_ocr_power(laser_trap.cur_power); + } + } + #else + if (laser_trap.till_update) + laser_trap.till_update--; + else { + laser_trap.till_update = LASER_POWER_INLINE_TRAPEZOID_CONT_PER; + laser_trap.cur_power = (current_block->laser.power * step_rate) / current_block->nominal_rate; + cutter.set_ocr_power(laser_trap.cur_power); // Cycle efficiency isn't relevant when the last line was many cycles + } + #endif + } #endif } - // We must be in cruise phase otherwise + // Must be in cruise phase otherwise else { #if ENABLED(LIN_ADVANCE) @@ -1759,6 +1960,22 @@ uint32_t Stepper::block_phase_isr() { // The timer interval is just the nominal value for the nominal speed interval = ticks_nominal; + + // Update laser - Cruising + #if ENABLED(LASER_POWER_INLINE_TRAPEZOID) + if (laser_trap.enabled) { + if (!laser_trap.cruise_set) { + laser_trap.cur_power = current_block->laser.power; + cutter.set_ocr_power(laser_trap.cur_power); + laser_trap.cruise_set = true; + } + #if ENABLED(LASER_POWER_INLINE_TRAPEZOID_CONT) + laser_trap.till_update = LASER_POWER_INLINE_TRAPEZOID_CONT_PER; + #else + laser_trap.last_step_count = step_events_completed; + #endif + } + #endif } } } @@ -1773,19 +1990,35 @@ uint32_t Stepper::block_phase_isr() { // 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(); + 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 + // For non-inline cutter, grossly apply power + #if ENABLED(LASER_FEATURE) && DISABLED(LASER_POWER_INLINE) cutter.apply_power(current_block->cutter_power); #endif - #if ENABLED(POWER_LOSS_RECOVERY) - recovery.info.sdpos = current_block->sdpos; + TERN_(POWER_LOSS_RECOVERY, recovery.info.sdpos = current_block->sdpos); + + #if ENABLED(DIRECT_STEPPING) + if (IS_PAGE(current_block)) { + page_step_state.segment_steps = 0; + page_step_state.segment_idx = 0; + page_step_state.page = page_manager.get_page(current_block->page_idx); + page_step_state.bd.reset(); + + if (DirectStepping::Config::DIRECTIONAL) + current_block->direction_bits = last_direction_bits; + + if (!page_step_state.page) { + discard_current_block(); + return interval; + } + } #endif // Flag all moving axes for proper endstop handling @@ -1805,11 +2038,11 @@ uint32_t Stepper::block_phase_isr() { * If DeltaA == DeltaB, the movement is only in the 1st axis (X) */ #if EITHER(COREXY, COREXZ) - #define X_CMP == + #define X_CMP(A,B) ((A)==(B)) #else - #define X_CMP != + #define X_CMP(A,B) ((A)!=(B)) #endif - #define X_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) X_CMP D_(2)) ) + #define X_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && X_CMP(D_(1),D_(2))) ) #else #define X_MOVE_TEST !!current_block->steps.a #endif @@ -1823,11 +2056,11 @@ uint32_t Stepper::block_phase_isr() { * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Y or Z) */ #if EITHER(COREYX, COREYZ) - #define Y_CMP == + #define Y_CMP(A,B) ((A)==(B)) #else - #define Y_CMP != + #define Y_CMP(A,B) ((A)!=(B)) #endif - #define Y_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) Y_CMP D_(2)) ) + #define Y_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && Y_CMP(D_(1),D_(2))) ) #else #define Y_MOVE_TEST !!current_block->steps.b #endif @@ -1841,11 +2074,11 @@ uint32_t Stepper::block_phase_isr() { * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Z) */ #if EITHER(COREZX, COREZY) - #define Z_CMP == + #define Z_CMP(A,B) ((A)==(B)) #else - #define Z_CMP != + #define Z_CMP(A,B) ((A)!=(B)) #endif - #define Z_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) Z_CMP D_(2)) ) + #define Z_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && Z_CMP(D_(1),D_(2))) ) #else #define Z_MOVE_TEST !!current_block->steps.c #endif @@ -1863,17 +2096,18 @@ uint32_t Stepper::block_phase_isr() { // No acceleration / deceleration time elapsed so far acceleration_time = deceleration_time = 0; - uint8_t oversampling = 0; // Assume no axis smoothing (via oversampling) - #if ENABLED(ADAPTIVE_STEP_SMOOTHING) + uint8_t oversampling = 0; // Assume no axis smoothing (via oversampling) // Decide if axis smoothing is possible - uint32_t max_rate = current_block->nominal_rate; // Get the maximum rate (maximum event speed) + uint32_t max_rate = current_block->nominal_rate; // Get the step event rate while (max_rate < MIN_STEP_ISR_FREQUENCY) { // As long as more ISRs are possible... max_rate <<= 1; // Try to double the rate - if (max_rate >= MAX_STEP_ISR_FREQUENCY_1X) break; // Don't exceed the estimated ISR limit - ++oversampling; // Increase the oversampling (used for left-shift) + if (max_rate < MIN_STEP_ISR_FREQUENCY) // Don't exceed the estimated ISR limit + ++oversampling; // Increase the oversampling (used for left-shift) } oversampling_factor = oversampling; // For all timer interval calculations + #else + constexpr uint8_t oversampling = 0; #endif // Based on the oversampling factor, do the calculations @@ -1917,27 +2151,50 @@ uint32_t Stepper::block_phase_isr() { else LA_isr_rate = LA_ADV_NEVER; #endif - if ( - #if HAS_L64XX - true // Always set direction for L64xx (This also enables the chips) - #else - current_block->direction_bits != last_direction_bits - #if DISABLED(MIXING_EXTRUDER) - || stepper_extruder != last_moved_extruder - #endif - #endif + if ( ENABLED(HAS_L64XX) // Always set direction for L64xx (Also enables the chips) + || current_block->direction_bits != last_direction_bits + || TERN(MIXING_EXTRUDER, false, stepper_extruder != last_moved_extruder) ) { last_direction_bits = current_block->direction_bits; #if EXTRUDERS > 1 last_moved_extruder = stepper_extruder; #endif - #if HAS_L64XX - L64XX_OK_to_power_up = true; - #endif + TERN_(HAS_L64XX, L64XX_OK_to_power_up = true); set_directions(); } + #if ENABLED(LASER_POWER_INLINE) + const power_status_t stat = current_block->laser.status; + #if ENABLED(LASER_POWER_INLINE_TRAPEZOID) + laser_trap.enabled = stat.isPlanned && stat.isEnabled; + laser_trap.cur_power = current_block->laser.power_entry; // RESET STATE + laser_trap.cruise_set = false; + #if DISABLED(LASER_POWER_INLINE_TRAPEZOID_CONT) + laser_trap.last_step_count = 0; + laser_trap.acc_step_count = current_block->laser.entry_per / 2; + #else + laser_trap.till_update = 0; + #endif + // Always have PWM in this case + if (stat.isPlanned) { // Planner controls the laser + cutter.set_ocr_power( + stat.isEnabled ? laser_trap.cur_power : 0 // ON with power or OFF + ); + } + #else + if (stat.isPlanned) { // Planner controls the laser + #if ENABLED(SPINDLE_LASER_PWM) + cutter.set_ocr_power( + stat.isEnabled ? current_block->laser.power : 0 // ON with power or OFF + ); + #else + cutter.set_enabled(stat.isEnabled); + #endif + } + #endif + #endif // LASER_POWER_INLINE + // 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 @@ -1957,21 +2214,34 @@ uint32_t Stepper::block_phase_isr() { // 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; + #else + // Set as deceleration point the initial rate of the block + acc_step_rate = current_block->initial_rate; #endif // Calculate the initial timer interval interval = calc_timer_interval(current_block->initial_rate, &steps_per_isr); } + #if ENABLED(LASER_POWER_INLINE_CONTINUOUS) + else { // No new block found; so apply inline laser parameters + // This should mean ending file with 'M5 I' will stop the laser; thus the inline flag isn't needed + const power_status_t stat = planner.laser_inline.status; + if (stat.isPlanned) { // Planner controls the laser + #if ENABLED(SPINDLE_LASER_PWM) + cutter.set_ocr_power( + stat.isEnabled ? planner.laser_inline.power : 0 // ON with power or OFF + ); + #else + cutter.set_enabled(stat.isEnabled); + #endif + } + } + #endif } // Return the interval to wait @@ -2007,14 +2277,14 @@ uint32_t Stepper::block_phase_isr() { #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) + if (LA_steps > 0) MIXER_STEPPER_LOOP(j) NORM_E_DIR(j); - else + else if (LA_steps < 0) MIXER_STEPPER_LOOP(j) REV_E_DIR(j); #else - if (LA_steps >= 0) + if (LA_steps > 0) NORM_E_DIR(stepper_extruder); - else + else if (LA_steps < 0) REV_E_DIR(stepper_extruder); #endif @@ -2123,20 +2393,14 @@ void Stepper::init() { #endif // Init Microstepping Pins - #if HAS_MICROSTEPS - microstep_init(); - #endif + TERN_(HAS_MICROSTEPS, microstep_init()); // Init Dir Pins - #if HAS_X_DIR - X_DIR_INIT(); - #endif - #if HAS_X2_DIR - X2_DIR_INIT(); - #endif + TERN_(HAS_X_DIR, X_DIR_INIT()); + TERN_(HAS_X2_DIR, X2_DIR_INIT()); #if HAS_Y_DIR Y_DIR_INIT(); - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_DIR + #if BOTH(Y_DUAL_STEPPER_DRIVERS, HAS_Y2_DIR) Y2_DIR_INIT(); #endif #endif @@ -2189,7 +2453,7 @@ void Stepper::init() { #if HAS_Y_ENABLE Y_ENABLE_INIT(); if (!Y_ENABLE_ON) Y_ENABLE_WRITE(HIGH); - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_ENABLE + #if BOTH(Y_DUAL_STEPPER_DRIVERS, HAS_Y2_ENABLE) Y2_ENABLE_INIT(); if (!Y_ENABLE_ON) Y2_ENABLE_WRITE(HIGH); #endif @@ -2287,7 +2551,7 @@ void Stepper::init() { AXIS_INIT(Z, Z); #endif - #if E_STEPPERS > 0 && HAS_E0_STEP + #if E_STEPPERS && HAS_E0_STEP E_AXIS_INIT(0); #endif #if E_STEPPERS > 1 && HAS_E1_STEP @@ -2327,9 +2591,7 @@ void Stepper::init() { set_directions(); #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - #if HAS_MOTOR_CURRENT_PWM - initialized = true; - #endif + TERN_(HAS_MOTOR_CURRENT_PWM, initialized = true); digipot_init(); #endif } @@ -2346,7 +2608,7 @@ void Stepper::init() { 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 + // these equations follow the form of the dA and dB equations on https://www.corexy.com/theory.html count_position.set(a + b, CORESIGN(a - b), c); #elif CORE_IS_XZ // corexz planning @@ -2538,7 +2800,9 @@ void Stepper::report_positions() { EXTRA_DIR_WAIT_AFTER(); \ }while(0) - #elif IS_CORE + #endif + + #if IS_CORE #define BABYSTEP_CORE(A, B, INV, DIR, ALT) do{ \ const xy_byte_t old_dir = { _READ_DIR(A), _READ_DIR(B) }; \ @@ -2584,7 +2848,7 @@ void Stepper::report_positions() { case Y_AXIS: #if CORE_IS_XY - BABYSTEP_CORE(X, Y, 0, direction, (CORESIGN(1)<0)); + BABYSTEP_CORE(X, Y, 1, !direction, (CORESIGN(1)>0)); #elif CORE_IS_YZ BABYSTEP_CORE(Y, Z, 0, direction, (CORESIGN(1)<0)); #else @@ -2809,112 +3073,112 @@ void Stepper::report_positions() { */ void Stepper::microstep_init() { - #if HAS_X_MICROSTEPS + #if HAS_X_MS_PINS 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 + #if HAS_X2_MS_PINS 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 + #if HAS_Y_MS_PINS 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 + #if HAS_Y2_MS_PINS 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 + #if HAS_Z_MS_PINS 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 + #if HAS_Z2_MS_PINS 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 + #if HAS_Z3_MS_PINS SET_OUTPUT(Z3_MS1_PIN); SET_OUTPUT(Z3_MS2_PIN); #if PIN_EXISTS(Z3_MS3) SET_OUTPUT(Z3_MS3_PIN); #endif #endif - #if HAS_Z4_MICROSTEPS + #if HAS_Z4_MS_PINS SET_OUTPUT(Z4_MS1_PIN); SET_OUTPUT(Z4_MS2_PIN); #if PIN_EXISTS(Z4_MS3) SET_OUTPUT(Z4_MS3_PIN); #endif #endif - #if HAS_E0_MICROSTEPS + #if HAS_E0_MS_PINS 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 + #if HAS_E1_MS_PINS 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 + #if HAS_E2_MS_PINS 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 + #if HAS_E3_MS_PINS 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 + #if HAS_E4_MS_PINS 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 + #if HAS_E5_MS_PINS SET_OUTPUT(E5_MS1_PIN); SET_OUTPUT(E5_MS2_PIN); #if PIN_EXISTS(E5_MS3) SET_OUTPUT(E5_MS3_PIN); #endif #endif - #if HAS_E6_MICROSTEPS + #if HAS_E6_MS_PINS SET_OUTPUT(E6_MS1_PIN); SET_OUTPUT(E6_MS2_PIN); #if PIN_EXISTS(E6_MS3) SET_OUTPUT(E6_MS3_PIN); #endif #endif - #if HAS_E7_MICROSTEPS + #if HAS_E7_MS_PINS SET_OUTPUT(E7_MS1_PIN); SET_OUTPUT(E7_MS2_PIN); #if PIN_EXISTS(E7_MS3) @@ -2929,188 +3193,188 @@ void Stepper::report_positions() { 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 + #if HAS_X_MS_PINS || HAS_X2_MS_PINS case 0: - #if HAS_X_MICROSTEPS + #if HAS_X_MS_PINS WRITE(X_MS1_PIN, ms1); #endif - #if HAS_X2_MICROSTEPS + #if HAS_X2_MS_PINS WRITE(X2_MS1_PIN, ms1); #endif break; #endif - #if HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS + #if HAS_Y_MS_PINS || HAS_Y2_MS_PINS case 1: - #if HAS_Y_MICROSTEPS + #if HAS_Y_MS_PINS WRITE(Y_MS1_PIN, ms1); #endif - #if HAS_Y2_MICROSTEPS + #if HAS_Y2_MS_PINS WRITE(Y2_MS1_PIN, ms1); #endif break; #endif - #if HAS_SOME_Z_MICROSTEPS + #if HAS_SOME_Z_MS_PINS case 2: - #if HAS_Z_MICROSTEPS + #if HAS_Z_MS_PINS WRITE(Z_MS1_PIN, ms1); #endif - #if HAS_Z2_MICROSTEPS + #if HAS_Z2_MS_PINS WRITE(Z2_MS1_PIN, ms1); #endif - #if HAS_Z3_MICROSTEPS + #if HAS_Z3_MS_PINS WRITE(Z3_MS1_PIN, ms1); #endif - #if HAS_Z4_MICROSTEPS + #if HAS_Z4_MS_PINS WRITE(Z4_MS1_PIN, ms1); #endif break; #endif - #if HAS_E0_MICROSTEPS + #if HAS_E0_MS_PINS case 3: WRITE(E0_MS1_PIN, ms1); break; #endif - #if HAS_E1_MICROSTEPS + #if HAS_E1_MS_PINS case 4: WRITE(E1_MS1_PIN, ms1); break; #endif - #if HAS_E2_MICROSTEPS + #if HAS_E2_MS_PINS case 5: WRITE(E2_MS1_PIN, ms1); break; #endif - #if HAS_E3_MICROSTEPS + #if HAS_E3_MS_PINS case 6: WRITE(E3_MS1_PIN, ms1); break; #endif - #if HAS_E4_MICROSTEPS + #if HAS_E4_MS_PINS case 7: WRITE(E4_MS1_PIN, ms1); break; #endif - #if HAS_E5_MICROSTEPS + #if HAS_E5_MS_PINS case 8: WRITE(E5_MS1_PIN, ms1); break; #endif - #if HAS_E6_MICROSTEPS + #if HAS_E6_MS_PINS case 9: WRITE(E6_MS1_PIN, ms1); break; #endif - #if HAS_E7_MICROSTEPS + #if HAS_E7_MS_PINS case 10: WRITE(E7_MS1_PIN, ms1); break; #endif } if (ms2 >= 0) switch (driver) { - #if HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS + #if HAS_X_MS_PINS || HAS_X2_MS_PINS case 0: - #if HAS_X_MICROSTEPS + #if HAS_X_MS_PINS WRITE(X_MS2_PIN, ms2); #endif - #if HAS_X2_MICROSTEPS + #if HAS_X2_MS_PINS WRITE(X2_MS2_PIN, ms2); #endif break; #endif - #if HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS + #if HAS_Y_MS_PINS || HAS_Y2_MS_PINS case 1: - #if HAS_Y_MICROSTEPS + #if HAS_Y_MS_PINS WRITE(Y_MS2_PIN, ms2); #endif - #if HAS_Y2_MICROSTEPS + #if HAS_Y2_MS_PINS WRITE(Y2_MS2_PIN, ms2); #endif break; #endif - #if HAS_SOME_Z_MICROSTEPS + #if HAS_SOME_Z_MS_PINS case 2: - #if HAS_Z_MICROSTEPS + #if HAS_Z_MS_PINS WRITE(Z_MS2_PIN, ms2); #endif - #if HAS_Z2_MICROSTEPS + #if HAS_Z2_MS_PINS WRITE(Z2_MS2_PIN, ms2); #endif - #if HAS_Z3_MICROSTEPS + #if HAS_Z3_MS_PINS WRITE(Z3_MS2_PIN, ms2); #endif - #if HAS_Z4_MICROSTEPS + #if HAS_Z4_MS_PINS WRITE(Z4_MS2_PIN, ms2); #endif break; #endif - #if HAS_E0_MICROSTEPS + #if HAS_E0_MS_PINS case 3: WRITE(E0_MS2_PIN, ms2); break; #endif - #if HAS_E1_MICROSTEPS + #if HAS_E1_MS_PINS case 4: WRITE(E1_MS2_PIN, ms2); break; #endif - #if HAS_E2_MICROSTEPS + #if HAS_E2_MS_PINS case 5: WRITE(E2_MS2_PIN, ms2); break; #endif - #if HAS_E3_MICROSTEPS + #if HAS_E3_MS_PINS case 6: WRITE(E3_MS2_PIN, ms2); break; #endif - #if HAS_E4_MICROSTEPS + #if HAS_E4_MS_PINS case 7: WRITE(E4_MS2_PIN, ms2); break; #endif - #if HAS_E5_MICROSTEPS + #if HAS_E5_MS_PINS case 8: WRITE(E5_MS2_PIN, ms2); break; #endif - #if HAS_E6_MICROSTEPS + #if HAS_E6_MS_PINS case 9: WRITE(E6_MS2_PIN, ms2); break; #endif - #if HAS_E7_MICROSTEPS + #if HAS_E7_MS_PINS case 10: WRITE(E7_MS2_PIN, ms2); break; #endif } if (ms3 >= 0) switch (driver) { - #if HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS + #if HAS_X_MS_PINS || HAS_X2_MS_PINS case 0: - #if HAS_X_MICROSTEPS && PIN_EXISTS(X_MS3) + #if HAS_X_MS_PINS && PIN_EXISTS(X_MS3) WRITE(X_MS3_PIN, ms3); #endif - #if HAS_X2_MICROSTEPS && PIN_EXISTS(X2_MS3) + #if HAS_X2_MS_PINS && PIN_EXISTS(X2_MS3) WRITE(X2_MS3_PIN, ms3); #endif break; #endif - #if HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS + #if HAS_Y_MS_PINS || HAS_Y2_MS_PINS case 1: - #if HAS_Y_MICROSTEPS && PIN_EXISTS(Y_MS3) + #if HAS_Y_MS_PINS && PIN_EXISTS(Y_MS3) WRITE(Y_MS3_PIN, ms3); #endif - #if HAS_Y2_MICROSTEPS && PIN_EXISTS(Y2_MS3) + #if HAS_Y2_MS_PINS && PIN_EXISTS(Y2_MS3) WRITE(Y2_MS3_PIN, ms3); #endif break; #endif - #if HAS_SOME_Z_MICROSTEPS + #if HAS_SOME_Z_MS_PINS case 2: - #if HAS_Z_MICROSTEPS && PIN_EXISTS(Z_MS3) + #if HAS_Z_MS_PINS && PIN_EXISTS(Z_MS3) WRITE(Z_MS3_PIN, ms3); #endif - #if HAS_Z2_MICROSTEPS && PIN_EXISTS(Z2_MS3) + #if HAS_Z2_MS_PINS && PIN_EXISTS(Z2_MS3) WRITE(Z2_MS3_PIN, ms3); #endif - #if HAS_Z3_MICROSTEPS && PIN_EXISTS(Z3_MS3) + #if HAS_Z3_MS_PINS && PIN_EXISTS(Z3_MS3) WRITE(Z3_MS3_PIN, ms3); #endif - #if HAS_Z4_MICROSTEPS && PIN_EXISTS(Z4_MS3) + #if HAS_Z4_MS_PINS && PIN_EXISTS(Z4_MS3) WRITE(Z4_MS3_PIN, ms3); #endif break; #endif - #if HAS_E0_MICROSTEPS && PIN_EXISTS(E0_MS3) + #if HAS_E0_MS_PINS && PIN_EXISTS(E0_MS3) case 3: WRITE(E0_MS3_PIN, ms3); break; #endif - #if HAS_E1_MICROSTEPS && PIN_EXISTS(E1_MS3) + #if HAS_E1_MS_PINS && PIN_EXISTS(E1_MS3) case 4: WRITE(E1_MS3_PIN, ms3); break; #endif - #if HAS_E2_MICROSTEPS && PIN_EXISTS(E2_MS3) + #if HAS_E2_MS_PINS && PIN_EXISTS(E2_MS3) case 5: WRITE(E2_MS3_PIN, ms3); break; #endif - #if HAS_E3_MICROSTEPS && PIN_EXISTS(E3_MS3) + #if HAS_E3_MS_PINS && PIN_EXISTS(E3_MS3) case 6: WRITE(E3_MS3_PIN, ms3); break; #endif - #if HAS_E4_MICROSTEPS && PIN_EXISTS(E4_MS3) + #if HAS_E4_MS_PINS && PIN_EXISTS(E4_MS3) case 7: WRITE(E4_MS3_PIN, ms3); break; #endif - #if HAS_E5_MICROSTEPS && PIN_EXISTS(E5_MS3) + #if HAS_E5_MS_PINS && PIN_EXISTS(E5_MS3) case 8: WRITE(E5_MS3_PIN, ms3); break; #endif - #if HAS_E6_MICROSTEPS && PIN_EXISTS(E6_MS3) + #if HAS_E6_MS_PINS && PIN_EXISTS(E6_MS3) case 9: WRITE(E6_MS3_PIN, ms3); break; #endif - #if HAS_E7_MICROSTEPS && PIN_EXISTS(E7_MS3) + #if HAS_E7_MS_PINS && PIN_EXISTS(E7_MS3) case 10: WRITE(E7_MS3_PIN, ms3); break; #endif } @@ -3148,95 +3412,76 @@ void Stepper::report_positions() { } void Stepper::microstep_readings() { - SERIAL_ECHOLNPGM("MS1|MS2|MS3 Pins"); - #if HAS_X_MICROSTEPS - SERIAL_ECHOPGM("X: "); - SERIAL_CHAR('0' + READ(X_MS1_PIN), '0' + READ(X_MS2_PIN) - #if PIN_EXISTS(X_MS3) - , '0' + READ(X_MS3_PIN) - #endif - ); + #define PIN_CHAR(P) SERIAL_CHAR('0' + READ(P##_PIN)) + #define MS_LINE(A) do{ SERIAL_ECHOPGM(" " STRINGIFY(A) ":"); PIN_CHAR(A##_MS1); PIN_CHAR(A##_MS2); }while(0) + SERIAL_ECHOPGM("MS1|2|3 Pins"); + #if HAS_X_MS_PINS + MS_LINE(X); + #if PIN_EXISTS(X_MS3) + PIN_CHAR(X_MS3); + #endif #endif - #if HAS_Y_MICROSTEPS - SERIAL_ECHOPGM("Y: "); - SERIAL_CHAR('0' + READ(Y_MS1_PIN), '0' + READ(Y_MS2_PIN) - #if PIN_EXISTS(Y_MS3) - , '0' + READ(Y_MS3_PIN) - #endif - ); + #if HAS_Y_MS_PINS + MS_LINE(Y); + #if PIN_EXISTS(Y_MS3) + PIN_CHAR(Y_MS3); + #endif #endif - #if HAS_Z_MICROSTEPS - SERIAL_ECHOPGM("Z: "); - SERIAL_CHAR('0' + READ(Z_MS1_PIN), '0' + READ(Z_MS2_PIN) - #if PIN_EXISTS(Z_MS3) - , '0' + READ(Z_MS3_PIN) - #endif - ); + #if HAS_Z_MS_PINS + MS_LINE(Z); + #if PIN_EXISTS(Z_MS3) + PIN_CHAR(Z_MS3); + #endif #endif - #if HAS_E0_MICROSTEPS - SERIAL_ECHOPGM("E0: "); - SERIAL_CHAR('0' + READ(E0_MS1_PIN), '0' + READ(E0_MS2_PIN) - #if PIN_EXISTS(E0_MS3) - , '0' + READ(E0_MS3_PIN) - #endif - ); + #if HAS_E0_MS_PINS + MS_LINE(E0); + #if PIN_EXISTS(E0_MS3) + PIN_CHAR(E0_MS3); + #endif #endif - #if HAS_E1_MICROSTEPS - SERIAL_ECHOPGM("E1: "); - SERIAL_CHAR('0' + READ(E1_MS1_PIN), '0' + READ(E1_MS2_PIN) - #if PIN_EXISTS(E1_MS3) - , '0' + READ(E1_MS3_PIN) - #endif - ); + #if HAS_E1_MS_PINS + MS_LINE(E1); + #if PIN_EXISTS(E1_MS3) + PIN_CHAR(E1_MS3); + #endif #endif - #if HAS_E2_MICROSTEPS - SERIAL_ECHOPGM("E2: "); - SERIAL_CHAR('0' + READ(E2_MS1_PIN), '0' + READ(E2_MS2_PIN) - #if PIN_EXISTS(E2_MS3) - , '0' + READ(E2_MS3_PIN) - #endif - ); + #if HAS_E2_MS_PINS + MS_LINE(E2); + #if PIN_EXISTS(E2_MS3) + PIN_CHAR(E2_MS3); + #endif #endif - #if HAS_E3_MICROSTEPS - SERIAL_ECHOPGM("E3: "); - SERIAL_CHAR('0' + READ(E3_MS1_PIN), '0' + READ(E3_MS2_PIN) - #if PIN_EXISTS(E3_MS3) - , '0' + READ(E3_MS3_PIN) - #endif - ); + #if HAS_E3_MS_PINS + MS_LINE(E3); + #if PIN_EXISTS(E3_MS3) + PIN_CHAR(E3_MS3); + #endif #endif - #if HAS_E4_MICROSTEPS - SERIAL_ECHOPGM("E4: "); - SERIAL_CHAR('0' + READ(E4_MS1_PIN), '0' + READ(E4_MS2_PIN) - #if PIN_EXISTS(E4_MS3) - , '0' + READ(E4_MS3_PIN) - #endif - ); + #if HAS_E4_MS_PINS + MS_LINE(E4); + #if PIN_EXISTS(E4_MS3) + PIN_CHAR(E4_MS3); + #endif #endif - #if HAS_E5_MICROSTEPS - SERIAL_ECHOPGM("E5: "); - SERIAL_CHAR('0' + READ(E5_MS1_PIN), '0' + READ(E5_MS2_PIN) - #if PIN_EXISTS(E5_MS3) - , '0' + READ(E5_MS3_PIN) - #endif - ); + #if HAS_E5_MS_PINS + MS_LINE(E5); + #if PIN_EXISTS(E5_MS3) + PIN_CHAR(E5_MS3); + #endif #endif - #if HAS_E6_MICROSTEPS - SERIAL_ECHOPGM("E6: "); - SERIAL_CHAR('0' + READ(E6_MS1_PIN), '0' + READ(E6_MS2_PIN) - #if PIN_EXISTS(E6_MS3) - , '0' + READ(E6_MS3_PIN) - #endif - ); + #if HAS_E6_MS_PINS + MS_LINE(E6); + #if PIN_EXISTS(E6_MS3) + PIN_CHAR(E6_MS3); + #endif #endif - #if HAS_E7_MICROSTEPS - SERIAL_ECHOPGM("E7: "); - SERIAL_CHAR('0' + READ(E7_MS1_PIN), '0' + READ(E7_MS2_PIN) - #if PIN_EXISTS(E7_MS3) - , '0' + READ(E7_MS3_PIN) - #endif - ); + #if HAS_E7_MS_PINS + MS_LINE(E7); + #if PIN_EXISTS(E7_MS3) + PIN_CHAR(E7_MS3); + #endif #endif + SERIAL_EOL(); } #endif // HAS_MICROSTEPS diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 46c6c1c16a..3b68553689 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -38,7 +38,7 @@ * 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 . + * along with Grbl. If not, see . */ #include "../inc/MarlinConfig.h" @@ -191,7 +191,6 @@ #error "Expected at least one of MINIMUM_STEPPER_PULSE or MAXIMUM_STEPPER_RATE to be defined" #endif - // 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)) @@ -230,8 +229,10 @@ #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 +// The minimum step ISR rate used by ADAPTIVE_STEP_SMOOTHING to target 50% CPU usage +// This does not account for the possibility of multi-stepping. +// Perhaps DISABLE_MULTI_STEPPING should be required with ADAPTIVE_STEP_SMOOTHING. +#define MIN_STEP_ISR_FREQUENCY (MAX_STEP_ISR_FREQUENCY_1X / 2) // // Stepper class definition @@ -240,7 +241,7 @@ class Stepper { public: - #if HAS_EXTRA_ENDSTOPS || ENABLED(Z_STEPPER_AUTO_ALIGN) + #if EITHER(HAS_EXTRA_ENDSTOPS, Z_STEPPER_AUTO_ALIGN) static bool separate_multi_axis; #endif @@ -334,28 +335,44 @@ class Stepper { static uint32_t nextBabystepISR; #endif + #if ENABLED(DIRECT_STEPPING) + static page_step_state_t page_step_state; + #endif + 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) - // + // Current stepper motor directions (+1 or -1) static xyze_int8_t count_direction; - public: + #if ENABLED(LASER_POWER_INLINE_TRAPEZOID) + typedef struct { + bool enabled; // Trapezoid needed flag (i.e., laser on, planner in control) + uint8_t cur_power; // Current laser power + bool cruise_set; // Power set up for cruising? + + #if DISABLED(LASER_POWER_INLINE_TRAPEZOID_CONT) + uint32_t last_step_count, // Step count from the last update + acc_step_count; // Bresenham counter for laser accel/decel + #else + uint16_t till_update; // Countdown to the next update + #endif + } stepper_laser_t; + + static stepper_laser_t laser_trap; + + #endif + + public: // Initialize stepper hardware static void init(); @@ -414,6 +431,17 @@ class Stepper { static void report_a_position(const xyz_long_t &pos); static void report_positions(); + // Discard current block and free any resources + FORCE_INLINE static void discard_current_block() { + #if ENABLED(DIRECT_STEPPING) + if (IS_PAGE(current_block)) + page_manager.free_page(current_block->page_idx); + #endif + current_block = nullptr; + axis_did_move = 0; + planner.release_current_block(); + } + // Quickly stop all steppers FORCE_INLINE static void quick_stop() { abort_current_block = true; } @@ -425,11 +453,7 @@ class Stepper { // 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 - ); + return (EXTRUDERS > 1 && DISABLED(MIXING_EXTRUDER)) ? last_moved_extruder : 0; } // Handle a triggered endstop @@ -449,7 +473,7 @@ class Stepper { static void microstep_readings(); #endif - #if HAS_EXTRA_ENDSTOPS || ENABLED(Z_STEPPER_AUTO_ALIGN) + #if EITHER(HAS_EXTRA_ENDSTOPS, 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) @@ -461,7 +485,7 @@ class Stepper { FORCE_INLINE static void set_y2_lock(const bool state) { locked_Y2_motor = state; } #endif #if EITHER(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN) - FORCE_INLINE static void set_z_lock(const bool state) { locked_Z_motor = state; } + FORCE_INLINE static void set_z1_lock(const bool state) { locked_Z_motor = state; } FORCE_INLINE static void set_z2_lock(const bool state) { locked_Z2_motor = state; } #if NUM_Z_STEPPER_DRIVERS >= 3 FORCE_INLINE static void set_z3_lock(const bool state) { locked_Z3_motor = state; } @@ -469,6 +493,16 @@ class Stepper { FORCE_INLINE static void set_z4_lock(const bool state) { locked_Z4_motor = state; } #endif #endif + static inline void set_all_z_lock(const bool lock, const int8_t except=-1) { + set_z1_lock(lock ^ (except == 0)); + set_z2_lock(lock ^ (except == 1)); + #if NUM_Z_STEPPER_DRIVERS >= 3 + set_z3_lock(lock ^ (except == 2)); + #if NUM_Z_STEPPER_DRIVERS >= 4 + set_z4_lock(lock ^ (except == 3)); + #endif + #endif + } #endif #if ENABLED(BABYSTEPPING) @@ -525,7 +559,7 @@ class Stepper { // 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; + 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 diff --git a/Marlin/src/module/stepper/L64xx.cpp b/Marlin/src/module/stepper/L64xx.cpp index 74f2e12fed..3e2bf09446 100644 --- a/Marlin/src/module/stepper/L64xx.cpp +++ b/Marlin/src/module/stepper/L64xx.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/module/stepper/L64xx.h b/Marlin/src/module/stepper/L64xx.h index 4449618e0b..9c8b0b1bdd 100644 --- a/Marlin/src/module/stepper/L64xx.h +++ b/Marlin/src/module/stepper/L64xx.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -45,7 +45,7 @@ #if AXIS_IS_L64XX(X) extern L64XX_CLASS(X) stepperX; #define X_ENABLE_INIT() NOOP - #define X_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperX.free()) + #define X_ENABLE_WRITE(STATE) (STATE ? stepperX.hardStop() : stepperX.free()) #define X_ENABLE_READ() (stepperX.getStatus() & STATUS_HIZ) #if AXIS_DRIVER_TYPE_X(L6474) #define X_DIR_INIT() SET_OUTPUT(X_DIR_PIN) @@ -65,7 +65,7 @@ #if AXIS_IS_L64XX(Y) extern L64XX_CLASS(Y) stepperY; #define Y_ENABLE_INIT() NOOP - #define Y_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperY.free()) + #define Y_ENABLE_WRITE(STATE) (STATE ? stepperY.hardStop() : stepperY.free()) #define Y_ENABLE_READ() (stepperY.getStatus() & STATUS_HIZ) #if AXIS_DRIVER_TYPE_Y(L6474) #define Y_DIR_INIT() SET_OUTPUT(Y_DIR_PIN) @@ -85,7 +85,7 @@ #if AXIS_IS_L64XX(Z) extern L64XX_CLASS(Z) stepperZ; #define Z_ENABLE_INIT() NOOP - #define Z_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperZ.free()) + #define Z_ENABLE_WRITE(STATE) (STATE ? stepperZ.hardStop() : stepperZ.free()) #define Z_ENABLE_READ() (stepperZ.getStatus() & STATUS_HIZ) #if AXIS_DRIVER_TYPE_Z(L6474) #define Z_DIR_INIT() SET_OUTPUT(Z_DIR_PIN) @@ -105,7 +105,7 @@ #if HAS_X2_ENABLE && AXIS_IS_L64XX(X2) extern L64XX_CLASS(X2) stepperX2; #define X2_ENABLE_INIT() NOOP - #define X2_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperX2.free()) + #define X2_ENABLE_WRITE(STATE) (STATE ? stepperX2.hardStop() : stepperX2.free()) #define X2_ENABLE_READ() (stepperX2.getStatus() & STATUS_HIZ) #if AXIS_DRIVER_TYPE_X2(L6474) #define X2_DIR_INIT() SET_OUTPUT(X2_DIR_PIN) @@ -126,7 +126,7 @@ #if HAS_Y2_ENABLE && AXIS_IS_L64XX(Y2) extern L64XX_CLASS(Y2) stepperY2; #define Y2_ENABLE_INIT() NOOP - #define Y2_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperY2.free()) + #define Y2_ENABLE_WRITE(STATE) (STATE ? stepperY2.hardStop() : stepperY2.free()) #define Y2_ENABLE_READ() (stepperY2.getStatus() & STATUS_HIZ) #if AXIS_DRIVER_TYPE_Y2(L6474) #define Y2_DIR_INIT() SET_OUTPUT(Y2_DIR_PIN) @@ -147,7 +147,7 @@ #if HAS_Z2_ENABLE && AXIS_IS_L64XX(Z2) extern L64XX_CLASS(Z2) stepperZ2; #define Z2_ENABLE_INIT() NOOP - #define Z2_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperZ2.free()) + #define Z2_ENABLE_WRITE(STATE) (STATE ? stepperZ2.hardStop() : stepperZ2.free()) #define Z2_ENABLE_READ() (stepperZ2.getStatus() & STATUS_HIZ) #if AXIS_DRIVER_TYPE_Z2(L6474) #define Z2_DIR_INIT() SET_OUTPUT(Z2_DIR_PIN) @@ -168,7 +168,7 @@ #if HAS_Z3_ENABLE && AXIS_IS_L64XX(Z3) extern L64XX_CLASS(Z3) stepperZ3; #define Z3_ENABLE_INIT() NOOP - #define Z3_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperZ3.free()) + #define Z3_ENABLE_WRITE(STATE) (STATE ? stepperZ3.hardStop() : stepperZ3.free()) #define Z3_ENABLE_READ() (stepperZ3.getStatus() & STATUS_HIZ) #if AXIS_DRIVER_TYPE_Z3(L6474) #define Z3_DIR_INIT() SET_OUTPUT(Z3_DIR_PIN) @@ -189,7 +189,7 @@ #if HAS_Z4_ENABLE && AXIS_IS_L64XX(Z4) extern L64XX_CLASS(Z4) stepperZ4; #define Z4_ENABLE_INIT() NOOP - #define Z4_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperZ4.free()) + #define Z4_ENABLE_WRITE(STATE) (STATE ? stepperZ4.hardStop() : stepperZ4.free()) #define Z4_ENABLE_READ() (stepperZ4.getStatus() & STATUS_HIZ) #if AXIS_DRIVER_TYPE_Z4(L6474) #define Z4_DIR_INIT() SET_OUTPUT(Z4_DIR_PIN) @@ -210,7 +210,7 @@ #if AXIS_IS_L64XX(E0) extern L64XX_CLASS(E0) stepperE0; #define E0_ENABLE_INIT() NOOP - #define E0_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE0.free()) + #define E0_ENABLE_WRITE(STATE) (STATE ? stepperE0.hardStop() : stepperE0.free()) #define E0_ENABLE_READ() (stepperE0.getStatus() & STATUS_HIZ) #if AXIS_DRIVER_TYPE_E0(L6474) #define E0_DIR_INIT() SET_OUTPUT(E0_DIR_PIN) @@ -221,7 +221,7 @@ #define E0_DIR_WRITE(STATE) L64XX_DIR_WRITE(E0, STATE) #define E0_DIR_READ() (stepper##E0.getStatus() & STATUS_DIR); #if AXIS_DRIVER_TYPE_E0(L6470) - #define DISABLE_STEPPER_E0() do{ stepperE0.free(); CBI(axis_known_position, E_AXIS); }while(0) + #define DISABLE_STEPPER_E0() do{ stepperE0.free(); }while(0) #endif #endif #endif @@ -230,7 +230,7 @@ #if AXIS_IS_L64XX(E1) extern L64XX_CLASS(E1) stepperE1; #define E1_ENABLE_INIT() NOOP - #define E1_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE1.free()) + #define E1_ENABLE_WRITE(STATE) (STATE ? stepperE1.hardStop() : stepperE1.free()) #define E1_ENABLE_READ() (stepperE1.getStatus() & STATUS_HIZ) #if AXIS_DRIVER_TYPE_E1(L6474) #define E1_DIR_INIT() SET_OUTPUT(E1_DIR_PIN) @@ -241,7 +241,7 @@ #define E1_DIR_WRITE(STATE) L64XX_DIR_WRITE(E1, STATE) #define E1_DIR_READ() (stepper##E1.getStatus() & STATUS_DIR); #if AXIS_DRIVER_TYPE_E1(L6470) - #define DISABLE_STEPPER_E1() do{ stepperE1.free(); CBI(axis_known_position, E_AXIS); }while(0) + #define DISABLE_STEPPER_E1() do{ stepperE1.free(); }while(0) #endif #endif #endif @@ -250,7 +250,7 @@ #if AXIS_IS_L64XX(E2) extern L64XX_CLASS(E2) stepperE2; #define E2_ENABLE_INIT() NOOP - #define E2_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE2.free()) + #define E2_ENABLE_WRITE(STATE) (STATE ? stepperE2.hardStop() : stepperE2.free()) #define E2_ENABLE_READ() (stepperE2.getStatus() & STATUS_HIZ) #if AXIS_DRIVER_TYPE_E2(L6474) #define E2_DIR_INIT() SET_OUTPUT(E2_DIR_PIN) @@ -261,7 +261,7 @@ #define E2_DIR_WRITE(STATE) L64XX_DIR_WRITE(E2, STATE) #define E2_DIR_READ() (stepper##E2.getStatus() & STATUS_DIR); #if AXIS_DRIVER_TYPE_E2(L6470) - #define DISABLE_STEPPER_E2() do{ stepperE2.free(); CBI(axis_known_position, E_AXIS); }while(0) + #define DISABLE_STEPPER_E2() do{ stepperE2.free(); }while(0) #endif #endif #endif @@ -270,7 +270,7 @@ #if AXIS_IS_L64XX(E3) extern L64XX_CLASS(E3) stepperE3; #define E3_ENABLE_INIT() NOOP - #define E3_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE3.free()) + #define E3_ENABLE_WRITE(STATE) (STATE ? stepperE3.hardStop() : stepperE3.free()) #define E3_ENABLE_READ() (stepperE3.getStatus() & STATUS_HIZ) #if AXIS_DRIVER_TYPE_E3(L6474) #define E3_DIR_INIT() SET_OUTPUT(E3_DIR_PIN) @@ -287,7 +287,7 @@ #if AXIS_IS_L64XX(E4) extern L64XX_CLASS(E4) stepperE4; #define E4_ENABLE_INIT() NOOP - #define E4_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE4.free()) + #define E4_ENABLE_WRITE(STATE) (STATE ? stepperE4.hardStop() : stepperE4.free()) #define E4_ENABLE_READ() (stepperE4.getStatus() & STATUS_HIZ) #if AXIS_DRIVER_TYPE_E4(L6474) #define E4_DIR_INIT() SET_OUTPUT(E4_DIR_PIN) @@ -298,7 +298,7 @@ #define E4_DIR_WRITE(STATE) L64XX_DIR_WRITE(E4, STATE) #define E4_DIR_READ() (stepper##E4.getStatus() & STATUS_DIR); #if AXIS_DRIVER_TYPE_E4(L6470) - #define DISABLE_STEPPER_E4() do{ stepperE4.free(); CBI(axis_known_position, E_AXIS); }while(0) + #define DISABLE_STEPPER_E4() do{ stepperE4.free(); }while(0) #endif #endif #endif @@ -307,7 +307,7 @@ #if AXIS_IS_L64XX(E5) extern L64XX_CLASS(E5) stepperE5; #define E5_ENABLE_INIT() NOOP - #define E5_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE5.free()) + #define E5_ENABLE_WRITE(STATE) (STATE ? stepperE5.hardStop() : stepperE5.free()) #define E5_ENABLE_READ() (stepperE5.getStatus() & STATUS_HIZ) #if AXIS_DRIVER_TYPE_E5(L6474) #define E5_DIR_INIT() SET_OUTPUT(E5_DIR_PIN) @@ -318,7 +318,7 @@ #define E5_DIR_WRITE(STATE) L64XX_DIR_WRITE(E5, STATE) #define E5_DIR_READ() (stepper##E5.getStatus() & STATUS_DIR); #if AXIS_DRIVER_TYPE_E5(L6470) - #define DISABLE_STEPPER_E5() do{ stepperE5.free(); CBI(axis_known_position, E_AXIS); }while(0) + #define DISABLE_STEPPER_E5() do{ stepperE5.free(); }while(0) #endif #endif #endif @@ -327,7 +327,7 @@ #if AXIS_IS_L64XX(E6) extern L64XX_CLASS(E6) stepperE6; #define E6_ENABLE_INIT() NOOP - #define E6_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE6.free()) + #define E6_ENABLE_WRITE(STATE) (STATE ? stepperE6.hardStop() : stepperE6.free()) #define E6_ENABLE_READ() (stepperE6.getStatus() & STATUS_HIZ) #if AXIS_DRIVER_TYPE_E6(L6474) #define E6_DIR_INIT() SET_OUTPUT(E6_DIR_PIN) @@ -338,7 +338,7 @@ #define E6_DIR_WRITE(STATE) L64XX_DIR_WRITE(E6, STATE) #define E6_DIR_READ() (stepper##E6.getStatus() & STATUS_DIR); #if AXIS_DRIVER_TYPE_E6(L6470) - #define DISABLE_STEPPER_E6() do{ stepperE6.free(); CBI(axis_known_position, E_AXIS); }while(0) + #define DISABLE_STEPPER_E6() do{ stepperE6.free(); }while(0) #endif #endif #endif @@ -347,7 +347,7 @@ #if AXIS_IS_L64XX(E7) extern L64XX_CLASS(E7) stepperE7; #define E7_ENABLE_INIT() NOOP - #define E7_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE7.free()) + #define E7_ENABLE_WRITE(STATE) (STATE ? stepperE7.hardStop() : stepperE7.free()) #define E7_ENABLE_READ() (stepperE7.getStatus() & STATUS_HIZ) #if AXIS_DRIVER_TYPE_E7(L6474) #define E7_DIR_INIT() SET_OUTPUT(E7_DIR_PIN) @@ -358,7 +358,7 @@ #define E7_DIR_WRITE(STATE) L64XX_DIR_WRITE(E7, STATE) #define E7_DIR_READ() (stepper##E7.getStatus() & STATUS_DIR); #if AXIS_DRIVER_TYPE_E7(L6470) - #define DISABLE_STEPPER_E7() do{ stepperE7.free(); CBI(axis_known_position, E_AXIS); }while(0) + #define DISABLE_STEPPER_E7() do{ stepperE7.free(); }while(0) #endif #endif #endif diff --git a/Marlin/src/module/stepper/TMC26X.cpp b/Marlin/src/module/stepper/TMC26X.cpp index 08c0b3e782..926f1a4e08 100644 --- a/Marlin/src/module/stepper/TMC26X.cpp +++ b/Marlin/src/module/stepper/TMC26X.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -30,7 +30,7 @@ // // TMC26X Driver objects and inits // -#if HAS_DRIVER(TMC26X) +#if HAS_TMC26X #include "TMC26X.h" @@ -141,4 +141,4 @@ void tmc26x_init_to_defaults() { #endif } -#endif // TMC26X +#endif // HAS_TMC26X diff --git a/Marlin/src/module/stepper/TMC26X.h b/Marlin/src/module/stepper/TMC26X.h index 39192cea25..8977266b47 100644 --- a/Marlin/src/module/stepper/TMC26X.h +++ b/Marlin/src/module/stepper/TMC26X.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/module/stepper/indirection.cpp b/Marlin/src/module/stepper/indirection.cpp index 2ddbfe62e3..6f9ac9ba0a 100644 --- a/Marlin/src/module/stepper/indirection.cpp +++ b/Marlin/src/module/stepper/indirection.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -33,21 +33,13 @@ #include "indirection.h" void restore_stepper_drivers() { - #if HAS_TRINAMIC_CONFIG - restore_trinamic_drivers(); - #endif + TERN_(HAS_TRINAMIC_CONFIG, restore_trinamic_drivers()); } void reset_stepper_drivers() { #if HAS_DRIVER(TMC26X) tmc26x_init_to_defaults(); #endif - - #if HAS_L64XX - L64xxManager.init_to_defaults(); - #endif - - #if HAS_TRINAMIC_CONFIG - reset_trinamic_drivers(); - #endif + TERN_(HAS_L64XX, L64xxManager.init_to_defaults()); + TERN_(HAS_TRINAMIC_CONFIG, reset_trinamic_drivers()); } diff --git a/Marlin/src/module/stepper/indirection.h b/Marlin/src/module/stepper/indirection.h index 0b36a5d0c0..e3d3730c79 100644 --- a/Marlin/src/module/stepper/indirection.h +++ b/Marlin/src/module/stepper/indirection.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -865,14 +865,14 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #endif #ifndef ENABLE_AXIS_E0 - #if E_STEPPERS > 0 && HAS_E0_ENABLE + #if E_STEPPERS && HAS_E0_ENABLE #define ENABLE_AXIS_E0() ENABLE_STEPPER_E0() #else #define ENABLE_AXIS_E0() NOOP #endif #endif #ifndef DISABLE_AXIS_E0 - #if E_STEPPERS > 0 && HAS_E0_ENABLE + #if E_STEPPERS && HAS_E0_ENABLE #define DISABLE_AXIS_E0() DISABLE_STEPPER_E0() #else #define DISABLE_AXIS_E0() NOOP diff --git a/Marlin/src/module/stepper/trinamic.cpp b/Marlin/src/module/stepper/trinamic.cpp index 14598f9c73..3dda98698b 100644 --- a/Marlin/src/module/stepper/trinamic.cpp +++ b/Marlin/src/module/stepper/trinamic.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -49,8 +49,12 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #define __TMC_SPI_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_CS_PIN, float(ST##_RSENSE), ST##_CHAIN_POS) #endif -#define TMC_UART_HW_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(&ST##_HARDWARE_SERIAL, float(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, float(ST##_RSENSE), ST##_SLAVE_ADDRESS, ST##_SERIAL_RX_PIN > -1) +#if ENABLED(TMC_SERIAL_MULTIPLEXER) + #define TMC_UART_HW_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(&ST##_HARDWARE_SERIAL, float(ST##_RSENSE), ST##_SLAVE_ADDRESS, SERIAL_MUL_PIN1, SERIAL_MUL_PIN2) +#else + #define TMC_UART_HW_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(&ST##_HARDWARE_SERIAL, float(ST##_RSENSE), ST##_SLAVE_ADDRESS) +#endif +#define TMC_UART_SW_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_SERIAL_RX_PIN, ST##_SERIAL_TX_PIN, float(ST##_RSENSE), ST##_SLAVE_ADDRESS) #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) @@ -58,7 +62,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #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 +#if DISTINCT_E > 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 @@ -117,16 +121,12 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #endif #ifndef TMC_BAUD_RATE - #if HAS_TMC_SW_SERIAL - // Reduce baud rate for boards not already overriding TMC_BAUD_RATE for software serial. - // Testing has shown that 115200 is not 100% reliable on AVR platforms, occasionally - // failing to read status properly. 32-bit platforms typically define an even lower - // TMC_BAUD_RATE, due to differences in how SoftwareSerial libraries work on different - // platforms. - #define TMC_BAUD_RATE 57600 - #else - #define TMC_BAUD_RATE 115200 - #endif + // Reduce baud rate for boards not already overriding TMC_BAUD_RATE for software serial. + // Testing has shown that 115200 is not 100% reliable on AVR platforms, occasionally + // failing to read status properly. 32-bit platforms typically define an even lower + // TMC_BAUD_RATE, due to differences in how SoftwareSerial libraries work on different + // platforms. + #define TMC_BAUD_RATE TERN(HAS_TMC_SW_SERIAL, 57600, 115200) #endif #if HAS_DRIVER(TMC2130) @@ -140,9 +140,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; chopconf.intpol = INTERPOLATE; chopconf.hend = chopper_timing.hend + 3; chopconf.hstrt = chopper_timing.hstrt - 1; - #if ENABLED(SQUARE_WAVE_STEPPING) - chopconf.dedge = true; - #endif + TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); st.rms_current(mA, HOLD_MULTIPLIER); @@ -160,11 +158,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; pwmconf.pwm_ampl = 180; st.PWMCONF(pwmconf.sr); - #if ENABLED(HYBRID_THRESHOLD) - st.set_pwm_thrs(hyb_thrs); - #else - UNUSED(hyb_thrs); - #endif + TERN(HYBRID_THRESHOLD, st.set_pwm_thrs(hyb_thrs), UNUSED(hyb_thrs)); st.GSTAT(); // Clear GSTAT } @@ -181,9 +175,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; chopconf.intpol = INTERPOLATE; chopconf.hend = chopper_timing.hend + 3; chopconf.hstrt = chopper_timing.hstrt - 1; - #if ENABLED(SQUARE_WAVE_STEPPING) - chopconf.dedge = true; - #endif + TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); st.rms_current(mA, HOLD_MULTIPLIER); @@ -204,11 +196,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; pwmconf.pwm_ofs = 36; st.PWMCONF(pwmconf.sr); - #if ENABLED(HYBRID_THRESHOLD) - st.set_pwm_thrs(hyb_thrs); - #else - UNUSED(hyb_thrs); - #endif + TERN(HYBRID_THRESHOLD, st.set_pwm_thrs(hyb_thrs), UNUSED(hyb_thrs)); st.GSTAT(); // Clear GSTAT } @@ -331,115 +319,130 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #endif #endif + enum TMCAxis : uint8_t { X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5, E6, E7, TOTAL }; + void tmc_serial_begin() { + #if HAS_TMC_HW_SERIAL + struct { + const void *ptr[TMCAxis::TOTAL]; + bool began(const TMCAxis a, const void * const p) { + LOOP_L_N(i, a) if (p == ptr[i]) return true; + ptr[a] = p; return false; + }; + } sp_helper; + + #define HW_SERIAL_BEGIN(A) do{ if (!sp_helper.began(TMCAxis::A, &A##_HARDWARE_SERIAL)) \ + A##_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); }while(0) + #endif + #if AXIS_HAS_UART(X) #ifdef X_HARDWARE_SERIAL - X_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + HW_SERIAL_BEGIN(X); #else stepperX.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(X2) #ifdef X2_HARDWARE_SERIAL - X2_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + HW_SERIAL_BEGIN(X2); #else stepperX2.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(Y) #ifdef Y_HARDWARE_SERIAL - Y_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + HW_SERIAL_BEGIN(Y); #else stepperY.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(Y2) #ifdef Y2_HARDWARE_SERIAL - Y2_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + HW_SERIAL_BEGIN(Y2); #else stepperY2.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(Z) #ifdef Z_HARDWARE_SERIAL - Z_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + HW_SERIAL_BEGIN(Z); #else stepperZ.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(Z2) #ifdef Z2_HARDWARE_SERIAL - Z2_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + HW_SERIAL_BEGIN(Z2); #else stepperZ2.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(Z3) #ifdef Z3_HARDWARE_SERIAL - Z3_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + HW_SERIAL_BEGIN(Z3); #else stepperZ3.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(Z4) #ifdef Z4_HARDWARE_SERIAL - Z4_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + HW_SERIAL_BEGIN(Z4); #else stepperZ4.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(E0) #ifdef E0_HARDWARE_SERIAL - E0_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + HW_SERIAL_BEGIN(E0); #else stepperE0.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(E1) #ifdef E1_HARDWARE_SERIAL - E1_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + HW_SERIAL_BEGIN(E1); #else stepperE1.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(E2) #ifdef E2_HARDWARE_SERIAL - E2_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + HW_SERIAL_BEGIN(E2); #else stepperE2.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(E3) #ifdef E3_HARDWARE_SERIAL - E3_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + HW_SERIAL_BEGIN(E3); #else stepperE3.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(E4) #ifdef E4_HARDWARE_SERIAL - E4_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + HW_SERIAL_BEGIN(E4); #else stepperE4.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(E5) #ifdef E5_HARDWARE_SERIAL - E5_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + HW_SERIAL_BEGIN(E5); #else stepperE5.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(E6) #ifdef E6_HARDWARE_SERIAL - E6_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + HW_SERIAL_BEGIN(E6); #else stepperE6.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(E7) #ifdef E7_HARDWARE_SERIAL - E7_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + HW_SERIAL_BEGIN(E7); #else stepperE7.beginSerial(TMC_BAUD_RATE); #endif @@ -464,9 +467,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; chopconf.intpol = INTERPOLATE; chopconf.hend = chopper_timing.hend + 3; chopconf.hstrt = chopper_timing.hstrt - 1; - #if ENABLED(SQUARE_WAVE_STEPPING) - chopconf.dedge = true; - #endif + TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); st.rms_current(mA, HOLD_MULTIPLIER); @@ -484,11 +485,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; pwmconf.pwm_ofs = 36; st.PWMCONF(pwmconf.sr); - #if ENABLED(HYBRID_THRESHOLD) - st.set_pwm_thrs(hyb_thrs); - #else - UNUSED(hyb_thrs); - #endif + TERN(HYBRID_THRESHOLD, st.set_pwm_thrs(hyb_thrs), UNUSED(hyb_thrs)); st.GSTAT(0b111); // Clear delay(200); @@ -512,9 +509,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; chopconf.intpol = INTERPOLATE; chopconf.hend = chopper_timing.hend + 3; chopconf.hstrt = chopper_timing.hstrt - 1; - #if ENABLED(SQUARE_WAVE_STEPPING) - chopconf.dedge = true; - #endif + TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); st.rms_current(mA, HOLD_MULTIPLIER); @@ -532,11 +527,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; pwmconf.pwm_ofs = 36; st.PWMCONF(pwmconf.sr); - #if ENABLED(HYBRID_THRESHOLD) - st.set_pwm_thrs(hyb_thrs); - #else - UNUSED(hyb_thrs); - #endif + TERN(HYBRID_THRESHOLD, st.set_pwm_thrs(hyb_thrs), UNUSED(hyb_thrs)); st.GSTAT(0b111); // Clear delay(200); @@ -558,15 +549,10 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; st.sdoff(0); st.rms_current(mA); st.microsteps(microsteps); - #if ENABLED(SQUARE_WAVE_STEPPING) - st.dedge(true); - #endif + TERN_(SQUARE_WAVE_STEPPING, st.dedge(true)); st.intpol(INTERPOLATE); st.diss2g(true); // Disable short to ground protection. Too many false readings? - - #if ENABLED(TMC_DEBUG) - st.rdsel(0b01); - #endif + TERN_(TMC_DEBUG, st.rdsel(0b01)); } #endif // TMC2660 @@ -581,9 +567,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; chopconf.intpol = INTERPOLATE; chopconf.hend = chopper_timing.hend + 3; chopconf.hstrt = chopper_timing.hstrt - 1; - #if ENABLED(SQUARE_WAVE_STEPPING) - chopconf.dedge = true; - #endif + TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); st.rms_current(mA, HOLD_MULTIPLIER); @@ -601,11 +585,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; pwmconf.pwm_ampl = 180; st.PWMCONF(pwmconf.sr); - #if ENABLED(HYBRID_THRESHOLD) - st.set_pwm_thrs(hyb_thrs); - #else - UNUSED(hyb_thrs); - #endif + TERN(HYBRID_THRESHOLD, st.set_pwm_thrs(hyb_thrs), UNUSED(hyb_thrs)); st.GSTAT(); // Clear GSTAT } @@ -622,9 +602,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; chopconf.intpol = INTERPOLATE; chopconf.hend = chopper_timing.hend + 3; chopconf.hstrt = chopper_timing.hstrt - 1; - #if ENABLED(SQUARE_WAVE_STEPPING) - chopconf.dedge = true; - #endif + TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); st.rms_current(mA, HOLD_MULTIPLIER); @@ -706,25 +684,7 @@ void restore_trinamic_drivers() { } void reset_trinamic_drivers() { - static constexpr bool stealthchop_by_axis[] = { - #if ENABLED(STEALTHCHOP_XY) - true - #else - false - #endif - , - #if ENABLED(STEALTHCHOP_Z) - true - #else - false - #endif - , - #if ENABLED(STEALTHCHOP_E) - true - #else - false - #endif - }; + static constexpr bool stealthchop_by_axis[] = { ENABLED(STEALTHCHOP_XY), ENABLED(STEALTHCHOP_Z), ENABLED(STEALTHCHOP_E) }; #if AXIS_IS_TMC(X) TMC_INIT(X, STEALTH_AXIS_XY); @@ -777,36 +737,27 @@ void reset_trinamic_drivers() { #if USE_SENSORLESS #if X_SENSORLESS - #if AXIS_HAS_STALLGUARD(X) - stepperX.homing_threshold(X_STALL_SENSITIVITY); + stepperX.homing_threshold(X_STALL_SENSITIVITY); + #if AXIS_HAS_STALLGUARD(X2) + stepperX2.homing_threshold(CAT(TERN(X2_SENSORLESS, X2, 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 + stepperY.homing_threshold(Y_STALL_SENSITIVITY); #if AXIS_HAS_STALLGUARD(Y2) - stepperY2.homing_threshold(Y_STALL_SENSITIVITY); + stepperY2.homing_threshold(CAT(TERN(Y2_SENSORLESS, Y2, Y), _STALL_SENSITIVITY)); #endif #endif #if Z_SENSORLESS - #if AXIS_HAS_STALLGUARD(Z) - stepperZ.homing_threshold(Z_STALL_SENSITIVITY); - #endif + stepperZ.homing_threshold(Z_STALL_SENSITIVITY); #if AXIS_HAS_STALLGUARD(Z2) - stepperZ2.homing_threshold(Z_STALL_SENSITIVITY); + stepperZ2.homing_threshold(CAT(TERN(Z2_SENSORLESS, Z2, Z), _STALL_SENSITIVITY)); #endif #if AXIS_HAS_STALLGUARD(Z3) - stepperZ3.homing_threshold(Z_STALL_SENSITIVITY); + stepperZ3.homing_threshold(CAT(TERN(Z3_SENSORLESS, Z3, Z), _STALL_SENSITIVITY)); #endif #if AXIS_HAS_STALLGUARD(Z4) - stepperZ4.homing_threshold(Z_STALL_SENSITIVITY); + stepperZ4.homing_threshold(CAT(TERN(Z4_SENSORLESS, Z4, Z), _STALL_SENSITIVITY)); #endif #endif #endif diff --git a/Marlin/src/module/stepper/trinamic.h b/Marlin/src/module/stepper/trinamic.h index 262e20840e..9cc3404cd2 100644 --- a/Marlin/src/module/stepper/trinamic.h +++ b/Marlin/src/module/stepper/trinamic.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index dfb905bc06..1dc480a927 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -24,20 +24,28 @@ * temperature.cpp - temperature control */ +// Useful when debugging thermocouples +//#define IGNORE_THERMOCOUPLE_ERRORS + #include "temperature.h" #include "endstops.h" #include "../MarlinCore.h" -#include "../lcd/ultralcd.h" #include "planner.h" -#include "../core/language.h" #include "../HAL/shared/Delay.h" + +#include "../lcd/ultralcd.h" + +#if ENABLED(DWIN_CREALITY_LCD) + #include "../lcd/dwin/dwin.h" +#endif + #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" #endif #if ENABLED(MAX6675_IS_MAX31865) - #include "Adafruit_MAX31865.h" + #include #ifndef MAX31865_CS_PIN #define MAX31865_CS_PIN MAX6675_SS_PIN // HW:49 SW:65 for example #endif @@ -79,6 +87,10 @@ #include "../feature/filwidth.h" #endif +#if HAS_POWER_MONITOR + #include "../feature/power_monitor.h" +#endif + #if ENABLED(EMERGENCY_PARSER) #include "../feature/e_parser.h" #endif @@ -101,12 +113,12 @@ #if HOTEND_USES_THERMISTOR #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - static const void* heater_ttbl_map[2] = { (void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE }; + static const temp_entry_t* heater_ttbl_map[2] = { HEATER_0_TEMPTABLE, HEATER_1_TEMPTABLE }; static constexpr uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN }; #else #define NEXT_TEMPTABLE(N) ,HEATER_##N##_TEMPTABLE #define NEXT_TEMPTABLE_LEN(N) ,HEATER_##N##_TEMPTABLE_LEN - static const void* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE REPEAT_S(1, HOTENDS, NEXT_TEMPTABLE)); + static const temp_entry_t* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE REPEAT_S(1, HOTENDS, NEXT_TEMPTABLE)); static constexpr uint8_t heater_ttbllen_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE_LEN REPEAT_S(1, HOTENDS, NEXT_TEMPTABLE_LEN)); #endif #endif @@ -140,8 +152,9 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY, bool Temperature::adaptive_fan_slowing = true; #endif -#if HOTENDS +#if HAS_HOTEND hotend_info_t Temperature::temp_hotend[HOTEND_TEMPS]; // = { 0 } + const uint16_t Temperature::heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP, HEATER_6_MAXTEMP, HEATER_7_MAXTEMP); #endif #if ENABLED(AUTO_POWER_E_FANS) @@ -152,7 +165,7 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY, uint8_t Temperature::chamberfan_speed; // = 0 #endif -#if FAN_COUNT > 0 +#if HAS_FAN uint8_t Temperature::fan_speed[FAN_COUNT]; // = { 0 } @@ -192,7 +205,7 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY, NOMORE(speed, 255U); - #if ENABLED(SINGLENOZZLE) + #if ENABLED(SINGLENOZZLE_STANDBY_FAN) if (target != active_extruder) { if (target < EXTRUDERS) singlenozzle_fan_speed[target] = speed; return; @@ -203,8 +216,21 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY, if (target >= FAN_COUNT) return; fan_speed[target] = speed; + + TERN_(REPORT_FAN_CHANGE, report_fan_speed(target)); } + #if ENABLED(REPORT_FAN_CHANGE) + /** + * Report print fan speed for a target extruder + */ + void Temperature::report_fan_speed(const uint8_t target) { + if (target >= FAN_COUNT) return; + PORT_REDIRECT(SERIAL_BOTH); + SERIAL_ECHOLNPAIR("M106 P", target, " S", fan_speed[target]); + } + #endif + #if EITHER(PROBING_FANS_OFF, ADVANCED_PAUSE_FANS_PAUSE) void Temperature::set_fans_paused(const bool p) { @@ -219,7 +245,7 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY, #endif -#endif // FAN_COUNT > 0 +#endif // HAS_FAN #if WATCH_HOTENDS hotend_watch_t Temperature::watch_hotend[HOTENDS]; // = { { 0 } } @@ -237,15 +263,9 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY, #ifdef BED_MAXTEMP int16_t Temperature::maxtemp_raw_BED = HEATER_BED_RAW_HI_TEMP; #endif - #if WATCH_BED - bed_watch_t Temperature::watch_bed; // = { 0 } - #endif - #if DISABLED(PIDTEMPBED) - millis_t Temperature::next_bed_check_ms; - #endif - #if HEATER_IDLE_HANDLER - hotend_idle_t Temperature::bed_idle; // = { 0 } - #endif + TERN_(WATCH_BED, bed_watch_t Temperature::watch_bed); // = { 0 } + TERN(PIDTEMPBED,, millis_t Temperature::next_bed_check_ms); + TERN_(HEATER_IDLE_HANDLER, hotend_idle_t Temperature::bed_idle); // = { 0 } #endif // HAS_HEATED_BED #if HAS_TEMP_CHAMBER @@ -298,7 +318,7 @@ volatile bool Temperature::raw_temps_ready = false; #define TEMPDIR(N) ((HEATER_##N##_RAW_LO_TEMP) < (HEATER_##N##_RAW_HI_TEMP) ? 1 : -1) -#if HOTENDS +#if HAS_HOTEND // 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 }, @@ -337,7 +357,7 @@ volatile bool Temperature::raw_temps_ready = false; #if HAS_ADC_BUTTONS uint32_t Temperature::current_ADCKey_raw = HAL_ADC_RANGE; - uint8_t Temperature::ADCKey_count = 0; + uint16_t Temperature::ADCKey_count = 0; #endif #if ENABLED(PID_EXTRUSION_SCALING) @@ -386,33 +406,29 @@ volatile bool Temperature::raw_temps_ready = false; #define ONHEATINGSTART() printerEventLEDs.onHotendHeatingStart() #define ONHEATING(S,C,T) printerEventLEDs.onHotendHeating(S,C,T) #endif + #define WATCH_PID BOTH(WATCH_BED, PIDTEMPBED) || BOTH(WATCH_HOTENDS, PIDTEMP) - #if WATCH_BED || WATCH_HOTENDS - #define HAS_TP_BED BOTH(THERMAL_PROTECTION_BED, PIDTEMPBED) - #if HAS_TP_BED && BOTH(THERMAL_PROTECTION_HOTENDS, PIDTEMP) + #if WATCH_PID + #if ALL(THERMAL_PROTECTION_HOTENDS, PIDTEMP, THERMAL_PROTECTION_BED, PIDTEMPBED) #define GTV(B,H) (isbed ? (B) : (H)) - #elif HAS_TP_BED - #define GTV(B,H) (B) - #else + #elif BOTH(THERMAL_PROTECTION_HOTENDS, PIDTEMP) #define GTV(B,H) (H) + #else + #define GTV(B,H) (B) #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; + millis_t temp_change_ms = next_temp_ms + SEC_TO_MS(watch_temp_period); float next_watch_temp = 0.0; bool heated = false; #endif - #if HAS_AUTO_FAN - next_auto_fan_check_ms = next_temp_ms + 2500UL; - #endif + TERN_(HAS_AUTO_FAN, next_auto_fan_check_ms = next_temp_ms + 2500UL); - if (target > GHV(BED_MAXTEMP - 10, temp_range[heater].maxtemp - 15)) { + if (target > GHV(BED_MAX_TARGET, temp_range[heater].maxtemp - HOTEND_OVERSHOOT)) { SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH)); return; } @@ -428,9 +444,7 @@ volatile bool Temperature::raw_temps_ready = false; LEDColor color = ONHEATINGSTART(); #endif - #if ENABLED(NO_FAN_SLOWING_IN_PID_TUNING) - adaptive_fan_slowing = false; - #endif + TERN_(NO_FAN_SLOWING_IN_PID_TUNING, adaptive_fan_slowing = false); // PID Tuning loop while (wait_for_heatup) { @@ -526,9 +540,7 @@ volatile bool Temperature::raw_temps_ready = false; #endif if (current_temp > target + MAX_OVERSHOOT_PID_AUTOTUNE) { SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH)); break; } @@ -541,23 +553,15 @@ volatile bool Temperature::raw_temps_ready = false; 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 + #if WATCH_PID + if (BOTH(WATCH_BED, WATCH_HOTENDS) || isbed == DISABLED(WATCH_HOTENDS)) { + 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 + SEC_TO_MS(watch_temp_period); // - 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 + else if (ELAPSED(ms, temp_change_ms)) // Watch timer expired _temp_error(heater, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD)); } else if (current_temp < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far? @@ -570,10 +574,9 @@ volatile bool Temperature::raw_temps_ready = false; #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)) { - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPidTuning(ExtUI::result_t::PID_TUNING_TIMEOUT); - #endif + if ((ms - _MIN(t1, t2)) > (MAX_CYCLE_TIME_PID_AUTOTUNE * 60L * 1000L)) { + TERN_(DWIN_CREALITY_LCD, Popup_Window_Temperature(0)); + TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TUNING_TIMEOUT)); SERIAL_ECHOLNPGM(STR_PID_TIMEOUT); break; } @@ -619,31 +622,23 @@ volatile bool Temperature::raw_temps_ready = false; #endif } - #if ENABLED(PRINTER_EVENT_LEDS) - printerEventLEDs.onPidTuningDone(color); - #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPidTuning(ExtUI::result_t::PID_DONE); - #endif + TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onPidTuningDone(color)); + + TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_DONE)); goto EXIT_M303; } - ui.update(); + TERN(DWIN_CREALITY_LCD, DWIN_Update(), ui.update()); } disable_all_heaters(); - #if ENABLED(PRINTER_EVENT_LEDS) - printerEventLEDs.onPidTuningDone(color); - #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPidTuning(ExtUI::result_t::PID_DONE); - #endif + TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onPidTuningDone(color)); + + TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_DONE)); EXIT_M303: - #if ENABLED(NO_FAN_SLOWING_IN_PID_TUNING) - adaptive_fan_slowing = true; - #endif + TERN_(NO_FAN_SLOWING_IN_PID_TUNING, adaptive_fan_slowing = true); return; } @@ -662,11 +657,7 @@ int16_t Temperature::getHeaterPower(const heater_ind_t heater_id) { case H_CHAMBER: return temp_chamber.soft_pwm_amount; #endif default: - return (0 - #if HOTENDS - + temp_hotend[heater_id].soft_pwm_amount - #endif - ); + return TERN0(HAS_HOTEND, temp_hotend[heater_id].soft_pwm_amount); } } @@ -680,7 +671,7 @@ int16_t Temperature::getHeaterPower(const heater_ind_t heater_id) { #define _EFAN(B,A) _EFANOVERLAP(A,B) ? B : static const uint8_t fanBit[] PROGMEM = { 0 - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND #define _NEXT_FAN(N) , REPEAT2(N,_EFAN,N) N RREPEAT_S(1, HOTENDS, _NEXT_FAN) #endif @@ -780,19 +771,16 @@ void Temperature::_temp_error(const heater_ind_t heater, PGM_P const serial_msg, static uint8_t killed = 0; - if (IsRunning() - #if BOGUS_TEMPERATURE_GRACE_PERIOD - && killed == 2 - #endif - ) { + if (IsRunning() && TERN1(BOGUS_TEMPERATURE_GRACE_PERIOD, killed == 2)) { SERIAL_ERROR_START(); serialprintPGM(serial_msg); SERIAL_ECHOPGM(STR_STOPPED_HEATER); - if (heater >= 0) SERIAL_ECHO((int)heater); - #if HAS_HEATED_CHAMBER - else if (heater == H_CHAMBER) SERIAL_ECHOPGM(STR_HEATER_CHAMBER); - #endif - else SERIAL_ECHOPGM(STR_HEATER_BED); + if (heater >= 0) + SERIAL_ECHO((int)heater); + else if (TERN0(HAS_HEATED_CHAMBER, heater == H_CHAMBER)) + SERIAL_ECHOPGM(STR_HEATER_CHAMBER); + else + SERIAL_ECHOPGM(STR_HEATER_BED); SERIAL_EOL(); } @@ -822,14 +810,16 @@ void Temperature::_temp_error(const heater_ind_t heater, PGM_P const serial_msg, } void Temperature::max_temp_error(const heater_ind_t heater) { + TERN_(DWIN_CREALITY_LCD, Popup_Window_Temperature(1)); _temp_error(heater, PSTR(STR_T_MAXTEMP), GET_TEXT(MSG_ERR_MAXTEMP)); } void Temperature::min_temp_error(const heater_ind_t heater) { + TERN_(DWIN_CREALITY_LCD, Popup_Window_Temperature(0)); _temp_error(heater, PSTR(STR_T_MINTEMP), GET_TEXT(MSG_ERR_MINTEMP)); } -#if HOTENDS +#if HAS_HOTEND #if ENABLED(PID_DEBUG) extern bool pid_debug_flag; #endif @@ -848,9 +838,7 @@ void Temperature::min_temp_error(const heater_ind_t heater) { if (temp_hotend[ee].target == 0 || pid_error < -(PID_FUNCTIONAL_RANGE) - #if HEATER_IDLE_HANDLER - || hotend_idle[ee].timed_out - #endif + || TERN0(HEATER_IDLE_HANDLER, hotend_idle[ee].timed_out) ) { pid_output = 0; pid_reset[ee] = true; @@ -918,11 +906,16 @@ void Temperature::min_temp_error(const heater_ind_t heater) { SERIAL_ECHO_START(); SERIAL_ECHOPAIR(STR_PID_DEBUG, ee, STR_PID_DEBUG_INPUT, temp_hotend[ee].celsius, STR_PID_DEBUG_OUTPUT, pid_output); #if DISABLED(PID_OPENLOOP) - SERIAL_ECHOPAIR( STR_PID_DEBUG_PTERM, work_pid[ee].Kp, STR_PID_DEBUG_ITERM, work_pid[ee].Ki, STR_PID_DEBUG_DTERM, work_pid[ee].Kd + { + SERIAL_ECHOPAIR( + STR_PID_DEBUG_PTERM, work_pid[ee].Kp, + STR_PID_DEBUG_ITERM, work_pid[ee].Ki, + STR_PID_DEBUG_DTERM, work_pid[ee].Kd #if ENABLED(PID_EXTRUSION_SCALING) , STR_PID_DEBUG_CTERM, work_pid[ee].Kc #endif ); + } #endif SERIAL_EOL(); } @@ -930,11 +923,7 @@ void Temperature::min_temp_error(const heater_ind_t heater) { #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 bool is_idling = TERN0(HEATER_IDLE_HANDLER, hotend_idle[ee].timed_out); const float pid_output = (!is_idling && temp_hotend[ee].celsius < temp_hotend[ee].target) ? BANG_MAX : 0; #endif @@ -942,7 +931,7 @@ void Temperature::min_temp_error(const heater_ind_t heater) { return pid_output; } -#endif // HOTENDS +#endif // HAS_HOTEND #if ENABLED(PIDTEMPBED) @@ -1024,27 +1013,27 @@ void Temperature::manage_heater() { if (!inited) return watchdog_refresh(); #endif - #if ENABLED(EMERGENCY_PARSER) - if (emergency_parser.killed_by_M112) kill(M112_KILL_STR, nullptr, true); - #endif + if (TERN0(EMERGENCY_PARSER, emergency_parser.killed_by_M112)) + kill(M112_KILL_STR, nullptr, true); if (!raw_temps_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); + #if DISABLED(IGNORE_THERMOCOUPLE_ERRORS) + #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 #endif millis_t ms = millis(); - #if HOTENDS + #if HAS_HOTEND HOTEND_LOOP() { #if ENABLED(THERMAL_PROTECTION_HOTENDS) @@ -1052,9 +1041,7 @@ void Temperature::manage_heater() { _temp_error((heater_ind_t)e, str_t_thermal_runaway, GET_TEXT(MSG_THERMAL_RUNAWAY)); #endif - #if HEATER_IDLE_HANDLER - hotend_idle[e].update(ms); - #endif + TERN_(HEATER_IDLE_HANDLER, hotend_idle[e].update(ms)); #if ENABLED(THERMAL_PROTECTION_HOTENDS) // Check for thermal runaway @@ -1066,8 +1053,10 @@ void Temperature::manage_heater() { #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? + if (degHotend(e) < watch_hotend[e].target) { // Failed to increase enough? + TERN_(DWIN_CREALITY_LCD, Popup_Window_Temperature(0)); _temp_error((heater_ind_t)e, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD)); + } else // Start again if the target is still far off start_watching_hotend(e); } @@ -1081,7 +1070,7 @@ void Temperature::manage_heater() { } // HOTEND_LOOP - #endif // HOTENDS + #endif // HAS_HOTEND #if HAS_AUTO_FAN if (ELAPSED(ms, next_auto_fan_check_ms)) { // only need to check fan state very infrequently @@ -1108,14 +1097,19 @@ void Temperature::manage_heater() { #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? + if (degBed() < watch_bed.target) { // Failed to increase enough? + TERN_(DWIN_CREALITY_LCD, Popup_Window_Temperature(0)); _temp_error(H_BED, str_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 - #define PAUSE_CHANGE_REQD BOTH(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING) + #if BOTH(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING) + #define PAUSE_CHANGE_REQD 1 + #endif + #if PAUSE_CHANGE_REQD static bool last_pause_state; #endif @@ -1124,23 +1118,15 @@ void Temperature::manage_heater() { #if DISABLED(PIDTEMPBED) if (PENDING(ms, next_bed_check_ms) - #if PAUSE_CHANGE_REQD - && paused == last_pause_state - #endif + && TERN1(PAUSE_CHANGE_REQD, paused == last_pause_state) ) break; next_bed_check_ms = ms + BED_CHECK_INTERVAL; - #if PAUSE_CHANGE_REQD - last_pause_state = paused; - #endif + TERN_(PAUSE_CHANGE_REQD, last_pause_state = paused); #endif - #if HEATER_IDLE_HANDLER - bed_idle.update(ms); - #endif + TERN_(HEATER_IDLE_HANDLER, bed_idle.update(ms)); - #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 + TERN_(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)); #if HEATER_IDLE_HANDLER if (bed_idle.timed_out) { @@ -1216,9 +1202,7 @@ void Temperature::manage_heater() { 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 + TERN_(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)); } // TODO: Implement true PID pwm @@ -1236,22 +1220,22 @@ void Temperature::manage_heater() { * 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); \ - } \ - } \ +#define SCAN_THERMISTOR_TABLE(TBL,LEN) do{ \ + uint8_t l = 0, r = LEN, m; \ + for (;;) { \ + m = (l + r) >> 1; \ + if (!m) return int16_t(pgm_read_word(&TBL[0].celsius)); \ + if (m == l || m == r) return int16_t(pgm_read_word(&TBL[LEN-1].celsius)); \ + int16_t v00 = pgm_read_word(&TBL[m-1].value), \ + v10 = pgm_read_word(&TBL[m-0].value); \ + if (raw < v00) r = m; \ + else if (raw > v10) l = m; \ + else { \ + const int16_t v01 = int16_t(pgm_read_word(&TBL[m-1].celsius)), \ + v11 = int16_t(pgm_read_word(&TBL[m-0].celsius)); \ + return v01 + (raw - v00) * float(v11 - v01) / float(v10 - v00); \ + } \ + } \ }while(0) #if HAS_USER_THERMISTORS @@ -1307,40 +1291,20 @@ void Temperature::manage_heater() { SERIAL_ECHOPAIR_F(" R", t.series_res, 1); SERIAL_ECHOPAIR_F_P(SP_T_STR, t.res_25, 1); - SERIAL_ECHOPAIR_F(" B", t.beta, 1); - SERIAL_ECHOPAIR_F(" C", t.sh_c_coeff, 9); + SERIAL_ECHOPAIR_F_P(SP_B_STR, t.beta, 1); + SERIAL_ECHOPAIR_F_P(SP_C_STR, 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_6_USER_THERMISTOR) - t_index == CTI_HOTEND_6 ? PSTR("HOTEND 6") : - #endif - #if ENABLED(HEATER_7_USER_THERMISTOR) - t_index == CTI_HOTEND_7 ? PSTR("HOTEND 7") : - #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 + TERN_(HEATER_0_USER_THERMISTOR, t_index == CTI_HOTEND_0 ? PSTR("HOTEND 0") :) + TERN_(HEATER_1_USER_THERMISTOR, t_index == CTI_HOTEND_1 ? PSTR("HOTEND 1") :) + TERN_(HEATER_2_USER_THERMISTOR, t_index == CTI_HOTEND_2 ? PSTR("HOTEND 2") :) + TERN_(HEATER_3_USER_THERMISTOR, t_index == CTI_HOTEND_3 ? PSTR("HOTEND 3") :) + TERN_(HEATER_4_USER_THERMISTOR, t_index == CTI_HOTEND_4 ? PSTR("HOTEND 4") :) + TERN_(HEATER_5_USER_THERMISTOR, t_index == CTI_HOTEND_5 ? PSTR("HOTEND 5") :) + TERN_(HEATER_6_USER_THERMISTOR, t_index == CTI_HOTEND_6 ? PSTR("HOTEND 6") :) + TERN_(HEATER_7_USER_THERMISTOR, t_index == CTI_HOTEND_7 ? PSTR("HOTEND 7") :) + TERN_(HEATER_BED_USER_THERMISTOR, t_index == CTI_BED ? PSTR("BED") :) + TERN_(HEATER_CHAMBER_USER_THERMISTOR, t_index == CTI_CHAMBER ? PSTR("CHAMBER") :) nullptr ); SERIAL_EOL(); @@ -1392,16 +1356,11 @@ void Temperature::manage_heater() { } #endif -#if HOTENDS +#if HAS_HOTEND // 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 - { + if (e > HOTENDS - DISABLED(TEMP_SENSOR_1_AS_REDUNDANT)) { SERIAL_ERROR_START(); SERIAL_ECHO((int)e); SERIAL_ECHOLNPGM(STR_INVALID_EXTRUDER_NUM); @@ -1505,13 +1464,13 @@ void Temperature::manage_heater() { #if HOTEND_USES_THERMISTOR // Thermistor with conversion table? - const short(*tt)[][2] = (short(*)[][2])(heater_ttbl_map[e]); + const temp_entry_t(*tt)[] = (temp_entry_t(*)[])(heater_ttbl_map[e]); SCAN_THERMISTOR_TABLE((*tt), heater_ttbllen_map[e]); #endif return 0; } -#endif // HOTENDS +#endif // HAS_HOTEND #if HAS_HEATED_BED // Derived from RepRap FiveD extruder::getTemperature() @@ -1583,24 +1542,16 @@ void Temperature::updateTemperaturesFromRawValues() { #if ENABLED(HEATER_1_USES_MAX6675) temp_hotend[1].raw = READ_MAX6675(1); #endif - #if HOTENDS + #if HAS_HOTEND 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 HAS_TEMP_PROBE - temp_probe.celsius = analog_to_celsius_probe(temp_probe.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 + + TERN_(HAS_HEATED_BED, temp_bed.celsius = analog_to_celsius_bed(temp_bed.raw)); + TERN_(HAS_TEMP_CHAMBER, temp_chamber.celsius = analog_to_celsius_chamber(temp_chamber.raw)); + TERN_(HAS_TEMP_PROBE, temp_probe.celsius = analog_to_celsius_probe(temp_probe.raw)); + TERN_(TEMP_SENSOR_1_AS_REDUNDANT, redundant_temperature = analog_to_celsius_hotend(redundant_temperature_raw, 1)); + TERN_(FILAMENT_WIDTH_SENSOR, filwidth.update_measured_mm()); + TERN_(HAS_POWER_MONITOR, power_monitor.capture_values()); // Reset the watchdog on good temperature measurement watchdog_refresh(); @@ -1646,9 +1597,7 @@ void Temperature::updateTemperaturesFromRawValues() { */ void Temperature::init() { - #if ENABLED(MAX6675_IS_MAX31865) - max31865.begin(MAX31865_2WIRE); // MAX31865_2WIRE, MAX31865_3WIRE, MAX31865_4WIRE - #endif + TERN_(MAX6675_IS_MAX31865, max31865.begin(MAX31865_2WIRE)); // MAX31865_2WIRE, MAX31865_3WIRE, MAX31865_4WIRE #if EARLY_WATCHDOG // Flag that the thermalManager should be running @@ -1659,12 +1608,20 @@ void Temperature::init() { #if MB(RUMBA) // Disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector #define _AD(N) ANY(HEATER_##N##_USES_AD595, HEATER_##N##_USES_AD8495) - #if _AD(0) || _AD(1) || _AD(2) || _AD(BED) || _AD(CHAMBER) + #if _AD(0) || _AD(1) || _AD(2) || _AD(BED) || _AD(CHAMBER) MCUCR = _BV(JTD); MCUCR = _BV(JTD); #endif #endif + // Thermistor activation by MCU pin + #if PIN_EXISTS(TEMP_0_TR_ENABLE_PIN) + OUT_WRITE(TEMP_0_TR_ENABLE_PIN, ENABLED(HEATER_0_USES_MAX6675)); + #endif + #if PIN_EXISTS(TEMP_1_TR_ENABLE_PIN) + OUT_WRITE(TEMP_1_TR_ENABLE_PIN, ENABLED(HEATER_1_USES_MAX6675)); + #endif + #if BOTH(PIDTEMP, PID_EXTRUSION_SCALING) last_e_position = 0; #endif @@ -1809,6 +1766,12 @@ void Temperature::init() { #if HAS_ADC_BUTTONS HAL_ANALOG_SELECT(ADC_KEYPAD_PIN); #endif + #if ENABLED(POWER_MONITOR_CURRENT) + HAL_ANALOG_SELECT(POWER_MONITOR_CURRENT_PIN); + #endif + #if ENABLED(POWER_MONITOR_VOLTAGE) + HAL_ANALOG_SELECT(POWER_MONITOR_VOLTAGE_PIN); + #endif HAL_timer_start(TEMP_TIMER_NUM, TEMP_TIMER_FREQUENCY); ENABLE_TEMPERATURE_INTERRUPT(); @@ -1844,83 +1807,73 @@ void Temperature::init() { // Wait for temperature measurement to settle delay(250); - #if HOTENDS + #if HAS_HOTEND #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) \ + const int16_t tmin = _MAX(HEATER_ ##NR## _MINTEMP, TERN(HEATER_##NR##_USER_THERMISTOR, 0, (int16_t)pgm_read_word(&HEATER_ ##NR## _TEMPTABLE[HEATER_ ##NR## _SENSOR_MINTEMP_IND].celsius))); \ + temp_range[NR].mintemp = tmin; \ + while (analog_to_celsius_hotend(temp_range[NR].raw_min, NR) < tmin) \ 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) \ + const int16_t tmax = _MIN(HEATER_ ##NR## _MAXTEMP, TERN(HEATER_##NR##_USER_THERMISTOR, 2000, (int16_t)pgm_read_word(&HEATER_ ##NR## _TEMPTABLE[HEATER_ ##NR## _SENSOR_MAXTEMP_IND].celsius) - 1)); \ + temp_range[NR].maxtemp = tmax; \ + while (analog_to_celsius_hotend(temp_range[NR].raw_max, NR) > tmax) \ temp_range[NR].raw_max -= TEMPDIR(NR) * (OVERSAMPLENR); \ }while(0) - #ifdef HEATER_0_MINTEMP + #define _MINMAX_TEST(N,M) (HOTENDS > N && THERMISTOR_HEATER_##N && THERMISTOR_HEATER_##N != 998 && THERMISTOR_HEATER_##N != 999 && defined(HEATER_##N##_##M##TEMP)) + + #if _MINMAX_TEST(0, MIN) _TEMP_MIN_E(0); #endif - #ifdef HEATER_0_MAXTEMP + #if _MINMAX_TEST(0, MAX) _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 - #if HOTENDS > 6 - #ifdef HEATER_6_MINTEMP - _TEMP_MIN_E(6); - #endif - #ifdef HEATER_6_MAXTEMP - _TEMP_MAX_E(6); - #endif - #if HOTENDS > 7 - #ifdef HEATER_7_MINTEMP - _TEMP_MIN_E(7); - #endif - #ifdef HEATER_7_MAXTEMP - _TEMP_MAX_E(7); - #endif - #endif // HOTENDS > 7 - #endif // HOTENDS > 6 - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 + #if _MINMAX_TEST(1, MIN) + _TEMP_MIN_E(1); + #endif + #if _MINMAX_TEST(1, MAX) + _TEMP_MAX_E(1); + #endif + #if _MINMAX_TEST(2, MIN) + _TEMP_MIN_E(2); + #endif + #if _MINMAX_TEST(2, MAX) + _TEMP_MAX_E(2); + #endif + #if _MINMAX_TEST(3, MIN) + _TEMP_MIN_E(3); + #endif + #if _MINMAX_TEST(3, MAX) + _TEMP_MAX_E(3); + #endif + #if _MINMAX_TEST(4, MIN) + _TEMP_MIN_E(4); + #endif + #if _MINMAX_TEST(4, MAX) + _TEMP_MAX_E(4); + #endif + #if _MINMAX_TEST(5, MIN) + _TEMP_MIN_E(5); + #endif + #if _MINMAX_TEST(5, MAX) + _TEMP_MAX_E(5); + #endif + #if _MINMAX_TEST(6, MIN) + _TEMP_MIN_E(6); + #endif + #if _MINMAX_TEST(6, MAX) + _TEMP_MAX_E(6); + #endif + #if _MINMAX_TEST(7, MIN) + _TEMP_MIN_E(7); + #endif + #if _MINMAX_TEST(7, MAX) + _TEMP_MAX_E(7); + #endif - #endif // HOTENDS + #endif // HAS_HOTEND #if HAS_HEATED_BED #ifdef BED_MINTEMP @@ -1940,9 +1893,7 @@ void Temperature::init() { #endif #endif - #if ENABLED(PROBING_HEATERS_OFF) - paused = false; - #endif + TERN_(PROBING_HEATERS_OFF, paused = false); } #if WATCH_HOTENDS @@ -2013,9 +1964,7 @@ void Temperature::init() { #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 + || TERN0(HAS_HEATED_BED, (heater_id < 0 && bed_idle.timed_out)) ) { sm.state = TRInactive; tr_target_temperature[heater_index] = 0; @@ -2059,13 +2008,14 @@ void Temperature::init() { #endif if (current >= tr_target_temperature[heater_index] - hysteresis_degc) { - sm.timer = millis() + period_seconds * 1000UL; + sm.timer = millis() + SEC_TO_MS(period_seconds); break; } else if (PENDING(millis(), sm.timer)) break; sm.state = TRRunaway; case TRRunaway: + TERN_(DWIN_CREALITY_LCD, Popup_Window_Temperature(0)); _temp_error(heater_id, str_t_thermal_runaway, GET_TEXT(MSG_THERMAL_RUNAWAY)); } } @@ -2074,45 +2024,31 @@ void Temperature::init() { 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 + TERN_(AUTOTEMP, planner.autotemp_enabled = false); // Unpause and reset everything - #if ENABLED(PROBING_HEATERS_OFF) - pause(false); + TERN_(PROBING_HEATERS_OFF, pause(false)); + + #if HAS_HOTEND + HOTEND_LOOP() { + setTargetHotend(0, e); + temp_hotend[e].soft_pwm_amount = 0; + } #endif - #define DISABLE_HEATER(N) { \ - setTargetHotend(0, N); \ - temp_hotend[N].soft_pwm_amount = 0; \ - WRITE_HEATER_##N(LOW); \ - } - #if HAS_TEMP_HOTEND + #define DISABLE_HEATER(N) WRITE_HEATER_##N(LOW); REPEAT(HOTENDS, DISABLE_HEATER); #endif #if HAS_HEATED_BED - temp_bed.target = 0; + setTargetBed(0); temp_bed.soft_pwm_amount = 0; WRITE_HEATER_BED(LOW); #endif #if HAS_HEATED_CHAMBER - temp_chamber.target = 0; + setTargetChamber(0); temp_chamber.soft_pwm_amount = 0; WRITE_HEATER_CHAMBER(LOW); #endif @@ -2121,16 +2057,11 @@ void Temperature::disable_all_heaters() { #if ENABLED(PRINTJOB_TIMER_AUTOSTART) bool Temperature::over_autostart_threshold() { - #if HOTENDS + #if HAS_HOTEND HOTEND_LOOP() if (degTargetHotend(e) > (EXTRUDE_MINTEMP) / 2) return true; #endif - #if HAS_HEATED_BED - if (degTargetBed() > BED_MINTEMP) return true; - #endif - #if HAS_HEATED_CHAMBER - if (degTargetChamber() > CHAMBER_MINTEMP) return true; - #endif - return false; + return TERN0(HAS_HEATED_BED, degTargetBed() > BED_MINTEMP) + || TERN0(HAS_HEATED_CHAMBER, degTargetChamber() > CHAMBER_MINTEMP); } void Temperature::check_timer_autostart(const bool can_start, const bool can_stop) { @@ -2152,16 +2083,12 @@ void Temperature::disable_all_heaters() { 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 + HOTEND_LOOP() hotend_idle[e].expire(); // Timeout immediately + TERN_(HAS_HEATED_BED, bed_idle.expire()); // Timeout immediately } else { HOTEND_LOOP() reset_hotend_idle_timer(e); - #if HAS_HEATED_BED - reset_bed_idle_timer(); - #endif + TERN_(HAS_HEATED_BED, reset_bed_idle_timer()); } } } @@ -2170,6 +2097,10 @@ void Temperature::disable_all_heaters() { #if HAS_MAX6675 + #ifndef THERMOCOUPLE_MAX_ERRORS + #define THERMOCOUPLE_MAX_ERRORS 15 + #endif + int Temperature::read_max6675( #if COUNT_6675 > 1 const uint8_t hindex @@ -2182,6 +2113,8 @@ void Temperature::disable_all_heaters() { static uint16_t max6675_temp_previous[COUNT_6675] = { 0 }; #endif + static uint8_t max6675_errors[COUNT_6675] = { 0 }; + #define MAX6675_HEAT_INTERVAL 250UL #if ENABLED(MAX6675_IS_MAX31855) @@ -2253,34 +2186,39 @@ void Temperature::disable_all_heaters() { 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 + if (DISABLED(IGNORE_THERMOCOUPLE_ERRORS) && (max6675_temp & MAX6675_ERROR_MASK)) { + max6675_errors[hindex] += 1; + if (max6675_errors[hindex] > THERMOCOUPLE_MAX_ERRORS) { + 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 - HEATER_0_MAX6675_TMAX + SERIAL_ECHOLNPGM("MAX6675"); #endif - ); + + // Thermocouple open + max6675_temp = 4 * ( + #if COUNT_6675 > 1 + hindex ? HEATER_1_MAX6675_TMAX : HEATER_0_MAX6675_TMAX + #else + TERN(HEATER_1_USES_MAX6675, HEATER_1_MAX6675_TMAX, HEATER_0_MAX6675_TMAX) + #endif + ); + } + else + max6675_temp >>= MAX6675_DISCARD_BITS; } - else + else { max6675_temp >>= MAX6675_DISCARD_BITS; + max6675_errors[hindex] = 0; + } #if ENABLED(MAX6675_IS_MAX31855) if (max6675_temp & 0x00002000) max6675_temp |= 0xFFFFC000; // Support negative temperature @@ -2312,46 +2250,19 @@ void Temperature::update_raw_temperatures() { #endif #endif - #if HAS_TEMP_ADC_2 - temp_hotend[2].update(); - #endif - #if HAS_TEMP_ADC_3 - temp_hotend[3].update(); - #endif - #if HAS_TEMP_ADC_4 - temp_hotend[4].update(); - #endif - #if HAS_TEMP_ADC_5 - temp_hotend[5].update(); - #endif - #if HAS_TEMP_ADC_6 - temp_hotend[6].update(); - #endif - #if HAS_TEMP_ADC_7 - temp_hotend[7].update(); - #endif + TERN_(HAS_TEMP_ADC_2, temp_hotend[2].update()); + TERN_(HAS_TEMP_ADC_3, temp_hotend[3].update()); + TERN_(HAS_TEMP_ADC_4, temp_hotend[4].update()); + TERN_(HAS_TEMP_ADC_5, temp_hotend[5].update()); + TERN_(HAS_TEMP_ADC_6, temp_hotend[6].update()); + TERN_(HAS_TEMP_ADC_7, temp_hotend[7].update()); + TERN_(HAS_HEATED_BED, temp_bed.update()); + TERN_(HAS_TEMP_CHAMBER, temp_chamber.update()); + TERN_(HAS_TEMP_PROBE, temp_probe.update()); - #if HAS_HEATED_BED - temp_bed.update(); - #endif - - #if HAS_TEMP_CHAMBER - temp_chamber.update(); - #endif - - #if HAS_TEMP_PROBE - temp_probe.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 + TERN_(HAS_JOY_ADC_X, joystick.x.update()); + TERN_(HAS_JOY_ADC_Y, joystick.y.update()); + TERN_(HAS_JOY_ADC_Z, joystick.z.update()); raw_temps_ready = true; } @@ -2362,58 +2273,32 @@ void Temperature::readings_ready() { if (!raw_temps_ready) update_raw_temperatures(); // Filament Sensor - can be read any time since IIR filtering is used - #if ENABLED(FILAMENT_WIDTH_SENSOR) - filwidth.reading_ready(); - #endif + TERN_(FILAMENT_WIDTH_SENSOR, filwidth.reading_ready()); - #if HOTENDS + #if HAS_HOTEND HOTEND_LOOP() temp_hotend[e].reset(); - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - temp_hotend[1].reset(); - #endif + TERN_(TEMP_SENSOR_1_AS_REDUNDANT, temp_hotend[1].reset()); #endif - #if HAS_HEATED_BED - temp_bed.reset(); - #endif + TERN_(HAS_HEATED_BED, temp_bed.reset()); + TERN_(HAS_TEMP_CHAMBER, temp_chamber.reset()); + TERN_(HAS_TEMP_PROBE, temp_probe.reset()); - #if HAS_TEMP_CHAMBER - temp_chamber.reset(); - #endif + TERN_(HAS_JOY_ADC_X, joystick.x.reset()); + TERN_(HAS_JOY_ADC_Y, joystick.y.reset()); + TERN_(HAS_JOY_ADC_Z, joystick.z.reset()); - #if HAS_TEMP_PROBE - temp_probe.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 + #if HAS_HOTEND 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 + TERN(HEATER_0_USES_MAX6675, 0, TEMPDIR(0)) + #if HAS_MULTI_HOTEND + , TERN(HEATER_1_USES_MAX6675, 0, TEMPDIR(1)) #if HOTENDS > 2 + #define _TEMPDIR(N) , TEMPDIR(N) REPEAT_S(2, HOTENDS, _TEMPDIR) - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 + #endif + #endif }; LOOP_L_N(e, COUNT(temp_dir)) { @@ -2421,9 +2306,7 @@ void Temperature::readings_ready() { 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 + || TERN0(PIDTEMP, temp_hotend[e].soft_pwm_amount) > 0 ); 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)) { @@ -2439,18 +2322,16 @@ void Temperature::readings_ready() { } } - #endif // HOTENDS + #endif // HAS_HOTEND #if HAS_HEATED_BED #if TEMPDIR(BED) < 0 - #define BEDCMP(A,B) ((A)<=(B)) + #define BEDCMP(A,B) ((A)<(B)) #else - #define BEDCMP(A,B) ((A)>=(B)) + #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 + const bool bed_on = temp_bed.target > 0 + || TERN0(PIDTEMPBED, temp_bed.soft_pwm_amount) > 0 ; 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); @@ -2458,9 +2339,9 @@ void Temperature::readings_ready() { #if HAS_HEATED_CHAMBER #if TEMPDIR(CHAMBER) < 0 - #define CHAMBERCMP(A,B) ((A)<=(B)) + #define CHAMBERCMP(A,B) ((A)<(B)) #else - #define CHAMBERCMP(A,B) ((A)>=(B)) + #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); @@ -2539,7 +2420,7 @@ void Temperature::tick() { static bool ADCKey_pressed = false; #endif - #if HOTENDS + #if HAS_HOTEND static SoftPWM soft_pwm_hotend[HOTENDS]; #endif @@ -2553,7 +2434,7 @@ void Temperature::tick() { #if DISABLED(SLOW_PWM_HEATERS) - #if HOTENDS || HAS_HEATED_BED || HAS_HEATED_CHAMBER + #if HAS_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER constexpr uint8_t pwm_mask = #if ENABLED(SOFT_PWM_DITHER) _BV(SOFT_PWM_SCALE) - 1 @@ -2573,7 +2454,7 @@ void Temperature::tick() { if (pwm_count_tmp >= 127) { pwm_count_tmp -= 127; - #if HOTENDS + #if HAS_HOTEND #define _PWM_MOD_E(N) _PWM_MOD(N,soft_pwm_hotend[N],temp_hotend[N]); REPEAT(HOTENDS, _PWM_MOD_E); #endif @@ -2620,7 +2501,7 @@ void Temperature::tick() { } else { #define _PWM_LOW(N,S) do{ if (S.count <= pwm_count_tmp) WRITE_HEATER_##N(LOW); }while(0) - #if HOTENDS + #if HAS_HOTEND #define _PWM_LOW_E(N) _PWM_LOW(N, soft_pwm_hotend[N]); REPEAT(HOTENDS, _PWM_LOW_E); #endif @@ -2686,7 +2567,7 @@ void Temperature::tick() { if (slow_pwm_count == 0) { - #if HOTENDS + #if HAS_HOTEND #define _SLOW_PWM_E(N) _SLOW_PWM(N, soft_pwm_hotend[N], temp_hotend[N]); REPEAT(HOTENDS, _SLOW_PWM_E); #endif @@ -2695,9 +2576,13 @@ void Temperature::tick() { _SLOW_PWM(BED, soft_pwm_bed, temp_bed); #endif + #if HAS_HEATED_CHAMBER + _SLOW_PWM(CHAMBER, soft_pwm_chamber, temp_chamber); + #endif + } // slow_pwm_count == 0 - #if HOTENDS + #if HAS_HOTEND #define _PWM_OFF_E(N) _PWM_OFF(N, soft_pwm_hotend[N]); REPEAT(HOTENDS, _PWM_OFF_E); #endif @@ -2706,6 +2591,10 @@ void Temperature::tick() { _PWM_OFF(BED, soft_pwm_bed); #endif + #if HAS_HEATED_CHAMBER + _PWM_OFF(CHAMBER, soft_pwm_chamber); + #endif + #if ENABLED(FAN_SOFT_PWM) if (pwm_count_tmp >= 127) { pwm_count_tmp = 0; @@ -2780,13 +2669,12 @@ void Temperature::tick() { slow_pwm_count++; slow_pwm_count &= 0x7F; - #if HOTENDS + #if HAS_HOTEND HOTEND_LOOP() soft_pwm_hotend[e].dec(); #endif - #if HAS_HEATED_BED - soft_pwm_bed.dec(); - #endif - } // ((pwm_count >> SOFT_PWM_SCALE) & 0x3F) == 0 + TERN_(HAS_HEATED_BED, soft_pwm_bed.dec()); + TERN_(HAS_HEATED_CHAMBER, soft_pwm_chamber.dec()); + } #endif // SLOW_PWM_HEATERS @@ -2896,13 +2784,31 @@ void Temperature::tick() { #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()); + if (!HAL_ADC_READY()) next_sensor_state = adc_sensor_state; // Redo this state + else filwidth.accumulate(HAL_READ_ADC()); break; #endif + #if ENABLED(POWER_MONITOR_CURRENT) + case Prepare_POWER_MONITOR_CURRENT: + HAL_START_ADC(POWER_MONITOR_CURRENT_PIN); + break; + case Measure_POWER_MONITOR_CURRENT: + if (!HAL_ADC_READY()) next_sensor_state = adc_sensor_state; // Redo this state + else power_monitor.add_current_sample(HAL_READ_ADC()); + break; + #endif + + #if ENABLED(POWER_MONITOR_VOLTAGE) + case Prepare_POWER_MONITOR_VOLTAGE: + HAL_START_ADC(POWER_MONITOR_VOLTAGE_PIN); + break; + case Measure_POWER_MONITOR_VOLTAGE: + if (!HAL_ADC_READY()) next_sensor_state = adc_sensor_state; // Redo this state + else power_monitor.add_voltage_sample(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; @@ -2998,7 +2904,7 @@ void Temperature::tick() { } SERIAL_CHAR(' '); SERIAL_CHAR(k); - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND if (e >= 0) SERIAL_CHAR('0' + e); #endif SERIAL_CHAR(':'); @@ -3060,7 +2966,7 @@ void Temperature::tick() { , H_PROBE ); #endif // HAS_TEMP_PROBE - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND HOTEND_LOOP() print_heater_state(degHotend(e), degTargetHotend(e) #if ENABLED(SHOW_TEMP_ADC_VALUES) , rawHotendTemp(e) @@ -3075,7 +2981,7 @@ void Temperature::tick() { #if HAS_HEATED_CHAMBER SERIAL_ECHOPAIR(" C@:", getHeaterPower(H_CHAMBER)); #endif - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND HOTEND_LOOP() { SERIAL_ECHOPAIR(" @", e); SERIAL_CHAR(':'); @@ -3100,11 +3006,11 @@ void Temperature::tick() { #endif // AUTO_REPORT_TEMPERATURES - #if HOTENDS && HAS_DISPLAY + #if HAS_HOTEND && HAS_DISPLAY void Temperature::set_heating_message(const uint8_t e) { const bool heating = isHeatingHotend(e); ui.status_printf_P(0, - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND PSTR("E%c " S_FMT), '1' + e #else PSTR("E " S_FMT) @@ -3128,11 +3034,16 @@ void Temperature::tick() { , const bool click_to_cancel/*=false*/ #endif ) { + + #if ENABLED(AUTOTEMP) + REMEMBER(1, planner.autotemp_enabled, false); + #endif + #if TEMP_RESIDENCY_TIME > 0 millis_t residency_start_ms = 0; bool first_loop = true; // Loop until the temperature has stabilized - #define TEMP_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_RESIDENCY_TIME) * 1000UL)) + #define TEMP_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + SEC_TO_MS(TEMP_RESIDENCY_TIME))) #else // Loop until the temperature is very close target #define TEMP_CONDITIONS (wants_to_cool ? isCoolingHotend(target_extruder) : isHeatingHotend(target_extruder)) @@ -3168,7 +3079,7 @@ void Temperature::tick() { #if TEMP_RESIDENCY_TIME > 0 SERIAL_ECHOPGM(" W:"); if (residency_start_ms) - SERIAL_ECHO(long((((TEMP_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL)); + SERIAL_ECHO(long((SEC_TO_MS(TEMP_RESIDENCY_TIME) - (now - residency_start_ms)) / 1000UL)); else SERIAL_CHAR('?'); #endif @@ -3191,10 +3102,8 @@ void Temperature::tick() { 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; - } + if (temp_diff < TEMP_WINDOW) + residency_start_ms = now + (first_loop ? SEC_TO_MS(TEMP_RESIDENCY_TIME) / 3 : 0); } else if (temp_diff > TEMP_HYSTERESIS) { // Restart the timer whenever the temperature falls outside the hysteresis. @@ -3226,10 +3135,14 @@ void Temperature::tick() { } while (wait_for_heatup && TEMP_CONDITIONS); if (wait_for_heatup) { - ui.reset_status(); - #if ENABLED(PRINTER_EVENT_LEDS) - printerEventLEDs.onHeatingDone(); + #if ENABLED(DWIN_CREALITY_LCD) + HMI_flag.heat_flag = 0; + duration_t elapsed = print_job_timer.duration(); // print timer + dwin_heat_time = elapsed.value; + #else + ui.reset_status(); #endif + TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onHeatingDone()); } return wait_for_heatup; @@ -3240,7 +3153,7 @@ void Temperature::tick() { #if HAS_HEATED_BED #ifndef MIN_COOLING_SLOPE_DEG_BED - #define MIN_COOLING_SLOPE_DEG_BED 1.50 + #define MIN_COOLING_SLOPE_DEG_BED 1.00 #endif #ifndef MIN_COOLING_SLOPE_TIME_BED #define MIN_COOLING_SLOPE_TIME_BED 60 @@ -3255,7 +3168,7 @@ void Temperature::tick() { 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)) + #define TEMP_BED_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + SEC_TO_MS(TEMP_BED_RESIDENCY_TIME))) #else // Loop until the temperature is very close target #define TEMP_BED_CONDITIONS (wants_to_cool ? isCoolingBed() : isHeatingBed()) @@ -3292,7 +3205,7 @@ void Temperature::tick() { #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)); + SERIAL_ECHO(long((SEC_TO_MS(TEMP_BED_RESIDENCY_TIME) - (now - residency_start_ms)) / 1000UL)); else SERIAL_CHAR('?'); #endif @@ -3315,10 +3228,8 @@ void Temperature::tick() { 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; - } + if (temp_diff < TEMP_BED_WINDOW) + residency_start_ms = now + (first_loop ? SEC_TO_MS(TEMP_BED_RESIDENCY_TIME) / 3 : 0); } else if (temp_diff > TEMP_BED_HYSTERESIS) { // Restart the timer whenever the temperature falls outside the hysteresis. @@ -3381,7 +3292,7 @@ void Temperature::tick() { millis_t residency_start_ms = 0; bool first_loop = true; // Loop until the temperature has stabilized - #define TEMP_CHAMBER_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_CHAMBER_RESIDENCY_TIME) * 1000UL)) + #define TEMP_CHAMBER_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + SEC_TO_MS(TEMP_CHAMBER_RESIDENCY_TIME))) #else // Loop until the temperature is very close target #define TEMP_CHAMBER_CONDITIONS (wants_to_cool ? isCoolingChamber() : isHeatingChamber()) @@ -3407,13 +3318,13 @@ void Temperature::tick() { } now = millis(); - if (ELAPSED(now, next_temp_ms)) { //Print Temp Reading every 1 second while heating up. + 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)); + SERIAL_ECHO(long((SEC_TO_MS(TEMP_CHAMBER_RESIDENCY_TIME) - (now - residency_start_ms)) / 1000UL)); else SERIAL_CHAR('?'); #endif @@ -3431,10 +3342,8 @@ void Temperature::tick() { 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; - } + if (temp_diff < TEMP_CHAMBER_WINDOW) + residency_start_ms = now + (first_loop ? SEC_TO_MS(TEMP_CHAMBER_RESIDENCY_TIME) / 3 : 0); } else if (temp_diff > TEMP_CHAMBER_HYSTERESIS) { // Restart the timer whenever the temperature falls outside the hysteresis. diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 24e0054496..94eb42fd0f 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -37,13 +37,8 @@ #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 +#define HOTEND_INDEX TERN(HAS_MULTI_HOTEND, e, 0) +#define E_NAME TERN_(HAS_MULTI_HOTEND, e) // Identifiers for other heaters typedef enum : int8_t { @@ -74,30 +69,18 @@ hotend_pid_t; typedef IF<(LPQ_MAX_LEN > 255), uint16_t, uint8_t>::type lpq_ptr_t; #endif +#define PID_PARAM(F,H) _PID_##F(TERN(PID_PARAMS_PER_HOTEND, H, 0)) +#define _PID_Kp(H) TERN(PIDTEMP, Temperature::temp_hotend[H].pid.Kp, NAN) +#define _PID_Ki(H) TERN(PIDTEMP, Temperature::temp_hotend[H].pid.Ki, NAN) +#define _PID_Kd(H) TERN(PIDTEMP, Temperature::temp_hotend[H].pid.Kd, NAN) #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 + #define _PID_Kc(H) TERN(PID_EXTRUSION_SCALING, Temperature::temp_hotend[H].pid.Kc, 1) + #define _PID_Kf(H) TERN(PID_FAN_SCALING, Temperature::temp_hotend[H].pid.Kf, 0) #else - #define _PID_Kp(H) NAN - #define _PID_Ki(H) NAN - #define _PID_Kd(H) NAN #define _PID_Kc(H) 1 + #define _PID_Kf(H) 0 #endif -#define PID_PARAM(F,H) _PID_##F(H) - /** * States for ADC reading in the ISR */ @@ -148,6 +131,14 @@ enum ADCSensorState : char { #if ENABLED(FILAMENT_WIDTH_SENSOR) Prepare_FILWIDTH, Measure_FILWIDTH, #endif + #if ENABLED(POWER_MONITOR_CURRENT) + Prepare_POWER_MONITOR_CURRENT, + Measure_POWER_MONITOR_CURRENT, + #endif + #if ENABLED(POWER_MONITOR_VOLTAGE) + Prepare_POWER_MONITOR_VOLTAGE, + Measure_POWER_MONITOR_VOLTAGE, + #endif #if HAS_ADC_BUTTONS Prepare_ADC_KEY, Measure_ADC_KEY, #endif @@ -173,7 +164,9 @@ enum ADCSensorState : char { #define unscalePID_d(d) ( float(d) * PID_dT ) #endif -#define G26_CLICK_CAN_CANCEL (HAS_LCD_MENU && ENABLED(G26_MESH_VALIDATION)) +#if BOTH(HAS_LCD_MENU, G26_MESH_VALIDATION) + #define G26_CLICK_CAN_CANCEL 1 +#endif // A temperature sensor typedef struct TempInfo { @@ -241,7 +234,7 @@ struct HeaterWatch { const int16_t newtarget = curr + INCREASE; if (newtarget < tgt - HYSTERESIS - 1) { target = newtarget; - next_ms = millis() + PERIOD * 1000UL; + next_ms = millis() + SEC_TO_MS(PERIOD); return; } } @@ -317,30 +310,17 @@ class Temperature { public: - #if HOTENDS - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - #define HOTEND_TEMPS (HOTENDS + 1) - #else - #define HOTEND_TEMPS HOTENDS - #endif + #if HAS_HOTEND + #define HOTEND_TEMPS (HOTENDS + ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)) static hotend_info_t temp_hotend[HOTEND_TEMPS]; + static const uint16_t heater_maxtemp[HOTENDS]; #endif - #if HAS_HEATED_BED - static bed_info_t temp_bed; - #endif - #if HAS_TEMP_PROBE - static probe_info_t temp_probe; - #endif - #if HAS_TEMP_CHAMBER - static chamber_info_t temp_chamber; - #endif + TERN_(HAS_HEATED_BED, static bed_info_t temp_bed); + TERN_(HAS_TEMP_PROBE, static probe_info_t temp_probe); + TERN_(HAS_TEMP_CHAMBER, static chamber_info_t temp_chamber); - #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 + TERN_(AUTO_POWER_E_FANS, static uint8_t autofan_speed[HOTENDS]); + TERN_(AUTO_POWER_CHAMBER_FAN, static uint8_t chamberfan_speed); #if ENABLED(FAN_SOFT_PWM) static uint8_t soft_pwm_amount_fan[FAN_COUNT], @@ -367,25 +347,17 @@ class Temperature { #if HEATER_IDLE_HANDLER static hotend_idle_t hotend_idle[HOTENDS]; - #if HAS_HEATED_BED - static hotend_idle_t bed_idle; - #endif - #if HAS_HEATED_CHAMBER - static hotend_idle_t chamber_idle; - #endif + TERN_(HAS_HEATED_BED, static hotend_idle_t bed_idle); + TERN_(HAS_HEATED_CHAMBER, static hotend_idle_t chamber_idle); #endif private: - #if EARLY_WATCHDOG - static bool inited; // If temperature controller is running - #endif + TERN_(EARLY_WATCHDOG, static bool inited); // If temperature controller is running static volatile bool raw_temps_ready; - #if WATCH_HOTENDS - static hotend_watch_t watch_hotend[HOTENDS]; - #endif + TERN_(WATCH_HOTENDS, static hotend_watch_t watch_hotend[HOTENDS]); #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) static uint16_t redundant_temperature_raw; @@ -397,17 +369,11 @@ class Temperature { static lpq_ptr_t lpq_ptr; #endif - #if HOTENDS - static temp_range_t temp_range[HOTENDS]; - #endif + TERN_(HAS_HOTEND, static temp_range_t temp_range[HOTENDS]); #if HAS_HEATED_BED - #if WATCH_BED - static bed_watch_t watch_bed; - #endif - #if DISABLED(PIDTEMPBED) - static millis_t next_bed_check_ms; - #endif + TERN_(WATCH_BED, static bed_watch_t watch_bed); + TERN(PIDTEMPBED,,static millis_t next_bed_check_ms); #ifdef BED_MINTEMP static int16_t mintemp_raw_BED; #endif @@ -417,9 +383,7 @@ class Temperature { #endif #if HAS_HEATED_CHAMBER - #if WATCH_CHAMBER - static chamber_watch_t watch_chamber; - #endif + TERN_(WATCH_CHAMBER, static chamber_watch_t watch_chamber); static millis_t next_chamber_check_ms; #ifdef CHAMBER_MINTEMP static int16_t mintemp_raw_CHAMBER; @@ -437,23 +401,17 @@ class Temperature { static millis_t preheat_end_time[HOTENDS]; #endif - #if HAS_AUTO_FAN - static millis_t next_auto_fan_check_ms; - #endif + TERN_(HAS_AUTO_FAN, static millis_t next_auto_fan_check_ms); - #if ENABLED(PROBING_HEATERS_OFF) - static bool paused; - #endif + TERN_(PROBING_HEATERS_OFF, static bool paused); public: #if HAS_ADC_BUTTONS static uint32_t current_ADCKey_raw; - static uint8_t ADCKey_count; + static uint16_t ADCKey_count; #endif - #if ENABLED(PID_EXTRUSION_SCALING) - static int16_t lpq_len; - #endif + TERN_(PID_EXTRUSION_SCALING, static int16_t lpq_len); /** * Instance Methods @@ -496,7 +454,7 @@ class Temperature { } #endif - #if HOTENDS + #if HAS_HOTEND static float analog_to_celsius_hotend(const int raw, const uint8_t e); #endif @@ -510,13 +468,17 @@ class Temperature { static float analog_to_celsius_chamber(const int raw); #endif - #if FAN_COUNT > 0 + #if HAS_FAN 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 ENABLED(REPORT_FAN_CHANGE) + static void report_fan_speed(const uint8_t target); + #endif + #if EITHER(PROBING_FANS_OFF, ADVANCED_PAUSE_FANS_PAUSE) static bool fans_paused; static uint8_t saved_fan_speed[FAN_COUNT]; @@ -524,19 +486,11 @@ class Temperature { 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 + TERN_(ADAPTIVE_FAN_SLOWING, static uint8_t fan_speed_scaler[FAN_COUNT]); 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; + return (fs * uint16_t(TERN(ADAPTIVE_FAN_SLOWING, fan_speed_scaler[target], 128))) >> 7; } static inline uint8_t scaledFanSpeed(const uint8_t target) { @@ -552,10 +506,10 @@ class Temperature { void set_fans_paused(const bool p); #endif - #endif // FAN_COUNT > 0 + #endif // HAS_FAN static inline void zero_fan_speeds() { - #if FAN_COUNT > 0 + #if HAS_FAN FANS_LOOP(i) set_fan_speed(i, 0); #endif } @@ -593,29 +547,17 @@ class Temperature { //deg=degreeCelsius FORCE_INLINE static float degHotend(const uint8_t E_NAME) { - return (0 - #if HOTENDS - + temp_hotend[HOTEND_INDEX].celsius - #endif - ); + return TERN0(HAS_HOTEND, temp_hotend[HOTEND_INDEX].celsius); } #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 - ); + return TERN0(HAS_HOTEND, temp_hotend[HOTEND_INDEX].raw); } #endif FORCE_INLINE static int16_t degTargetHotend(const uint8_t E_NAME) { - return (0 - #if HOTENDS - + temp_hotend[HOTEND_INDEX].target - #endif - ); + return TERN0(HAS_HOTEND, temp_hotend[HOTEND_INDEX].target); } #if WATCH_HOTENDS @@ -624,7 +566,7 @@ class Temperature { static inline void start_watching_hotend(const uint8_t=0) {} #endif - #if HOTENDS + #if HAS_HOTEND static void setTargetHotend(const int16_t celsius, const uint8_t E_NAME) { const uint8_t ee = HOTEND_INDEX; @@ -634,10 +576,8 @@ class Temperature { 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); + TERN_(AUTO_POWER_CONTROL, if (celsius) powerManager.power_on()); + temp_hotend[ee].target = _MIN(celsius, temp_range[ee].maxtemp - HOTEND_OVERSHOOT); start_watching_hotend(ee); } @@ -661,7 +601,11 @@ class Temperature { return degTargetHotend(e) > TEMP_HYSTERESIS && ABS(degHotend(e) - degTargetHotend(e)) > TEMP_HYSTERESIS; } - #endif // HOTENDS + FORCE_INLINE static bool degHotendNear(const uint8_t e, const float &temp) { + return ABS(degHotend(e) - temp) < (TEMP_HYSTERESIS); + } + + #endif // HAS_HOTEND #if HAS_HEATED_BED @@ -680,12 +624,10 @@ class Temperature { #endif static void setTargetBed(const int16_t celsius) { - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif + TERN_(AUTO_POWER_CONTROL, if (celsius) powerManager.power_on()); temp_bed.target = - #ifdef BED_MAXTEMP - _MIN(celsius, BED_MAXTEMP - 10) + #ifdef BED_MAX_TARGET + _MIN(celsius, BED_MAX_TARGET) #else celsius #endif @@ -701,6 +643,10 @@ class Temperature { static void wait_for_bed_heating(); + FORCE_INLINE static bool degBedNear(const float &temp) { + return ABS(degBed() - temp) < (TEMP_BED_HYSTERESIS); + } + #endif // HAS_HEATED_BED #if HAS_TEMP_PROBE @@ -784,9 +730,7 @@ class Temperature { */ #if ENABLED(PIDTEMP) FORCE_INLINE static void updatePID() { - #if ENABLED(PID_EXTRUSION_SCALING) - last_e_position = 0; - #endif + TERN_(PID_EXTRUSION_SCALING, last_e_position = 0); } #endif @@ -831,8 +775,10 @@ class Temperature { #endif #endif - #if HAS_DISPLAY - static void set_heating_message(const uint8_t e); + TERN_(HAS_DISPLAY, static void set_heating_message(const uint8_t e)); + + #if HAS_LCD_MENU && HAS_TEMPERATURE + static void lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb); #endif private: @@ -841,11 +787,7 @@ class Temperature { #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 + #define COUNT_6675 1 + BOTH(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) #if COUNT_6675 > 1 #define READ_MAX6675(N) read_max6675(N) #else @@ -862,13 +804,9 @@ class Temperature { static float get_pid_output_hotend(const uint8_t e); - #if ENABLED(PIDTEMPBED) - static float get_pid_output_bed(); - #endif + TERN_(PIDTEMPBED, static float get_pid_output_bed()); - #if HAS_HEATED_CHAMBER - static float get_pid_output_chamber(); - #endif + TERN_(HAS_HEATED_CHAMBER, static float get_pid_output_chamber()); 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); @@ -885,15 +823,9 @@ class Temperature { 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 + TERN_(THERMAL_PROTECTION_HOTENDS, static tr_state_machine_t tr_state_machine[HOTENDS]); + TERN_(HAS_THERMALLY_PROTECTED_BED, static tr_state_machine_t tr_state_machine_bed); + TERN_(THERMAL_PROTECTION_CHAMBER, static tr_state_machine_t tr_state_machine_chamber); 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); diff --git a/Marlin/src/module/thermistor/thermistor_1.h b/Marlin/src/module/thermistor/thermistor_1.h index f3226da475..fad7908375 100644 --- a/Marlin/src/module/thermistor/thermistor_1.h +++ b/Marlin/src/module/thermistor/thermistor_1.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 = { +const temp_entry_t temptable_1[] PROGMEM = { { OV( 23), 300 }, { OV( 25), 295 }, { OV( 27), 290 }, diff --git a/Marlin/src/module/thermistor/thermistor_10.h b/Marlin/src/module/thermistor/thermistor_10.h index 9e89eab84a..c24ad40bf4 100644 --- a/Marlin/src/module/thermistor/thermistor_10.h +++ b/Marlin/src/module/thermistor/thermistor_10.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 = { +const temp_entry_t temptable_10[] PROGMEM = { { OV( 1), 929 }, { OV( 36), 299 }, { OV( 71), 246 }, diff --git a/Marlin/src/module/thermistor/thermistor_1010.h b/Marlin/src/module/thermistor/thermistor_1010.h index 200d9aed56..8ab5e3b364 100644 --- a/Marlin/src/module/thermistor/thermistor_1010.h +++ b/Marlin/src/module/thermistor/thermistor_1010.h @@ -16,13 +16,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once +#define REVERSE_TEMP_SENSOR_RANGE_1010 1 + // Pt1000 with 1k0 pullup -const short temptable_1010[][2] PROGMEM = { +const temp_entry_t temptable_1010[] PROGMEM = { PtLine( 0, 1000, 1000), PtLine( 25, 1000, 1000), PtLine( 50, 1000, 1000), diff --git a/Marlin/src/module/thermistor/thermistor_1047.h b/Marlin/src/module/thermistor/thermistor_1047.h index af41a20a10..6e1b61f9d0 100644 --- a/Marlin/src/module/thermistor/thermistor_1047.h +++ b/Marlin/src/module/thermistor/thermistor_1047.h @@ -16,13 +16,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once +#define REVERSE_TEMP_SENSOR_RANGE_1047 1 + // Pt1000 with 4k7 pullup -const short temptable_1047[][2] PROGMEM = { +const temp_entry_t temptable_1047[] PROGMEM = { // only a few values are needed as the curve is very flat PtLine( 0, 1000, 4700), PtLine( 50, 1000, 4700), @@ -30,5 +32,9 @@ const short temptable_1047[][2] PROGMEM = { PtLine(150, 1000, 4700), PtLine(200, 1000, 4700), PtLine(250, 1000, 4700), - PtLine(300, 1000, 4700) + PtLine(300, 1000, 4700), + PtLine(350, 1000, 4700), + PtLine(400, 1000, 4700), + PtLine(450, 1000, 4700), + PtLine(500, 1000, 4700) }; diff --git a/Marlin/src/module/thermistor/thermistor_11.h b/Marlin/src/module/thermistor/thermistor_11.h index 1b2da4a71a..345d009a64 100644 --- a/Marlin/src/module/thermistor/thermistor_11.h +++ b/Marlin/src/module/thermistor/thermistor_11.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 = { +const temp_entry_t temptable_11[] PROGMEM = { { OV( 1), 938 }, { OV( 31), 314 }, { OV( 41), 290 }, diff --git a/Marlin/src/module/thermistor/thermistor_110.h b/Marlin/src/module/thermistor/thermistor_110.h index fe8f4fbb80..215495e2c6 100644 --- a/Marlin/src/module/thermistor/thermistor_110.h +++ b/Marlin/src/module/thermistor/thermistor_110.h @@ -16,13 +16,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once +#define REVERSE_TEMP_SENSOR_RANGE_110 1 + // Pt100 with 1k0 pullup -const short temptable_110[][2] PROGMEM = { +const temp_entry_t temptable_110[] PROGMEM = { // only a few values are needed as the curve is very flat PtLine( 0, 100, 1000), PtLine( 50, 100, 1000), diff --git a/Marlin/src/module/thermistor/thermistor_12.h b/Marlin/src/module/thermistor/thermistor_12.h index f9e994a959..d1ee23b2b7 100644 --- a/Marlin/src/module/thermistor/thermistor_12.h +++ b/Marlin/src/module/thermistor/thermistor_12.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 = { +const temp_entry_t temptable_12[] PROGMEM = { { OV( 35), 180 }, // top rating 180C { OV( 211), 140 }, { OV( 233), 135 }, diff --git a/Marlin/src/module/thermistor/thermistor_13.h b/Marlin/src/module/thermistor/thermistor_13.h index 44c5243c1f..bb622240c8 100644 --- a/Marlin/src/module/thermistor/thermistor_13.h +++ b/Marlin/src/module/thermistor/thermistor_13.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 = { +const temp_entry_t temptable_13[] PROGMEM = { { OV( 20.04), 300 }, { OV( 23.19), 290 }, { OV( 26.71), 280 }, diff --git a/Marlin/src/module/thermistor/thermistor_147.h b/Marlin/src/module/thermistor/thermistor_147.h index 8fead6c429..6d846ad5be 100644 --- a/Marlin/src/module/thermistor/thermistor_147.h +++ b/Marlin/src/module/thermistor/thermistor_147.h @@ -16,13 +16,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once +#define REVERSE_TEMP_SENSOR_RANGE_147 1 + // Pt100 with 4k7 pullup -const short temptable_147[][2] PROGMEM = { +const temp_entry_t temptable_147[] PROGMEM = { // only a few values are needed as the curve is very flat PtLine( 0, 100, 4700), PtLine( 50, 100, 4700), diff --git a/Marlin/src/module/thermistor/thermistor_15.h b/Marlin/src/module/thermistor/thermistor_15.h index 85602abb3a..46dcce8c1e 100644 --- a/Marlin/src/module/thermistor/thermistor_15.h +++ b/Marlin/src/module/thermistor/thermistor_15.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 = { +const temp_entry_t temptable_15[] PROGMEM = { { OV( 31), 275 }, { OV( 33), 270 }, { OV( 35), 260 }, diff --git a/Marlin/src/module/thermistor/thermistor_18.h b/Marlin/src/module/thermistor/thermistor_18.h index f6a3edec49..9c2d81b3e6 100644 --- a/Marlin/src/module/thermistor/thermistor_18.h +++ b/Marlin/src/module/thermistor/thermistor_18.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 = { +const temp_entry_t temptable_18[] PROGMEM = { { OV( 1), 713 }, { OV( 17), 284 }, { OV( 20), 275 }, diff --git a/Marlin/src/module/thermistor/thermistor_2.h b/Marlin/src/module/thermistor/thermistor_2.h index efd64194d3..d0e1e4f3df 100644 --- a/Marlin/src/module/thermistor/thermistor_2.h +++ b/Marlin/src/module/thermistor/thermistor_2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -26,7 +26,7 @@ // Verified by linagee. Source: https://www.mouser.com/datasheet/2/362/semitec%20usa%20corporation_gtthermistor-1202937.pdf // Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance // -const short temptable_2[][2] PROGMEM = { +const temp_entry_t temptable_2[] PROGMEM = { { OV( 1), 848 }, { OV( 30), 300 }, // top rating 300C { OV( 34), 290 }, diff --git a/Marlin/src/module/thermistor/thermistor_20.h b/Marlin/src/module/thermistor/thermistor_20.h index 49b212da50..73094f1460 100644 --- a/Marlin/src/module/thermistor/thermistor_20.h +++ b/Marlin/src/module/thermistor/thermistor_20.h @@ -16,15 +16,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once -#define REVERSE_TEMP_SENSOR_RANGE +#define REVERSE_TEMP_SENSOR_RANGE_20 1 // Pt100 with INA826 amp on Ultimaker v2.0 electronics -const short temptable_20[][2] PROGMEM = { +const temp_entry_t temptable_20[] PROGMEM = { { OV( 0), 0 }, { OV(227), 1 }, { OV(236), 10 }, diff --git a/Marlin/src/module/thermistor/thermistor_201.h b/Marlin/src/module/thermistor/thermistor_201.h index d92f957561..44d5280681 100644 --- a/Marlin/src/module/thermistor/thermistor_201.h +++ b/Marlin/src/module/thermistor/thermistor_201.h @@ -16,15 +16,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once -#define REVERSE_TEMP_SENSOR_RANGE +#define REVERSE_TEMP_SENSOR_RANGE_201 1 // Pt100 with LMV324 amp on Overlord v1.1 electronics -const short temptable_201[][2] PROGMEM = { +const temp_entry_t temptable_201[] PROGMEM = { { OV( 0), 0 }, { OV( 8), 1 }, { OV( 23), 6 }, diff --git a/Marlin/src/module/thermistor/thermistor_202.h b/Marlin/src/module/thermistor/thermistor_202.h index 9da3d45f45..c5229607ae 100644 --- a/Marlin/src/module/thermistor/thermistor_202.h +++ b/Marlin/src/module/thermistor/thermistor_202.h @@ -3,7 +3,7 @@ // Temptable sent from dealer technologyoutlet.co.uk // -const short temptable_202[][2] PROGMEM = { +const temp_entry_t temptable_202[] PROGMEM = { { OV( 1), 864 }, { OV( 35), 300 }, { OV( 38), 295 }, diff --git a/Marlin/src/module/thermistor/thermistor_21.h b/Marlin/src/module/thermistor/thermistor_21.h index 655f56685d..cd867df291 100644 --- a/Marlin/src/module/thermistor/thermistor_21.h +++ b/Marlin/src/module/thermistor/thermistor_21.h @@ -16,18 +16,18 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once -#define REVERSE_TEMP_SENSOR_RANGE +#define REVERSE_TEMP_SENSOR_RANGE_21 1 #undef OV_SCALE #define OV_SCALE(N) (float((N) * 5) / 3.3f) // Pt100 with INA826 amp with 3.3v excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics" -const short temptable_21[][2] PROGMEM = { +const temp_entry_t temptable_21[] PROGMEM = { { OV( 0), 0 }, { OV(227), 1 }, { OV(236), 10 }, diff --git a/Marlin/src/module/thermistor/thermistor_22.h b/Marlin/src/module/thermistor/thermistor_22.h new file mode 100644 index 0000000000..6f4a31050a --- /dev/null +++ b/Marlin/src/module/thermistor/thermistor_22.h @@ -0,0 +1,72 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 hotend thermistor with 4.7k pull up to 3.3v and 220R to analog input as in GTM32 Pro vB +const temp_entry_t temptable_22[] PROGMEM = { + { OV( 1), 352 }, + { OV( 6), 341 }, + { OV( 11), 330 }, + { OV( 16), 319 }, + { OV( 20), 307 }, + { OV( 26), 296 }, + { OV( 31), 285 }, + { OV( 40), 274 }, + { OV( 51), 263 }, + { OV( 61), 251 }, + { OV( 72), 245 }, + { OV( 77), 240 }, + { OV( 82), 237 }, + { OV( 87), 232 }, + { OV( 91), 229 }, + { OV( 94), 227 }, + { OV( 97), 225 }, + { OV( 100), 223 }, + { OV( 104), 221 }, + { OV( 108), 219 }, + { OV( 115), 214 }, + { OV( 126), 209 }, + { OV( 137), 204 }, + { OV( 147), 200 }, + { OV( 158), 193 }, + { OV( 167), 192 }, + { OV( 177), 189 }, + { OV( 197), 163 }, + { OV( 230), 174 }, + { OV( 267), 165 }, + { OV( 310), 158 }, + { OV( 336), 151 }, + { OV( 379), 143 }, + { OV( 413), 138 }, + { OV( 480), 127 }, + { OV( 580), 110 }, + { OV( 646), 100 }, + { OV( 731), 88 }, + { OV( 768), 84 }, + { OV( 861), 69 }, + { OV( 935), 50 }, + { OV( 975), 38 }, + { OV(1001), 27 }, + { OV(1011), 22 }, + { OV(1015), 13 }, + { OV(1020), 6 }, + { OV(1023), 0 } +}; diff --git a/Marlin/src/module/thermistor/thermistor_23.h b/Marlin/src/module/thermistor/thermistor_23.h new file mode 100644 index 0000000000..02ff9fb2b6 --- /dev/null +++ b/Marlin/src/module/thermistor/thermistor_23.h @@ -0,0 +1,128 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 hotbed thermistor with 4.7k pull up to 3.3v and 220R to analog input as in GTM32 Pro vB +const temp_entry_t temptable_23[] PROGMEM = { + { OV( 1), 938 }, + { OV( 11), 423 }, + { OV( 21), 351 }, + { 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( 211), 173 }, + { OV( 221), 170 }, + { OV( 231), 167 }, + { OV( 241), 165 }, + { OV( 251), 162 }, + { OV( 261), 160 }, + { OV( 271), 157 }, + { OV( 281), 155 }, + { OV( 291), 153 }, + { OV( 301), 150 }, + { OV( 311), 148 }, + { OV( 321), 146 }, + { OV( 331), 144 }, + { OV( 341), 142 }, + { OV( 351), 140 }, + { OV( 361), 139 }, + { OV( 371), 137 }, + { OV( 381), 135 }, + { OV( 391), 133 }, + { OV( 401), 131 }, + { OV( 411), 130 }, + { OV( 421), 128 }, + { OV( 431), 126 }, + { 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( 971), 28 }, + { OV( 981), 25 }, + { OV( 991), 23 }, + { OV(1001), 21 }, + { OV(1011), 19 }, + { OV(1021), 5 } +}; diff --git a/Marlin/src/module/thermistor/thermistor_3.h b/Marlin/src/module/thermistor/thermistor_3.h index e37c2ace7b..74e00e2ba4 100644 --- a/Marlin/src/module/thermistor/thermistor_3.h +++ b/Marlin/src/module/thermistor/thermistor_3.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 = { +const temp_entry_t temptable_3[] PROGMEM = { { OV( 1), 864 }, { OV( 21), 300 }, { OV( 25), 290 }, diff --git a/Marlin/src/module/thermistor/thermistor_331.h b/Marlin/src/module/thermistor/thermistor_331.h index 434492d7e7..ccb0f6b62d 100644 --- a/Marlin/src/module/thermistor/thermistor_331.h +++ b/Marlin/src/module/thermistor/thermistor_331.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -24,7 +24,7 @@ #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 = { +const temp_entry_t temptable_331[] PROGMEM = { { OVM( 23), 300 }, { OVM( 25), 295 }, { OVM( 27), 290 }, diff --git a/Marlin/src/module/thermistor/thermistor_332.h b/Marlin/src/module/thermistor/thermistor_332.h index 3112751b95..9502f1bdae 100644 --- a/Marlin/src/module/thermistor/thermistor_332.h +++ b/Marlin/src/module/thermistor/thermistor_332.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -24,7 +24,7 @@ #define OVM(V) OV((V)*(0.327/0.327)) // R25 = 100 kOhm, beta25 = 4092 K, 4.7 kOhm pull-up, bed thermistor -const short temptable_332[][2] PROGMEM = { +const temp_entry_t temptable_332[] PROGMEM = { { OVM( 268), 150 }, { OVM( 293), 145 }, { OVM( 320), 141 }, diff --git a/Marlin/src/module/thermistor/thermistor_4.h b/Marlin/src/module/thermistor/thermistor_4.h index 00e0d9ed97..92d907249b 100644 --- a/Marlin/src/module/thermistor/thermistor_4.h +++ b/Marlin/src/module/thermistor/thermistor_4.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 = { +const temp_entry_t temptable_4[] PROGMEM = { { OV( 1), 430 }, { OV( 54), 137 }, { OV( 107), 107 }, diff --git a/Marlin/src/module/thermistor/thermistor_5.h b/Marlin/src/module/thermistor/thermistor_5.h index 2f72082608..1d5fa2fec7 100644 --- a/Marlin/src/module/thermistor/thermistor_5.h +++ b/Marlin/src/module/thermistor/thermistor_5.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -26,7 +26,7 @@ // ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan) // Verified by linagee. Source: https://www.mouser.com/datasheet/2/362/semitec%20usa%20corporation_gtthermistor-1202937.pdf // Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance -const short temptable_5[][2] PROGMEM = { +const temp_entry_t temptable_5[] PROGMEM = { { OV( 1), 713 }, { OV( 17), 300 }, // top rating 300C { OV( 20), 290 }, diff --git a/Marlin/src/module/thermistor/thermistor_501.h b/Marlin/src/module/thermistor/thermistor_501.h index 3db433644e..d40e341f7e 100644 --- a/Marlin/src/module/thermistor/thermistor_501.h +++ b/Marlin/src/module/thermistor/thermistor_501.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once // 100k Zonestar thermistor. Adjusted By Hally -const short temptable_501[][2] PROGMEM = { +const temp_entry_t temptable_501[] PROGMEM = { { OV( 1), 713 }, { OV( 14), 300 }, // Top rating 300C { OV( 16), 290 }, diff --git a/Marlin/src/module/thermistor/thermistor_502.h b/Marlin/src/module/thermistor/thermistor_502.h new file mode 100644 index 0000000000..69cee2431c --- /dev/null +++ b/Marlin/src/module/thermistor/thermistor_502.h @@ -0,0 +1,60 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +// Unknown thermistor for the Zonestar P802M hot bed. Adjusted By Nerseth +// These were the shipped settings from Zonestar in original firmware: P802M_8_Repetier_V1.6_Zonestar.zip +const temp_entry_t temptable_502[] PROGMEM = { + { OV( 56.0 / 4), 300 }, + { OV( 187.0 / 4), 250 }, + { OV( 615.0 / 4), 190 }, + { OV( 690.0 / 4), 185 }, + { OV( 750.0 / 4), 180 }, + { OV( 830.0 / 4), 175 }, + { OV( 920.0 / 4), 170 }, + { OV(1010.0 / 4), 165 }, + { OV(1118.0 / 4), 160 }, + { OV(1215.0 / 4), 155 }, + { OV(1330.0 / 4), 145 }, + { OV(1460.0 / 4), 140 }, + { OV(1594.0 / 4), 135 }, + { OV(1752.0 / 4), 130 }, + { OV(1900.0 / 4), 125 }, + { OV(2040.0 / 4), 120 }, + { OV(2200.0 / 4), 115 }, + { OV(2350.0 / 4), 110 }, + { OV(2516.0 / 4), 105 }, + { OV(2671.0 / 4), 98 }, + { OV(2831.0 / 4), 92 }, + { OV(2975.0 / 4), 85 }, + { OV(3115.0 / 4), 76 }, + { OV(3251.0 / 4), 72 }, + { OV(3480.0 / 4), 62 }, + { OV(3580.0 / 4), 52 }, + { OV(3660.0 / 4), 46 }, + { OV(3740.0 / 4), 40 }, + { OV(3869.0 / 4), 30 }, + { OV(3912.0 / 4), 25 }, + { OV(3948.0 / 4), 20 }, + { OV(4077.0 / 4), -20 }, + { OV(4094.0 / 4), -55 } +}; diff --git a/Marlin/src/module/thermistor/thermistor_51.h b/Marlin/src/module/thermistor/thermistor_51.h index f314777a52..d02dd47ba5 100644 --- a/Marlin/src/module/thermistor/thermistor_51.h +++ b/Marlin/src/module/thermistor/thermistor_51.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -26,7 +26,7 @@ // 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 = { +const temp_entry_t temptable_51[] PROGMEM = { { OV( 1), 350 }, { OV( 190), 250 }, // top rating 250C { OV( 203), 245 }, diff --git a/Marlin/src/module/thermistor/thermistor_512.h b/Marlin/src/module/thermistor/thermistor_512.h index 5528e56b97..e8021e1e48 100644 --- a/Marlin/src/module/thermistor/thermistor_512.h +++ b/Marlin/src/module/thermistor/thermistor_512.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ // 100k thermistor supplied with RPW-Ultra hotend, 4.7k pullup -const short temptable_512[][2] PROGMEM = { +const temp_entry_t temptable_512[] PROGMEM = { { OV(26), 300 }, { OV(28), 295 }, { OV(30), 290 }, diff --git a/Marlin/src/module/thermistor/thermistor_52.h b/Marlin/src/module/thermistor/thermistor_52.h index 29832d7501..5c9cb9dc4d 100644 --- a/Marlin/src/module/thermistor/thermistor_52.h +++ b/Marlin/src/module/thermistor/thermistor_52.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -26,7 +26,7 @@ // Verified by linagee. Source: https://www.mouser.com/datasheet/2/362/semitec%20usa%20corporation_gtthermistor-1202937.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 = { +const temp_entry_t temptable_52[] PROGMEM = { { OV( 1), 500 }, { OV( 125), 300 }, // top rating 300C { OV( 142), 290 }, diff --git a/Marlin/src/module/thermistor/thermistor_55.h b/Marlin/src/module/thermistor/thermistor_55.h index 54fe1be893..707b7d420a 100644 --- a/Marlin/src/module/thermistor/thermistor_55.h +++ b/Marlin/src/module/thermistor/thermistor_55.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -26,7 +26,7 @@ // Verified by linagee. Source: https://www.mouser.com/datasheet/2/362/semitec%20usa%20corporation_gtthermistor-1202937.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 = { +const temp_entry_t temptable_55[] PROGMEM = { { OV( 1), 500 }, { OV( 76), 300 }, { OV( 87), 290 }, diff --git a/Marlin/src/module/thermistor/thermistor_6.h b/Marlin/src/module/thermistor/thermistor_6.h index f84c64413c..68113419e5 100644 --- a/Marlin/src/module/thermistor/thermistor_6.h +++ b/Marlin/src/module/thermistor/thermistor_6.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 = { +const temp_entry_t temptable_6[] PROGMEM = { { OV( 1), 350 }, { OV( 28), 250 }, // top rating 250C { OV( 31), 245 }, diff --git a/Marlin/src/module/thermistor/thermistor_60.h b/Marlin/src/module/thermistor/thermistor_60.h index 167e0edcf8..a3fe50559f 100644 --- a/Marlin/src/module/thermistor/thermistor_60.h +++ b/Marlin/src/module/thermistor/thermistor_60.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -31,7 +31,7 @@ // beta: 3950 // min adc: 1 at 0.0048828125 V // max adc: 1023 at 4.9951171875 V -const short temptable_60[][2] PROGMEM = { +const temp_entry_t temptable_60[] PROGMEM = { { OV( 51), 272 }, { OV( 61), 258 }, { OV( 71), 247 }, diff --git a/Marlin/src/module/thermistor/thermistor_61.h b/Marlin/src/module/thermistor/thermistor_61.h index 5f8171a1d4..ed4c4c8859 100644 --- a/Marlin/src/module/thermistor/thermistor_61.h +++ b/Marlin/src/module/thermistor/thermistor_61.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -30,7 +30,7 @@ // Resistance Tolerance + / -1% // B Value 3950K at 25/50 deg. C // B Value Tolerance + / - 1% -const short temptable_61[][2] PROGMEM = { +const temp_entry_t temptable_61[] 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 }, diff --git a/Marlin/src/module/thermistor/thermistor_66.h b/Marlin/src/module/thermistor/thermistor_66.h index 97f0823486..0ad5994ea8 100644 --- a/Marlin/src/module/thermistor/thermistor_66.h +++ b/Marlin/src/module/thermistor/thermistor_66.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 = { +const temp_entry_t temptable_66[] PROGMEM = { { OV( 17.5), 850 }, { OV( 17.9), 500 }, { OV( 21.7), 480 }, diff --git a/Marlin/src/module/thermistor/thermistor_666.h b/Marlin/src/module/thermistor/thermistor_666.h index ab8b0380f1..86493988e0 100644 --- a/Marlin/src/module/thermistor/thermistor_666.h +++ b/Marlin/src/module/thermistor/thermistor_666.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/module/thermistor/thermistor_67.h b/Marlin/src/module/thermistor/thermistor_67.h index 5af203c8ab..7d6d7f697d 100644 --- a/Marlin/src/module/thermistor/thermistor_67.h +++ b/Marlin/src/module/thermistor/thermistor_67.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 = { +const temp_entry_t temptable_67[] PROGMEM = { { OV( 22 ), 500 }, { OV( 23 ), 490 }, { OV( 25 ), 480 }, diff --git a/Marlin/src/module/thermistor/thermistor_7.h b/Marlin/src/module/thermistor/thermistor_7.h index e791d0c333..7a73755984 100644 --- a/Marlin/src/module/thermistor/thermistor_7.h +++ b/Marlin/src/module/thermistor/thermistor_7.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 = { +const temp_entry_t temptable_7[] PROGMEM = { { OV( 1), 941 }, { OV( 19), 362 }, { OV( 37), 299 }, // top rating 300C diff --git a/Marlin/src/module/thermistor/thermistor_70.h b/Marlin/src/module/thermistor/thermistor_70.h index b498041069..466b925553 100644 --- a/Marlin/src/module/thermistor/thermistor_70.h +++ b/Marlin/src/module/thermistor/thermistor_70.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -26,7 +26,7 @@ // 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 = { +const temp_entry_t temptable_70[] PROGMEM = { { OV( 18), 270 }, { OV( 27), 248 }, { OV( 34), 234 }, diff --git a/Marlin/src/module/thermistor/thermistor_71.h b/Marlin/src/module/thermistor/thermistor_71.h index c3a9193b79..abd7fc5b98 100644 --- a/Marlin/src/module/thermistor/thermistor_71.h +++ b/Marlin/src/module/thermistor/thermistor_71.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -27,7 +27,7 @@ // Beta = 3974 // R1 = 0 Ohm // R2 = 4700 Ohm -const short temptable_71[][2] PROGMEM = { +const temp_entry_t temptable_71[] PROGMEM = { { OV( 35), 300 }, { OV( 51), 269 }, { OV( 59), 258 }, diff --git a/Marlin/src/module/thermistor/thermistor_75.h b/Marlin/src/module/thermistor/thermistor_75.h index 3a3cdc6364..79800d2e40 100644 --- a/Marlin/src/module/thermistor/thermistor_75.h +++ b/Marlin/src/module/thermistor/thermistor_75.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -34,7 +34,7 @@ //#define HIGH_TEMP_RANGE_75 -const short temptable_75[][2] PROGMEM = { // Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor +const temp_entry_t temptable_75[] 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 diff --git a/Marlin/src/module/thermistor/thermistor_8.h b/Marlin/src/module/thermistor/thermistor_8.h index f6e407a730..9e19168fed 100644 --- a/Marlin/src/module/thermistor/thermistor_8.h +++ b/Marlin/src/module/thermistor/thermistor_8.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 = { +const temp_entry_t temptable_8[] PROGMEM = { { OV( 1), 704 }, { OV( 54), 216 }, { OV( 107), 175 }, diff --git a/Marlin/src/module/thermistor/thermistor_9.h b/Marlin/src/module/thermistor/thermistor_9.h index 5023fbe1d0..29097420ec 100644 --- a/Marlin/src/module/thermistor/thermistor_9.h +++ b/Marlin/src/module/thermistor/thermistor_9.h @@ -16,13 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 = { +const temp_entry_t temptable_9[] PROGMEM = { { OV( 1), 936 }, { OV( 36), 300 }, { OV( 71), 246 }, diff --git a/Marlin/src/module/thermistor/thermistor_99.h b/Marlin/src/module/thermistor/thermistor_99.h index 045a42b738..839a511c09 100644 --- a/Marlin/src/module/thermistor/thermistor_99.h +++ b/Marlin/src/module/thermistor/thermistor_99.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -24,7 +24,7 @@ // 100k bed thermistor with a 10K pull-up resistor - made by $ buildroot/share/scripts/createTemperatureLookupMarlin.py --rp=10000 -const short temptable_99[][2] PROGMEM = { +const temp_entry_t temptable_99[] 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 diff --git a/Marlin/src/module/thermistor/thermistor_998.h b/Marlin/src/module/thermistor/thermistor_998.h index 6f631d4b9a..e4cfbbaa0d 100644 --- a/Marlin/src/module/thermistor/thermistor_998.h +++ b/Marlin/src/module/thermistor/thermistor_998.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -27,7 +27,7 @@ #define DUMMY_THERMISTOR_998_VALUE 25 #endif -const short temptable_998[][2] PROGMEM = { +const temp_entry_t temptable_998[] PROGMEM = { { OV( 1), DUMMY_THERMISTOR_998_VALUE }, { OV(1023), DUMMY_THERMISTOR_998_VALUE } }; diff --git a/Marlin/src/module/thermistor/thermistor_999.h b/Marlin/src/module/thermistor/thermistor_999.h index d750d5597c..0271c47f85 100644 --- a/Marlin/src/module/thermistor/thermistor_999.h +++ b/Marlin/src/module/thermistor/thermistor_999.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -27,7 +27,7 @@ #define DUMMY_THERMISTOR_999_VALUE 25 #endif -const short temptable_999[][2] PROGMEM = { +const temp_entry_t temptable_999[] PROGMEM = { { OV( 1), DUMMY_THERMISTOR_999_VALUE }, { OV(1023), DUMMY_THERMISTOR_999_VALUE } }; diff --git a/Marlin/src/module/thermistor/thermistors.h b/Marlin/src/module/thermistor/thermistors.h index 8ac9f11a55..44680a7baa 100644 --- a/Marlin/src/module/thermistor/thermistors.h +++ b/Marlin/src/module/thermistor/thermistors.h @@ -16,15 +16,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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)) +#define THERMISTOR_TABLE_ADC_RESOLUTION 10 +#define THERMISTOR_TABLE_SCALE (HAL_ADC_RANGE / _BV(THERMISTOR_TABLE_ADC_RESOLUTION)) #if ENABLED(HAL_ADC_FILTERED) #define OVERSAMPLENR 1 #else @@ -42,6 +42,8 @@ #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 || THERMISTOR_HEATER_6 == n || THERMISTOR_HEATER_7 == n || THERMISTORBED == n || THERMISTORCHAMBER == n || THERMISTORPROBE == n) +typedef struct { int16_t value, celsius; } temp_entry_t; + // Pt1000 and Pt100 handling // // Rt=R0*(1+a*T+b*T*T) [for T>0] @@ -70,6 +72,9 @@ #if ANY_THERMISTOR_IS(501) // 100K Zonestar thermistor #include "thermistor_501.h" #endif +#if ANY_THERMISTOR_IS(502) // Unknown thermistor used by the Zonestar Prusa P802M hot bed + #include "thermistor_502.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 @@ -109,6 +114,12 @@ #if ANY_THERMISTOR_IS(21) // Pt100 with INA826 amp with 3.3v excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics" #include "thermistor_21.h" #endif +#if ANY_THERMISTOR_IS(22) // Thermistor in a Rostock 301 hot end, calibrated with a multimeter + #include "thermistor_22.h" +#endif +#if ANY_THERMISTOR_IS(23) // By AluOne #12622. Formerly 22 above. May need calibration/checking. + #include "thermistor_23.h" +#endif #if ANY_THERMISTOR_IS(51) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 1 kOhm, "EPCOS" #include "thermistor_51.h" #endif @@ -176,12 +187,13 @@ #include "thermistor_999.h" #endif #if ANY_THERMISTOR_IS(1000) // Custom - const short temptable_1000[][2] PROGMEM = { { 0, 0 } }; + const temp_entry_t temptable_1000[] 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) @@ -279,9 +291,12 @@ #else #define CHAMBER_TEMPTABLE_LEN 0 #endif + #ifdef THERMISTORPROBE #define PROBE_TEMPTABLE TT_NAME(THERMISTORPROBE) #define PROBE_TEMPTABLE_LEN COUNT(PROBE_TEMPTABLE) +#elif defined(HEATER_PROBE_USES_THERMISTOR) + #error "No probe thermistor table specified" #else #define PROBE_TEMPTABLE_LEN 0 #endif @@ -291,7 +306,7 @@ 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 - && HEATER_6_TEMPTABLE_LEN < 258 && HEATER_7_TEMPTABLE_LEN < 258 + && HEATER_6_TEMPTABLE_LEN < 256 && HEATER_7_TEMPTABLE_LEN < 256 && BED_TEMPTABLE_LEN < 256 && CHAMBER_TEMPTABLE_LEN < 256 && PROBE_TEMPTABLE_LEN < 256, "Temperature conversion tables over 255 entries need special consideration." @@ -300,8 +315,85 @@ static_assert( // 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 + +#define _TT_REV(N) REVERSE_TEMP_SENSOR_RANGE_##N +#define TT_REV(N) _TT_REV(N) + +#ifdef HEATER_0_TEMPTABLE + #if TT_REV(THERMISTOR_HEATER_0) + #define HEATER_0_SENSOR_MINTEMP_IND 0 + #define HEATER_0_SENSOR_MAXTEMP_IND HEATER_0_TEMPTABLE_LEN - 1 + #else + #define HEATER_0_SENSOR_MINTEMP_IND HEATER_0_TEMPTABLE_LEN - 1 + #define HEATER_0_SENSOR_MAXTEMP_IND 0 + #endif +#endif +#ifdef HEATER_1_TEMPTABLE + #if TT_REV(THERMISTOR_HEATER_1) + #define HEATER_1_SENSOR_MINTEMP_IND 0 + #define HEATER_1_SENSOR_MAXTEMP_IND HEATER_1_TEMPTABLE_LEN - 1 + #else + #define HEATER_1_SENSOR_MINTEMP_IND HEATER_1_TEMPTABLE_LEN - 1 + #define HEATER_1_SENSOR_MAXTEMP_IND 0 + #endif +#endif +#ifdef HEATER_2_TEMPTABLE + #if TT_REV(THERMISTOR_HEATER_2) + #define HEATER_2_SENSOR_MINTEMP_IND 0 + #define HEATER_2_SENSOR_MAXTEMP_IND HEATER_2_TEMPTABLE_LEN - 1 + #else + #define HEATER_2_SENSOR_MINTEMP_IND HEATER_2_TEMPTABLE_LEN - 1 + #define HEATER_2_SENSOR_MAXTEMP_IND 0 + #endif +#endif +#ifdef HEATER_3_TEMPTABLE + #if TT_REV(THERMISTOR_HEATER_3) + #define HEATER_3_SENSOR_MINTEMP_IND 0 + #define HEATER_3_SENSOR_MAXTEMP_IND HEATER_3_TEMPTABLE_LEN - 1 + #else + #define HEATER_3_SENSOR_MINTEMP_IND HEATER_3_TEMPTABLE_LEN - 1 + #define HEATER_3_SENSOR_MAXTEMP_IND 0 + #endif +#endif +#ifdef HEATER_4_TEMPTABLE + #if TT_REV(THERMISTOR_HEATER_4) + #define HEATER_4_SENSOR_MINTEMP_IND 0 + #define HEATER_4_SENSOR_MAXTEMP_IND HEATER_4_TEMPTABLE_LEN - 1 + #else + #define HEATER_4_SENSOR_MINTEMP_IND HEATER_4_TEMPTABLE_LEN - 1 + #define HEATER_4_SENSOR_MAXTEMP_IND 0 + #endif +#endif +#ifdef HEATER_5_TEMPTABLE + #if TT_REV(THERMISTOR_HEATER_5) + #define HEATER_5_SENSOR_MINTEMP_IND 0 + #define HEATER_5_SENSOR_MAXTEMP_IND HEATER_5_TEMPTABLE_LEN - 1 + #else + #define HEATER_5_SENSOR_MINTEMP_IND HEATER_5_TEMPTABLE_LEN - 1 + #define HEATER_5_SENSOR_MAXTEMP_IND 0 + #endif +#endif +#ifdef HEATER_6_TEMPTABLE + #if TT_REV(THERMISTOR_HEATER_6) + #define HEATER_6_SENSOR_MINTEMP_IND 0 + #define HEATER_6_SENSOR_MAXTEMP_IND HEATER_6_TEMPTABLE_LEN - 1 + #else + #define HEATER_6_SENSOR_MINTEMP_IND HEATER_6_TEMPTABLE_LEN - 1 + #define HEATER_6_SENSOR_MAXTEMP_IND 0 + #endif +#endif +#ifdef HEATER_7_TEMPTABLE + #if TT_REV(THERMISTOR_HEATER_7) + #define HEATER_7_SENSOR_MINTEMP_IND 0 + #define HEATER_7_SENSOR_MAXTEMP_IND HEATER_7_TEMPTABLE_LEN - 1 + #else + #define HEATER_7_SENSOR_MINTEMP_IND HEATER_7_TEMPTABLE_LEN - 1 + #define HEATER_7_SENSOR_MAXTEMP_IND 0 + #endif +#endif + #ifndef HEATER_0_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_0_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_0) || !defined(HEATER_0_USES_THERMISTOR) #define HEATER_0_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_0_RAW_LO_TEMP 0 #else @@ -310,7 +402,7 @@ static_assert( #endif #endif #ifndef HEATER_1_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_1_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_1) || !defined(HEATER_1_USES_THERMISTOR) #define HEATER_1_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_1_RAW_LO_TEMP 0 #else @@ -319,7 +411,7 @@ static_assert( #endif #endif #ifndef HEATER_2_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_2_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_2) || !defined(HEATER_2_USES_THERMISTOR) #define HEATER_2_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_2_RAW_LO_TEMP 0 #else @@ -328,7 +420,7 @@ static_assert( #endif #endif #ifndef HEATER_3_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_3_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_3) || !defined(HEATER_3_USES_THERMISTOR) #define HEATER_3_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_3_RAW_LO_TEMP 0 #else @@ -337,7 +429,7 @@ static_assert( #endif #endif #ifndef HEATER_4_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_4_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_4) || !defined(HEATER_4_USES_THERMISTOR) #define HEATER_4_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_4_RAW_LO_TEMP 0 #else @@ -346,7 +438,7 @@ static_assert( #endif #endif #ifndef HEATER_5_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_5_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_5) || !defined(HEATER_5_USES_THERMISTOR) #define HEATER_5_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_5_RAW_LO_TEMP 0 #else @@ -355,7 +447,7 @@ static_assert( #endif #endif #ifndef HEATER_6_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_6_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_6) || !defined(HEATER_6_USES_THERMISTOR) #define HEATER_6_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_6_RAW_LO_TEMP 0 #else @@ -364,7 +456,7 @@ static_assert( #endif #endif #ifndef HEATER_7_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_7_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_7) || !defined(HEATER_7_USES_THERMISTOR) #define HEATER_7_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_7_RAW_LO_TEMP 0 #else @@ -373,7 +465,7 @@ static_assert( #endif #endif #ifndef HEATER_BED_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_BED_USES_THERMISTOR) + #if TT_REV(THERMISTORBED) || !defined(HEATER_BED_USES_THERMISTOR) #define HEATER_BED_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_BED_RAW_LO_TEMP 0 #else @@ -382,7 +474,7 @@ static_assert( #endif #endif #ifndef HEATER_CHAMBER_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_CHAMBER_USES_THERMISTOR) + #if TT_REV(THERMISTORCHAMBER) || !defined(HEATER_CHAMBER_USES_THERMISTOR) #define HEATER_CHAMBER_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_CHAMBER_RAW_LO_TEMP 0 #else @@ -390,5 +482,15 @@ static_assert( #define HEATER_CHAMBER_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE #endif #endif +#ifndef HEATER_PROBE_RAW_HI_TEMP + #if TT_REV(THERMISTORPROBE) || !defined(HEATER_PROBE_USES_THERMISTOR) + #define HEATER_PROBE_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE + #define HEATER_PROBE_RAW_LO_TEMP 0 + #else + #define HEATER_PROBE_RAW_HI_TEMP 0 + #define HEATER_PROBE_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE + #endif +#endif -#undef REVERSE_TEMP_SENSOR_RANGE +#undef _TT_REV +#undef TT_REV diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 2471581c8c..225f4cbb91 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -31,18 +31,30 @@ #include "../MarlinCore.h" -#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) +//#define DEBUG_TOOL_CHANGE + +#define DEBUG_OUT ENABLED(DEBUG_TOOL_CHANGE) #include "../core/debug_out.h" #if EXTRUDERS > 1 toolchange_settings_t toolchange_settings; // Initialized by settings.load() #endif -#if ENABLED(SINGLENOZZLE) +#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) + migration_settings_t migration = migration_defaults; + bool enable_first_prime; +#endif + +#if ENABLED(TOOLCHANGE_FS_INIT_BEFORE_SWAP) + bool toolchange_extruder_ready[EXTRUDERS]; +#endif + +#if ENABLED(SINGLENOZZLE_STANDBY_TEMP) uint16_t singlenozzle_temp[EXTRUDERS]; - #if FAN_COUNT > 0 - uint8_t singlenozzle_fan_speed[EXTRUDERS]; - #endif +#endif + +#if BOTH(HAS_FAN, SINGLENOZZLE_STANDBY_FAN) + uint8_t singlenozzle_fan_speed[EXTRUDERS]; #endif #if ENABLED(MAGNETIC_PARKING_EXTRUDER) || defined(EVENT_GCODE_AFTER_TOOLCHANGE) || (ENABLED(PARKING_EXTRUDER) && PARKING_EXTRUDER_SOLENOIDS_DELAY > 0) @@ -85,6 +97,14 @@ #include "../feature/pause.h" #endif +#if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #include "../gcode/gcode.h" + #if TOOLCHANGE_FS_WIPE_RETRACT <= 0 + #undef TOOLCHANGE_FS_WIPE_RETRACT + #define TOOLCHANGE_FS_WIPE_RETRACT 0 + #endif +#endif + #if DO_SWITCH_EXTRUDER #if EXTRUDERS > 3 @@ -152,11 +172,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a 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 - ); + offsetcompensation = TERN0(HAS_HOTEND_OFFSET, hotend_offset[active_extruder].x * mpe_settings.compensation_factor); if (axis_unhomed_error(_BV(X_AXIS))) return; @@ -176,10 +192,8 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a 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); - } + 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(); @@ -188,10 +202,8 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a current_position.x = grabpos + offsetcompensation; - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR("(2) Couple extruder ", int(new_tool)); - DEBUG_POS(" to new extruder GrabPos", current_position); - } + 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(); @@ -202,10 +214,9 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a // 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); - } + + 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(); @@ -213,10 +224,9 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a // 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); - } + + 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(); @@ -225,10 +235,8 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a 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); - } + 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(); @@ -237,15 +245,13 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a current_position.x = oldx; - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR("(6) Move extruder ", int(new_tool)); - DEBUG_POS(" to starting position", current_position); - } + 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."); + DEBUG_ECHOLNPGM("Autopark done."); } #elif ENABLED(PARKING_EXTRUDER) @@ -294,37 +300,37 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a // STEP 1 - if (DEBUGGING(LEVELING)) DEBUG_POS("Start PE Tool-Change", current_position); + 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); - } + + 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"); + 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); - } + + 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 + DEBUG_ECHOLNPGM("(4) Engage magnetic field"); + + // Just save power for inverted magnets + TERN_(PARKING_EXTRUDER_SOLENOIDS_INVERT, pe_activate_solenoid(active_extruder)); pe_activate_solenoid(new_tool); // STEP 5 @@ -333,34 +339,29 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a fast_line_to_current(X_AXIS); current_position.x = grabpos; - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - DEBUG_POS("(5) Unpark extruder", current_position); - } + + DEBUG_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); - } + current_position.x = midpos - TERN0(HAS_HOTEND_OFFSET, hotend_offset[new_tool].x); + + DEBUG_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); + 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 + // Just save power for inverted magnets + TERN_(PARKING_EXTRUDER_SOLENOIDS_INVERT, pe_activate_solenoid(active_extruder)); } } @@ -391,31 +392,31 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a // 1. Move to switch position of current toolhead - if (DEBUGGING(LEVELING)) DEBUG_POS("Start ST Tool-Change", current_position); + 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); - } + + 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); - } + + DEBUG_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"); + DEBUG_ECHOLNPGM("(2) Unlock and Place Toolhead"); swt_lock(false); safe_delay(500); current_position.y = SWITCHING_TOOLHEAD_Y_POS; - if (DEBUGGING(LEVELING)) DEBUG_POS("Move Y SwitchPos", current_position); + DEBUG_POS("Move Y SwitchPos", current_position); slow_line_to_current(Y_AXIS); // Wait for move to complete, then another 0.2s @@ -423,34 +424,34 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a safe_delay(200); current_position.y -= SWITCHING_TOOLHEAD_Y_CLEAR; - if (DEBUGGING(LEVELING)) DEBUG_POS("Move back Y clear", current_position); + 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); - } + + DEBUG_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); - } + + DEBUG_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); - } + + DEBUG_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 @@ -460,11 +461,11 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a safe_delay(500); current_position.y -= SWITCHING_TOOLHEAD_Y_CLEAR; - if (DEBUGGING(LEVELING)) DEBUG_POS("Move back Y clear", current_position); + 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); + DEBUG_POS("ST Tool-Change done.", current_position); } #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) @@ -487,83 +488,77 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a * 4. Grab the new toolhead and move to security position */ - if (DEBUGGING(LEVELING)) DEBUG_POS("Start MST Tool-Change", current_position); + 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); - } + + 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); - } + + DEBUG_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); - } + + DEBUG_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); - } + + DEBUG_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"); - } + DEBUG_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); + 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); - } + + DEBUG_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"); - } + DEBUG_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); + 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"); - } + DEBUG_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); + 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); - } + + DEBUG_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) @@ -581,17 +576,17 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a #endif current_position.x = grabxclear; - if (DEBUGGING(LEVELING)) DEBUG_POS("Move to new toolhead X + Security", current_position); + 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); + 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); + DEBUG_POS("MST Tool-Change done.", current_position); } #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) @@ -620,32 +615,29 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a * 9. Apply Z hotend offset to current position */ - if (DEBUGGING(LEVELING)) DEBUG_POS("Start EMST Tool-Change", current_position); + 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); + 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); - } + DEBUG_SYNCHRONIZE(); + DEBUG_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); - } + DEBUG_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); @@ -653,15 +645,13 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a // 4. Disengage magnetic field, wait for delay planner.synchronize(); - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(4) Disengage magnet"); + 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); - } + 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); @@ -680,23 +670,23 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a // 7. Engage magnetic field for new extruder parking - planner.synchronize(); - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(7) Engage magnetic field"); + DEBUG_SYNCHRONIZE(); + 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"); + 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); + 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); + DEBUG_POS("EMST Tool-Change done.", current_position); } #endif // ELECTROMAGNETIC_SWITCHING_TOOLHEAD @@ -712,14 +702,13 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a #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; - } + + 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); @@ -728,7 +717,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a && (delayed_move_time || current_position.x != xhome) ) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("MoveX to ", xhome); + DEBUG_ECHOLNPAIR("MoveX to ", xhome); // Park old head current_position.x = xhome; @@ -742,7 +731,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a // 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); + DEBUG_POS("New Extruder", current_position); switch (dual_x_carriage_mode) { case DXC_FULL_CONTROL_MODE: @@ -761,23 +750,95 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a break; } - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no"); - DEBUG_POS("New extruder (parked)", current_position); - } + DEBUG_ECHOLNPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no"); + DEBUG_POS("New extruder (parked)", current_position); } #endif // DUAL_X_CARRIAGE +/** + * Prime active tool using TOOLCHANGE_FILAMENT_SWAP settings + */ +#if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + +void tool_change_prime() { + if (toolchange_settings.extra_prime > 0 + && TERN(PREVENT_COLD_EXTRUSION, !thermalManager.targetTooColdToExtrude(active_extruder), 1) + ) { + destination = current_position; // Remember the old position + + const bool ok = TERN1(TOOLCHANGE_PARK, all_axes_homed() && toolchange_settings.enable_park); + + #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0 + // Store and stop fan. Restored on any exit. + REMEMBER(fan, thermalManager.fan_speed[TOOLCHANGE_FS_FAN], 0); + #endif + + // Z raise + if (ok) { + // 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); + planner.synchronize(); + } + + // Park + #if ENABLED(TOOLCHANGE_PARK) + if (ok) { + TERN(TOOLCHANGE_PARK_Y_ONLY,,current_position.x = toolchange_settings.change_point.x); + TERN(TOOLCHANGE_PARK_X_ONLY,,current_position.y = toolchange_settings.change_point.y); + planner.buffer_line(current_position, MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE), active_extruder); + planner.synchronize(); + } + #endif + + // Prime (All distances are added and slowed down to ensure secure priming in all circumstances) + unscaled_e_move(toolchange_settings.swap_length + toolchange_settings.extra_prime, MMM_TO_MMS(toolchange_settings.prime_speed)); + + // Cutting retraction + #if TOOLCHANGE_FS_WIPE_RETRACT + unscaled_e_move(-(TOOLCHANGE_FS_WIPE_RETRACT), MMM_TO_MMS(toolchange_settings.retract_speed)); + #endif + + // Cool down with fan + #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0 + thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed; + gcode.dwell(toolchange_settings.fan_time * 1000); + thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = 0; + #endif + + // Move back + #if ENABLED(TOOLCHANGE_PARK) + if (ok) { + #if ENABLED(TOOLCHANGE_NO_RETURN) + do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]); + #else + do_blocking_move_to(destination, MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE)); + #endif + } + #endif + + // Cutting recover + unscaled_e_move(toolchange_settings.extra_resume + TOOLCHANGE_FS_WIPE_RETRACT, MMM_TO_MMS(toolchange_settings.unretract_speed)); + + planner.synchronize(); + current_position.e = destination.e; + sync_plan_position_e(); // Resume at the old E position + } +} +#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 new_tool, bool no_move/*=false*/) { - #if ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) - if (new_tool == active_extruder) return; - #endif + if (TERN0(MAGNETIC_SWITCHING_TOOLHEAD, new_tool == active_extruder)) + return; #if ENABLED(MIXING_EXTRUDER) @@ -821,14 +882,12 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { if (new_tool >= EXTRUDERS) return invalid_extruder_error(new_tool); - if (!no_move && !all_axes_homed()) { + if (!no_move && homing_needed()) { no_move = true; - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("No move (not homed)"); + DEBUG_ECHOLNPGM("No move (not homed)"); } - #if HAS_LCD_MENU - if (!no_move) ui.return_to_status(); - #endif + TERN_(HAS_LCD_MENU, if (!no_move) ui.return_to_status()); #if ENABLED(DUAL_X_CARRIAGE) const bool idex_full_control = dual_x_carriage_mode == DXC_FULL_CONTROL_MODE; @@ -839,44 +898,66 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { 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(STR_ERR_HOTEND_TOO_COLD); - #if ENABLED(SINGLENOZZLE) - active_extruder = new_tool; - return; - #endif - } - else { - #if ENABLED(ADVANCED_PAUSE_FEATURE) - unscaled_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 && DISABLED(SINGLENOZZLE) + #if HAS_LEVELING // Set current position to the physical position TEMPORARY_BED_LEVELING_STATE(false); #endif - if (new_tool != old_tool) { + // First tool priming. To prime again, reboot the machine. + #if BOTH(TOOLCHANGE_FILAMENT_SWAP, TOOLCHANGE_FS_PRIME_FIRST_USED) + static bool first_tool_is_primed = false; + if (new_tool == old_tool && !first_tool_is_primed && enable_first_prime) { + tool_change_prime(); + first_tool_is_primed = true; + toolchange_extruder_ready[old_tool] = true; // Primed and initialized + } + #endif - #if SWITCHING_NOZZLE_TWO_SERVOS - raise_nozzle(old_tool); + if (new_tool != old_tool) { + destination = current_position; + + #if BOTH(TOOLCHANGE_FILAMENT_SWAP, HAS_FAN) && TOOLCHANGE_FS_FAN >= 0 + // Store and stop fan. Restored on any exit. + REMEMBER(fan, thermalManager.fan_speed[TOOLCHANGE_FS_FAN], 0); #endif + // Z raise before retraction + #if ENABLED(TOOLCHANGE_ZRAISE_BEFORE_RETRACT) && DISABLED(SWITCHING_NOZZLE) + if (can_move_away && TERN1(TOOLCHANGE_PARK, toolchange_settings.enable_park)) { + // 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); + planner.synchronize(); + } + #endif + + // Unload / Retract + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + const bool should_swap = can_move_away && toolchange_settings.swap_length, + too_cold = TERN0(PREVENT_COLD_EXTRUSION, + !DEBUGGING(DRYRUN) && (thermalManager.targetTooColdToExtrude(old_tool) || thermalManager.targetTooColdToExtrude(new_tool)) + ); + if (should_swap) { + if (too_cold) { + SERIAL_ECHO_MSG(STR_ERR_HOTEND_TOO_COLD); + if (ENABLED(SINGLENOZZLE)) { active_extruder = new_tool; return; } + } + else { + #if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED) + // For first new tool, change without unloading the old. 'Just prime/init the new' + if (first_tool_is_primed) + unscaled_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed)); + first_tool_is_primed = true; // The first new tool will be primed by toolchanging + #endif + } + } + #endif + + TERN_(SWITCHING_NOZZLE_TWO_SERVOS, raise_nozzle(old_tool)); + REMEMBER(fr, feedrate_mm_s, XY_PROBE_FEEDRATE_MM_S); #if HAS_SOFTWARE_ENDSTOPS @@ -892,29 +973,30 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { #endif #endif - destination = current_position; - - #if DISABLED(SWITCHING_NOZZLE) - if (can_move_away) { + #if DISABLED(TOOLCHANGE_ZRAISE_BEFORE_RETRACT) && DISABLED(SWITCHING_NOZZLE) + if (can_move_away && TERN1(TOOLCHANGE_PARK, toolchange_settings.enable_park)) { // 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); + } + #endif + + // Toolchange park + #if ENABLED(TOOLCHANGE_PARK) && DISABLED(SWITCHING_NOZZLE) + if (can_move_away && toolchange_settings.enable_park) { + TERN(TOOLCHANGE_PARK_Y_ONLY,,current_position.x = toolchange_settings.change_point.x); + TERN(TOOLCHANGE_PARK_X_ONLY,,current_position.y = toolchange_settings.change_point.y); + planner.buffer_line(current_position, MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE), 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 + TERN_(DUAL_X_CARRIAGE, diff.x = 0); #else constexpr xyz_pos_t diff{0}; #endif @@ -951,12 +1033,11 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { move_nozzle_servo(new_tool); #endif - #if DISABLED(DUAL_X_CARRIAGE) - active_extruder = new_tool; // Set the new active extruder - #endif + // Set the new active extruder + if (DISABLED(DUAL_X_CARRIAGE)) active_extruder = new_tool; // The newly-selected extruder XYZ is actually at... - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Offset Tool XYZ by { ", diff.x, ", ", diff.y, ", ", diff.z, " }"); + DEBUG_ECHOLNPAIR("Offset Tool XYZ by { ", diff.x, ", ", diff.y, ", ", diff.z, " }"); current_position += diff; // Tell the planner the new "current position" @@ -970,37 +1051,54 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { #endif // Return to position and lower again - if (safe_to_move && !no_move && IsRunning()) { + const bool should_move = safe_to_move && !no_move && IsRunning(); + if (should_move) { - #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 + #if BOTH(HAS_FAN, SINGLENOZZLE_STANDBY_FAN) + singlenozzle_fan_speed[old_tool] = thermalManager.fan_speed[0]; + thermalManager.fan_speed[0] = singlenozzle_fan_speed[new_tool]; + #endif + #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) 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 + TERN_(AUTOTEMP, planner.autotemp_update()); + TERN_(HAS_DISPLAY, thermalManager.set_heating_message(0)); (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) - unscaled_e_move(toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.prime_speed)); - unscaled_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); + + float fr = toolchange_settings.unretract_speed; + + #if ENABLED(TOOLCHANGE_FS_INIT_BEFORE_SWAP) + if (!toolchange_extruder_ready[new_tool]) { + toolchange_extruder_ready[new_tool] = true; + fr = toolchange_settings.prime_speed; // Next move is a prime + unscaled_e_move(0, MMM_TO_MMS(fr)); // Init planner with 0 length move + } + #endif + + // Unretract (or Prime) + unscaled_e_move(toolchange_settings.swap_length, MMM_TO_MMS(fr)); + + // Extra Prime + unscaled_e_move(toolchange_settings.extra_prime, MMM_TO_MMS(toolchange_settings.prime_speed)); + + // Cutting retraction + #if TOOLCHANGE_FS_WIPE_RETRACT + unscaled_e_move(-(TOOLCHANGE_FS_WIPE_RETRACT), MMM_TO_MMS(toolchange_settings.retract_speed)); + #endif + + // Cool down with fan + #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0 + thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed; + gcode.dwell(toolchange_settings.fan_time * 1000); + thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = 0; #endif - planner.synchronize(); - planner.set_e_position_mm((destination.e = current_position.e = current_position.e - (TOOLCHANGE_FIL_EXTRA_PRIME))); } #endif @@ -1020,34 +1118,54 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { if (can_move_away) { #if ENABLED(TOOLCHANGE_NO_RETURN) // Just move back down - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Move back Z only"); + DEBUG_ECHOLNPGM("Move back Z only"); + + #if ENABLED(TOOLCHANGE_PARK) + if (toolchange_settings.enable_park) + #endif 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); + DEBUG_POS("Move back", destination); + + #if ENABLED(TOOLCHANGE_PARK) + if (toolchange_settings.enable_park) do_blocking_move_to_xy_z(destination, destination.z, MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE)); + #else + do_blocking_move_to_xy(destination); + #endif + #endif } - else if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Move back skipped"); - #if ENABLED(DUAL_X_CARRIAGE) - active_extruder_parked = false; + else DEBUG_ECHOLNPGM("Move back skipped"); + + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + if (should_swap && !too_cold) { + // Cutting recover + unscaled_e_move(toolchange_settings.extra_resume + TOOLCHANGE_FS_WIPE_RETRACT, MMM_TO_MMS(toolchange_settings.unretract_speed)); + current_position.e = 0; + sync_plan_position_e(); // New extruder primed and set to 0 + + // Restart Fan + #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0 + RESTORE(fan); + #endif + } #endif + + TERN_(DUAL_X_CARRIAGE, active_extruder_parked = false); } + #if ENABLED(SWITCHING_NOZZLE) - else { - // Move back down. (Including when the new tool is higher.) + // Move back down. (Including when the new tool is higher.) + if (!should_move) 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 + TERN_(PRUSA_MMU2, mmu2.tool_change(new_tool)); - #if SWITCHING_NOZZLE_TWO_SERVOS - lower_nozzle(new_tool); - #endif + TERN_(SWITCHING_NOZZLE_TWO_SERVOS, lower_nozzle(new_tool)); } // (new_tool != old_tool) @@ -1068,12 +1186,10 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { move_extruder_servo(active_extruder); #endif - #if HAS_FANMUX - fanmux_switch(active_extruder); - #endif + TERN_(HAS_FANMUX, fanmux_switch(active_extruder)); #ifdef EVENT_GCODE_AFTER_TOOLCHANGE - if (!no_move) + if (!no_move && TERN1(DUAL_X_CARRIAGE, dual_x_carriage_mode == DXC_AUTO_PARK_MODE)) gcode.process_subcommands_now_P(PSTR(EVENT_GCODE_AFTER_TOOLCHANGE)); #endif @@ -1082,3 +1198,107 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { #endif // EXTRUDERS > 1 } + +#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) + + bool extruder_migration() { + + #if ENABLED(PREVENT_COLD_EXTRUSION) + if (thermalManager.targetTooColdToExtrude(active_extruder)) { + #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) + SERIAL_ECHOLN("Migration Source Too Cold"); + #endif + return false; + } + #endif + + // No auto-migration or specified target? + if (!migration.target && active_extruder >= migration.last) { + #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) + SERIAL_ECHO_MSG("No Migration Target"); + SERIAL_ECHO_MSG("Target: ", migration.target, + " Last: ", migration.last, + " Active: ", active_extruder); + #endif + migration.automode = false; + return false; + } + + // Migrate to a target or the next extruder + + uint8_t migration_extruder = active_extruder; + + if (migration.target) { + #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) + SERIAL_ECHOLN("Migration using fixed target"); + #endif + // Specified target ok? + const int16_t t = migration.target - 1; + if (t != active_extruder) migration_extruder = t; + } + else if (migration.automode && migration_extruder < migration.last && migration_extruder < EXTRUDERS - 1) + migration_extruder++; + + if (migration_extruder == active_extruder) { + #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) + SERIAL_ECHOLN("Migration source matches active"); + #endif + return false; + } + + // Migration begins + #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) + SERIAL_ECHOLN("Beginning migration"); + #endif + + migration.in_progress = true; // Prevent runout script + planner.synchronize(); + + // Remember position before migration + const float resume_current_e = current_position.e; + + // Migrate the flow + planner.set_flow(migration_extruder, planner.flow_percentage[active_extruder]); + + // Migrate the retracted state + #if ENABLED(FWRETRACT) + fwretract.retracted[migration_extruder] = fwretract.retracted[active_extruder]; + #endif + + // Migrate the temperature to the new hotend + #if HAS_MULTI_HOTEND + thermalManager.setTargetHotend(thermalManager.temp_hotend[active_extruder].target, migration_extruder); + TERN_(AUTOTEMP, planner.autotemp_update()); + TERN_(HAS_DISPLAY, thermalManager.set_heating_message(0)); + thermalManager.wait_for_hotend(active_extruder); + #endif + + // Migrate Linear Advance K factor to the new extruder + TERN_(LIN_ADVANCE, planner.extruder_advance_K[active_extruder] = planner.extruder_advance_K[migration_extruder]); + + // Perform the tool change + tool_change(migration_extruder); + + // Retract if previously retracted + #if ENABLED(FWRETRACT) + if (fwretract.retracted[active_extruder]) + unscaled_e_move(-fwretract.settings.retract_length, fwretract.settings.retract_feedrate_mm_s); + #endif + + // If no available extruder + if (EXTRUDERS < 2 || active_extruder >= EXTRUDERS - 2 || active_extruder == migration.last) + migration.automode = false; + + migration.in_progress = false; + + current_position.e = resume_current_e; + + planner.synchronize(); + planner.set_e_position_mm(current_position.e); // New extruder primed and ready + #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) + SERIAL_ECHOLN("Migration Complete"); + #endif + return true; + } + +#endif // TOOLCHANGE_MIGRATION_FEATURE diff --git a/Marlin/src/module/tool_change.h b/Marlin/src/module/tool_change.h index 17c173d052..d0cb57841b 100644 --- a/Marlin/src/module/tool_change.h +++ b/Marlin/src/module/tool_change.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -28,10 +28,11 @@ typedef struct { #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - float swap_length, extra_prime; - int16_t prime_speed, retract_speed; + float swap_length, extra_prime, extra_resume; + int16_t prime_speed, retract_speed, unretract_speed, fan, fan_speed, fan_time; #endif #if ENABLED(TOOLCHANGE_PARK) + bool enable_park; xy_pos_t change_point; #endif float z_raise; @@ -39,6 +40,27 @@ extern toolchange_settings_t toolchange_settings; + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + extern void tool_change_prime(); + #endif + + #if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED) + extern bool enable_first_prime; + #endif + + #if ENABLED(TOOLCHANGE_FS_INIT_BEFORE_SWAP) + extern bool toolchange_extruder_ready[EXTRUDERS]; + #endif + + #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) + typedef struct { + uint8_t target, last; + bool automode, in_progress; + } migration_settings_t; + constexpr migration_settings_t migration_defaults = { 0, 0, false, false }; + extern migration_settings_t migration; + bool extruder_migration(); + #endif #endif #if DO_SWITCH_EXTRUDER @@ -86,20 +108,17 @@ #endif -#if ENABLED(SINGLENOZZLE) +#if ENABLED(SINGLENOZZLE_STANDBY_TEMP) 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(); +#if BOTH(HAS_FAN, SINGLENOZZLE_STANDBY_FAN) + extern uint8_t singlenozzle_fan_speed[EXTRUDERS]; #endif -#if ENABLED(SWITCHING_TOOLHEAD) - void swt_init(); -#endif +TERN_(ELECTROMAGNETIC_SWITCHING_TOOLHEAD, void est_init()); + +TERN_(SWITCHING_TOOLHEAD, void swt_init()); /** * Perform a tool-change, which may result in moving the diff --git a/Marlin/src/pins/esp32/pins_E4D.h b/Marlin/src/pins/esp32/pins_E4D.h index 829c391c4d..e66bb669f7 100644 --- a/Marlin/src/pins/esp32/pins_E4D.h +++ b/Marlin/src/pins/esp32/pins_E4D.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -24,7 +24,7 @@ /** * E4d@Box pin assignments * E4d@Box is a small factor 3D printer control board based on the ESP32 microcontroller for Laser, CNC and 3d printers - * for more info check http://atbox.tech/ and join to Facebook page E4d@box. + * for more info check https://atbox.tech/ and join to Facebook page E4d@box. */ #ifndef ARDUINO_ARCH_ESP32 diff --git a/Marlin/src/pins/esp32/pins_ESP32.h b/Marlin/src/pins/esp32/pins_ESP32.h index e4da400528..5f793f1cf2 100644 --- a/Marlin/src/pins/esp32/pins_ESP32.h +++ b/Marlin/src/pins/esp32/pins_ESP32.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPA.h b/Marlin/src/pins/esp32/pins_MRR_ESPA.h index 8a06f9a169..8a5b11ed71 100644 --- a/Marlin/src/pins/esp32/pins_MRR_ESPA.h +++ b/Marlin/src/pins/esp32/pins_MRR_ESPA.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPE.h b/Marlin/src/pins/esp32/pins_MRR_ESPE.h index 3dd50489df..b38a88351d 100644 --- a/Marlin/src/pins/esp32/pins_MRR_ESPE.h +++ b/Marlin/src/pins/esp32/pins_MRR_ESPE.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h index 0bfbaabdcd..9361680c23 100644 --- a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h +++ b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -49,7 +49,9 @@ #define BOARD_INFO_NAME "RAMPS 1.4" #endif -#define E2END 0xFFF // 4KB +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif #define IS_RAMPS_EFB @@ -142,7 +144,7 @@ // 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 HAS_MULTI_HOTEND #if TEMP_SENSOR_BED #define IS_RAMPS_EEB #else @@ -507,7 +509,7 @@ #elif ENABLED(LCD_I2C_VIKI) - #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. + #define BTN_EN1 22 // https://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 diff --git a/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h b/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h index 1417fb7d99..ffc149279c 100644 --- a/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h +++ b/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -31,12 +31,6 @@ #define BOARD_INFO_NAME "AZSMZ MINI" -// -// EEPROM -// -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION - // // Servos // diff --git a/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h b/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h index d710138b95..6ccfca1cac 100644 --- a/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h +++ b/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -38,12 +38,6 @@ #define BOARD_INFO_NAME "BIQU Thunder B300 V1.0" #endif -// -// EEPROM -// -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION - // // Limit Switches // diff --git a/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h b/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h index 041235d493..20edcb07a7 100644 --- a/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h +++ b/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -36,12 +36,6 @@ #define BOARD_INFO_NAME "BIQU BQ111-A4" -// -// EEPROM -// -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION - // // Limit Switches // @@ -55,19 +49,19 @@ // // Steppers // -#define X_STEP_PIN P2_0 -#define X_DIR_PIN P0_5 -#define X_ENABLE_PIN P0_4 +#define X_STEP_PIN P2_00 +#define X_DIR_PIN P0_05 +#define X_ENABLE_PIN P0_04 -#define Y_STEP_PIN P2_1 +#define Y_STEP_PIN P2_01 #define Y_DIR_PIN P0_11 #define Y_ENABLE_PIN P0_10 -#define Z_STEP_PIN P2_2 +#define Z_STEP_PIN P2_02 #define Z_DIR_PIN P0_20 #define Z_ENABLE_PIN P0_19 -#define E0_STEP_PIN P2_3 +#define E0_STEP_PIN P2_03 #define E0_DIR_PIN P0_22 #define E0_ENABLE_PIN P0_21 @@ -81,10 +75,10 @@ // // Heaters / Fans // -#define HEATER_0_PIN P2_7 -#define HEATER_BED_PIN P2_5 +#define HEATER_0_PIN P2_07 +#define HEATER_BED_PIN P2_05 #ifndef FAN_PIN - #define FAN_PIN P2_4 + #define FAN_PIN P2_04 #endif // diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h index 4dae2dc5d6..d5e2560662 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h @@ -16,23 +16,16 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once -#define BOARD_INFO_NAME "BIGTREE SKR 1.1" - -// -// EEPROM -// -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION +#define BOARD_INFO_NAME "BTT SKR V1.1" // // Limit Switches // - #define X_MIN_PIN P1_29 #define X_MAX_PIN P1_28 #define Y_MIN_PIN P1_27 @@ -151,31 +144,26 @@ #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 diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h index 1d1ad60f24..9e26a33597 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -16,32 +16,26 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once -#define BOARD_INFO_NAME "BIGTREE SKR 1.3" +#define BOARD_INFO_NAME "BTT SKR V1.3" // -// EEPROM +// Trinamic Stallguard pins // -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION - -/** - * Trinamic Stallguard pins - */ #define X_DIAG_PIN P1_29 // X- #define Y_DIAG_PIN P1_27 // Y- #define Z_DIAG_PIN P1_25 // Z- #define E0_DIAG_PIN P1_28 // X+ #define E1_DIAG_PIN P1_26 // Y+ -/** - * Limit Switches - */ -#if X_STALL_SENSITIVITY +// +// Limit Switches +// +#ifdef X_STALL_SENSITIVITY #define X_STOP_PIN X_DIAG_PIN #if X_HOME_DIR < 0 #define X_MAX_PIN P1_28 // X+ @@ -53,7 +47,7 @@ #define X_MAX_PIN P1_28 // X+ #endif -#if Y_STALL_SENSITIVITY +#ifdef Y_STALL_SENSITIVITY #define Y_STOP_PIN Y_DIAG_PIN #if Y_HOME_DIR < 0 #define Y_MAX_PIN P1_26 // Y+ @@ -65,7 +59,7 @@ #define Y_MAX_PIN P1_26 // Y+ #endif -#if Z_STALL_SENSITIVITY +#ifdef Z_STALL_SENSITIVITY #define Z_STOP_PIN Z_DIAG_PIN #if Z_HOME_DIR < 0 #define Z_MAX_PIN P1_24 // Z+ @@ -267,6 +261,10 @@ #define LCD_PINS_ENABLE EXPA1_03_PIN #define LCD_PINS_D4 EXPA1_05_PIN + #elif HAS_ADC_BUTTONS + + #error "ADC BUTTONS do not work unmodifed on SKR 1.3, The ADC ports cannot take more than 3.3v." + #else // !CR10_STOCKDISPLAY #define LCD_PINS_RS EXPA1_07_PIN diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h index 7e722ea45f..f467ba58cb 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -16,21 +16,13 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once #ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "BIGTREE SKR 1.4" -#endif - -// -// EEPROM -// -#if NONE(FLASH_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION) - #define FLASH_EEPROM_EMULATION - //#define SDCARD_EEPROM_EMULATION + #define BOARD_INFO_NAME "BTT SKR V1.4" #endif // @@ -57,7 +49,7 @@ // // Limit Switches // -#if X_STALL_SENSITIVITY +#ifdef X_STALL_SENSITIVITY #define X_STOP_PIN X_DIAG_PIN #if X_HOME_DIR < 0 #define X_MAX_PIN P1_26 // E0DET @@ -68,7 +60,7 @@ #define X_STOP_PIN P1_29 // X-STOP #endif -#if Y_STALL_SENSITIVITY +#ifdef Y_STALL_SENSITIVITY #define Y_STOP_PIN Y_DIAG_PIN #if Y_HOME_DIR < 0 #define Y_MAX_PIN P1_25 // E1DET @@ -79,7 +71,7 @@ #define Y_STOP_PIN P1_28 // Y-STOP #endif -#if Z_STALL_SENSITIVITY +#ifdef Z_STALL_SENSITIVITY #define Z_STOP_PIN Z_DIAG_PIN #if Z_HOME_DIR < 0 #define Z_MAX_PIN P1_00 // PWRDET @@ -259,6 +251,7 @@ #define LCD_PINS_D4 P1_21 #else + #define BTN_ENC P0_28 // (58) open-drain #define LCD_PINS_RS P1_19 @@ -319,10 +312,14 @@ #endif // !FYSETC_MINI_12864 - #endif + #endif // HAS_GRAPHICAL_LCD #endif // HAS_SPI_LCD +#if HAS_ADC_BUTTONS + #error "ADC BUTTONS do not work unmodifed on SKR 1.4, The ADC ports cannot take more than 3.3v." +#endif + // // Neopixel LED // diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h index 63e160d8a0..cc35dfb0d4 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -32,10 +32,6 @@ // Ignore temp readings during development. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 -#if DISABLED(SDCARD_EEPROM_EMULATION) - #define FLASH_EEPROM_EMULATION -#endif - // // Steppers // @@ -63,8 +59,12 @@ #define TEMP_BED_PIN P0_23_A0 // A0 (T0) - (67) - TEMP_BED_PIN #endif -#if HOTENDS == 1 && TEMP_SENSOR_PROBE - #define TEMP_PROBE_PIN TEMP_1_PIN +#if HOTENDS == 1 + #if TEMP_SENSOR_PROBE + #define TEMP_PROBE_PIN TEMP_1_PIN + #elif TEMP_SENSOR_CHAMBER + #define TEMP_CHAMBER_PIN TEMP_1_PIN + #endif #endif // diff --git a/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h index 32de7bb740..7012068d61 100644 --- a/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h +++ b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -30,12 +30,6 @@ // Ignore temp readings during develpment. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 -// -// EEPROM -// -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION - // // Enable 12MHz clock output on P1.27 pin to sync TMC2208 chip clocks // diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h index 0cd10ebc05..db8551c114 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -38,14 +38,6 @@ #define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SBASE" #endif -// -// EEPROM -// -#if NONE(FLASH_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION) - #define FLASH_EEPROM_EMULATION - //#define SDCARD_EEPROM_EMULATION -#endif - #define LED_PIN P1_18 // Used as a status indicator #define LED2_PIN P1_19 #define LED3_PIN P1_20 diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index afbe6d5564..c4bc90c17f 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -32,12 +32,6 @@ #define BOARD_INFO_NAME "MKS SGen-L" #define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SGEN_L" -// -// EEPROM -// -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION - // // Servos // @@ -56,7 +50,7 @@ // // Limit Switches // -#if X_STALL_SENSITIVITY +#ifdef X_STALL_SENSITIVITY #define X_STOP_PIN X_DIAG_PIN #if X_HOME_DIR < 0 #define X_MAX_PIN P1_28 // X+ @@ -68,7 +62,7 @@ #define X_MAX_PIN P1_28 // X+ #endif -#if Y_STALL_SENSITIVITY +#ifdef Y_STALL_SENSITIVITY #define Y_STOP_PIN Y_DIAG_PIN #if Y_HOME_DIR < 0 #define Y_MAX_PIN P1_26 // Y+ @@ -80,7 +74,7 @@ #define Y_MAX_PIN P1_26 // Y+ #endif -#if Z_STALL_SENSITIVITY +#ifdef Z_STALL_SENSITIVITY #define Z_STOP_PIN Z_DIAG_PIN #if Z_HOME_DIR < 0 #define Z_MAX_PIN P1_24 // Z+ diff --git a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h index b8b04a348c..554c060cb4 100644 --- a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -42,12 +42,6 @@ #define BOARD_INFO_NAME "Re-ARM RAMPS 1.4" -// -// EEPROM -// -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION - // // Servos // @@ -177,14 +171,14 @@ #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 ?? 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 HAS_MULTI_HOTEND #if TEMP_SENSOR_BED #define IS_RAMPS_EEB #else @@ -299,7 +293,7 @@ * 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 + * - https://panucattdevices.freshdesk.com/support/solutions/articles/1000243195-lcd-display-installation */ /** @@ -353,7 +347,7 @@ #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 + #define LCD_SDSS P1_23 // (53) J3-5 & AUX-3 #if ENABLED(NEWPANEL) #if ENABLED(REPRAPWORLD_KEYPAD) diff --git a/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h b/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h index 6f84f87bba..e717511c12 100644 --- a/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h +++ b/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -32,12 +32,6 @@ #define BOARD_INFO_NAME "Selena Compact" #define BOARD_WEBSITE_URL "github.com/Ales2-k/Selena" -// -// EEPROM -// -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION - // // Servos // diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h index 95cbd2163e..83cf17eee9 100644 --- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -32,12 +32,6 @@ #define BOARD_INFO_NAME "Azteeg X5 GT" #define BOARD_WEBSITE_URL "tinyurl.com/yx8tdqa3" -// -// EEPROM -// -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION - // // Servos // diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h index ba1351e6f4..042b724e8c 100644 --- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -187,14 +187,6 @@ #endif // HAS_SPI_LCD -// -// EEPROM -// -#if NONE(FLASH_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION) - #define FLASH_EEPROM_EMULATION - //#define SDCARD_EEPROM_EMULATION -#endif - // // SD Support // diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h index 1e5d2f3a2c..592f666e39 100644 --- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -31,12 +31,6 @@ #define BOARD_INFO_NAME "Azteeg X5 MINI WIFI" -// -// EEPROM -// -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION - // // DIGIPOT slave addresses // diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h index a8649b6f8d..a751286e3a 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h @@ -16,20 +16,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once -#define BOARD_INFO_NAME "BIGTREE SKR 1.4 TURBO" +#define BOARD_INFO_NAME "BTT SKR V1.4 TURBO" #define SKR_HAS_LPC1769 -// -// EEPROM -// -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION - // // Include SKR 1.4 pins // diff --git a/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h b/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h index 87d3cb459c..d5c7d9868f 100644 --- a/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h +++ b/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -31,12 +31,6 @@ #define BOARD_INFO_NAME "Cohesion3D Mini" -// -// EEPROM -// -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION - // // Servos // @@ -110,10 +104,15 @@ // 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 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E1_AUTO_FAN_PIN + #define E1_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E2_AUTO_FAN_PIN + #define E2_AUTO_FAN_PIN AUTO_FAN_PIN +#endif // // Misc. Functions diff --git a/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h b/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h index fa55a8adae..3870902881 100644 --- a/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h +++ b/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -31,12 +31,6 @@ #define BOARD_INFO_NAME "Cohesion3D ReMix" -// -// EEPROM -// -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION - // // Servos // @@ -139,9 +133,15 @@ #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 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E1_AUTO_FAN_PIN + #define E1_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E2_AUTO_FAN_PIN + #define E2_AUTO_FAN_PIN AUTO_FAN_PIN +#endif // // Misc. Functions diff --git a/Marlin/src/pins/lpc1769/pins_MKS_SGEN.h b/Marlin/src/pins/lpc1769/pins_MKS_SGEN.h index fd98b5ef13..23275e86b6 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN.h @@ -16,13 +16,17 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once /** * MKS SGen pin assignments + * + * The pins diagram can be found and the following URL: + * https://github.com/makerbase-mks/MKS-SGen/blob/master/Hardware/MKS%20SGEN%20V1.0_001/MKS%20SGEN%20V1.0_001%20PIN.pdf + * */ #ifndef MCU_LPC1769 @@ -32,42 +36,24 @@ #define BOARD_INFO_NAME "MKS SGen" #define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SGEN" -// -// EEPROM -// -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION - #define MKS_HAS_LPC1769 #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_TMC_UART /** * 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 + #define X_SERIAL_TX_PIN P1_22 // J8-2 + #define X_SERIAL_RX_PIN P1_22 // J8-2 + #define Y_SERIAL_TX_PIN P1_23 // J8-3 + #define Y_SERIAL_RX_PIN P1_23 // J8-3 + #define Z_SERIAL_TX_PIN P2_12 // J8-4 + #define Z_SERIAL_RX_PIN P2_12 // J8-4 + #define E0_SERIAL_TX_PIN P2_11 // J8-5 + #define E0_SERIAL_RX_PIN P2_11 // J8-5 + #define E1_SERIAL_TX_PIN P4_28 // J8-6 + #define E1_SERIAL_RX_PIN P4_28 // J8-6 // Reduce baud rate to improve software serial reliability #define TMC_BAUD_RATE 19200 diff --git a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h index 43db07ea5e..0712a274bb 100644 --- a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -32,12 +32,6 @@ #define BOARD_INFO_NAME "Smoothieboard" #define BOARD_WEBSITE_URL "smoothieware.org/smoothieboard" -// -// EEPROM -// -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION - // // Servos // diff --git a/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h index d4030ed790..a1d3b08caa 100644 --- a/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -32,12 +32,6 @@ #define BOARD_INFO_NAME "TH3D EZBoard" #define BOARD_WEBSITE_URL "th3dstudio.com" -// -// EEPROM -// -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION - // // Servos // @@ -131,9 +125,15 @@ // 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 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E1_AUTO_FAN_PIN + #define E1_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E2_AUTO_FAN_PIN + #define E2_AUTO_FAN_PIN AUTO_FAN_PIN +#endif // // SD Card diff --git a/Marlin/src/pins/mega/pins_CHEAPTRONIC.h b/Marlin/src/pins/mega/pins_CHEAPTRONIC.h index 7b0c0010a3..90d4340ba8 100644 --- a/Marlin/src/pins/mega/pins_CHEAPTRONIC.h +++ b/Marlin/src/pins/mega/pins_CHEAPTRONIC.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h b/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h index d56d08c9e0..18bcc9e407 100644 --- a/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h +++ b/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h index 833499fe0f..6f792ad5fa 100644 --- a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -95,10 +95,22 @@ //#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 +// +// Auto fans +// +#define AUTO_FAN_PIN 7 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E1_AUTO_FAN_PIN + #define E1_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E2_AUTO_FAN_PIN + #define E2_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E3_AUTO_FAN_PIN + #define E3_AUTO_FAN_PIN AUTO_FAN_PIN +#endif // // Misc. Functions diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h index 680a5c9a99..7040c2babb 100644 --- a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -95,10 +95,22 @@ #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 +// +// Auto fans +// +#define AUTO_FAN_PIN 7 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E1_AUTO_FAN_PIN + #define E1_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E2_AUTO_FAN_PIN + #define E2_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E3_AUTO_FAN_PIN + #define E3_AUTO_FAN_PIN AUTO_FAN_PIN +#endif // // Misc. Functions diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_15.h b/Marlin/src/pins/mega/pins_CNCONTROLS_15.h index b4aa8ab815..4af0d991e9 100644 --- a/Marlin/src/pins/mega/pins_CNCONTROLS_15.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_15.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -88,11 +88,26 @@ // Fans // #define FAN_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 + +// +// Auto fans +// +#define AUTO_FAN_PIN 30 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E1_AUTO_FAN_PIN + #define E1_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E2_AUTO_FAN_PIN + #define E2_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E3_AUTO_FAN_PIN + #define E3_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef CHAMBER_AUTO_FAN_PIN + //#define CHAMBER_AUTO_FAN_PIN 10 +#endif // // Misc. Functions diff --git a/Marlin/src/pins/mega/pins_EINSTART-S.h b/Marlin/src/pins/mega/pins_EINSTART-S.h index 8bb8f081f5..eeaf0c4197 100644 --- a/Marlin/src/pins/mega/pins_EINSTART-S.h +++ b/Marlin/src/pins/mega/pins_EINSTART-S.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/mega/pins_ELEFU_3.h b/Marlin/src/pins/mega/pins_ELEFU_3.h index 3d35a72b19..685611f78d 100644 --- a/Marlin/src/pins/mega/pins_ELEFU_3.h +++ b/Marlin/src/pins/mega/pins_ELEFU_3.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/mega/pins_GT2560_REV_A.h b/Marlin/src/pins/mega/pins_GT2560_REV_A.h index e111f2ce44..ebfdd24bb4 100644 --- a/Marlin/src/pins/mega/pins_GT2560_REV_A.h +++ b/Marlin/src/pins/mega/pins_GT2560_REV_A.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -44,7 +44,17 @@ #define Y_MIN_PIN 26 #define Y_MAX_PIN 28 #define Z_MIN_PIN 30 -#define Z_MAX_PIN 32 + +#if ENABLED(BLTOUCH) + #if MB(GT2560_REV_A_PLUS) + #define SERVO0_PIN 11 + #else + #define SERVO0_PIN 32 + #endif + #define Z_MAX_PIN -1 +#else + #define Z_MAX_PIN 32 +#endif // // Steppers diff --git a/Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h b/Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h index 3ce4627dce..7e2ce20c67 100644 --- a/Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h +++ b/Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -29,8 +29,6 @@ #include "pins_GT2560_REV_A.h" -#if ENABLED(BLTOUCH) - #define SERVO0_PIN 11 -#else +#if DISABLED(BLTOUCH) #define SERVO0_PIN 32 #endif diff --git a/Marlin/src/pins/mega/pins_GT2560_V3.h b/Marlin/src/pins/mega/pins_GT2560_V3.h index 08f9018a29..9b396d8db2 100644 --- a/Marlin/src/pins/mega/pins_GT2560_V3.h +++ b/Marlin/src/pins/mega/pins_GT2560_V3.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -121,7 +121,7 @@ // #define TEMP_0_PIN 11 // Analog Input #define TEMP_1_PIN 9 // Analog Input -#define TEMP_2_PIN 1 // Analog Input +#define TEMP_2_PIN 8 // Analog Input #define TEMP_BED_PIN 10 // Analog Input // @@ -129,7 +129,7 @@ // #define HEATER_0_PIN 10 #define HEATER_1_PIN 3 -#define HEATER_2_PIN 1 +#define HEATER_2_PIN 2 #define HEATER_BED_PIN 4 #define FAN_PIN 9 #define FAN1_PIN 8 @@ -140,7 +140,7 @@ // #define SD_DETECT_PIN 38 #define SDSS 53 -#define LED_PIN 6 +#define LED_PIN 13 // Use 6 (case light) for external LED. 13 is internal (yellow) LED. #define PS_ON_PIN 12 #define SUICIDE_PIN 54 // This pin must be enabled at boot to keep power flowing diff --git a/Marlin/src/pins/mega/pins_GT2560_V3_A20.h b/Marlin/src/pins/mega/pins_GT2560_V3_A20.h index 06ac9fd9df..e1956488c6 100644 --- a/Marlin/src/pins/mega/pins_GT2560_V3_A20.h +++ b/Marlin/src/pins/mega/pins_GT2560_V3_A20.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -30,6 +30,8 @@ #define LCD_PINS_D4 21 #define LCD_PINS_D7 6 +#define SPEAKER // The speaker can produce tones + #if ENABLED(NEWPANEL) #define BTN_EN1 16 #define BTN_EN2 17 diff --git a/Marlin/src/pins/mega/pins_GT2560_V3_MC2.h b/Marlin/src/pins/mega/pins_GT2560_V3_MC2.h index 0f06aaf256..26721df364 100644 --- a/Marlin/src/pins/mega/pins_GT2560_V3_MC2.h +++ b/Marlin/src/pins/mega/pins_GT2560_V3_MC2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h index 66adfb2fa7..2cbac0723c 100644 --- a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h +++ b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -103,7 +103,10 @@ #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 + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 8 // 8 默认挤出机风扇作为Case LED,如果需要PWM FAN,则需要将FAN_PIN置为7,LED_PIN置为8 +#endif //#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. diff --git a/Marlin/src/pins/mega/pins_INTAMSYS40.h b/Marlin/src/pins/mega/pins_INTAMSYS40.h index c688823ddf..19725eda2f 100644 --- a/Marlin/src/pins/mega/pins_INTAMSYS40.h +++ b/Marlin/src/pins/mega/pins_INTAMSYS40.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/mega/pins_LEAPFROG.h b/Marlin/src/pins/mega/pins_LEAPFROG.h index 188cbcad3d..99872e1fb4 100644 --- a/Marlin/src/pins/mega/pins_LEAPFROG.h +++ b/Marlin/src/pins/mega/pins_LEAPFROG.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/mega/pins_LEAPFROG_XEED2015.h b/Marlin/src/pins/mega/pins_LEAPFROG_XEED2015.h index 36cb0e2c14..61f5508cdc 100644 --- a/Marlin/src/pins/mega/pins_LEAPFROG_XEED2015.h +++ b/Marlin/src/pins/mega/pins_LEAPFROG_XEED2015.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/mega/pins_MEGACONTROLLER.h b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h index 2d0db15825..6b90b884c2 100644 --- a/Marlin/src/pins/mega/pins_MEGACONTROLLER.h +++ b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -128,7 +128,10 @@ // #define SDSS 53 #define LED_PIN 13 -#define CASE_LIGHT_PIN 2 + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 2 +#endif // // LCD / Controller diff --git a/Marlin/src/pins/mega/pins_MEGATRONICS.h b/Marlin/src/pins/mega/pins_MEGATRONICS.h index 4d7a980050..84346e5f66 100644 --- a/Marlin/src/pins/mega/pins_MEGATRONICS.h +++ b/Marlin/src/pins/mega/pins_MEGATRONICS.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -98,7 +98,10 @@ #define SDSS 53 #define LED_PIN 13 #define PS_ON_PIN 12 -#define CASE_LIGHT_PIN 2 + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 2 +#endif // // LCD / Controller diff --git a/Marlin/src/pins/mega/pins_MEGATRONICS_2.h b/Marlin/src/pins/mega/pins_MEGATRONICS_2.h index d976e09816..481dc35fa3 100644 --- a/Marlin/src/pins/mega/pins_MEGATRONICS_2.h +++ b/Marlin/src/pins/mega/pins_MEGATRONICS_2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -113,7 +113,10 @@ #define SDSS 53 #define LED_PIN 13 #define PS_ON_PIN 12 -#define CASE_LIGHT_PIN 2 + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 2 +#endif // // M3/M4/M5 - Spindle/Laser Control diff --git a/Marlin/src/pins/mega/pins_MEGATRONICS_3.h b/Marlin/src/pins/mega/pins_MEGATRONICS_3.h index 78dd88809f..0938896748 100644 --- a/Marlin/src/pins/mega/pins_MEGATRONICS_3.h +++ b/Marlin/src/pins/mega/pins_MEGATRONICS_3.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -132,7 +132,10 @@ #define SDSS 53 #define LED_PIN 13 #define PS_ON_PIN 12 -#define CASE_LIGHT_PIN 45 // Try the keypad connector + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 45 // Try the keypad connector +#endif // // LCD / Controller diff --git a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h index 3282216819..efa9916420 100644 --- a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h +++ b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -159,7 +159,7 @@ #define HBP_PIN 45 // L4 #define EXTRA_FET_PIN 44 // L5 -#if HOTENDS > 1 +#if HAS_MULTI_HOTEND #if TEMP_SENSOR_BED #define IS_EEB #else @@ -197,12 +197,17 @@ #endif #endif +#ifndef CONTROLLER_FAN_PIN + #define CONTROLLER_FAN_PIN EX2_FAN_PIN +#endif + // // Misc. Functions // #define LED_PIN 13 // B7 #define CUTOFF_RESET_PIN 16 // H1 #define CUTOFF_TEST_PIN 17 // H0 +#define CUTOFF_SR_CHECK_PIN 70 // G4 (TOSC1) // // LCD / Controller diff --git a/Marlin/src/pins/mega/pins_MINITRONICS.h b/Marlin/src/pins/mega/pins_MINITRONICS.h index 35d1b59ecb..138d4b4431 100644 --- a/Marlin/src/pins/mega/pins_MINITRONICS.h +++ b/Marlin/src/pins/mega/pins_MINITRONICS.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/mega/pins_OVERLORD.h b/Marlin/src/pins/mega/pins_OVERLORD.h index 4e02127c12..bbccc93561 100644 --- a/Marlin/src/pins/mega/pins_OVERLORD.h +++ b/Marlin/src/pins/mega/pins_OVERLORD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/mega/pins_PICA.h b/Marlin/src/pins/mega/pins_PICA.h index f00d817d6e..40ef3a610f 100644 --- a/Marlin/src/pins/mega/pins_PICA.h +++ b/Marlin/src/pins/mega/pins_PICA.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -29,8 +29,8 @@ * Applies to PICA, PICA_REVB */ -#ifndef BOARD_NAME - #define BOARD_NAME "PICA" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "PICA" #endif /* @@ -46,6 +46,12 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif +// +// Servos +// +#define SERVO0_PIN 3 +#define SERVO1_PIN 4 +#define SERVO2_PIN 5 // // Limit Switches // @@ -75,6 +81,10 @@ #define E0_DIR_PIN 24 #define E0_ENABLE_PIN 26 +#define E1_STEP_PIN 68 +#define E1_DIR_PIN 28 +#define E1_ENABLE_PIN 27 + // // Temperature Sensors // diff --git a/Marlin/src/pins/mega/pins_PICAOLD.h b/Marlin/src/pins/mega/pins_PICAOLD.h index 34861277a8..f53a4cdcd2 100644 --- a/Marlin/src/pins/mega/pins_PICAOLD.h +++ b/Marlin/src/pins/mega/pins_PICAOLD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/pins/mega/pins_SILVER_GATE.h b/Marlin/src/pins/mega/pins_SILVER_GATE.h index 4c79507eab..a67725d9bc 100644 --- a/Marlin/src/pins/mega/pins_SILVER_GATE.h +++ b/Marlin/src/pins/mega/pins_SILVER_GATE.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -61,7 +61,10 @@ #define HEATER_0_PIN 7 -#define ORIG_E0_AUTO_FAN_PIN 3 // Use this by NOT overriding E0_AUTO_FAN_PIN +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN 3 +#endif + #define CONTROLLER_FAN_PIN 2 #define TEMP_0_PIN 7 // Analog Input @@ -90,4 +93,7 @@ #define STAT_LED_RED_PIN 23 #define STAT_LED_BLUE_PIN 26 -#define CASE_LIGHT_PIN 51 + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 51 +#endif diff --git a/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h b/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h index 6c53b7ea4e..ba7f64768b 100644 --- a/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h +++ b/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 5de75a1f0e..1b78b0f769 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -98,6 +98,8 @@ #include "ramps/pins_K8200.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 (3DRAG) #elif MB(K8400) #include "ramps/pins_K8400.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 (3DRAG) +#elif MB(K8600) + #include "ramps/pins_K8600.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 #elif MB(K8800) #include "ramps/pins_K8800.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 (3DRAG) #elif MB(BAM_DICE) @@ -190,6 +192,10 @@ #include "ramps/pins_MKS_GEN_L_V2.h" // ATmega2560 env:mega2560 #elif MB(COPYMASTER_3D) #include "ramps/pins_COPYMASTER_3D.h" // ATmega2560 env:mega2560 +#elif MB(ORTUR_4) + #include "ramps/pins_ORTUR_4.h" // ATmega2560 env:mega2560 +#elif MB(TENLOG_D3_HERO) + #include "ramps/pins_TENLOG_D3_HERO.h" // ATmega2560 env:mega2560 // // RAMBo and derivatives @@ -280,10 +286,12 @@ #include "sanguino/pins_SANGUINOLOLU_12.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p #elif MB(MELZI) #include "sanguino/pins_MELZI.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p +#elif MB(MELZI_V2) + #include "sanguino/pins_MELZI_V2.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p #elif MB(MELZI_MAKR3D) #include "sanguino/pins_MELZI_MAKR3D.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p #elif MB(MELZI_CREALITY) - #include "sanguino/pins_MELZI_CREALITY.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_MELZI_CREALITY.h" // ATmega1284P env:melzi env:melzi_optimized env:melzi_optiboot #elif MB(MELZI_MALYAN) #include "sanguino/pins_MELZI_MALYAN.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p #elif MB(MELZI_TRONXY) @@ -454,7 +462,7 @@ #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 + #include "sam/pins_ARCHIM2.h" // SAM3X8E env:DUE_archim env:DUE_archim_debug #elif MB(ALLIGATOR) #include "sam/pins_ALLIGATOR_R2.h" // SAM3X8E env:DUE env:DUE_debug #elif MB(ADSK) @@ -464,6 +472,14 @@ #elif MB(CNCONTROLS_15D) #include "sam/pins_CNCONTROLS_15D.h" // SAM3X8E env:DUE env:DUE_USB +// +// STM32 ARM Cortex-M0 +// +#elif MB(MALYAN_M200_V2) + #include "stm32f0/pins_MALYAN_M200_V2.h" // STM32F0 env:STM32F070RB_malyan +#elif MB(MALYAN_M300) + #include "stm32f0/pins_MALYAN_M300.h" // STM32F070 env:malyan_M300 + // // STM32 ARM Cortex-M3 // @@ -491,7 +507,9 @@ #elif MB(MKS_ROBIN_MINI) #include "stm32f1/pins_MKS_ROBIN_MINI.h" // STM32F1 env:mks_robin_mini #elif MB(MKS_ROBIN_NANO) - #include "stm32f1/pins_MKS_ROBIN_NANO.h" // STM32F1 env:mks_robin_nano + #include "stm32f1/pins_MKS_ROBIN_NANO.h" // STM32F1 env:mks_robin_nano35 +#elif MB(MKS_ROBIN_NANO_V2) + #include "stm32f1/pins_MKS_ROBIN_NANO_V2.h" // STM32F1 env:mks_robin_nano35 #elif MB(MKS_ROBIN_LITE) #include "stm32f1/pins_MKS_ROBIN_LITE.h" // STM32F1 env:mks_robin_lite #elif MB(BTT_SKR_MINI_V1_1) @@ -500,6 +518,8 @@ #include "stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h" // STM32F1 env:STM32F103RC_btt env:STM32F103RC_btt_512K env:STM32F103RC_btt_USB env:STM32F103RC_btt_512K_USB #elif MB(BTT_SKR_MINI_E3_V1_2) #include "stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h" // STM32F1 env:STM32F103RC_btt env:STM32F103RC_btt_512K env:STM32F103RC_btt_USB env:STM32F103RC_btt_512K_USB +#elif MB(BTT_SKR_MINI_E3_V2_0) + #include "stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h" // STM32F1 env:STM32F103RC_btt env:STM32F103RC_btt_512K env:STM32F103RC_btt_USB env:STM32F103RC_btt_512K_USB #elif MB(BTT_SKR_E3_DIP) #include "stm32f1/pins_BTT_SKR_E3_DIP.h" // STM32F1 env:STM32F103RE_btt env:STM32F103RE_btt_USB env:STM32F103RC_btt env:STM32F103RC_btt_512K env:STM32F103RC_btt_USB env:STM32F103RC_btt_512K_USB #elif MB(JGAURORA_A5S_A1) @@ -516,6 +536,20 @@ #include "stm32f1/pins_MKS_ROBIN_LITE3.h" // STM32F1 env:mks_robin_lite3 #elif MB(MKS_ROBIN_PRO) #include "stm32f1/pins_MKS_ROBIN_PRO.h" // STM32F1 env:mks_robin_pro +#elif MB(MKS_ROBIN_E3D) + #include "stm32f1/pins_MKS_ROBIN_E3D.h" // STM32F1 env:mks_robin_e3 +#elif MB(MKS_ROBIN_E3) + #include "stm32f1/pins_MKS_ROBIN_E3.h" // STM32F1 env:mks_robin_e3 +#elif MB(CCROBOT_MEEB_3DP) + #include "stm32f1/pins_CCROBOT_MEEB_3DP.h" // STM32F1 env:STM32F103RC_meeb +#elif MB(CHITU3D_V5) + #include "stm32f1/pins_CHITU3D_V5.h" // STM32F1 env:chitu_f103 env:chitu_v5_gpio_init +#elif MB(CHITU3D_V6) + #include "stm32f1/pins_CHITU3D_V6.h" // STM32F1 env:chitu_f103 +#elif MB(CREALITY_V4) + #include "stm32f1/pins_CREALITY_V4.h" // STM32F1 env:STM32F103RET6_creality +#elif MB(TRIGORILLA_PRO) + #include "stm32f1/pins_TRIGORILLA_PRO.h" // STM32F1 env:trigorilla_pro // // ARM Cortex-M4F @@ -536,24 +570,30 @@ #include "stm32f4/pins_GENERIC_STM32F4.h" // STM32F4 env:STM32F4 #elif MB(ARMED) #include "stm32f4/pins_ARMED.h" // STM32F4 env:ARMED -#elif MB(RUMBA32_AUS3D) - #include "stm32f4/pins_RUMBA32_AUS3D.h" // STM32F4 env:rumba32_f446ve +#elif MB(RUMBA32_V1_0) + #include "stm32f4/pins_RUMBA32_AUS3D.h" // STM32F4 env:rumba32 +#elif MB(RUMBA32_V1_1) + #include "stm32f4/pins_RUMBA32_AUS3D.h" // STM32F4 env:rumba32 #elif MB(RUMBA32_MKS) - #include "stm32f4/pins_RUMBA32_MKS.h" // STM32F4 env:rumba32_mks + #include "stm32f4/pins_RUMBA32_MKS.h" // STM32F4 env:rumba32 #elif MB(BLACK_STM32F407VE) #include "stm32f4/pins_BLACK_STM32F407VE.h" // STM32F4 env:STM32F407VE_black #elif MB(STEVAL_3DP001V1) #include "stm32f4/pins_STEVAL_3DP001V1.h" // STM32F4 env:STM32F401VE_STEVAL #elif MB(BTT_SKR_PRO_V1_1) #include "stm32f4/pins_BTT_SKR_PRO_V1_1.h" // STM32F4 env:BIGTREE_SKR_PRO +#elif MB(BTT_SKR_PRO_V1_2) + #include "stm32f4/pins_BTT_SKR_PRO_V1_2.h" // STM32F4 env:BIGTREE_SKR_PRO #elif MB(BTT_GTR_V1_0) #include "stm32f4/pins_BTT_GTR_V1_0.h" // STM32F4 env:BIGTREE_GTR_V1_0 #elif MB(BTT_BTT002_V1_0) #include "stm32f4/pins_BTT_BTT002_V1_0.h" // STM32F4 env:BIGTREE_BTT002 #elif MB(LERDGE_K) #include "stm32f4/pins_LERDGE_K.h" // STM32F4 env:STM32F4 +#elif MB(LERDGE_S) + #include "stm32f4/pins_LERDGE_S.h" // STM32F4 env:LERDGE_S #elif MB(LERDGE_X) - #include "stm32f4/pins_LERDGE_X.h" // STM32F4 env:STM32F4 + #include "stm32f4/pins_LERDGE_X.h" // STM32F4 env:LERDGE_X #elif MB(VAKE403D) #include "stm32f4/pins_VAKE403D.h" // STM32F4 env:STM32F4 #elif MB(FYSETC_S6) @@ -577,7 +617,6 @@ // #elif MB(ESPRESSIF_ESP32) - #include "esp32/pins_ESP32.h" // ESP32 env:esp32 #elif MB(MRR_ESPA) #include "esp32/pins_MRR_ESPA.h" // ESP32 env:esp32 @@ -625,6 +664,7 @@ #define BOARD_BIGTREE_SKR_MINI_E3 -1016 #define BOARD_BIGTREE_SKR_E3_DIP -1017 #define BOARD_RUMBA32 -1018 + #define BOARD_RUMBA32_AUS3D -1019 #if MB(MKS_13) #error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration." @@ -665,7 +705,9 @@ #elif MB(STEVAL) #error "BOARD_STEVAL has been renamed BOARD_STEVAL_3DP001V1. Please update your configuration." #elif MB(RUMBA32) - #error "BOARD_RUMBA32 is now BOARD_RUMBA32_MKS or BOARD_RUMBA32_AUS3D. Please update your configuration." + #error "BOARD_RUMBA32 is now BOARD_RUMBA32_MKS or BOARD_RUMBA32_V1_0. Please update your configuration." + #elif MB(RUMBA32_AUS3D) + #error "BOARD_RUMBA32_AUS3D is now BOARD_RUMBA32_V1_0. Please update your configuration." #else #error "Unknown MOTHERBOARD value set in Configuration.h" #endif @@ -689,6 +731,7 @@ #undef BOARD_BIGTREE_SKR_MINI_V1_1 #undef BOARD_BIGTREE_SKR_E3_DIP #undef BOARD_RUMBA32 + #undef BOARD_RUMBA32_AUS3D #endif @@ -1047,73 +1090,6 @@ #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 E6_AUTO_FAN_PIN - #ifdef ORIG_E6_AUTO_FAN_PIN - #define E6_AUTO_FAN_PIN ORIG_E6_AUTO_FAN_PIN - #else - #define E6_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef E7_AUTO_FAN_PIN - #ifdef ORIG_E7_AUTO_FAN_PIN - #define E7_AUTO_FAN_PIN ORIG_E7_AUTO_FAN_PIN - #else - #define E7_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 // @@ -1282,7 +1258,7 @@ // // Auto-assign pins for stallGuard sensorless homing // - #if X2_STALL_SENSITIVITY && ENABLED(X_DUAL_ENDSTOPS) && _PEXI(X2_E_INDEX, DIAG) + #if defined(X2_STALL_SENSITIVITY) && ENABLED(X_DUAL_ENDSTOPS) && _PEXI(X2_E_INDEX, DIAG) #define X2_DIAG_PIN _EPIN(X2_E_INDEX, DIAG) #if DIAG_REMAPPED(X2, X_MIN) // If already remapped in the pins file... #define X2_USE_ENDSTOP _XMIN_ @@ -1351,7 +1327,7 @@ #define Y2_SERIAL_RX_PIN _EPIN(Y2_E_INDEX, SERIAL_RX) #endif #endif - #if Y2_STALL_SENSITIVITY && ENABLED(Y_DUAL_ENDSTOPS) && _PEXI(Y2_E_INDEX, DIAG) + #if defined(Y2_STALL_SENSITIVITY) && ENABLED(Y_DUAL_ENDSTOPS) && _PEXI(Y2_E_INDEX, DIAG) #define Y2_DIAG_PIN _EPIN(Y2_E_INDEX, DIAG) #if DIAG_REMAPPED(Y2, X_MIN) #define Y2_USE_ENDSTOP _XMIN_ @@ -1419,7 +1395,7 @@ #define Z2_SERIAL_RX_PIN _EPIN(Z2_E_INDEX, SERIAL_RX) #endif #endif - #if Z2_STALL_SENSITIVITY && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 2 && _PEXI(Z2_E_INDEX, DIAG) + #if defined(Z2_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 2 && _PEXI(Z2_E_INDEX, DIAG) #define Z2_DIAG_PIN _EPIN(Z2_E_INDEX, DIAG) #if DIAG_REMAPPED(Z2, X_MIN) #define Z2_USE_ENDSTOP _XMIN_ @@ -1488,7 +1464,7 @@ #define Z3_SERIAL_RX_PIN _EPIN(Z3_E_INDEX, SERIAL_RX) #endif #endif - #if Z3_STALL_SENSITIVITY && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3 && _PEXI(Z3_E_INDEX, DIAG) + #if defined(Z3_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3 && _PEXI(Z3_E_INDEX, DIAG) #define Z3_DIAG_PIN _EPIN(Z3_E_INDEX, DIAG) #if DIAG_REMAPPED(Z3, X_MIN) #define Z3_USE_ENDSTOP _XMIN_ @@ -1555,7 +1531,7 @@ #define Z4_SERIAL_RX_PIN _EPIN(Z4_E_INDEX, SERIAL_RX) #endif #endif - #if Z4_STALL_SENSITIVITY && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4 && _PEXI(Z4_E_INDEX, DIAG) + #if defined(Z4_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4 && _PEXI(Z4_E_INDEX, DIAG) #define Z4_DIAG_PIN _EPIN(Z4_E_INDEX, DIAG) #if DIAG_REMAPPED(Z4, X_MIN) #define Z4_USE_ENDSTOP _XMIN_ diff --git a/Marlin/src/pins/pinsDebug.h b/Marlin/src/pins/pinsDebug.h index c08acd3836..0766d818e7 100644 --- a/Marlin/src/pins/pinsDebug.h +++ b/Marlin/src/pins/pinsDebug.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/pins/pinsDebug_list.h b/Marlin/src/pins/pinsDebug_list.h index 28478973fb..3307cbde97 100644 --- a/Marlin/src/pins/pinsDebug_list.h +++ b/Marlin/src/pins/pinsDebug_list.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -30,7 +30,7 @@ // Analog Pin Assignments // -#define ANALOG_OK(PN) ((PN) >= 0 && (PN) < NUM_ANALOG_PINS) +#define ANALOG_OK(PN) ((PN) >= 0 && (PN) < NUM_ANALOG_INPUTS) #if defined(EXT_AUX_A0) && ANALOG_OK(EXT_AUX_A0) REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A0) @@ -1409,3 +1409,15 @@ #if PIN_EXISTS(CLOSED_LOOP_MOVE_COMPLETE) REPORT_NAME_DIGITAL(__LINE__, CLOSED_LOOP_MOVE_COMPLETE_PIN) #endif +#if PIN_EXISTS(ESP_WIFI_MODULE_RESET) + REPORT_NAME_DIGITAL(__LINE__, ESP_WIFI_MODULE_RESET_PIN) +#endif +#if PIN_EXISTS(ESP_WIFI_MODULE_ENABLE) + REPORT_NAME_DIGITAL(__LINE__, ESP_WIFI_MODULE_ENABLE_PIN) +#endif +#if PIN_EXISTS(ESP_WIFI_MODULE_GPIO0) + REPORT_NAME_DIGITAL(__LINE__, ESP_WIFI_MODULE_GPIO0_PIN) +#endif +#if PIN_EXISTS(ESP_WIFI_MODULE_GPIO2) + REPORT_NAME_DIGITAL(__LINE__, ESP_WIFI_MODULE_GPIO2_PIN) +#endif diff --git a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h index 430fa170e1..76c3f131a9 100644 --- a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -129,7 +129,10 @@ // #define SDSS 77 #define LED_PIN 13 -#define CASE_LIGHT_PIN 9 + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 9 +#endif // // M3/M4/M5 - Spindle/Laser Control diff --git a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h index 6e8463d0bd..0df977a05b 100644 --- a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -143,7 +143,10 @@ // #define SDSS 53 #define LED_PIN 13 -#define CASE_LIGHT_PIN 9 + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 9 +#endif // // M3/M4/M5 - Spindle/Laser Control diff --git a/Marlin/src/pins/rambo/pins_MINIRAMBO.h b/Marlin/src/pins/rambo/pins_MINIRAMBO.h index 18bc3ddd16..f89bba2d7f 100644 --- a/Marlin/src/pins/rambo/pins_MINIRAMBO.h +++ b/Marlin/src/pins/rambo/pins_MINIRAMBO.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/rambo/pins_RAMBO.h b/Marlin/src/pins/rambo/pins_RAMBO.h index dec72b8ea7..5abf1f2d90 100644 --- a/Marlin/src/pins/rambo/pins_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_RAMBO.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -34,7 +34,7 @@ * * Instructions for installing the Arduino RAMBo board type for the * Arduino IDE are available at: - * http://reprap.org/wiki/Rambo_firmware + * https://reprap.org/wiki/Rambo_firmware */ /** @@ -112,7 +112,7 @@ #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 +#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 @@ -144,7 +144,10 @@ #define SDSS 53 #define LED_PIN 13 #define PS_ON_PIN 4 -#define CASE_LIGHT_PIN 46 + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 46 +#endif #ifndef FILWIDTH_PIN #define FILWIDTH_PIN 3 // Analog Input diff --git a/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h b/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h index 49237c7062..bba628f307 100644 --- a/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h +++ b/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -92,7 +92,7 @@ #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 +#define DIGIPOT_CHANNELS {4,5,3,0,1} // X Y Z E0 E1 digipot channels to stepper driver mapping // // Temperature Sensors diff --git a/Marlin/src/pins/ramps/pins_3DRAG.h b/Marlin/src/pins/ramps/pins_3DRAG.h index 69d2ac2088..1989a1657f 100644 --- a/Marlin/src/pins/ramps/pins_3DRAG.h +++ b/Marlin/src/pins/ramps/pins_3DRAG.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -34,7 +34,7 @@ #endif #ifndef DEFAULT_SOURCE_CODE_URL - #define DEFAULT_SOURCE_CODE_URL "http://3dprint.elettronicain.it/" + #define DEFAULT_SOURCE_CODE_URL "https://3dprint.elettronicain.it/" #endif // @@ -44,7 +44,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 +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN -1 // Hardware PWM but one is not available on expansion header +#endif #include "pins_RAMPS.h" diff --git a/Marlin/src/pins/ramps/pins_AZTEEG_X3.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h index a38e4e1b43..d142fb903e 100644 --- a/Marlin/src/pins/ramps/pins_AZTEEG_X3.h +++ b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h index c8e2a6683d..a23ada0aca 100644 --- a/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h +++ b/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -118,11 +118,22 @@ #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 +// +// Auto fans +// +#define AUTO_FAN_PIN 5 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E1_AUTO_FAN_PIN + #define E1_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E2_AUTO_FAN_PIN + #define E2_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E3_AUTO_FAN_PIN + #define E3_AUTO_FAN_PIN AUTO_FAN_PIN +#endif // // LCD / Controller diff --git a/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h b/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h index 1aa9b67f7c..af1adabbbc 100644 --- a/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h +++ b/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_BIQU_KFB_2.h b/Marlin/src/pins/ramps/pins_BIQU_KFB_2.h index 738b522e66..b31df11563 100644 --- a/Marlin/src/pins/ramps/pins_BIQU_KFB_2.h +++ b/Marlin/src/pins/ramps/pins_BIQU_KFB_2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h b/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h index 44b6ff1e61..1420aaaa56 100644 --- a/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h +++ b/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -42,10 +42,18 @@ // // 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 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN 11 +#endif +#ifndef E1_AUTO_FAN_PIN + #define E1_AUTO_FAN_PIN 6 +#endif +#ifndef E2_AUTO_FAN_PIN + #define E2_AUTO_FAN_PIN 6 +#endif +#ifndef E3_AUTO_FAN_PIN + #define E3_AUTO_FAN_PIN 6 +#endif // // M3/M4/M5 - Spindle/Laser Control @@ -94,7 +102,9 @@ #undef PS_ON_PIN // 12 #define PS_ON_PIN 81 // External Power Supply -#define CASE_LIGHT_PIN 44 // Hardware PWM +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 44 // Hardware PWM +#endif // 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 diff --git a/Marlin/src/pins/ramps/pins_COPYMASTER_3D.h b/Marlin/src/pins/ramps/pins_COPYMASTER_3D.h index 8f61ef47dc..b9eee6bd53 100644 --- a/Marlin/src/pins/ramps/pins_COPYMASTER_3D.h +++ b/Marlin/src/pins/ramps/pins_COPYMASTER_3D.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h b/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h index 9ff9d3be62..21c3f6dbfe 100644 --- a/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h +++ b/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_FELIX2.h b/Marlin/src/pins/ramps/pins_FELIX2.h index bfd341db6d..6cc6997adc 100644 --- a/Marlin/src/pins/ramps/pins_FELIX2.h +++ b/Marlin/src/pins/ramps/pins_FELIX2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h index 75d647fed5..f1e6e6727c 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -124,7 +124,7 @@ // 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 HAS_MULTI_HOTEND #if TEMP_SENSOR_BED #define IS_RAMPS_EEB #else @@ -172,7 +172,9 @@ #define PS_ON_PIN 12 #endif -#define CASE_LIGHT_PIN 5 +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 5 +#endif // // LCD / Controller diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h index 3ed9fb9692..843eadb432 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h b/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h index 5176c699ee..4a9b9e1d59 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h @@ -16,20 +16,11 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once -/** - * Override default LCD timing for Formbot T-Rex 2+ machines. - * The long LCD cables and the routing near electrically noisy stepper motors - * requires a slightly longer setup and hold time on the signals. - */ -#define BOARD_ST7920_DELAY_1 DELAY_NS(200) -#define BOARD_ST7920_DELAY_2 DELAY_NS(200) -#define BOARD_ST7920_DELAY_3 DELAY_NS(200) - /** * Formbot pin assignments */ @@ -130,7 +121,7 @@ // 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 HAS_MULTI_HOTEND #if TEMP_SENSOR_BED #define IS_RAMPS_EEB #else @@ -175,7 +166,9 @@ #define PS_ON_PIN 12 #endif -#define CASE_LIGHT_PIN 8 +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 8 +#endif // // LCD / Controller @@ -203,3 +196,15 @@ #define LCD_PINS_D6 27 #define LCD_PINS_D7 29 #endif + +#if HAS_GRAPHICAL_LCD + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(200) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(200) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(200) + #endif +#endif diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h b/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h index 3846a7649e..a804df4ed3 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -134,12 +134,16 @@ // // Misc. Functions // -#define CASE_LIGHT_PIN 5 #define SDSS 53 + #ifndef LED_PIN #define LED_PIN 13 #endif +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 5 +#endif + #define SPINDLE_LASER_PWM_PIN -1 // Hardware PWM #define SPINDLE_LASER_ENA_PIN 4 // Pullup! diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h index 19238bc5f8..ffaa72d988 100644 --- a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h +++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -211,58 +211,77 @@ // // 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 - - #if ENABLED(FYSETC_GENERIC_12864_1_1) - #define LCD_BACKLIGHT_PIN 27 - #endif - - #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 +#if ENABLED(FYSETC_242_OLED_12864) + #define BTN_EN1 37 + #define BTN_EN2 29 #define BTN_ENC 35 + #define BEEPER_PIN 31 + + #define LCD_PINS_DC 25 + #define LCD_PINS_RS 33 + #define DOGLCD_CS 16 + #define DOGLCD_MOSI 23 + #define DOGLCD_SCK 17 + #define DOGLCD_A0 LCD_PINS_DC + + #define KILL_PIN -1 // NC + #define NEOPIXEL_PIN 27 + +#else + #define BEEPER_PIN 37 + + #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 + + #if ENABLED(FYSETC_GENERIC_12864_1_1) + #define LCD_BACKLIGHT_PIN 27 + #endif + + #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 #endif #ifndef RGB_LED_R_PIN diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_14.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_14.h index f0eb0bf4c6..4280204b99 100644 --- a/Marlin/src/pins/ramps/pins_FYSETC_F6_14.h +++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_14.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ // FYSETC F6 v1.4 pin assignments // -#define BOARD_NAME "FYSETC F6 1.4" +#define BOARD_INFO_NAME "FYSETC F6 1.4" #define Z_MAX_PIN 2 diff --git a/Marlin/src/pins/ramps/pins_K8200.h b/Marlin/src/pins/ramps/pins_K8200.h index 6052232907..5d4d2d7022 100644 --- a/Marlin/src/pins/ramps/pins_K8200.h +++ b/Marlin/src/pins/ramps/pins_K8200.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_K8400.h b/Marlin/src/pins/ramps/pins_K8400.h index 4c5ba7eca1..c36e291598 100644 --- a/Marlin/src/pins/ramps/pins_K8400.h +++ b/Marlin/src/pins/ramps/pins_K8400.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_K8600.h b/Marlin/src/pins/ramps/pins_K8600.h new file mode 100644 index 0000000000..0de0192752 --- /dev/null +++ b/Marlin/src/pins/ramps/pins_K8600.h @@ -0,0 +1,127 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * VERTEX NANO Arduino Mega with RAMPS EFB v1.4 pin assignments. + */ + +#if HOTENDS > 1 + #error "Only 1 hotend is supported for Vertex Nano." +#endif + +#define BOARD_INFO_NAME "K8600" +#define DEFAULT_MACHINE_NAME "Vertex Nano" + +// +// Limit Switches +// +#define X_MIN_PIN 3 +#define Y_MAX_PIN 14 +#define Z_MAX_PIN 18 +#define Z_MIN_PIN -1 + +// +// Heaters / Fans +// +#define FAN_PIN 8 + +// +// Misc. Functions +// +#define CASE_LIGHT_PIN 7 + +// +// Other RAMPS pins +// +#define IS_RAMPS_EFB // Override autodetection. Bed will be undefined. +#include "pins_RAMPS.h" + +// +// Steppers +// +#undef X_STEP_PIN +#undef X_DIR_PIN +#undef X_ENABLE_PIN +#define X_STEP_PIN 54 +#define X_DIR_PIN 55 +#define X_ENABLE_PIN 38 + +#undef Y_STEP_PIN +#undef Y_DIR_PIN +#undef Y_ENABLE_PIN +#define Y_STEP_PIN 60 +#define Y_DIR_PIN 61 +#define Y_ENABLE_PIN 56 + +#undef Z_ENABLE_PIN +#define Z_ENABLE_PIN 63 + +#undef E0_STEP_PIN +#undef E0_DIR_PIN +#undef E0_ENABLE_PIN +#define E0_STEP_PIN 26 +#define E0_DIR_PIN 28 +#define E0_ENABLE_PIN 24 + +// +// Heaters / Fans +// +#undef HEATER_BED_PIN + +// +// Misc. Functions +// +#undef SDSS +#define SDSS 25 // 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 17 + #define BTN_EN2 16 + #define BTN_ENC 23 + +#else + + #define BEEPER_PIN 33 + +#endif diff --git a/Marlin/src/pins/ramps/pins_K8800.h b/Marlin/src/pins/ramps/pins_K8800.h index 09f35b1fe0..2783f69896 100644 --- a/Marlin/src/pins/ramps/pins_K8800.h +++ b/Marlin/src/pins/ramps/pins_K8800.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_MAKEBOARD_MINI.h b/Marlin/src/pins/ramps/pins_MAKEBOARD_MINI.h index 6a31142450..a42dba874f 100644 --- a/Marlin/src/pins/ramps/pins_MAKEBOARD_MINI.h +++ b/Marlin/src/pins/ramps/pins_MAKEBOARD_MINI.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_10.h b/Marlin/src/pins/ramps/pins_MKS_BASE_10.h index b1010482c1..0be58653aa 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_10.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_10.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_14.h b/Marlin/src/pins/ramps/pins_MKS_BASE_14.h index 057b51a584..3612f9b894 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_14.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_14.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -38,7 +38,7 @@ #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! @@ -54,6 +54,10 @@ #define RGB_LED_B_PIN 52 #endif +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 11 // PB5 ** Pin24 ** PWM11 +#endif + #include "pins_MKS_BASE_common.h" /* diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_15.h b/Marlin/src/pins/ramps/pins_MKS_BASE_15.h index 683c6b7d0e..9e670d1bbd 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_15.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_15.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h index b769d655d6..42796acf8b 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h b/Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h index 1b06657f09..3ce138b975 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_common.h b/Marlin/src/pins/ramps/pins_MKS_BASE_common.h index 2d06171906..9047a4bcf0 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_common.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_common.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h index c4c90ba6fa..08dd0f44bd 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_L.h b/Marlin/src/pins/ramps/pins_MKS_GEN_L.h index ea45f91238..522a34cda1 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_L.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h index 3236627c3b..20f3dece42 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_ORTUR_4.h b/Marlin/src/pins/ramps/pins_ORTUR_4.h new file mode 100644 index 0000000000..cef01bf62a --- /dev/null +++ b/Marlin/src/pins/ramps/pins_ORTUR_4.h @@ -0,0 +1,116 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Ortur 4 Arduino Mega based on RAMPS v1.4 pin assignments + */ + +#define BOARD_INFO_NAME "Ortur 4.3" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME + +// +// Servos +// +#define SERVO0_PIN 29 + +// +// Limit Switches +// +#define X_MAX_PIN 18 +#define Z_MIN_PIN 63 + +#define Z_MIN_PROBE_PIN 2 +#define FIL_RUNOUT_PIN 59 + +// +// Steppers +// +#define E0_CS_PIN 44 +#define E1_CS_PIN 42 + +// +// Temperature Sensors +// +#define TEMP_0_PIN 15 // Analog Input +#define TEMP_1_PIN 13 // Analog Input + +// +// Software serial +// +#define X_SERIAL_TX_PIN 59 +#define X_SERIAL_RX_PIN 63 + +#define Y_SERIAL_TX_PIN 64 +#define Y_SERIAL_RX_PIN 40 + +#define Z_SERIAL_TX_PIN 44 +#define Z_SERIAL_RX_PIN 42 + +#define E0_SERIAL_TX_PIN 66 +#define E0_SERIAL_RX_PIN 65 + +#include "pins_RAMPS.h" + +// +// Steppers +// +#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 + +// +// LCD / Controller +// +#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #undef BEEPER_PIN + #define BEEPER_PIN 35 + + #undef LCD_PINS_RS + #undef LCD_PINS_ENABLE + #undef LCD_PINS_D4 + #define LCD_PINS_RS 27 + #define LCD_PINS_ENABLE 23 + #define LCD_PINS_D4 37 + + #undef LCD_SDSS + #undef SD_DETECT_PIN + #define LCD_SDSS 53 + #define SD_DETECT_PIN 49 + + #undef BTN_EN1 + #undef BTN_EN2 + #undef BTN_ENC + #define BTN_EN1 29 + #define BTN_EN2 25 + #define BTN_ENC 16 +#endif diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index ffe7f7bb1e..e32c79afa9 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -180,7 +180,7 @@ // 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 HAS_MULTI_HOTEND #if TEMP_SENSOR_BED #define IS_RAMPS_EEB #else @@ -553,7 +553,7 @@ #elif ENABLED(LCD_I2C_VIKI) - #define BTN_EN1 40 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. + #define BTN_EN1 40 // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. #define BTN_EN2 42 #define BTN_ENC -1 @@ -603,7 +603,7 @@ #define KILL_PIN 41 #endif - #if ENABLED(MKS_MINI_12864) // Added in Marlin 1.1.6 + #if ENABLED(MKS_MINI_12864) #define DOGLCD_A0 27 #define DOGLCD_CS 25 @@ -707,7 +707,7 @@ #endif // HAS_SPI_LCD -#if ENABLED(REPRAPWORLD_KEYPAD) +#if ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(ADC_KEYPAD) #define SHIFT_OUT 40 #define SHIFT_CLK 44 #define SHIFT_LD 42 @@ -721,3 +721,46 @@ #define BTN_ENC 63 #endif #endif + +#if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) + + #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_RAMPS.h' for details. Comment out this line to continue." + + /** FYSETC TFT TFT81050 display pinout + * + * Board Display + * _____ _____ + * (SCK) D52 | 1 2 | D50 (MISO) MISO | 1 2 | SCK + * (SD_CS) D53 | 3 4 | D33 (BNT_EN2) (BNT_EN2) MOD_RESET | 3 4 | SD_CS + * (MOSI) D51 | 5 6 D31 (BNT_EN1) (BNT_EN1) LCD_CS | 5 6 MOSI + * RESET | 7 8 | D49 (SD_DET) SD_DET | 7 8 | RESET + * NC | 9 10| GND GND | 9 10| 5V + * ----- ----- + * EXP2 EXP1 + * + * Needs custom cable: + * + * Board Adapter Display + * _________ + * EXP2-1 ----------- EXP1-10 + * EXP2-2 ----------- EXP1-9 + * EXP2-4 ----------- EXP1-8 + * EXP2-4 ----------- EXP1-7 + * EXP2-3 ----------- EXP1-6 + * EXP2-6 ----------- EXP1-5 + * EXP2-7 ----------- EXP1-4 + * EXP2-8 ----------- EXP1-3 + * EXP2-1 ----------- EXP1-2 + * EXP1-10 ----------- EXP1-1 + * + * NOTE: The MISO pin should not get a 5V signal. + * To fix, insert a 1N4148 diode in the MISO line. + */ + + #define BEEPER_PIN 37 + + #define SD_DETECT_PIN 49 + + #define CLCD_MOD_RESET 31 + #define CLCD_SPI_CS 33 +#endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050 diff --git a/Marlin/src/pins/ramps/pins_RAMPS_13.h b/Marlin/src/pins/ramps/pins_RAMPS_13.h index 1eb883f4db..032dd79c23 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_13.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_13.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -39,4 +39,5 @@ #endif #define IS_RAMPS_13 + #include "pins_RAMPS.h" diff --git a/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h b/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h index f6847feb4b..b2a412e305 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -39,9 +39,13 @@ #define FIL_RUNOUT2_PIN 15 // Creality CR-X can use dual runout sensors #endif -#define SD_DETECT_PIN 49 // Always define onboard SD detect +#ifndef SD_DETECT_PIN + #define SD_DETECT_PIN 49 // Always define onboard SD detect +#endif -#define PS_ON_PIN 40 // Used by CR2020 Industrial series +#ifndef PS_ON_PIN + #define PS_ON_PIN 40 // Used by CR2020 Industrial series +#endif #if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) #define CASE_LIGHT_PIN 65 @@ -59,4 +63,6 @@ #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 +#ifndef SUICIDE_PIN_INVERTING + #define SUICIDE_PIN_INVERTING true +#endif diff --git a/Marlin/src/pins/ramps/pins_RAMPS_DAGOMA.h b/Marlin/src/pins/ramps/pins_RAMPS_DAGOMA.h index b0ba7822ef..ad56b7f9d1 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_DAGOMA.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_DAGOMA.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -32,7 +32,9 @@ #define Z_STOP_PIN 15 #define FIL_RUNOUT_PIN 39 -#define ORIG_E0_AUTO_FAN_PIN 7 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN 7 +#endif // // Import RAMPS 1.4 pins diff --git a/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h b/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h index d6b08a1d68..513c7fe8d5 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_RAMPS_OLD.h b/Marlin/src/pins/ramps/pins_RAMPS_OLD.h index 0323366944..d154b2fdd0 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_OLD.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_OLD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -106,7 +106,10 @@ #define SDPOWER_PIN 48 #define SDSS 53 #define LED_PIN 13 -#define CASE_LIGHT_PIN 45 // Hardware PWM + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 45 // Hardware PWM +#endif // // M3/M4/M5 - Spindle/Laser Control diff --git a/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h b/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h index f93b6dcc86..9af4a3e05c 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_RIGIDBOARD.h b/Marlin/src/pins/ramps/pins_RIGIDBOARD.h index 8e84281754..c43d786aa2 100644 --- a/Marlin/src/pins/ramps/pins_RIGIDBOARD.h +++ b/Marlin/src/pins/ramps/pins_RIGIDBOARD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -97,7 +97,6 @@ // Misc. Functions // #undef PS_ON_PIN -#define PS_ON_PIN -1 // // LCD / Controller @@ -120,9 +119,7 @@ // 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 diff --git a/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h b/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h index d56ab1bb7f..406cbec816 100644 --- a/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h +++ b/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_RL200.h b/Marlin/src/pins/ramps/pins_RL200.h index 7b0303476b..3fccb90276 100644 --- a/Marlin/src/pins/ramps/pins_RL200.h +++ b/Marlin/src/pins/ramps/pins_RL200.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_RUMBA.h b/Marlin/src/pins/ramps/pins_RUMBA.h index 4bf10d7399..5b4f830328 100644 --- a/Marlin/src/pins/ramps/pins_RUMBA.h +++ b/Marlin/src/pins/ramps/pins_RUMBA.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -153,7 +153,10 @@ #define LED_PIN 13 #define PS_ON_PIN 45 #define KILL_PIN 46 -#define CASE_LIGHT_PIN 45 + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 45 +#endif // // M3/M4/M5 - Spindle/Laser Control diff --git a/Marlin/src/pins/ramps/pins_RUMBA_RAISE3D.h b/Marlin/src/pins/ramps/pins_RUMBA_RAISE3D.h index 7dfa747bf4..39942613ff 100644 --- a/Marlin/src/pins/ramps/pins_RUMBA_RAISE3D.h +++ b/Marlin/src/pins/ramps/pins_RUMBA_RAISE3D.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h b/Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h index 2e94490460..e15fc94ac4 100644 --- a/Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h +++ b/Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_TANGO.h b/Marlin/src/pins/ramps/pins_TANGO.h index 221b30b0cb..715444cee2 100644 --- a/Marlin/src/pins/ramps/pins_TANGO.h +++ b/Marlin/src/pins/ramps/pins_TANGO.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -30,7 +30,9 @@ #define FAN_PIN 8 #define FAN1_PIN -1 -#define ORIG_E0_AUTO_FAN_PIN 7 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN 7 +#endif #ifndef TEMP_0_PIN #if TEMP_SENSOR_0 == -1 diff --git a/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h b/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h new file mode 100644 index 0000000000..98a20fb3fd --- /dev/null +++ b/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h @@ -0,0 +1,185 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Tenlog pin assignments + */ + +#ifndef __AVR_ATmega2560__ + #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "Tenlog supports up to 2 hotends / E-steppers. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "Tenlog D3 Hero" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME + +// +// Servos +// +#define SERVO0_PIN 11 +#define SERVO1_PIN 6 +#define SERVO2_PIN -1 // Original pin 5 used for hotend fans +#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 // Connected to "DJ" plug on extruder heads +#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 15 // Ramps is normally 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 X2_STEP_PIN 36 +#define X2_DIR_PIN 34 +#define X2_ENABLE_PIN 30 +//#ifndef X2_CS_PIN + //#define X2_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 Z2_STEP_PIN 65 +#define Z2_DIR_PIN 66 +#define Z2_ENABLE_PIN 64 +//#ifndef Z2_CS_PIN + //#define Z2_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 57 +#define E1_DIR_PIN 58 +#define E1_ENABLE_PIN 59 +//#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 -1 // Don't use 53 if using Display/SD card +#else + #define MAX6675_SS_PIN -1 // Don't use 49 (SD_DETECT_PIN) +#endif + +// +// Heaters / Fans +// +#define HEATER_0_PIN 10 +#define HEATER_1_PIN 11 +#define HEATER_BED_PIN 8 + +#define FAN_PIN 9 +#define FAN1_PIN 5 // Normall this would be a servo pin + +// XXX Runout support unknown? +//#define NUM_RUNOUT_SENSORS 0 +//#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 +// + +//#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + +#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 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 -1 +//#endif + +//#endif // REPRAP_DISCOUNT_SMART_CONTROLLER diff --git a/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h b/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h index c0b8630354..9508be0173 100644 --- a/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h +++ b/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -28,9 +28,12 @@ #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 +#define RAMPS_D9_PIN 44 +#define FAN2_PIN 9 + +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN 9 +#endif #include "pins_RAMPS_13.h" diff --git a/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h b/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h index f32f006e92..6382d3af51 100644 --- a/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h +++ b/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -38,15 +38,38 @@ #endif // -// Custom Limit Switches +// Limit Switches // //#define ANYCUBIC_4_MAX_PRO_ENDSTOPS + +#define X_MIN_PIN 3 + #if ENABLED(ANYCUBIC_4_MAX_PRO_ENDSTOPS) #define X_MAX_PIN 43 - #define Y_MIN_PIN 19 +#else + #define X_MAX_PIN 43 #endif -// Labeled pins +#if ENABLED(ANYCUBIC_4_MAX_PRO_ENDSTOPS) + #define Y_STOP_PIN 19 +#else + #define Y_STOP_PIN 42 +#endif + +#define Z_STOP_PIN 18 + +// +// Z Probe (when not Z_MIN_PIN) +// +#define Z_MIN_PROBE_PIN 2 + +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN 19 +#endif + +// +// Heaters / Fans +// #define TG_HEATER_BED_PIN 8 #define TG_HEATER_0_PIN 10 #define TG_HEATER_1_PIN 45 // Anycubic Kossel: Unused @@ -55,11 +78,16 @@ #define TG_FAN1_PIN 7 // Anycubic Kossel: Unused #define TG_FAN2_PIN 44 // Anycubic Kossel: Hotend fan +#define CONTROLLER_FAN_PIN TG_FAN1_PIN + +#define BEEPER_PIN 31 +#define SD_DETECT_PIN 49 + // Remap MOSFET pins to common usages: #define RAMPS_D10_PIN TG_HEATER_0_PIN // HEATER_0_PIN is always RAMPS_D10_PIN in pins_RAMPS.h -#if HOTENDS > 1 // EEF and EEB +#if HAS_MULTI_HOTEND // EEF and EEB #define RAMPS_D9_PIN TG_HEATER_1_PIN #if !TEMP_SENSOR_BED // EEF @@ -79,11 +107,14 @@ #define RAMPS_D8_PIN TG_FAN0_PIN #endif -#if HOTENDS > 1 || TEMP_SENSOR_BED // EEF, EEB, EFB +#if HAS_MULTI_HOTEND || TEMP_SENSOR_BED // EEF, EEB, EFB #define FAN1_PIN TG_FAN1_PIN #endif #define FAN2_PIN TG_FAN2_PIN -#define ORIG_E0_AUTO_FAN_PIN TG_FAN2_PIN // Used in Anycubic Kossel example config + +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN TG_FAN2_PIN // Used in Anycubic Kossel example config +#endif #include "pins_RAMPS.h" diff --git a/Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h b/Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h index 92ed852867..d02a063e80 100644 --- a/Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h +++ b/Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/ramps/pins_TT_OSCAR.h b/Marlin/src/pins/ramps/pins_TT_OSCAR.h index f5c79d0b57..ab3dc1a32b 100644 --- a/Marlin/src/pins/ramps/pins_TT_OSCAR.h +++ b/Marlin/src/pins/ramps/pins_TT_OSCAR.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -392,7 +392,7 @@ #elif ENABLED(LCD_I2C_VIKI) - #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. + #define BTN_EN1 22 // https://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 diff --git a/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h b/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h index 776dfcc3da..cbf9523eac 100644 --- a/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -98,7 +98,9 @@ #define FAN_PIN 7 #endif -#define ORIG_E0_AUTO_FAN_PIN 77 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN 77 +#endif // // Misc. Functions diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER.h b/Marlin/src/pins/ramps/pins_ULTIMAKER.h index 8cc588a2f9..f316fad778 100644 --- a/Marlin/src/pins/ramps/pins_ULTIMAKER.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAKER.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -111,7 +111,10 @@ #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 + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 8 +#endif // // LCD / Controller diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h index dc12442224..9558015584 100644 --- a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -115,7 +115,7 @@ // // Z Probe (when not Z_MIN_PIN) // -#if !defined(Z_MIN_PROBE_PIN) && !(HAS_CUTTER && ENABLED(BOARD_REV_1_0)) +#if !defined(Z_MIN_PROBE_PIN) && !BOTH(HAS_CUTTER, BOARD_REV_1_0) #define Z_MIN_PROBE_PIN Z_MAX_PIN #endif @@ -134,7 +134,7 @@ #define Z_DIR_PIN 39 #define Z_ENABLE_PIN 35 -#if HAS_CUTTER && ENABLED(BOARD_REV_1_1_TO_1_3) && EXTRUDERS == 1 +#if BOTH(HAS_CUTTER, 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 diff --git a/Marlin/src/pins/ramps/pins_VORON.h b/Marlin/src/pins/ramps/pins_VORON.h index 12c0a36db1..40ec71b6f0 100644 --- a/Marlin/src/pins/ramps/pins_VORON.h +++ b/Marlin/src/pins/ramps/pins_VORON.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -38,8 +38,16 @@ #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) + +// +// Auto fans +// +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN 6 // Servo pin 6 for E3D Fan +#endif +#ifndef E1_AUTO_FAN_PIN + #define E1_AUTO_FAN_PIN 6 // Servo pin 6 for E3D Fan (same pin for both extruders since it's the same fan) +#endif // // LCDs and Controllers diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V20.h b/Marlin/src/pins/ramps/pins_ZRIB_V20.h index 5aee07c96f..90433c62d7 100644 --- a/Marlin/src/pins/ramps/pins_ZRIB_V20.h +++ b/Marlin/src/pins/ramps/pins_ZRIB_V20.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -39,10 +39,21 @@ #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 +// +// Auto fans +// +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN ZRIB_V20_D6_PIN +#endif +#ifndef E1_AUTO_FAN_PIN + #define E1_AUTO_FAN_PIN ZRIB_V20_D6_PIN +#endif +#ifndef E2_AUTO_FAN_PIN + #define E2_AUTO_FAN_PIN ZRIB_V20_D6_PIN +#endif +#ifndef E3_AUTO_FAN_PIN + #define E3_AUTO_FAN_PIN ZRIB_V20_D6_PIN +#endif #ifndef FILWIDTH_PIN #define FILWIDTH_PIN 11 // Analog Input @@ -58,6 +69,13 @@ #undef ADC_KEYPAD_PIN #undef BEEPER_PIN + #undef SHIFT_OUT + #undef SHIFT_CLK + #undef SHIFT_LD + #undef BTN_EN1 + #undef BTN_EN2 + #undef BTN_ENC + #define LCD_PINS_RS ZRIB_V20_D16_PIN #define LCD_PINS_ENABLE ZRIB_V20_D17_PIN #define LCD_PINS_D4 ZRIB_V20_D23_PIN diff --git a/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h b/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h index f55ec51567..4bf63f348f 100644 --- a/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h +++ b/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sam/pins_ADSK.h b/Marlin/src/pins/sam/pins_ADSK.h index 61c2e1b494..289fa462cc 100644 --- a/Marlin/src/pins/sam/pins_ADSK.h +++ b/Marlin/src/pins/sam/pins_ADSK.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -175,12 +175,12 @@ A stepper for E0 extruder #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 + #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 + #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) diff --git a/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h b/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h index c74e1b72eb..7cd81456b1 100644 --- a/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h +++ b/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sam/pins_ARCHIM1.h b/Marlin/src/pins/sam/pins_ARCHIM1.h index 606e024697..134049781a 100644 --- a/Marlin/src/pins/sam/pins_ARCHIM1.h +++ b/Marlin/src/pins/sam/pins_ARCHIM1.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -46,6 +46,7 @@ // // Timers // +// These are already defined in DUE, so must be undefined first #define STEP_TIMER_NUM 3 #define HAL_STEP_TIMER_ISR() void TC3_Handler() diff --git a/Marlin/src/pins/sam/pins_ARCHIM2.h b/Marlin/src/pins/sam/pins_ARCHIM2.h index d2114ea433..bbd4804dbd 100644 --- a/Marlin/src/pins/sam/pins_ARCHIM2.h +++ b/Marlin/src/pins/sam/pins_ARCHIM2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -216,7 +216,9 @@ // Case Light -#define CASE_LIGHT_PIN GPIO_PB1_J20_5 +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN GPIO_PB1_J20_5 +#endif // 2MB SPI Flash #define SPI_FLASH_SS 52 // D52 PB21 diff --git a/Marlin/src/pins/sam/pins_CNCONTROLS_15D.h b/Marlin/src/pins/sam/pins_CNCONTROLS_15D.h index f23d008bec..b977ad1aba 100644 --- a/Marlin/src/pins/sam/pins_CNCONTROLS_15D.h +++ b/Marlin/src/pins/sam/pins_CNCONTROLS_15D.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -93,11 +93,26 @@ // 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 + +// +// Auto fans +// +#define AUTO_FAN_PIN 30 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E1_AUTO_FAN_PIN + #define E1_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E2_AUTO_FAN_PIN + #define E2_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef E3_AUTO_FAN_PIN + #define E3_AUTO_FAN_PIN AUTO_FAN_PIN +#endif +#ifndef CHAMBER_AUTO_FAN_PIN + #define CHAMBER_AUTO_FAN_PIN 10 +#endif // // SD card diff --git a/Marlin/src/pins/sam/pins_DUE3DOM.h b/Marlin/src/pins/sam/pins_DUE3DOM.h index 8f1fb75012..e0a56137f7 100644 --- a/Marlin/src/pins/sam/pins_DUE3DOM.h +++ b/Marlin/src/pins/sam/pins_DUE3DOM.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h b/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h index 34706d5e90..9a488e3126 100644 --- a/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h +++ b/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h b/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h index b3a9e456a2..5d8716b678 100644 --- a/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h +++ b/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sam/pins_RADDS.h b/Marlin/src/pins/sam/pins_RADDS.h index 3bc52e9387..78231afaff 100644 --- a/Marlin/src/pins/sam/pins_RADDS.h +++ b/Marlin/src/pins/sam/pins_RADDS.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -31,6 +31,14 @@ #define BOARD_INFO_NAME "RADDS" +// +// EEPROM +// +#if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM) + #define I2C_EEPROM + #define MARLIN_EEPROM_SIZE 0x2000 // 8KB +#endif + // // Servos // @@ -205,9 +213,6 @@ #define FIL_RUNOUT_PIN 39 // SERVO2_PIN #endif -#define I2C_EEPROM -#define E2END 0x1FFF // 8KB - // // M3/M4/M5 - Spindle/Laser Control // diff --git a/Marlin/src/pins/sam/pins_RAMPS4DUE.h b/Marlin/src/pins/sam/pins_RAMPS4DUE.h index 21a2055967..2bd894f9ae 100644 --- a/Marlin/src/pins/sam/pins_RAMPS4DUE.h +++ b/Marlin/src/pins/sam/pins_RAMPS4DUE.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -44,6 +44,7 @@ #endif #define BOARD_INFO_NAME "RAMPS4DUE" + #define IS_RAMPS4DUE // diff --git a/Marlin/src/pins/sam/pins_RAMPS_DUO.h b/Marlin/src/pins/sam/pins_RAMPS_DUO.h index 916dbf6430..5f8864ab14 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_DUO.h +++ b/Marlin/src/pins/sam/pins_RAMPS_DUO.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -50,6 +50,7 @@ #define BOARD_INFO_NAME "RAMPS Duo" #define IS_RAMPS_DUO + #include "../ramps/pins_RAMPS.h" // diff --git a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h index 297aaa9cb8..eb9889607d 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h +++ b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sam/pins_RAMPS_FD_V2.h b/Marlin/src/pins/sam/pins_RAMPS_FD_V2.h index 6e7d055069..55a42b2a47 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_FD_V2.h +++ b/Marlin/src/pins/sam/pins_RAMPS_FD_V2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -41,7 +41,7 @@ #undef INVERTED_FAN_PINS #define I2C_EEPROM -#define E2END 0xFFFF // 64K in a 24C512 +#define MARLIN_EEPROM_SIZE 0x10000 // 64K in a 24C512 #ifndef PS_ON_PIN #define PS_ON_PIN 12 diff --git a/Marlin/src/pins/sam/pins_RAMPS_SMART.h b/Marlin/src/pins/sam/pins_RAMPS_SMART.h index 0fd4a6b3ea..4c26d19caf 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_SMART.h +++ b/Marlin/src/pins/sam/pins_RAMPS_SMART.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -65,13 +65,12 @@ #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 MARLIN_EEPROM_SIZE 0x1000 #define RESET_PIN 42 // Resets the board if the jumper is attached diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h index 7b844b5be0..22353611b6 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * * Ported sys0724 & Vynt */ @@ -186,7 +186,7 @@ // // EEPROM // -#define E2END 0x7FFF // 32Kb (24lc256) +#define MARLIN_EEPROM_SIZE 0x8000 // 32Kb (24lc256) #define I2C_EEPROM // EEPROM on I2C-0 //#define EEPROM_SD // EEPROM on SDCARD //#define SPI_EEPROM // EEPROM on SPI-0 diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h index 3ba6fd17cf..19b8ac9775 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * * Ported sys0724 & Vynt */ @@ -172,7 +172,7 @@ // // EEPROM // -#define E2END 0x7FFF // 32Kb (24lc256) +#define MARLIN_EEPROM_SIZE 0x8000 // 32Kb (24lc256) #define I2C_EEPROM // EEPROM on I2C-0 //#define EEPROM_SD // EEPROM on SDCARD //#define SPI_EEPROM // EEPROM on SPI-0 @@ -240,8 +240,6 @@ #elif ENABLED(MKS_MINI_12864) - #define ORIG_BEEPER_PIN 62 - #define DOGLCD_A0 52 #define DOGLCD_CS 50 diff --git a/Marlin/src/pins/sam/pins_ULTRATRONICS_PRO.h b/Marlin/src/pins/sam/pins_ULTRATRONICS_PRO.h index ae01d5da4c..671307bc00 100644 --- a/Marlin/src/pins/sam/pins_ULTRATRONICS_PRO.h +++ b/Marlin/src/pins/sam/pins_ULTRATRONICS_PRO.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/samd/pins_RAMPS_144.h b/Marlin/src/pins/samd/pins_RAMPS_144.h index f02a8b86bd..319584b5eb 100644 --- a/Marlin/src/pins/samd/pins_RAMPS_144.h +++ b/Marlin/src/pins/samd/pins_RAMPS_144.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -46,7 +46,7 @@ // //#define QSPI_EEPROM // Use AGCM4 onboard QSPI EEPROM (Uses 4K of RAM) #define I2C_EEPROM // EEPROM on I2C-0 -#define E2END 0x7FFF // 32K (24lc256) +#define MARLIN_EEPROM_SIZE 0x8000 // 32K (24lc256) // // Limit Switches @@ -129,9 +129,8 @@ #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 + #define FIL_RUNOUT_PIN 70 #endif #ifndef PS_ON_PIN @@ -296,55 +295,55 @@ #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) // TO TEST - // #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 + //#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) // TO TEST - // #define LCD_PINS_RS 40 - // #define LCD_PINS_ENABLE 42 - // #define LCD_PINS_D4 57 // Mega/Due:65 - AGCM4:57 - // #define LCD_PINS_D5 58 // Mega/Due:66 - AGCM4:58 - // #define LCD_PINS_D6 44 - // #define LCD_PINS_D7 56 // Mega/Due:64 - AGCM4:56 + //#define LCD_PINS_RS 40 + //#define LCD_PINS_ENABLE 42 + //#define LCD_PINS_D4 57 // Mega/Due:65 - AGCM4:57 + //#define LCD_PINS_D5 58 // Mega/Due:66 - AGCM4:58 + //#define LCD_PINS_D6 44 + //#define LCD_PINS_D7 56 // Mega/Due:64 - AGCM4:56 #else #if ENABLED(CR10_STOCKDISPLAY) // TO TEST - // #define LCD_PINS_RS 27 - // #define LCD_PINS_ENABLE 29 - // #define LCD_PINS_D4 25 + //#define LCD_PINS_RS 27 + //#define LCD_PINS_ENABLE 29 + //#define LCD_PINS_D4 25 #if DISABLED(NEWPANEL) // TO TEST - // #define BEEPER_PIN 37 + //#define BEEPER_PIN 37 #endif #elif ENABLED(ZONESTAR_LCD) // TO TEST - // #define LCD_PINS_RS 56 // Mega/Due:64 - AGCM4:56 - // #define LCD_PINS_ENABLE 44 - // #define LCD_PINS_D4 55 // Mega/Due:63 - AGCM4:55 - // #define LCD_PINS_D5 40 - // #define LCD_PINS_D6 42 - // #define LCD_PINS_D7 57 // Mega/Due:65 - AGCM4:57 + //#define LCD_PINS_RS 56 // Mega/Due:64 - AGCM4:56 + //#define LCD_PINS_ENABLE 44 + //#define LCD_PINS_D4 55 // Mega/Due:63 - AGCM4:55 + //#define LCD_PINS_D5 40 + //#define LCD_PINS_D6 42 + //#define LCD_PINS_D7 57 // Mega/Due:65 - AGCM4:57 #else #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306) // TO TEST - // #define LCD_PINS_DC 25 // Set as output on init - // #define LCD_PINS_RS 27 // Pull low for 1s to init + //#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 + //#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 @@ -383,8 +382,8 @@ #if ENABLED(CR10_STOCKDISPLAY) // TO TEST - // #define BTN_EN1 17 - // #define BTN_EN2 23 + //#define BTN_EN1 17 + //#define BTN_EN2 23 #else #define BTN_EN1 31 #define BTN_EN2 33 @@ -398,70 +397,70 @@ #if ENABLED(BQ_LCD_SMART_CONTROLLER) // TO TEST - // #define LCD_BACKLIGHT_PIN 39 + //#define LCD_BACKLIGHT_PIN 39 #endif #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) // TO TEST - // #define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 - // #define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 - // #define BTN_ENC 55 - // #define SD_DETECT_PIN 42 + //#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 + //#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 + //#define BTN_ENC 55 + //#define SD_DETECT_PIN 42 #elif ENABLED(LCD_I2C_PANELOLU2) // TO TEST - // #define BTN_EN1 47 - // #define BTN_EN2 43 - // #define BTN_ENC 32 - // #define LCD_SDSS SDSS - // #define KILL_PIN 41 + //#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) // TO TEST - // #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 BTN_EN1 40 // https://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 + //#define LCD_SDSS SDSS + //#define SD_DETECT_PIN 49 #elif ANY(VIKI2, miniVIKI) // TO TEST - // #define DOGLCD_CS 45 - // #define DOGLCD_A0 44 - // #define LCD_SCREEN_ROT_180 + //#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 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 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 + //#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) // TO TEST - // #define DOGLCD_CS 29 - // #define DOGLCD_A0 27 + //#define DOGLCD_CS 29 + //#define DOGLCD_A0 27 - // #define BEEPER_PIN 23 - // #define LCD_BACKLIGHT_PIN 33 + //#define BEEPER_PIN 23 + //#define LCD_BACKLIGHT_PIN 33 - // #define BTN_EN1 35 - // #define BTN_EN2 37 - // #define BTN_ENC 31 + //#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 + //#define LCD_SDSS SDSS + //#define SD_DETECT_PIN 49 + //#define KILL_PIN 41 #elif EITHER(MKS_MINI_12864, FYSETC_MINI_12864) @@ -474,56 +473,56 @@ // #define KILL_PIN 41 //#endif - #if ENABLED(MKS_MINI_12864) // Added in Marlin 1.1.6 + #if ENABLED(MKS_MINI_12864) // TO TEST - // #define DOGLCD_A0 27 - // #define DOGLCD_CS 25 + //#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 LCD_SCREEN_ROT_90 + //#define LCD_SCREEN_ROT_180 + //#define LCD_SCREEN_ROT_270 // not connected to a pin - // #define LCD_BACKLIGHT_PIN 57 // backlight LED on A11/D? (Mega/Due:65 - AGCM4:57) + //#define LCD_BACKLIGHT_PIN 57 // backlight LED on A11/D? (Mega/Due:65 - AGCM4:57) - // #define BTN_EN1 31 - // #define BTN_EN2 33 + //#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 // TO TEST - // #define DOGLCD_A0 16 - // #define DOGLCD_CS 17 + //#define DOGLCD_A0 16 + //#define DOGLCD_CS 17 - // #define BTN_EN1 33 - // #define BTN_EN2 31 + //#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. + //#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 // TO TEST - // #define RGB_LED_R_PIN 25 + //#define RGB_LED_R_PIN 25 #endif #ifndef RGB_LED_G_PIN // TO TEST - // #define RGB_LED_G_PIN 27 + //#define RGB_LED_G_PIN 27 #endif #ifndef RGB_LED_B_PIN // TO TEST - // #define RGB_LED_B_PIN 29 + //#define RGB_LED_B_PIN 29 #endif #elif ENABLED(FYSETC_MINI_12864_2_1) // TO TEST - // #define NEOPIXEL_PIN 25 + //#define NEOPIXEL_PIN 25 #endif #endif @@ -531,30 +530,30 @@ #elif ENABLED(MINIPANEL) // TO TEST - // #define BEEPER_PIN 42 + //#define BEEPER_PIN 42 // not connected to a pin - // #define LCD_BACKLIGHT_PIN 57 // backlight LED on A11/D? (Mega/Due:65 - AGCM4:57) + //#define LCD_BACKLIGHT_PIN 57 // backlight LED on A11/D? (Mega/Due:65 - AGCM4:57) - // #define DOGLCD_A0 44 - // #define DOGLCD_CS 58 // Mega/Due:66 - AGCM4:58 + //#define DOGLCD_A0 44 + //#define DOGLCD_CS 58 // Mega/Due:66 - AGCM4:58 // GLCD features // Uncomment screen orientation - // #define LCD_SCREEN_ROT_90 - // #define LCD_SCREEN_ROT_180 - // #define LCD_SCREEN_ROT_270 + //#define LCD_SCREEN_ROT_90 + //#define LCD_SCREEN_ROT_180 + //#define LCD_SCREEN_ROT_270 - // #define BTN_EN1 40 - // #define BTN_EN2 55 // Mega/Due:63 - AGCM4:55 - // #define BTN_ENC 72 // Mega/Due:59 - AGCM4:72 + //#define BTN_EN1 40 + //#define BTN_EN2 55 // Mega/Due:63 - AGCM4:55 + //#define BTN_ENC 72 // Mega/Due:59 - AGCM4:72 - // #define SD_DETECT_PIN 49 - // #define KILL_PIN 56 // Mega/Due:64 - AGCM4:56 + //#define SD_DETECT_PIN 49 + //#define KILL_PIN 56 // Mega/Due:64 - AGCM4:56 #elif ENABLED(ZONESTAR_LCD) // TO TEST - // #define ADC_KEYPAD_PIN 12 + //#define ADC_KEYPAD_PIN 12 #elif ENABLED(AZSMZ_12864) @@ -563,33 +562,33 @@ #else // Beeper on AUX-4 - // #define BEEPER_PIN 33 + //#define BEEPER_PIN 33 // Buttons are directly attached to AUX-2 #if ENABLED(REPRAPWORLD_KEYPAD) // TO TEST - // #define SHIFT_OUT 40 - // #define SHIFT_CLK 44 - // #define SHIFT_LD 42 - // #define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 - // #define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 - // #define BTN_ENC 55 // Mega/Due:63 - AGCM4:55 + //#define SHIFT_OUT 40 + //#define SHIFT_CLK 44 + //#define SHIFT_LD 42 + //#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 + //#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 + //#define BTN_ENC 55 // Mega/Due:63 - AGCM4:55 #elif ENABLED(PANEL_ONE) // TO TEST - // #define BTN_EN1 72 // AUX2 PIN 3 (Mega/Due:59 - AGCM4:72) - // #define BTN_EN2 55 // AUX2 PIN 4 (Mega/Due:63 - AGCM4:55) - // #define BTN_ENC 49 // AUX3 PIN 7 + //#define BTN_EN1 72 // AUX2 PIN 3 (Mega/Due:59 - AGCM4:72) + //#define BTN_EN2 55 // AUX2 PIN 4 (Mega/Due:63 - AGCM4:55) + //#define BTN_ENC 49 // AUX3 PIN 7 #else // TO TEST - // #define BTN_EN1 37 - // #define BTN_EN2 35 - // #define BTN_ENC 31 + //#define BTN_EN1 37 + //#define BTN_EN2 35 + //#define BTN_ENC 31 #endif #if ENABLED(G3D_PANEL) // TO TEST - // #define SD_DETECT_PIN 49 - // #define KILL_PIN 41 + //#define SD_DETECT_PIN 49 + //#define KILL_PIN 41 #endif #endif diff --git a/Marlin/src/pins/sanguino/pins_ANET_10.h b/Marlin/src/pins/sanguino/pins_ANET_10.h index 73145a3cdb..a2ef1e2c17 100644 --- a/Marlin/src/pins/sanguino/pins_ANET_10.h +++ b/Marlin/src/pins/sanguino/pins_ANET_10.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -82,7 +82,7 @@ * Additional info: * * Anet Schematics - https://github.com/ralf-e/ANET-3D-Board-V1.0 - * Wiring RRDFG Smart Controller - http://www.thingiverse.com/thing:2103748 + * Wiring RRDFG Smart Controller - https://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/ * @@ -209,7 +209,7 @@ * ==================================================================== * * Anet V1.0 controller | ZONESTAR_LCD | ANET_FULL_ | RepRapDiscount Full | Thingiverse RepRap wiring - * physical logical alt | | GRAPHICS_LCD | Graphics Display Wiring | http://www.thingiverse + * physical logical alt | | GRAPHICS_LCD | Graphics Display Wiring | https://www.thingiverse * pin pin functions | | | | .com/thing:2103748 *------------------------------------------------------------------------------------------------------------------------ * ANET-J3.1 8 *** | N/A | J3_TX *** | | diff --git a/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h b/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h index 4c991c5e9e..c3c38eb6f3 100644 --- a/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h +++ b/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sanguino/pins_GEN3_MONOLITHIC.h b/Marlin/src/pins/sanguino/pins_GEN3_MONOLITHIC.h index b9a917d65d..901e326742 100644 --- a/Marlin/src/pins/sanguino/pins_GEN3_MONOLITHIC.h +++ b/Marlin/src/pins/sanguino/pins_GEN3_MONOLITHIC.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sanguino/pins_GEN3_PLUS.h b/Marlin/src/pins/sanguino/pins_GEN3_PLUS.h index 6cd6fdaf27..a28b4c039c 100644 --- a/Marlin/src/pins/sanguino/pins_GEN3_PLUS.h +++ b/Marlin/src/pins/sanguino/pins_GEN3_PLUS.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sanguino/pins_GEN6.h b/Marlin/src/pins/sanguino/pins_GEN6.h index 0d2449ae6e..ad54f3cd76 100644 --- a/Marlin/src/pins/sanguino/pins_GEN6.h +++ b/Marlin/src/pins/sanguino/pins_GEN6.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -106,7 +106,10 @@ // #define SDSS 17 #define DEBUG_PIN 0 -#define CASE_LIGHT_PIN 16 // Hardware PWM + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 16 // Hardware PWM +#endif // RS485 pins #define TX_ENABLE_PIN 12 diff --git a/Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h b/Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h index 14e1c67b6f..a40c2ec15f 100644 --- a/Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h +++ b/Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sanguino/pins_GEN7_12.h b/Marlin/src/pins/sanguino/pins_GEN7_12.h index bb0e44a300..75b75cdc6f 100644 --- a/Marlin/src/pins/sanguino/pins_GEN7_12.h +++ b/Marlin/src/pins/sanguino/pins_GEN7_12.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sanguino/pins_GEN7_13.h b/Marlin/src/pins/sanguino/pins_GEN7_13.h index 728dfd8a5c..6743c8cf75 100644 --- a/Marlin/src/pins/sanguino/pins_GEN7_13.h +++ b/Marlin/src/pins/sanguino/pins_GEN7_13.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sanguino/pins_GEN7_14.h b/Marlin/src/pins/sanguino/pins_GEN7_14.h index 9dc9f2808b..af0d824151 100644 --- a/Marlin/src/pins/sanguino/pins_GEN7_14.h +++ b/Marlin/src/pins/sanguino/pins_GEN7_14.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -102,7 +102,10 @@ // Misc. Functions // #define PS_ON_PIN 15 -#define CASE_LIGHT_PIN 15 // Hardware PWM + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 15 // Hardware PWM +#endif // A pin for debugging #define DEBUG_PIN 0 diff --git a/Marlin/src/pins/sanguino/pins_GEN7_CUSTOM.h b/Marlin/src/pins/sanguino/pins_GEN7_CUSTOM.h index 67a9762fa0..27ec622fce 100644 --- a/Marlin/src/pins/sanguino/pins_GEN7_CUSTOM.h +++ b/Marlin/src/pins/sanguino/pins_GEN7_CUSTOM.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -104,7 +104,10 @@ // #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 + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 15 // Hardware PWM +#endif // A pin for debugging #define DEBUG_PIN -1 diff --git a/Marlin/src/pins/sanguino/pins_MELZI.h b/Marlin/src/pins/sanguino/pins_MELZI.h index b73c1150de..887aae1858 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI.h +++ b/Marlin/src/pins/sanguino/pins_MELZI.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h index 10a52705e7..4817ce8043 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -28,11 +28,26 @@ * 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/ + * See https://www.instructables.com/id/Burn-Arduino-Bootloader-with-Arduino-MEGA/ + * + * Schematic: https://bit.ly/2XOnsWb */ #define BOARD_INFO_NAME "Melzi (Creality)" +// Alter timing for graphical display +#if HAS_GRAPHICAL_LCD + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) + #endif +#endif + #include "pins_MELZI.h" // @@ -46,7 +61,6 @@ #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 @@ -56,13 +70,13 @@ #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) +#elif ENABLED(FILAMENT_RUNOUT_SENSOR) + #ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN 27 + #endif + #if FIL_RUNOUT_PIN == BEEPER_PIN + #undef BEEPER_PIN + #endif #endif #if ENABLED(MINIPANEL) @@ -116,3 +130,14 @@ PIN: 30 Port: A1 LCD_PINS_D4 Output = 1 PIN: 31 Port: A0 SDSS Output = 1 */ + +/** + * EXP1 Connector EXP1 as CR10 STOCKDISPLAY + * _____ _____ + * PA4 | 6 5 | PC0 BEEPER_PIN | 6 5 | BTN_ENC + * PD3 | 7 4 | RESET BTN_EN1 | 7 4 | RESET + * PD2 8 3 | PA1 BTN_EN2 8 3 | LCD_PINS_D4 (ST9720 CLK) + * PA3 | 9 2 | PC1 (ST9720 CS) LCD_PINS_RS | 9 2 | LCD_PINS_ENABLE (ST9720 DAT) + * GND |10 1 | 5V GND |10 1 | 5V + * ----- ----- + */ diff --git a/Marlin/src/pins/sanguino/pins_MELZI_MAKR3D.h b/Marlin/src/pins/sanguino/pins_MELZI_MAKR3D.h index 59baa2d6dd..0e09c1f005 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_MAKR3D.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_MAKR3D.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h b/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h index 8e682453b4..8128fb86e6 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -26,6 +26,20 @@ */ #define BOARD_INFO_NAME "Melzi (Malyan)" + +// Alter timing for graphical display +#if HAS_GRAPHICAL_LCD + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) + #endif +#endif + #include "pins_MELZI.h" #undef LCD_SDSS @@ -42,10 +56,3 @@ #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/src/pins/sanguino/pins_MELZI_TRONXY.h b/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h index 88b80dfb89..9e433f19c4 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -26,6 +26,19 @@ */ #define BOARD_INFO_NAME "Melzi (Tronxy)" + +#if HAS_GRAPHICAL_LCD + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(0) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(0) + #endif +#endif + #include "pins_MELZI.h" #undef Z_ENABLE_PIN @@ -50,9 +63,3 @@ #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/src/pins/sanguino/pins_MELZI_V2.h b/Marlin/src/pins/sanguino/pins_MELZI_V2.h new file mode 100644 index 0000000000..1cdf51117f --- /dev/null +++ b/Marlin/src/pins/sanguino/pins_MELZI_V2.h @@ -0,0 +1,39 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 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 + +/** + * Melzi V2.0 as found at https://www.reprap.org/wiki/Melzi + */ + +#define BOARD_INFO_NAME "Melzi V2" + +#if HAS_GRAPHICAL_LCD + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(0) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(188) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(0) + #endif +#endif + +#include "pins_MELZI.h" diff --git a/Marlin/src/pins/sanguino/pins_OMCA.h b/Marlin/src/pins/sanguino/pins_OMCA.h index 6d9d0f2505..8e4c6d2b64 100644 --- a/Marlin/src/pins/sanguino/pins_OMCA.h +++ b/Marlin/src/pins/sanguino/pins_OMCA.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sanguino/pins_OMCA_A.h b/Marlin/src/pins/sanguino/pins_OMCA_A.h index 73237743b8..922ef69b5e 100644 --- a/Marlin/src/pins/sanguino/pins_OMCA_A.h +++ b/Marlin/src/pins/sanguino/pins_OMCA_A.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h index 50d3a53779..83c2d56d2b 100644 --- a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h +++ b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -166,9 +166,15 @@ #define LCD_PINS_ENABLE 16 #define LCD_PINS_D4 11 - #define BOARD_ST7920_DELAY_1 DELAY_NS(0) - #define BOARD_ST7920_DELAY_2 DELAY_NS(188) - #define BOARD_ST7920_DELAY_3 DELAY_NS(0) + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(0) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(188) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(0) + #endif #elif ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0 @@ -180,6 +186,19 @@ // Marlin so this can be used for BEEPER_PIN. You can use this pin // with M42 instead of BEEPER_PIN. #define BEEPER_PIN 27 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(0) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(188) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(0) + #endif + #endif + #else // Sanguinololu >=1.3 #define LCD_PINS_RS 4 #define LCD_PINS_ENABLE 17 diff --git a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h index 3254a01a15..c5c8b4f57e 100644 --- a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h +++ b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sanguino/pins_SETHI.h b/Marlin/src/pins/sanguino/pins_SETHI.h index b945869cbc..19fea9ff53 100644 --- a/Marlin/src/pins/sanguino/pins_SETHI.h +++ b/Marlin/src/pins/sanguino/pins_SETHI.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sanguino/pins_STB_11.h b/Marlin/src/pins/sanguino/pins_STB_11.h index 774fb00403..b10a09840a 100644 --- a/Marlin/src/pins/sanguino/pins_STB_11.h +++ b/Marlin/src/pins/sanguino/pins_STB_11.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/sensitive_pins.h b/Marlin/src/pins/sensitive_pins.h index 180bc8d6f6..5f61389cf9 100644 --- a/Marlin/src/pins/sensitive_pins.h +++ b/Marlin/src/pins/sensitive_pins.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -389,6 +389,31 @@ // Heaters, Fans, Temp Sensors // +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN -1 +#endif +#ifndef E1_AUTO_FAN_PIN + #define E1_AUTO_FAN_PIN -1 +#endif +#ifndef E2_AUTO_FAN_PIN + #define E2_AUTO_FAN_PIN -1 +#endif +#ifndef E3_AUTO_FAN_PIN + #define E3_AUTO_FAN_PIN -1 +#endif +#ifndef E4_AUTO_FAN_PIN + #define E4_AUTO_FAN_PIN -1 +#endif +#ifndef E5_AUTO_FAN_PIN + #define E5_AUTO_FAN_PIN -1 +#endif +#ifndef E6_AUTO_FAN_PIN + #define E6_AUTO_FAN_PIN -1 +#endif +#ifndef E7_AUTO_FAN_PIN + #define E7_AUTO_FAN_PIN -1 +#endif + #define _H0_PINS #define _H1_PINS #define _H2_PINS @@ -398,10 +423,10 @@ #define _H6_PINS #define _H7_PINS -#if HOTENDS +#if HAS_HOTEND #undef _H0_PINS #define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_0_PIN), - #if HOTENDS > 1 + #if HAS_MULTI_HOTEND #undef _H1_PINS #define _H1_PINS HEATER_1_PIN, E1_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_1_PIN), #if HOTENDS > 2 @@ -428,15 +453,9 @@ #endif // HOTENDS > 4 #endif // HOTENDS > 3 #endif // HOTENDS > 2 - #endif // HOTENDS > 1 + #endif // HAS_MULTI_HOTEND #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 @@ -641,14 +660,31 @@ #define _FANC #endif +#if PIN_EXISTS(HEATER_BED) && PIN_EXISTS(TEMP_BED) + #define _BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN), +#else + #define _BED_PINS +#endif + +#if PIN_EXISTS(TEMP_CHAMBER) + #define __CHAMBER_PINS CHAMBER_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_CHAMBER_PIN), +#else + #define __CHAMBER_PINS +#endif +#if PIN_EXISTS(HEATER_CHAMBER) + #define _CHAMBER_PINS __CHAMBER_PINS HEATER_CHAMBER_PIN, +#else + #define _CHAMBER_PINS +#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 _Z4_PINS _Z_PROBE \ - _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS _E5_PINS _E6_PINS _E7_PINS _BED_PINS \ + _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS _E5_PINS _E6_PINS _E7_PINS \ _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS _H5_PINS _H6_PINS _H7_PINS \ _PS_ON _HEATER_BED _FAN0 _FAN1 _FAN2 _FAN3 _FAN4 _FAN5 _FAN6 _FAN7 _FANC \ - HAL_SENSITIVE_PINS \ + _BED_PINS _CHAMBER_PINS HAL_SENSITIVE_PINS \ } diff --git a/Marlin/src/pins/stm32f0/pins_MALYAN_M200_V2.h b/Marlin/src/pins/stm32f0/pins_MALYAN_M200_V2.h new file mode 100644 index 0000000000..0e5bd58987 --- /dev/null +++ b/Marlin/src/pins/stm32f0/pins_MALYAN_M200_V2.h @@ -0,0 +1,31 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 STM32F0xx + #error "Oops! Select an STM32F0 board in your IDE." +#endif + +#define BOARD_INFO_NAME "Malyan M200 V2" + +#include "../stm32f1/pins_MALYAN_M200.h" diff --git a/Marlin/src/pins/stm32f0/pins_MALYAN_M300.h b/Marlin/src/pins/stm32f0/pins_MALYAN_M300.h new file mode 100644 index 0000000000..b8c2ed9503 --- /dev/null +++ b/Marlin/src/pins/stm32f0/pins_MALYAN_M300.h @@ -0,0 +1,88 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 NONE(__STM32F1__, STM32F1xx, STM32F0xx) + #error "Oops! Select a 'Malyan M300' board in 'Tools > Board.'" +#endif + +#define BOARD_INFO_NAME "Malyan M300" + +// +// EEPROM Emulation +// +#if NO_EEPROM_SELECTED + #define FLASH_EEPROM_EMULATION +#endif + +// +// SD CARD SPI +// +#define SDSS SS_PIN + +// +// Timers +// +#define STEP_TIMER 6 +#define TEMP_TIMER 7 + +// +// Limit Switches +// +#define X_MAX_PIN PC13 +#define Y_MAX_PIN PC14 +#define Z_MAX_PIN PC15 +#define Z_MIN_PIN PB7 + +// +// Steppers +// +#define X_STEP_PIN PB14 +#define X_DIR_PIN PB13 +#define X_ENABLE_PIN PB10 + +#define Y_STEP_PIN PB12 +#define Y_DIR_PIN PB11 +#define Y_ENABLE_PIN PB10 + +#define Z_STEP_PIN PB2 +#define Z_DIR_PIN PB1 +#define Z_ENABLE_PIN PB10 + +#define E0_STEP_PIN PA7 +#define E0_DIR_PIN PA6 +#define E0_ENABLE_PIN PB0 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PA0 // Analog Input (HOTEND0 thermistor) +#define TEMP_BED_PIN PA4 // Analog Input (BED thermistor) + +// +// Heaters / Fans +// +#define HEATER_0_PIN PA1 // HOTEND0 MOSFET +#define HEATER_BED_PIN PA5 // BED MOSFET + +#define AUTO_FAN_PIN PA8 diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h index fef8eeb617..3801a9bae4 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif -#define BOARD_INFO_NAME "BIGTREE SKR E3 DIP V1.0" +#define BOARD_INFO_NAME "BTT SKR E3 DIP V1.0" // Release PB3/PB4 (TMC_SW Pins) from JTAG pins #define DISABLE_JTAG @@ -33,11 +33,12 @@ // Ignore temp readings during development. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 -#define FLASH_EEPROM_EMULATION -#define EEPROM_PAGE_SIZE uint16(0x800) // 2KB -#define EEPROM_START_ADDRESS uint32(0x8000000 + (STM32_FLASH_SIZE) * 1024 - 2 * EEPROM_PAGE_SIZE) -#undef E2END -#define E2END (EEPROM_PAGE_SIZE - 1) // 2KB +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB +#endif // // Servos @@ -47,20 +48,20 @@ // // Limit Switches // -#define X_STOP_PIN PC1 // X-STOP -#define Y_STOP_PIN PC0 // Y-STOP -#define Z_STOP_PIN PC15 // Z-STOP +#define X_STOP_PIN PC1 // "X-STOP" +#define Y_STOP_PIN PC0 // "Y-STOP" +#define Z_STOP_PIN PC15 // "Z-STOP" // // Z Probe must be this pin // -#define Z_MIN_PROBE_PIN PC14 // PROBE +#define Z_MIN_PROBE_PIN PC14 // "PROBE" // // Filament Runout Sensor // #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN PC2 // E0-STOP + #define FIL_RUNOUT_PIN PC2 // "E0-STOP" #endif // @@ -149,9 +150,9 @@ // // Heaters / Fans // -#define HEATER_0_PIN PC8 // HE -#define HEATER_BED_PIN PC9 // HB -#define FAN_PIN PA8 // FAN0 +#define HEATER_0_PIN PC8 // "HE" +#define HEATER_BED_PIN PC9 // "HB" +#define FAN_PIN PA8 // "FAN0" // // USB connect control @@ -159,8 +160,6 @@ #define USB_CONNECT_PIN PC13 #define USB_CONNECT_INVERTING false -#define SD_DETECT_PIN PC4 - /** * _____ * 5V | 1 2 | GND @@ -172,27 +171,31 @@ * EXP1 */ -#define EXPA1_03_PIN PB7 -#define EXPA1_04_PIN PB8 -#define EXPA1_05_PIN PB9 -#define EXPA1_06_PIN PA10 -#define EXPA1_07_PIN -1 -#define EXPA1_08_PIN PA9 -#define EXPA1_09_PIN PB6 -#define EXPA1_10_PIN PA15 - #if HAS_SPI_LCD - #define BTN_ENC EXPA1_09_PIN - #define BTN_EN1 EXPA1_08_PIN - #define BTN_EN2 EXPA1_06_PIN #if ENABLED(CR10_STOCKDISPLAY) - #define BEEPER_PIN EXPA1_10_PIN + #define BEEPER_PIN PA15 - #define LCD_PINS_RS EXPA1_04_PIN - #define LCD_PINS_ENABLE EXPA1_03_PIN - #define LCD_PINS_D4 EXPA1_05_PIN + #define BTN_ENC PB6 + #define BTN_EN1 PA9 + #define BTN_EN2 PA10 + + #define LCD_PINS_RS PB8 + #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! + + #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue." + + #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 PA15 + #define ADC_KEYPAD_PIN PA1 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD! #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) @@ -207,27 +210,83 @@ * EXP1 */ - #define DOGLCD_CS EXPA1_04_PIN - #define DOGLCD_A0 EXPA1_05_PIN - #define DOGLCD_SCK EXPA1_10_PIN - #define DOGLCD_MOSI EXPA1_03_PIN + #define BTN_ENC PB6 + #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, ENDER2_STOCKDISPLAY, and MKS_MINI_12864 are currently supported on the BIGTREE_SKR_E3_DIP." + #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, and MKS_LCD12864 are currently supported on the BIGTREE_SKR_E3_DIP." #endif #endif // HAS_SPI_LCD +#if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) + + #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_SKR_E3_DIP.h' for details. Comment out this line to continue." + + /** FYSETC TFT TFT81050 display pinout + * + * Board Display + * _____ _____ + * 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK) + * (FREE) PB7 | 3 4 | PB8 (LCD_CS) (PA9) MOD_RESET | 3 4 | SD_CS (PA10) + * (FREE) PB9 | 5 6 PA10 (SD_CS) (PB8) LCD_CS | 5 6 MOSI (SPI1-MOSI) + * RESET | 7 8 | PA9 (MOD_RESET) (PA15) SD_DET | 7 8 | RESET + * (BEEPER) PB6 | 9 10| PA15 (SD_DET) GND | 9 10| 5V + * ----- ----- + * EXP1 EXP1 + * + * Needs custom cable: + * + * Board Adapter Display + * _________ + * EXP1-1 ----------- EXP1-10 + * EXP1-2 ----------- EXP1-9 + * SPI1-4 ----------- EXP1-6 + * EXP1-4 ----------- EXP1-5 + * SP11-3 ----------- EXP1-2 + * EXP1-6 ----------- EXP1-4 + * EXP1-7 ----------- EXP1-8 + * EXP1-8 ----------- EXP1-3 + * SPI1-1 ----------- EXP1-1 + * EXP1-10 ----------- EXP1-7 + * + */ + + #define CLCD_SPI_BUS 1 // SPI1 connector + + #define BEEPER_PIN PB6 + + #define CLCD_MOD_RESET PA9 + #define CLCD_SPI_CS PA8 + +#endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050 + // // SD Support // -#define HAS_ONBOARD_SD #ifndef SDCARD_CONNECTION #define SDCARD_CONNECTION ONBOARD #endif -#define ON_BOARD_SPI_DEVICE 1 //SPI1 +#if SD_CONNECTION_IS(ONBOARD) + #define SD_DETECT_PIN PC4 +#endif + +#if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) && SD_CONNECTION_IS(LCD) + #define SD_DETECT_PIN PA15 + #define SS_PIN PA10 +#elif SD_CONNECTION_IS(CUSTOM_CABLE) + #error "SD CUSTOM_CABLE is not compatible with SKR E3 DIP." +#endif + +#define ON_BOARD_SPI_DEVICE 1 // SPI1 #define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h deleted file mode 100644 index 15bc01263a..0000000000 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h +++ /dev/null @@ -1,191 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License 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 | 1 2 | GND - * (LCD_EN) PB7 | 3 4 | PB8 (LCD_RS) - * (LCD_D4) PB9 | 5 6 PA10 (BTN_EN2) - * RESET | 7 8 | PA9 (BTN_EN1) - * (BTN_ENC) PB6 | 9 10| PB5 (BEEPER) - * ----- - * EXP1 - */ - -#define EXPA1_03_PIN PB7 -#define EXPA1_04_PIN PB8 -#define EXPA1_05_PIN PB9 -#define EXPA1_06_PIN PA10 -#define EXPA1_07_PIN -1 -#define EXPA1_08_PIN PA9 -#define EXPA1_09_PIN PB6 -#define EXPA1_10_PIN PB5 - -#if HAS_SPI_LCD - - #if ENABLED(CR10_STOCKDISPLAY) - - #define BEEPER_PIN EXPA1_10_PIN - - #define BTN_EN1 EXPA1_08_PIN - #define BTN_EN2 EXPA1_06_PIN - #define BTN_ENC EXPA1_09_PIN - - #define LCD_PINS_RS EXPA1_04_PIN - #define LCD_PINS_ENABLE EXPA1_03_PIN - #define LCD_PINS_D4 EXPA1_05_PIN - - #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! - - #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3.h' for details. Comment out this line to continue." - - #define LCD_PINS_RS EXPA1_05_PIN - #define LCD_PINS_ENABLE EXPA1_09_PIN - #define LCD_PINS_D4 EXPA1_04_PIN - #define LCD_PINS_D5 EXPA1_06_PIN - #define LCD_PINS_D6 EXPA1_08_PIN - #define LCD_PINS_D7 EXPA1_10_PIN - #define ADC_KEYPAD_PIN PA1 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD! - - #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) - - /** Creality Ender-2 display pinout - * _____ - * 5V | 1 2 | GND - * (MOSI) PB7 | 3 4 | PB8 (LCD_RS) - * (LCD_A0) PB9 | 5 6 PA10 (BTN_EN2) - * RESET | 7 8 | PA9 (BTN_EN1) - * (BTN_ENC) PB6 | 9 10| PB5 (SCK) - * ----- - * EXP1 - */ - #define BTN_EN1 EXPA1_08_PIN - #define BTN_EN2 EXPA1_06_PIN - #define BTN_ENC EXPA1_09_PIN - - #define DOGLCD_CS EXPA1_04_PIN - #define DOGLCD_A0 EXPA1_05_PIN - #define DOGLCD_SCK EXPA1_10_PIN - #define DOGLCD_MOSI EXPA1_03_PIN - #define FORCE_SOFT_SPI - #define LCD_BACKLIGHT_PIN -1 - - #else - - #error "Only ZONESTAR_LCD, MKS_MINI_12864, ENDER2_STOCKDISPLAY, and CR10_STOCKDISPLAY 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/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h index f909cce83a..b658f3d714 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h @@ -16,14 +16,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once -#include "pins_BTT_SKR_MINI_E3.h" +#include "pins_BTT_SKR_MINI_E3_common.h" -#define BOARD_INFO_NAME "BIGTREE SKR Mini E3" +#define BOARD_INFO_NAME "BTT SKR Mini E3 V1.0" /** * TMC220x stepper drivers diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h index 961620ee8b..8d384c7396 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h @@ -16,14 +16,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once -#include "pins_BTT_SKR_MINI_E3.h" +#include "pins_BTT_SKR_MINI_E3_common.h" -#define BOARD_INFO_NAME "BIGTREE SKR Mini E3 V1.2" +#define BOARD_INFO_NAME "BTT SKR Mini E3 V1.2" #define NEOPIXEL_PIN PC7 // LED driving pin diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h new file mode 100644 index 0000000000..cb94f0bdca --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h @@ -0,0 +1,59 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 SKR_MINI_E3_V2 + +// Onboard I2C EEPROM +#if NO_EEPROM_SELECTED + #define I2C_EEPROM + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #undef NO_EEPROM_SELECTED +#endif + +#include "pins_BTT_SKR_MINI_E3_common.h" + +#define BOARD_INFO_NAME "BTT SKR Mini E3 V2.0" + +// Release PA13/PA14 (led, usb control) from SWD pins +#define DISABLE_DEBUG + +#define NEOPIXEL_PIN PA8 // LED driving pin + +#define PS_ON_PIN PC13 // Power Supply Control + +#define FAN1_PIN PC7 + +#ifndef CONTROLLER_FAN_PIN + #define CONTROLLER_FAN_PIN FAN1_PIN +#endif + +/** + * TMC220x stepper drivers + * Hardware serial communication ports. + */ +#if HAS_TMC_UART + #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/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h new file mode 100644 index 0000000000..a8df0e5c02 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h @@ -0,0 +1,240 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 + +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB +#endif + +// +// Servos +// +#define SERVO0_PIN PA1 // "SERVOS" + +// +// Limit Switches +// +#define X_STOP_PIN PC0 // "X-STOP" +#define Y_STOP_PIN PC1 // "Y-STOP" +#define Z_STOP_PIN PC2 // "Z-STOP" + +// +// Z Probe must be this pin +// +#define Z_MIN_PROBE_PIN PC14 // "PROBE" + +// +// 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 "TH0" +#define TEMP_BED_PIN PC3 // Analog Input "TB0" + +// +// Heaters / Fans +// +#define HEATER_0_PIN PC8 // "HE" +#define HEATER_BED_PIN PC9 // "HB" + +#ifdef SKR_MINI_E3_V2 + #define FAN_PIN PC6 +#else + #define FAN_PIN PA8 // "FAN0" +#endif + +// +// USB connect control +// +#ifdef SKR_MINI_E3_V2 + #define USB_CONNECT_PIN PA14 +#else + #define USB_CONNECT_PIN PC13 +#endif + +#define USB_CONNECT_INVERTING false + +/** + * SKR Mini E3 V1.0, V1.2 SKR Mini E3 V2.0 + * _____ _____ + * 5V | 1 2 | GND 5V | 1 2 | GND + * (LCD_EN) PB7 | 3 4 | PB8 (LCD_RS) (LCD_EN) PB15 | 3 4 | PB8 (LCD_RS) + * (LCD_D4) PB9 | 5 6 PA10 (BTN_EN2) (LCD_D4) PB9 | 5 6 PA10 (BTN_EN2) + * RESET | 7 8 | PA9 (BTN_EN1) RESET | 7 8 | PA9 (BTN_EN1) + * (BTN_ENC) PB6 | 9 10| PB5 (BEEPER) (BTN_ENC) PA15 | 9 10| PB5 (BEEPER) + * ----- ----- + * EXP1 EXP1 + */ +#ifdef SKR_MINI_E3_V2 + #define EXP1_9 PA15 + #define EXP1_3 PB15 +#else + #define EXP1_9 PB6 + #define EXP1_3 PB7 +#endif + +#if HAS_SPI_LCD + + #if ENABLED(CR10_STOCKDISPLAY) + + #define BEEPER_PIN PB5 + #define BTN_ENC EXP1_9 + + #define BTN_EN1 PA9 + #define BTN_EN2 PA10 + + #define LCD_PINS_RS PB8 + #define LCD_PINS_ENABLE EXP1_3 + #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! + + #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue." + + #define LCD_PINS_RS PB9 + #define LCD_PINS_ENABLE EXP1_9 + #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 EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) + + #define BTN_ENC EXP1_9 + #define BTN_EN1 PA9 + #define BTN_EN2 PA10 + + #define DOGLCD_CS PB8 + #define DOGLCD_A0 PB9 + #define DOGLCD_SCK PB5 + #define DOGLCD_MOSI EXP1_3 + + #define FORCE_SOFT_SPI + #define LCD_BACKLIGHT_PIN -1 + + #else + #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, and MKS_MINI_12864 are currently supported on the BIGTREE_SKR_MINI_E3." + #endif + +#endif // HAS_SPI_LCD + +#if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) + + #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue." + + /** FYSETC TFT TFT81050 display pinout + * + * Board Display + * _____ _____ + * 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK) + * (FREE) PB7 | 3 4 | PB8 (LCD_CS) (PA9) MOD_RESET | 3 4 | SD_CS (PA10) + * (FREE) PB9 | 5 6 PA10 (SD_CS) (PB8) LCD_CS | 5 6 MOSI (SPI1-MOSI) + * RESET | 7 8 | PA9 (MOD_RESET) (PB5) SD_DET | 7 8 | RESET + * (BEEPER) PB6 | 9 10| PB5 (SD_DET) GND | 9 10| 5V + * ----- ----- + * EXP1 EXP1 + * + * Needs custom cable: + * + * Board Adapter Display + * _________ + * EXP1-1 ----------- EXP1-10 + * EXP1-2 ----------- EXP1-9 + * SPI1-4 ----------- EXP1-6 + * EXP1-4 ----------- EXP1-5 + * SPI1-3 ----------- EXP1-2 + * EXP1-6 ----------- EXP1-4 + * EXP1-7 ----------- EXP1-8 + * EXP1-8 ----------- EXP1-3 + * SPI1-1 ----------- EXP1-1 + * EXP1-10 ----------- EXP1-7 + * + */ + + #define CLCD_SPI_BUS 1 // SPI1 connector + + #define BEEPER_PIN EXP1_9 + + #define CLCD_MOD_RESET PA9 + #define CLCD_SPI_CS PB8 + +#endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050 + +// +// SD Support +// + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#if SD_CONNECTION_IS(ONBOARD) + #define SD_DETECT_PIN PC4 +#endif + +#if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) && SD_CONNECTION_IS(LCD) + #define SD_DETECT_PIN PB5 + #define SS_PIN PA10 +#elif SD_CONNECTION_IS(CUSTOM_CABLE) + #error "SD CUSTOM_CABLE is not compatible with SKR Mini E3." +#endif + +#define ON_BOARD_SPI_DEVICE 1 // SPI1 +#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h index fff3af5b6b..db31eb377f 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -25,7 +25,7 @@ #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif -#define BOARD_INFO_NAME "BIGTREE SKR Mini 1.1" +#define BOARD_INFO_NAME "BTT SKR Mini V1.1" //#define DISABLE_DEBUG #define DISABLE_JTAG @@ -33,10 +33,12 @@ // 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) +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB +#endif // // Limit Switches @@ -161,15 +163,27 @@ #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 + #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 + #if HAS_GRAPHICAL_LCD + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) + #endif + #endif + #endif #endif // HAS_SPI_LCD @@ -179,8 +193,7 @@ // // 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 +// Change SDCARD_CONNECTION from 'ONBOARD' to 'LCD' for an external (LCD module) SD #ifndef SDCARD_CONNECTION #define SDCARD_CONNECTION ONBOARD #endif @@ -200,11 +213,5 @@ #define MOSI_PIN PA7 #define SS_PIN PA4 #endif -#define ON_BOARD_SPI_DEVICE 1 //SPI1 +#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/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h new file mode 100644 index 0000000000..f99721f144 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h @@ -0,0 +1,179 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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.'" +#elif HOTENDS > 1 || E_STEPPERS > 1 + #error "CCROBOT-ONLINE MEEB_3DP only supports 1 hotend / E-stepper. Comment out this line to continue." +#endif + +// https://github.com/ccrobot-online/MEEB_3DP +// Pin assignments for 32-bit MEEB_3DP +#define BOARD_INFO_NAME "CCROBOT-ONLINE MEEB_3DP" +#define DEFAULT_MACHINE_NAME "STM32F103RCT6" +#define BOARD_WEBSITE_URL "ccrobot-online.com" + +// +// Release PB4 from JTAG NRST role +// +#define DISABLE_JTAG + +// +// EEPROM +// +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define EEPROM_PAGE_SIZE 0x800U // 2KB + #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif + +// +// 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 pin +// +#define Z_MIN_PROBE_PIN PC15 // "PROBE" + +// +// TMC2208 stepper drivers +// +#define X_ENABLE_PIN PB4 +#define X_STEP_PIN PC12 +#define X_DIR_PIN PC11 + +#define Y_ENABLE_PIN PC10 +#define Y_STEP_PIN PB14 +#define Y_DIR_PIN PB13 + +#define Z_ENABLE_PIN PB12 +#define Z_STEP_PIN PB2 +#define Z_DIR_PIN PB1 + +#define E0_ENABLE_PIN PB0 +#define E0_STEP_PIN PA6 +#define E0_DIR_PIN PA5 + +// Stepper drivers Serial UART +#define X_SERIAL_TX_PIN PB3 +#define X_SERIAL_RX_PIN PD2 +#define Y_SERIAL_TX_PIN PA15 +#define Y_SERIAL_RX_PIN PC6 +#define Z_SERIAL_TX_PIN PB11 +#define Z_SERIAL_RX_PIN PB10 +#define E0_SERIAL_TX_PIN PC5 +#define E0_SERIAL_RX_PIN PC4 + +// Reduce baud rate to improve software serial reliability +#define TMC_BAUD_RATE 19200 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PA0 // TH0 +#define TEMP_BED_PIN PC3 // THB + +// +// Heaters / Fans +// +#define HEATER_0_PIN PC8 // HEATER0 +#define HEATER_BED_PIN PC9 // HOT BED + +#define FAN_PIN PA7 // FAN (fan2 on board) model cool fan +#define FAN1_PIN PA8 // FAN (fan0 on board) e0 cool fan +#define FAN2_PIN PB9 // FAN (fan1 on board) controller cool fan + +// One neopixel onboard and a connector for other neopixels +#define NEOPIXEL_PIN PC7 // The NEOPIXEL LED driving pin + +/** + * 1 _____ 2 + * PB5 | · · | PB6 + * PA2 | · · | RESET + * PA3 | · · | PB8 + * PB7 | · · | PA4 + * GND | · · | VCC5 + * 9 ----- 10 + * LCD EXP + */ + +// +// LCD / Controller +// +#if ENABLED(CR10_STOCKDISPLAY) + #define BEEPER_PIN PB5 + #define BTN_EN1 PA2 + #define BTN_EN2 PA3 + #define BTN_ENC PB6 + + #define LCD_PINS_RS PB7 // CS -- SOFT SPI for ENDER3 LCD + #define LCD_PINS_D4 PB8 // SCLK + #define LCD_PINS_ENABLE PA4 // DATA MOSI +#endif + +// Alter timing for graphical display +#if HAS_GRAPHICAL_LCD + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) + #endif +#endif + +// +// Camera +// +#define CHDK_PIN PB15 + +#if 0 + +// +// SD-NAND +// +#if SD_CONNECTION_IS(ONBOARD) + #define ENABLE_SPI1 + #define SD_DETECT_PIN -1 + #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 SD-NAND + +#endif diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D.h b/Marlin/src/pins/stm32f1/pins_CHITU3D.h index b9272c7211..e3b7d2f547 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -84,7 +84,10 @@ // #define SDSS -1 #define LED_PIN -1 -#define CASE_LIGHT_PIN PA8 // 8 + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN PA8 // 8 +#endif #define PS_ON_PIN -1 #define KILL_PIN PD6 // LED strip 24v @@ -183,7 +186,7 @@ #elif ENABLED(LCD_I2C_VIKI) - #define BTN_EN1 PB6 // 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. + #define BTN_EN1 PB6 // 22 // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. #define BTN_EN2 PA7 // 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. #define BTN_ENC -1 diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h new file mode 100644 index 0000000000..0a733049b8 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h @@ -0,0 +1,225 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 V5" +#define DEFAULT_MACHINE_NAME "STM32F103ZET6" + +#define DISABLE_JTAG + +// +// EEPROM +// +#define FLASH_EEPROM_EMULATION +#if 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 MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE +#else + #define MARLIN_EEPROM_SIZE 0x800U // On SD, Limit to 2KB, require this amount of RAM +#endif + +// +// Limit Switches +// +#define X_STOP_PIN PG10 +#define Y_STOP_PIN PA12 +#define Z_STOP_PIN PA14 + +// +// Steppers +// +#define X_ENABLE_PIN PC13 +#define X_STEP_PIN PE5 +#define X_DIR_PIN PE6 + +#define Y_ENABLE_PIN PE4 +#define Y_STEP_PIN PE2 +#define Y_DIR_PIN PE3 + +#define Z_ENABLE_PIN PE1 +#define Z_STEP_PIN PB9 +#define Z_DIR_PIN PE0 + +#define E0_ENABLE_PIN PB8 +#define E0_STEP_PIN PB4 +#define E0_DIR_PIN PB5 + +#define E1_ENABLE_PIN PG8 +#define E1_STEP_PIN PC7 +#define E1_DIR_PIN PC6 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PA1 // TH1 +#define TEMP_BED_PIN PA0 // TB1 + +// +// Heaters +// +#define HEATER_0_PIN PG12 // HEATER1 +#define HEATER_BED_PIN PG11 // HOT BED + +// +// Fans +// +#define CONTROLLER_FAN_PIN PD6 // BOARD FAN +#define FAN_PIN PG13 // FAN +#define FAN_PIN_2 PG14 + +// +// Misc +// +#define BEEPER_PIN PB0 +//#define LED_PIN -1 +//#define POWER_LOSS_PIN -1 +#define FIL_RUNOUT_PIN PA15 + +// +// TronXY TFT Support +// +//#define FSMC_GRAPHICAL_TFT +//#define TOUCH_BUTTONS + +#if ENABLED(FSMC_GRAPHICAL_TFT) + #define FSMC_UPSCALE 3 + #define LCD_FULL_PIXEL_WIDTH 480 + #define LCD_PIXEL_OFFSET_X 48 + #define LCD_FULL_PIXEL_HEIGHT 320 + #define LCD_PIXEL_OFFSET_Y 48 + + #define LCD_RESET_PIN PF11 + #define LCD_BACKLIGHT_PIN PD13 + #define FSMC_CS_PIN PD7 + #define FSMC_RS_PIN PD11 + + #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 PB7 // SPI1_NSS + #define TOUCH_SCK_PIN PA5 // SPI1_SCK + #define TOUCH_MISO_PIN PA6 // SPI1_MISO + #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI + + #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 340 + #define XPT2046_Y_OFFSET -20 + #endif +#endif + +#define SPI_FLASH_SIZE 0x200000 // 2MB + +#if HAS_TFT_LVGL_UI + #define HAS_SPI_FLASH_FONT 0 + #define HAS_GCODE_PREVIEW 1 + #define HAS_GCODE_DEFAULT_VIEW_IN_FLASH 0 + #define HAS_LANG_SELECT_SCREEN 0 + #define HAS_BAK_VIEW_IN_FLASH 0 + #define HAS_LOGO_IN_FLASH 0 + + //SPI 2 + #define W25QXX_CS_PIN PB12 + #define W25QXX_MOSI_PIN PB15 + #define W25QXX_MISO_PIN PB14 + #define W25QXX_SCK_PIN PB13 + + #define TOUCH_CS_PIN PB7 // SPI1_NSS + #define TOUCH_SCK_PIN PA5 // SPI1_SCK + #define TOUCH_MISO_PIN PA6 // SPI1_MISO + #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI + // #define TOUCH_INT_PIN PB6 + + #define SPI_TFT_CS_PIN TOUCH_CS_PIN + #define SPI_TFT_SCK_PIN TOUCH_SCK_PIN + #define SPI_TFT_MISO_PIN TOUCH_MISO_PIN + #define SPI_TFT_MOSI_PIN TOUCH_MOSI_PIN + #define SPI_TFT_DC_PIN PB6 + #define SPI_TFT_RST_PIN PF11 + + #define LCD_RESET_PIN PF11 + #define LCD_BACKLIGHT_PIN PD13 + #define FSMC_CS_PIN PD7 + #define FSMC_RS_PIN PD11 + + #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 LCD_FULL_PIXEL_WIDTH 480 + #define LCD_PIXEL_OFFSET_X 48 + #define LCD_FULL_PIXEL_HEIGHT 320 + #define LCD_PIXEL_OFFSET_Y 48 + + #define LCD_PIXEL_HEIGHT 320 + #define LCD_PIXEL_WIDTH 480 + + #define XPT2046_X_CALIBRATION -12316 + #define XPT2046_Y_CALIBRATION 8981 + #define XPT2046_X_OFFSET 340 + #define XPT2046_Y_OFFSET -20 + + #define USE_XPT2046 1 + #define XPT2046_XY_SWAP 0 + #define XPT2046_X_INV 1 + #define XPT2046_Y_INV 0 + + #define XPT2046_HOR_RES 480 + #define XPT2046_VER_RES 320 + #define XPT2046_X_MIN 140 + #define XPT2046_Y_MIN 200 + #define XPT2046_X_MAX 1900 + #define XPT2046_Y_MAX 1900 + #define XPT2046_AVG 4 + #define XPT2046_INV 0 +#endif + +// SPI1(PA7)=LCD & SPI3(PB5)=STUFF, are not available +// We nee to use the SPI2 +#define ENABLE_SPI2 +#define SCK_PIN PB13 +#define MISO_PIN PB14 +#define MOSI_PIN PB15 +#define SS_PIN PB12 + +// +// SD Card +// +#define SDIO_SUPPORT +#define SD_DETECT_PIN -1 // PF0, but it isn't connected +#define SDIO_CLOCK 4500000 +#define SDIO_READ_RETRIES 16 diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h new file mode 100644 index 0000000000..0fb3a9a879 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h @@ -0,0 +1,231 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 "STM32F103ZET6" + +#define DISABLE_JTAG + +// +// EEPROM +// + +#if NO_EEPROM_SELECTED + #define FLASH_EEPROM_EMULATION +#endif + +#if 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 MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE +#else + #define MARLIN_EEPROM_SIZE 0x800U // On SD, Limit to 2KB, require this amount of RAM +#endif + +// +// Limit Switches +// +#define X_STOP_PIN PG10 +#define Y_STOP_PIN PA12 +#define Z_STOP_PIN PG9 + +// +// Steppers +// +#define X_ENABLE_PIN PC13 +#define X_STEP_PIN PE5 +#define X_DIR_PIN PE6 + +#define Y_ENABLE_PIN PE4 +#define Y_STEP_PIN PE2 +#define Y_DIR_PIN PE3 + +#define Z_ENABLE_PIN PE1 +#define Z_STEP_PIN PB9 +#define Z_DIR_PIN PE0 + +#define Z2_ENABLE_PIN PF3 +#define Z2_STEP_PIN PF5 +#define Z2_DIR_PIN PF1 + +#define E0_ENABLE_PIN PB8 +#define E0_STEP_PIN PB4 +#define E0_DIR_PIN PB5 + +#define E1_ENABLE_PIN PG8 +#define E1_STEP_PIN PC7 +#define E1_DIR_PIN PC6 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PA1 // TH1 +#define TEMP_BED_PIN PA0 // TB1 + +// +// Heaters +// +#define HEATER_0_PIN PG12 // HEATER1 +#define HEATER_BED_PIN PG11 // HOT BED +//#define HEATER_BED_INVERTING true + +// +// Fans +// +#define CONTROLLER_FAN_PIN PD6 // BOARD FAN +#define FAN_PIN PG13 // FAN +#define FAN_PIN_2 PG14 + +// +// Misc +// +#define BEEPER_PIN PB0 +//#define LED_PIN PD3 +//#define POWER_LOSS_PIN PG2 // PG4 PW_DET +#define FIL_RUNOUT_PIN PA15 // MT_DET + +// +// TronXY TFT Support +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + #define FSMC_UPSCALE 3 + #define LCD_FULL_PIXEL_WIDTH 480 + #define LCD_PIXEL_OFFSET_X 48 + #define LCD_FULL_PIXEL_HEIGHT 320 + #define LCD_PIXEL_OFFSET_Y 48 + + #define LCD_RESET_PIN PF11 + #define LCD_BACKLIGHT_PIN PD13 + #define FSMC_CS_PIN PD7 + #define FSMC_RS_PIN PD11 + + #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 PB7 // SPI1_NSS + #define TOUCH_SCK_PIN PA5 // SPI1_SCK + #define TOUCH_MISO_PIN PA6 // SPI1_MISO + #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI + + #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 340 + #define XPT2046_Y_OFFSET -20 + #endif +#endif + +#define SPI_FLASH_SIZE 0x200000 // 2MB + +#if HAS_TFT_LVGL_UI + #define HAS_SPI_FLASH_FONT 0 + #define HAS_GCODE_PREVIEW 1 + #define HAS_GCODE_DEFAULT_VIEW_IN_FLASH 0 + #define HAS_LANG_SELECT_SCREEN 0 + #define HAS_BAK_VIEW_IN_FLASH 0 + #define HAS_LOGO_IN_FLASH 0 + + //SPI 2 + #define W25QXX_CS_PIN PB12 + #define W25QXX_MOSI_PIN PB15 + #define W25QXX_MISO_PIN PB14 + #define W25QXX_SCK_PIN PB13 + + #define TOUCH_CS_PIN PB7 // SPI1_NSS + #define TOUCH_SCK_PIN PA5 // SPI1_SCK + #define TOUCH_MISO_PIN PA6 // SPI1_MISO + #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI + // #define TOUCH_INT_PIN PB6 + + #define SPI_TFT_CS_PIN TOUCH_CS_PIN + #define SPI_TFT_SCK_PIN TOUCH_SCK_PIN + #define SPI_TFT_MISO_PIN TOUCH_MISO_PIN + #define SPI_TFT_MOSI_PIN TOUCH_MOSI_PIN + #define SPI_TFT_DC_PIN PB6 + #define SPI_TFT_RST_PIN PF11 + + #define LCD_RESET_PIN PF11 + #define LCD_BACKLIGHT_PIN PD13 + #define FSMC_CS_PIN PD7 + #define FSMC_RS_PIN PD11 + + #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 LCD_FULL_PIXEL_WIDTH 480 + #define LCD_PIXEL_OFFSET_X 48 + #define LCD_FULL_PIXEL_HEIGHT 320 + #define LCD_PIXEL_OFFSET_Y 48 + + #define LCD_PIXEL_HEIGHT 320 + #define LCD_PIXEL_WIDTH 480 + + #define XPT2046_X_CALIBRATION -12316 + #define XPT2046_Y_CALIBRATION 8981 + #define XPT2046_X_OFFSET 340 + #define XPT2046_Y_OFFSET -20 + + #define USE_XPT2046 1 + #define XPT2046_XY_SWAP 0 + #define XPT2046_X_INV 1 + #define XPT2046_Y_INV 0 + + #define XPT2046_HOR_RES 480 + #define XPT2046_VER_RES 320 + #define XPT2046_X_MIN 140 + #define XPT2046_Y_MIN 200 + #define XPT2046_X_MAX 1900 + #define XPT2046_Y_MAX 1900 + #define XPT2046_AVG 4 + #define XPT2046_INV 0 +#endif + +// SPI1(PA7)=LCD & SPI3(PB5)=STUFF, are not available +// so SPI2 is required. +#define ENABLE_SPI2 +#define SCK_PIN PB13 +#define MISO_PIN PB14 +#define MOSI_PIN PB15 +#define SS_PIN PB12 + +// +// SD Card +// +#define SDIO_SUPPORT +#define SD_DETECT_PIN -1 // PF0, but it isn't connected +#define SDIO_CLOCK 4500000 +#define SDIO_READ_RETRIES 16 diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h new file mode 100644 index 0000000000..ed281eb00c --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -0,0 +1,179 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * CREALITY (STM32F103) board pin assignments + */ + +#ifndef __STM32F1__ + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" +#endif + +#if HOTENDS > 1 || E_STEPPERS > 1 + #error "CREALITY supports up to 1 hotends / E-steppers. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "CREALITY V4" +#define DEFAULT_MACHINE_NAME "Ender 3 V2" + +// +// EEPROM +// +#if NO_EEPROM_SELECTED + // FLASH + //#define FLASH_EEPROM_EMULATION + + // I2C + #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 used only for display settings + #if ENABLED(IIC_BL24CXX_EEPROM) + #define IIC_EEPROM_SDA PA11 + #define IIC_EEPROM_SCL PA12 + #define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16) + #else + #define SDCARD_EEPROM_EMULATION // SD EEPROM until all EEPROM is BL24CXX + #define MARLIN_EEPROM_SIZE 0x800 // 2Kb + #endif + + // SPI + //#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 ? +#endif + +// +// Servos +// +#define SERVO0_PIN PB0 // BLTouch OUT + +// +// Limit Switches +// +#define X_STOP_PIN PA5 +#define Y_STOP_PIN PA6 +#define Z_STOP_PIN PA7 + +#define Z_PROBE_PIN PB1 // BLTouch IN + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PA4 // "Pulled-high" +#endif + +// +// Steppers +// +#define X_ENABLE_PIN PC3 +#define X_STEP_PIN PC2 +#define X_DIR_PIN PB9 + +#define Y_ENABLE_PIN PC3 +#define Y_STEP_PIN PB8 +#define Y_DIR_PIN PB7 + +#define Z_ENABLE_PIN PC3 +#define Z_STEP_PIN PB6 +#define Z_DIR_PIN PB5 + +#define E0_ENABLE_PIN PC3 +#define E0_STEP_PIN PB4 +#define E0_DIR_PIN PB3 + +// +// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role +// +#define DISABLE_DEBUG + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC5 // TH1 +#define TEMP_BED_PIN PC4 // TB1 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PA1 // HEATER1 +#define HEATER_BED_PIN PA2 // HOT BED + +#define FAN_PIN PA0 // FAN +#define FAN_SOFT_PWM + +// +// SD Card +// +#define SD_DETECT_PIN PC7 +#define SDCARD_CONNECTION ONBOARD +#define ON_BOARD_SPI_DEVICE 1 +#define ONBOARD_SD_CS_PIN PA4 // SDSS +#define SDIO_SUPPORT + +#if ENABLED(RET6_12864_LCD) + + /* RET6 12864 LCD */ + #define LCD_PINS_RS PB12 + #define LCD_PINS_ENABLE PB15 + #define LCD_PINS_D4 PB13 + + #define BTN_ENC PB2 + #define BTN_EN1 PB10 + #define BTN_EN2 PB14 + + #define BEEPER_PIN PC6 +#elif ENABLED(VET6_12864_LCD) + + /* VET6 12864 LCD */ + #define LCD_PINS_RS PA4 + #define LCD_PINS_ENABLE PA7 + #define LCD_PINS_D4 PA5 + + #define BTN_ENC PC5 + #define BTN_EN1 PB10 + #define BTN_EN2 PA6 + +#elif ENABLED(DWIN_CREALITY_LCD) + + /* RET6 DWIN ENCODER LCD */ + #define BTN_ENC PB14 + #define BTN_EN1 PB15 + #define BTN_EN2 PB12 + + //#define LCD_LED_PIN PB2 + #define BEEPER_PIN PB13 + +#elif ENABLED(DWIN_VET6_CREALITY_LCD) + + /* VET6 DWIN ENCODER LCD */ + #define BTN_ENC PA6 + #define BTN_EN1 PA7 + #define BTN_EN2 PA4 + + #define BEEPER_PIN PA5 + +#endif diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h index dcd1119c86..6a30a2cb23 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -30,7 +30,7 @@ #define DISABLE_JTAG -#define pins_v2_20190128 // geo-f:add for new pins define +#define pins_v2_20190128 // new pins define // Ignore temp readings during development. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 @@ -38,11 +38,13 @@ // // 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 +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB +#endif + // // Limit Switches // @@ -82,32 +84,37 @@ #define E0_DIR_PIN PC14 #define E0_ENABLE_PIN PC13 +#if HAS_TMC_UART + + /** + * TMC2208/TMC2209 stepper drivers + */ + + // + // Hardware serial with switch + // + #define X_HARDWARE_SERIAL Serial1 + #define Y_HARDWARE_SERIAL Serial1 + #define Z_HARDWARE_SERIAL Serial1 + #define E0_HARDWARE_SERIAL Serial1 + + // The 4xTMC2209 module doesn't have a serial multiplexer and + // needs to set *_SLAVE_ADDRESS in Configuration_adv.h for X,Y,Z,E0 + #if HAS_DRIVER(TMC2208) + #define TMC_SERIAL_MULTIPLEXER + #define SERIAL_MUL_PIN1 PB13 + #define SERIAL_MUL_PIN2 PB12 + #endif + +#endif + // // 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 + #define MOTOR_CURRENT_PWM_RANGE 1500 // origin: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 +#define DEFAULT_PWM_MOTOR_CURRENT { 500, 500, 400 } // origin: {1300,1300,1250} // // Heaters / Fans diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h index e726ca1831..7143176bd7 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -29,17 +29,19 @@ #define BOARD_INFO_NAME "FYSETC Cheetah" #define BOARD_WEBSITE_URL "fysetc.com" +// https://github.com/FYSETC/Cheetah // 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 +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB +#endif // // Servos @@ -101,12 +103,34 @@ // Misc. Functions // #define SDSS PA4 +#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 + +/* +* EXP1 pinout for the LCD according to Fysetcs schematic for the Cheetah board +* _____ +* (Beeper) PC9 | 1 2 | PC12 (BTN_ENC) +* (BTN_EN2) PC11 | 3 4 | PB14 (LCD_RS / MISO) +* (BTN_EN1) PC10 5 6 | PB13 (SCK) +* (LCD_EN) PB12 | 7 8 | PB15 (MOSI) +* GND | 9 10| 5V +* ----- +* EXP1 +* Note: The pin-numbers match the connector correctly and are not in reverse order like on the Ender-3 board. +* Note: Functionally the pins are assigned in the same order as on the Ender-3 board. +* Note: Pin 4 on the Cheetah board is assigned to an I/O, it is assigned to RESET on the Ender-3 board. +*/ -// -// LCD Pins -// #if HAS_SPI_LCD - #define BEEPER_PIN PC9 #if HAS_GRAPHICAL_LCD @@ -127,25 +151,27 @@ #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_EN1 PC10 + #define BTN_EN2 PC11 #define BTN_ENC PC12 #endif - +#endif + +#if ENABLED(TOUCH_UI_FTDI_EVE) + #define BEEPER_PIN PC9 + #define CLCD_MOD_RESET PC11 + #define CLCD_SPI_CS PB12 + + //#define CLCD_USE_SOFT_SPI // the Cheetah can use hardware-SPI so we do not really need this + + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI PB15 + #define CLCD_SOFT_SPI_MISO PB14 + #define CLCD_SOFT_SPI_SCLK PB13 + #else + #define CLCD_SPI_BUS 2 + #endif #endif diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH_V12.h b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH_V12.h index 9c6412c0cb..f07320db40 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH_V12.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH_V12.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h index 38cc615f64..03f9ce0216 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -52,8 +52,10 @@ //#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 +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif // // Limit Switches @@ -110,10 +112,13 @@ // 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 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan +#endif + // // Temperature Sensors // @@ -154,9 +159,15 @@ #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) + #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 diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h index 873d02b065..3f5a39a90c 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -52,8 +52,10 @@ //#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 +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif // // Limit Switches @@ -110,10 +112,13 @@ // 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 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan +#endif + // // Temperature Sensors // diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h index 38cc615f64..03f9ce0216 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -52,8 +52,10 @@ //#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 +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif // // Limit Switches @@ -110,10 +112,13 @@ // 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 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan +#endif + // // Temperature Sensors // @@ -154,9 +159,15 @@ #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) + #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 diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h index 24196ad892..c39c89e42c 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -30,7 +30,7 @@ #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif -#define BOARD_NAME "GTM32 Pro VB" +#define BOARD_INFO_NAME "GTM32 Pro VB" #define DEFAULT_MACHINE_NAME "M201" //#define DISABLE_DEBUG @@ -52,8 +52,10 @@ //#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 +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif // // Limit Switches @@ -112,7 +114,10 @@ //#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 + +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan +#endif // // Temperature Sensors @@ -140,12 +145,13 @@ // 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 LCD_PINS_RS PA12 // CS chip select /SS chip slave select + // RW is hardwired to VSS + #define LCD_PINS_ENABLE PC7 // SID (MOSI) + #define LCD_PINS_D4 PD1 // SCK (CLK) clock + #define LCD_PINS_D5 PD4 + #define LCD_PINS_D6 PD5 + #define LCD_PINS_D7 PD7 #define BTN_EN1 PE8 #define BTN_EN2 PE9 @@ -163,14 +169,14 @@ #endif #if HAS_GRAPHICAL_LCD - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(96) + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(48) + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(715) + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(715) #endif #endif diff --git a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h index 6395f6efc9..c68c059265 100644 --- a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h +++ b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -43,10 +43,12 @@ // Enable EEPROM Emulation for this board, so that we don't overwrite factory data //#define I2C_EEPROM // AT24C64 -//#define E2END 0x7FFF // 64KB +//#define MARLIN_EEPROM_SIZE 0x8000UL // 64KB + //#define FLASH_EEPROM_EMULATION -//#define E2END 0xFFF // 4KB -//#define E2END uint32(EEPROM_START_ADDRESS + (EEPROM_PAGE_SIZE * 2) - 1) +//#define MARLIN_EEPROM_SIZE 0x1000UL // 4KB +//#define MARLIN_EEPROM_SIZE (EEPROM_START_ADDRESS + (EEPROM_PAGE_SIZE) * 2UL) + //#define EEPROM_CHITCHAT //#define DEBUG_EEPROM_READWRITE diff --git a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h index 83881c128d..e99b702700 100644 --- a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h +++ b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -147,10 +147,11 @@ // Persistent Storage // If no option is selected below the SD Card will be used // -//#define SPI_EEPROM -#define FLASH_EEPROM_EMULATION +#if NO_EEPROM_SELECTED + //#define SPI_EEPROM + #define FLASH_EEPROM_EMULATION +#endif -#undef E2END #if ENABLED(SPI_EEPROM) // SPI1 EEPROM Winbond W25Q64 (8MB/64Mbits) #define SPI_CHAN_EEPROM1 1 @@ -159,12 +160,12 @@ #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... + #define MARLIN_EEPROM_SIZE 16UL * (EEPROM_PAGE_SIZE) // 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) + #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) + #define MARLIN_EEPROM_SIZE (EEPROM_PAGE_SIZE) #else - #define E2END (0x7FFU) // On SD, Limit to 2KB, require this amount of RAM + #define MARLIN_EEPROM_SIZE 0x800U // On SD, Limit to 2KB, require this amount of RAM #endif diff --git a/Marlin/src/pins/stm32f1/pins_MALYAN_M200.h b/Marlin/src/pins/stm32f1/pins_MALYAN_M200.h index 9829018d8d..6a8f316b0d 100644 --- a/Marlin/src/pins/stm32f1/pins_MALYAN_M200.h +++ b/Marlin/src/pins/stm32f1/pins_MALYAN_M200.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -29,12 +29,14 @@ #error "Oops! Select an STM32 board in your IDE." #endif -#define BOARD_INFO_NAME "Malyan M200" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Malyan M200" +#endif -// 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 +// Assume Flash EEPROM +#if NO_EEPROM_SELECTED + #define FLASH_EEPROM_EMULATION +#endif #define SDSS SS_PIN @@ -42,8 +44,6 @@ // 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 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h index a8c6d30eb4..86b6f613d2 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -40,6 +40,11 @@ // #define DISABLE_JTAG +// +// Enable SD EEPROM to prevent infinite boot loop +// +#define SDCARD_EEPROM_EMULATION + // // Servos // @@ -178,10 +183,10 @@ //#define E4_HARDWARE_SERIAL Serial1 // Unused servo pins may be repurposed with SoftwareSerialM - //#define X_SERIAL_TX_PIN PF8 // SERVO3_PIN - //#define Y_SERIAL_TX_PIN PF9 // SERVO2_PIN - //#define Z_SERIAL_TX_PIN PA1 // SERVO1_PIN - //#define E0_SERIAL_TX_PIN PC3 // SERVO0_PIN + //#define X_SERIAL_TX_PIN PF8 // SERVO3_PIN -- XS2 - 6 + //#define Y_SERIAL_TX_PIN PF9 // SERVO2_PIN -- XS2 - 5 + //#define Z_SERIAL_TX_PIN PA1 // SERVO1_PIN -- XS1 - 6 + //#define E0_SERIAL_TX_PIN PC3 // SERVO0_PIN -- XS1 - 5 //#define X_SERIAL_RX_PIN X_SERIAL_TX_PIN //#define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN //#define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h new file mode 100644 index 0000000000..2028cd9dd4 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h @@ -0,0 +1,36 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 E3 (STM32F103RCT6) board pin assignments + */ + +#if HOTENDS > 1 || E_STEPPERS > 1 + #error "MKS Robin E3 supports up to 1 hotends / E-steppers. Comment out this line to continue." +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "MKS Robin E3" +#endif + +#include "pins_MKS_ROBIN_E3_common.h" diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h new file mode 100644 index 0000000000..d1f6dece5c --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h @@ -0,0 +1,67 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 E3D (STM32F103RCT6) board pin assignments + */ + +#if HOTENDS > 1 || E_STEPPERS > 1 + #error "MKS Robin E3D supports up to 1 hotends / E-steppers. Comment out this line to continue." +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "MKS Robin E3D" +#endif + +// +// Steppers +// +#ifndef X_CS_PIN + #define X_CS_PIN PC7 +#endif +#ifndef Y_CS_PIN + #define Y_CS_PIN PD2 +#endif +#ifndef Z_CS_PIN + #define Z_CS_PIN PC12 +#endif +#ifndef E0_CS_PIN + #define E0_CS_PIN PC11 +#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 + +#include "pins_MKS_ROBIN_E3_common.h" diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h new file mode 100644 index 0000000000..0f55de8245 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -0,0 +1,188 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 E3 & E3D (STM32F103RCT6) common board pin assignments + */ + +#ifndef __STM32F1__ + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" +#endif + +#define BOARD_WEBSITE_URL "github.com/makerbase-mks" + +//#define DISABLE_DEBUG +#define DISABLE_JTAG +#define ENABLE_SPI2 + +// +// EEPROM +// +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB +#endif + +// +// Servos +// +#define SERVO0_PIN PA3 + +// +// Limit Switches +// +#define X_STOP_PIN PA12 +#define Y_STOP_PIN PA11 +#define Z_MIN_PIN PC6 +#define Z_MAX_PIN PB1 + +// +// Steppers +// +#define X_STEP_PIN PC0 +#define X_DIR_PIN PB2 +#define X_ENABLE_PIN PC13 + +#define Y_STEP_PIN PC2 +#define Y_DIR_PIN PB9 +#define Y_ENABLE_PIN PB12 + +#define Z_STEP_PIN PB7 +#define Z_DIR_PIN PB6 +#define Z_ENABLE_PIN PB8 + +#define E0_STEP_PIN PB4 +#define E0_DIR_PIN PB3 +#define E0_ENABLE_PIN PB5 + +#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 PC7 + #define X_SERIAL_RX_PIN PC7 + + #define Y_SERIAL_TX_PIN PD2 + #define Y_SERIAL_RX_PIN PD2 + + #define Z_SERIAL_TX_PIN PC12 + #define Z_SERIAL_RX_PIN PC12 + + #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 + +// +// Heaters 0,1 / Fans / Bed +// +#define HEATER_0_PIN PC9 +#define FAN_PIN PA8 +#define HEATER_BED_PIN PC8 + +// +// Temperature Sensors +// +#define TEMP_BED_PIN PA1 // TB +#define TEMP_0_PIN PA0 // TH1 + +#define FIL_RUNOUT_PIN PB10 // MT_DET + +/** + * _____ _____ _____ + * (BEEPER) PC1 | 1 2 | PC3 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SD_SCK) 5V | 1 2 | GND + * (LCD_EN) PA4 | 3 4 | PA5 (LCD_RS) (BTN_EN1) PB11 | 3 4 | PA15 (SD_SS) (LCD_EN) PA4 | 3 4 | PA5 (LCD_RS) + * (LCD_D4) PA6 | 5 6 PA7 (LCD_D5) (BTN_EN2) PB0 | 5 6 PB15 (SD_MOSI) (LCD_D4) PA6 | 5 6 PB0 (BTN_EN2) + * (LCD_D6) PC4 | 7 8 | PC5 (LCD_D7) (SD_DETECT) PC10 | 7 8 | RESET RESET | 7 8 | PB11 (BTN_EN1) + * GND | 9 10| 5V GND | 9 10| NC (BTN_ENC) PC3 | 9 10| PC1 (BEEPER) + * ----- ----- ----- + * EXP1 EXP2 EXP3 + */ +#if HAS_SPI_LCD + + #define BEEPER_PIN PC1 + #define BTN_ENC PC3 + #define LCD_PINS_ENABLE PA4 + #define LCD_PINS_RS PA5 + #define BTN_EN1 PB11 + #define BTN_EN2 PB0 + + // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) + #if ENABLED(MKS_MINI_12864) + + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN -1 + #define DOGLCD_A0 PC4 + #define DOGLCD_CS PA7 + #define DOGLCD_SCK PB13 + #define DOGLCD_MOSI PB15 + + #undef SHOW_BOOTSCREEN + + #else + + #define LCD_PINS_D4 PA6 + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 PA7 + #define LCD_PINS_D6 PC4 + #define LCD_PINS_D7 PC5 + #endif + + #endif // !MKS_MINI_12864 + +#endif // HAS_SPI_LCD + +// +// SD Card +// +#define ENABLE_SPI2 +#define SD_DETECT_PIN PC10 +#define SCK_PIN PB13 +#define MISO_PIN PB14 +#define MOSI_PIN PB15 +#define SS_PIN PA15 + +#ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) +#endif +#ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) +#endif +#ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) +#endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h index 4c10a310bf..3cf0bce06d 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -111,6 +111,18 @@ #endif // !MKS_MINI_12864 + #if HAS_GRAPHICAL_LCD + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) + #endif + #endif + #endif // HAS_SPI_LCD // Motor current PWM pins @@ -129,9 +141,3 @@ #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/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h index 466bdecc81..9cf8685dfa 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -115,8 +115,6 @@ #define DOGLCD_SCK PB13 #define DOGLCD_MOSI PB15 - // Required for MKS_MINI_12864 with this board - #define MKS_LCD12864B #undef SHOW_BOOTSCREEN #else // !MKS_MINI_12864 @@ -142,12 +140,12 @@ #define MOSI_PIN PB15 #define SS_PIN PA15 -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(125) +#ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) #endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(125) +#ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) #endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(125) +#ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index 50babad274..a4c179afce 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -38,11 +38,13 @@ // #define DISABLE_DEBUG -#define FLASH_EEPROM_EMULATION -// 2K in a AT24C16N -#define EEPROM_PAGE_SIZE (uint16)0x800 // 2048 -#define EEPROM_START_ADDRESS ((uint32)(0x8000000 + 512 * 1024 - 2 * EEPROM_PAGE_SIZE)) -#define E2END (EEPROM_PAGE_SIZE - 1) +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + // 2K in a AT24C16N + #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB +#endif // // Note: MKS Robin mini board is using SPI2 interface. @@ -124,8 +126,6 @@ #define FSMC_RS_PIN PD11 // A0 #define LCD_RESET_PIN PC6 - #define NO_LCD_REINIT // Suppress LCD re-initialization - #define LCD_BACKLIGHT_PIN PD13 #if ENABLED(TOUCH_BUTTONS) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index ae9118e6d0..610f4b5735 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -31,13 +31,25 @@ #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" +#define BOARD_INFO_NAME "MKS Robin Nano" // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // #define DISABLE_DEBUG +// +// EEPROM +// +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB +#endif + +#define ENABLE_SPI2 + // // Limit Switches // @@ -83,11 +95,24 @@ // // 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 +#ifndef HEATER_0_PIN + #define HEATER_0_PIN PC3 +#endif +#if HOTENDS == 1 + #ifndef FAN1_PIN + #define FAN1_PIN PB0 + #endif +#else + #ifndef HEATER_1_PIN + #define HEATER_1_PIN PB0 + #endif +#endif +#ifndef FAN_PIN + #define FAN_PIN PB1 // FAN +#endif +#ifndef HEATER_BED_PIN + #define HEATER_BED_PIN PA0 +#endif // // Thermocouples @@ -101,13 +126,33 @@ #define POWER_LOSS_PIN PA2 // PW_DET #define PS_ON_PIN PA3 // PW_OFF -#define LED_PIN PB2 +//#define SUICIDE_PIN PB2 // Enable MKSPWC support ROBIN NANO v1.2 ONLY +//#define SUICIDE_PIN_INVERTING false + +//#define KILL_PIN PA2 // Enable MKSPWC support ROBIN NANO v1.2 ONLY +//#define KILL_PIN_INVERTING true // Enable MKSPWC support ROBIN NANO v1.2 ONLY + +#define SERVO0_PIN PA8 // Enable BLTOUCH support ROBIN NANO v1.2 ONLY + +//#define LED_PIN PB2 + +#define MT_DET_1_PIN PA4 +#define MT_DET_2_PIN PE6 +#define MT_DET_PIN_INVERTING false + +#define WIFI_IO0_PIN PC13 // // SD Card // +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + #define SDIO_SUPPORT +#define SDIO_CLOCK 4500000 // 4.5 MHz #define SD_DETECT_PIN PD12 +#define ONBOARD_SD_CS_PIN PC11 // // LCD / Controller @@ -119,13 +164,50 @@ * If the screen stays white, disable 'LCD_RESET_PIN' * to let the bootloader init the screen. */ + +#if ENABLED(TFT_LVGL_UI_SPI) + + #define SPI_TFT_CS_PIN PD11 + #define SPI_TFT_SCK_PIN PA5 + #define SPI_TFT_MISO_PIN PA6 + #define SPI_TFT_MOSI_PIN PA7 + #define SPI_TFT_DC_PIN PD10 + #define SPI_TFT_RST_PIN PC6 + + #define LCD_BACKLIGHT_PIN PD13 + + #define TOUCH_CS_PIN PE14 // SPI1_NSS + #define TOUCH_SCK_PIN PA5 // SPI1_SCK + #define TOUCH_MISO_PIN PA6 // SPI1_MISO + #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI + + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 + +#elif ENABLED(TFT_LVGL_UI_FSMC) + + #define FSMC_CS_PIN PD7 // NE4 + #define FSMC_RS_PIN PD11 // A0 + + #define TOUCH_CS_PIN PA7 // SPI2_NSS + #define TOUCH_SCK_PIN PB13 // SPI2_SCK + #define TOUCH_MISO_PIN PB14 // SPI2_MISO + #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI + + #define LCD_BACKLIGHT_PIN PD13 + +#endif + #if ENABLED(FSMC_GRAPHICAL_TFT) + //#define DOGLCD_MOSI -1 // prevent redefine Conditionals_post.h + //#define DOGLCD_SCK -1 + #define FSMC_CS_PIN PD7 // NE4 #define FSMC_RS_PIN PD11 // A0 #define LCD_RESET_PIN PC6 // FSMC_RST - #define NO_LCD_REINIT // Suppress LCD re-initialization - #define LCD_BACKLIGHT_PIN PD13 #if ENABLED(TOUCH_BUTTONS) @@ -135,3 +217,57 @@ #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI #endif #endif + +#if HAS_SPI_LCD + + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 + #define LCD_PINS_ENABLE PD13 + #define LCD_PINS_RS PC6 + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define LCD_BACKLIGHT_PIN -1 + + // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) + #if ENABLED(MKS_MINI_12864) + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN -1 + #define DOGLCD_A0 PD11 + #define DOGLCD_CS PE15 + #define DOGLCD_SCK PA5 + #define DOGLCD_MOSI PA7 + + // Required for MKS_MINI_12864 with this board + #define MKS_LCD12864B + #undef SHOW_BOOTSCREEN + + #else // !MKS_MINI_12864 + + #define LCD_PINS_D4 PE14 + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 PE15 + #define LCD_PINS_D6 PD11 + #define LCD_PINS_D7 PD10 + #endif + + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) + #endif + + #endif // !MKS_MINI_12864 + +#endif // HAS_SPI_LCD + +#define SPI_FLASH +#if ENABLED(SPI_FLASH) + #define W25QXX_CS_PIN PB12 + #define W25QXX_MOSI_PIN PB15 + #define W25QXX_MISO_PIN PB14 + #define W25QXX_SCK_PIN PB13 +#endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h new file mode 100644 index 0000000000..dd0d1e9465 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -0,0 +1,322 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 V2.0" + +// +// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role +// + +//#define DISABLE_DEBUG + +// +// EEPROM +// +//#define FLASH_EEPROM_EMULATION +//#define SDCARD_EEPROM_EMULATION + +#if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM) + #define I2C_EEPROM // EEPROM on I2C-0 + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif + +// +// Note: MKS Robin board is using SPI2 interface. +// +//#define SPI_MODULE 2 +#define ENABLE_SPI2 + +// +// Limit Switches +// +#define X_DIAG_PIN PA15 +#define Y_DIAG_PIN PA12 +#define Z_DIAG_PIN PA11 +#define E0_DIAG_PIN PC4 +#define E1_DIAG_PIN PE7 + +#define X_STOP_PIN PA15 +#define Y_STOP_PIN PA12 +#define Z_MIN_PIN PA11 +#define Z_MAX_PIN PC4 + +// +// Steppers +// +#define X_ENABLE_PIN PE4 +#define X_STEP_PIN PE3 +#define X_DIR_PIN PE2 +#ifndef X_CS_PIN + #define X_CS_PIN PD5 +#endif + +#define Y_ENABLE_PIN PE1 +#define Y_STEP_PIN PE0 +#define Y_DIR_PIN PB9 +#ifndef Y_CS_PIN + #define Y_CS_PIN PD7 +#endif + +#define Z_ENABLE_PIN PB8 +#define Z_STEP_PIN PB5 +#define Z_DIR_PIN PB4 +#ifndef Z_CS_PIN + #define Z_CS_PIN PD4 +#endif + +#define E0_ENABLE_PIN PB3 +#define E0_STEP_PIN PD6 +#define E0_DIR_PIN PD3 +#ifndef E0_CS_PIN + #define E0_CS_PIN PD9 +#endif + +#define E1_ENABLE_PIN PA3 +#define E1_STEP_PIN PD15 +#define E1_DIR_PIN PA1 +#ifndef E1_CS_PIN + #define E1_CS_PIN PD8 +#endif + +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PD14 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PD1 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PD0 + #endif +#endif + +#if HAS_TMC_UART + /** + * 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 PD5 + #define X_SERIAL_RX_PIN PD5 + + #define Y_SERIAL_TX_PIN PD7 + #define Y_SERIAL_RX_PIN PD7 + + #define Z_SERIAL_TX_PIN PD4 + #define Z_SERIAL_RX_PIN PD4 + + #define E0_SERIAL_TX_PIN PD9 + #define E0_SERIAL_RX_PIN PD9 + + #define E1_SERIAL_TX_PIN PD8 + #define E1_SERIAL_RX_PIN PD8 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif // TMC2208 || TMC2209 + +// +// 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 SUICIDE_PIN PB2 // Enable MKSPWC support ROBIN NANO v1.2 ONLY +//#define SUICIDE_PIN_INVERTING false + +//#define KILL_PIN PA2 // Enable MKSPWC support ROBIN NANO v1.2 ONLY +//#define KILL_PIN_INVERTING true // Enable MKSPWC support ROBIN NANO v1.2 ONLY + +#define SERVO0_PIN PA8 // Enable BLTOUCH support ROBIN NANO v1.2 ONLY + +//#define LED_PIN PB2 + +#define MT_DET_1_PIN PA4 +#define MT_DET_2_PIN PE6 +#define MT_DET_PIN_INVERTING false + +#define WIFI_IO0_PIN PC13 + +// +// SD Card +// +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#define SDIO_SUPPORT +#define SDIO_CLOCK 4500000 // 4.5 MHz +#define SD_DETECT_PIN PD12 +#define ONBOARD_SD_CS_PIN PC11 + +// +// LCD / Controller +// +#define BEEPER_PIN PC5 + +/** + * 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(TFT_LVGL_UI_SPI) + + #define SPI_TFT_CS_PIN PD11 + #define SPI_TFT_SCK_PIN PA5 + #define SPI_TFT_MISO_PIN PA6 + #define SPI_TFT_MOSI_PIN PA7 + #define SPI_TFT_DC_PIN PD10 + #define SPI_TFT_RST_PIN PC6 + + #define LCD_BACKLIGHT_PIN PD13 + + #define TOUCH_CS_PIN PE14 // SPI1_NSS + #define TOUCH_SCK_PIN PA5 // SPI1_SCK + #define TOUCH_MISO_PIN PA6 // SPI1_MISO + #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI + + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 + +#elif ENABLED(TFT_LITTLE_VGL_UI) + + #define FSMC_CS_PIN PD7 // NE4 + #define FSMC_RS_PIN PD11 // A0 + + #define TOUCH_CS_PIN PA7 // SPI2_NSS + #define TOUCH_SCK_PIN PB13 // SPI2_SCK + #define TOUCH_MISO_PIN PB14 // SPI2_MISO + #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI + + #define LCD_BACKLIGHT_PIN PD13 + +#endif + +#if HAS_SPI_LCD + + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 + #define LCD_PINS_ENABLE PD13 + #define LCD_PINS_RS PC6 + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define LCD_BACKLIGHT_PIN -1 + + // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) + #if ENABLED(MKS_MINI_12864) + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN -1 + #define DOGLCD_A0 PD11 + #define DOGLCD_CS PE15 + #define DOGLCD_SCK PA5 + #define DOGLCD_MOSI PA7 + + // Required for MKS_MINI_12864 with this board + #define MKS_LCD12864B + #undef SHOW_BOOTSCREEN + + #else // !MKS_MINI_12864 + + #define LCD_PINS_D4 PE14 + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 PE15 + #define LCD_PINS_D6 PD11 + #define LCD_PINS_D7 PD10 + #endif + + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) + #endif + + #endif // !MKS_MINI_12864 + +#endif // HAS_SPI_LCD + +#define SPI_FLASH +#if ENABLED(SPI_FLASH) + #define W25QXX_CS_PIN PB12 + #define W25QXX_MOSI_PIN PB15 + #define W25QXX_MISO_PIN PB14 + #define W25QXX_SCK_PIN PB13 +#endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h index b42856721d..2d6c98eb1e 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -219,8 +219,6 @@ #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) @@ -263,12 +261,12 @@ #endif // !MKS_MINI_12864 && !ENDER2_STOCKDISPLAY #endif -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(125) +#ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) #endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(125) +#ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) #endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(125) +#ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) #endif diff --git a/Marlin/src/pins/stm32f1/pins_MORPHEUS.h b/Marlin/src/pins/stm32f1/pins_MORPHEUS.h index 7311d91a80..1cd3780ec5 100644 --- a/Marlin/src/pins/stm32f1/pins_MORPHEUS.h +++ b/Marlin/src/pins/stm32f1/pins_MORPHEUS.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/stm32f1/pins_STM32F1R.h b/Marlin/src/pins/stm32f1/pins_STM32F1R.h index d144c0e692..475f31cb71 100644 --- a/Marlin/src/pins/stm32f1/pins_STM32F1R.h +++ b/Marlin/src/pins/stm32f1/pins_STM32F1R.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -163,7 +163,7 @@ #elif ENABLED(LCD_I2C_VIKI) - #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. + #define BTN_EN1 22 // https://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 diff --git a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h index 58b13b90df..16e665621c 100644 --- a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -186,7 +186,7 @@ #elif ENABLED(LCD_I2C_VIKI) - #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. + #define BTN_EN1 22 // https://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 diff --git a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h new file mode 100644 index 0000000000..2ca5897e9e --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h @@ -0,0 +1,157 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * ANYCUBIC Trigorilla Pro (STM32F130ZET6) board pin assignments. + * It is the same used by the Tronxy X5SA thanks to ftoz1 for sharing it + * https://github.com/MarlinFirmware/Marlin/issues/14655 + * https://github.com/MarlinFirmware/Marlin/files/3401484/x5sa-main_board-2.pdf + */ + +#ifndef __STM32F1__ + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "Trigorilla Pro supports up to 2 hotends / E-steppers. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "Trigorilla Pro" +#define DISABLE_JTAG + +// +// EEPROM +// +#define FLASH_EEPROM_EMULATION +#if 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 MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE +#else + #define MARLIN_EEPROM_SIZE (0x800U) // On SD, Limit to 2KB, require this amount of RAM +#endif + +// +// Limit Switches +// +#define X_MAX_PIN PG10 +#define Y_MAX_PIN PA12 +#define Z_MAX_PIN PA14 +#define Z_MIN_PIN PA13 + +// +// Steppers +// +#define X_ENABLE_PIN PC13 +#define X_STEP_PIN PE5 +#define X_DIR_PIN PE6 + +#define Y_ENABLE_PIN PE4 +#define Y_STEP_PIN PE2 +#define Y_DIR_PIN PE3 + +#define Z_ENABLE_PIN PE1 +#define Z_STEP_PIN PB9 +#define Z_DIR_PIN PE0 + +#define E0_ENABLE_PIN PB8 +#define E0_STEP_PIN PB4 +#define E0_DIR_PIN PB5 + +#define E1_ENABLE_PIN PG8 +#define E1_STEP_PIN PC7 +#define E1_DIR_PIN PC6 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PA1 // TH1 +#define TEMP_BED_PIN PA0 // TB1 + +// +// Heaters +// +#define HEATER_0_PIN PG12 // HEATER1 +#define HEATER_BED_PIN PG11 // HOT BED +#define HEATER_BED_INVERTING true + +// +// Fans +// +#define CONTROLLER_FAN_PIN PD6 // FAN +#define FAN_PIN PG13 // FAN +#define FAN1_PIN PG14 // FAN + +// +// Misc +// +#define BEEPER_PIN PB0 +#define LED_PIN PD3 +//#define POWER_LOSS_PIN PG2 // PG4 PW_DET +#define FIL_RUNOUT_PIN PA15 // MT_DET + +/** + * Note: MKS Robin TFT screens use various TFT controllers + * Supported screens are based on the ILI9341, ST7789V and ILI9328 (320x240) + * ILI9488 is not supported. + * 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 PF11 +#define LCD_BACKLIGHT_PIN PD13 +#define FSMC_CS_PIN PD7 // NE4 +#define FSMC_RS_PIN PD11 // 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 PB7 // SPI2_NSS + #define TOUCH_SCK_PIN PA5 // SPI2_SCK + #define TOUCH_MISO_PIN PA6 // SPI2_MISO + #define TOUCH_MOSI_PIN PA7 // SPI2_MOSI +#endif + +// SPI1(PA7) & SPI3(PB5) not available +#define ENABLE_SPI2 + +#if ENABLED(SDIO_SUPPORT) + #define SCK_PIN PB13 // SPI2 ok + #define MISO_PIN PB14 // SPI2 ok + #define MOSI_PIN PB15 // SPI2 ok + #define SS_PIN PC11 // PB12 is X- ok + #define SD_DETECT_PIN -1 // SD_CD ok +#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/src/pins/stm32f4/pins_ARMED.h b/Marlin/src/pins/stm32f4/pins_ARMED.h index ddbe09c355..232337f6df 100644 --- a/Marlin/src/pins/stm32f4/pins_ARMED.h +++ b/Marlin/src/pins/stm32f4/pins_ARMED.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -39,9 +39,7 @@ #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 +#define MARLIN_EEPROM_SIZE 0x1000 // 4KB // // Limit Switches diff --git a/Marlin/src/pins/stm32f4/pins_BEAST.h b/Marlin/src/pins/stm32f4/pins_BEAST.h index 5be4368789..676f1f8c9b 100644 --- a/Marlin/src/pins/stm32f4/pins_BEAST.h +++ b/Marlin/src/pins/stm32f4/pins_BEAST.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -186,7 +186,7 @@ #elif ENABLED(LCD_I2C_VIKI) - #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. + #define BTN_EN1 22 // https://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 diff --git a/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h b/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h index 524f4892b8..e6350f71dc 100644 --- a/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h +++ b/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -40,8 +40,8 @@ #define DEFAULT_MACHINE_NAME "STM32F407VET6" //#define I2C_EEPROM -//#define E2END 0x1FFF // 8KB #define SRAM_EEPROM_EMULATION +#define MARLIN_EEPROM_SIZE 0x2000 // 8KB // // Servos @@ -142,7 +142,11 @@ #define SDIO_CK_PIN PC12 #define SDIO_CMD_PIN PD2 -#if !defined(SDCARD_CONNECTION) || SDCARD_CONNECTION == ONBOARD +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#if SD_CONNECTION_IS(ONBOARD) #define SDIO_SUPPORT // Use SDIO for onboard SD #ifndef SDIO_SUPPORT diff --git a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h index ee5c4da1fe..0e81237ad9 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -27,11 +27,19 @@ #error "BIGTREE BTT002 V1.0 supports up to 1 hotends / E-steppers." #endif -#define BOARD_INFO_NAME "BIGTREE Btt002 1.0" +#define BOARD_INFO_NAME "BTT BTT002 V1.0" // 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 +#if NO_EEPROM_SELECTED + //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation + #define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation +#endif + +#if ENABLED(FLASH_EEPROM_EMULATION) + // Decrease delays and flash wear by spreading writes across the + // 128 kB sector allocated for EEPROM emulation. + #define FLASH_EEPROM_LEVELING +#endif // Ignore temp readings during development. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 @@ -229,9 +237,15 @@ // 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) + #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(600) + #endif #endif #endif // HAS_SPI_LCD diff --git a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h index ac8b731aae..776ab1d811 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -29,12 +29,11 @@ #error "Marlin extruder/hotends limit! Increase MAX_EXTRUDERS to continue." #endif -#define BOARD_INFO_NAME "BIGTREE GTR 1.0" +#define BOARD_INFO_NAME "BTT GTR V1.0" -// Use one of these or SDCard-based Emulation will be used -//#define I2C_EEPROM -//#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation -//#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation +// Onboard I2C EEPROM +#define I2C_EEPROM +#define MARLIN_EEPROM_SIZE 0x2000 // 8KB (24C64 ... 64Kb = 8KB) #define TP // Enable to define servo and probe pins @@ -321,17 +320,18 @@ #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS PA8 + #define LCD_PINS_RS PG6 - #define BTN_EN1 PD10 - #define BTN_EN2 PH10 + #define BTN_EN1 PC10 + #define BTN_EN2 PG8 - #define LCD_PINS_ENABLE PG7 - #define LCD_PINS_D4 PG8 + #define LCD_PINS_ENABLE PG5 + #define LCD_PINS_D4 PG7 - //#undef ST7920_DELAY_1 - //#undef ST7920_DELAY_2 - //#undef ST7920_DELAY_3 + // CR10_STOCKDISPLAY default timing is too fast + #undef BOARD_ST7920_DELAY_1 + #undef BOARD_ST7920_DELAY_2 + #undef BOARD_ST7920_DELAY_3 #else @@ -378,9 +378,15 @@ // 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) + #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(600) + #endif #endif //#define DOGLCD_CS PB12 @@ -389,3 +395,5 @@ //#define DOGLCD_MOSI PB15 #endif // HAS_SPI_LCD + +#undef TP diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_1.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_1.h index 4dbdf0e77f..fb4b17b6fb 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_1.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_1.h @@ -16,269 +16,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 +#if 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? +#define BOARD_INFO_NAME "BTT SKR Pro V1.1" -// 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_TMC_UART - /** - * 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 -// - -#ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION LCD -#endif - -// -// Onboard SD card -// NOT compatible with LCD -// -#if SDCARD_CONNECTION == ONBOARD && !HAS_SPI_LCD - #define SOFTWARE_SPI // Use soft SPI for onboard SD - #define SDSS PA4 - #define SCK_PIN PA5 - #define MISO_PIN PA6 - #define MOSI_PIN PB5 -#else - #define SDSS PB12 -#endif - -/** - * _____ _____ - * 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 +#include "pins_BTT_SKR_PRO_common.h" diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_2.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_2.h new file mode 100644 index 0000000000..615751b62d --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_2.h @@ -0,0 +1,30 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 > 3 || E_STEPPERS > 3 + #error "BIGTREE SKR Pro V1.2 supports up to 3 hotends / E-steppers." +#endif + +#define BOARD_INFO_NAME "BTT SKR Pro V1.2" + +#include "pins_BTT_SKR_PRO_common.h" diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h new file mode 100644 index 0000000000..b6bb854d5b --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h @@ -0,0 +1,374 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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.'" +#endif + +// Use one of these or SDCard-based Emulation will be used +#if NO_EEPROM_SELECTED + //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation + #define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation +#endif + +#if ENABLED(FLASH_EEPROM_EMULATION) + // Decrease delays and flash wear by spreading writes across the + // 128 kB sector allocated for EEPROM emulation. + #define FLASH_EEPROM_LEVELING +#endif + +// +// Servos +// +#define SERVO0_PIN PA1 + +// +// Trinamic Stallguard pins +// +#define X_DIAG_PIN PB10 // X- +#define Y_DIAG_PIN PE12 // Y- +#define Z_DIAG_PIN PG8 // Z- +#define E0_DIAG_PIN PE15 // E0 +#define E1_DIAG_PIN PE10 // E1 +#define E2_DIAG_PIN PG5 // E2 + +// +// Limit Switches +// +#ifdef X_STALL_SENSITIVITY + #define X_STOP_PIN X_DIAG_PIN + #if X_HOME_DIR < 0 + #define X_MAX_PIN PE15 // E0 + #else + #define X_MIN_PIN PE15 // E0 + #endif +#else + #define X_MIN_PIN PB10 // X- + #define X_MAX_PIN PE15 // E0 +#endif + +#ifdef Y_STALL_SENSITIVITY + #define Y_STOP_PIN Y_DIAG_PIN + #if Y_HOME_DIR < 0 + #define Y_MAX_PIN PE10 // E1 + #else + #define Y_MIN_PIN PE10 // E1 + #endif +#else + #define Y_MIN_PIN PE12 // Y- + #define Y_MAX_PIN PE10 // E1 +#endif + +#ifdef Z_STALL_SENSITIVITY + #define Z_STOP_PIN Z_DIAG_PIN + #if Z_HOME_DIR < 0 + #define Z_MAX_PIN PG5 // E2 + #else + #define Z_MIN_PIN PG5 // E2 + #endif +#else + #define Z_MIN_PIN PG8 // Z- + #define Z_MAX_PIN PG5 // E2 +#endif + +// +// Z Probe must be this pin +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN PA2 +#endif + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PE15 +#endif +#ifndef FIL_RUNOUT2_PIN + #define FIL_RUNOUT2_PIN PE10 +#endif +#ifndef FIL_RUNOUT3_PIN + #define FIL_RUNOUT3_PIN PG5 +#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_TMC_UART + /** + * 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 + +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN FAN1_PIN +#endif + +// +// Misc. Functions +// + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION LCD +#endif + +// +// Onboard SD card +// Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2 +// +#if SD_CONNECTION_IS(ONBOARD) + #define SOFTWARE_SPI // Use soft SPI for onboard SD + #define SDSS PA4 + #define SCK_PIN PA5 + #define MISO_PIN PA6 + #define MOSI_PIN PB5 +#endif + +/** + * _____ _____ + * 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 SD_CONNECTION_IS(LCD) + #define SDSS PB12 // Uses default hardware SPI for LCD's SD + #endif + + #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_STOCKDISPLAY default timing is too fast + #undef BOARD_ST7920_DELAY_1 + #undef BOARD_ST7920_DELAY_2 + #undef BOARD_ST7920_DELAY_3 + + #elif ENABLED(MKS_MINI_12864) + #define DOGLCD_A0 PG6 + #define DOGLCD_CS PG3 + + #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 + #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(600) + #endif + #endif + +#endif // HAS_SPI_LCD + +// +// WIFI +// + +/** + * _____ + * TX | 1 2 | GND Enable PG1 // Must be high for module to run + * Enable | 3 4 | GPIO2 Reset PG0 // active low, probably OK to leave floating + * Reset | 5 6 | GPIO0 GPIO2 PF15 // must be high (ESP3D software configures this with a pullup so OK to leave as floating) + * 3.3V| 7 8 | RX GPIO0 PF14 // Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating) + *  ̄ ̄ + * W1 + */ +#define ESP_WIFI_MODULE_COM 6 // Must also set either SERIAL_PORT or SERIAL_PORT_2 to this +#define ESP_WIFI_MODULE_BAUDRATE BAUDRATE // Must use same BAUDRATE as SERIAL_PORT & SERIAL_PORT_2 +#define ESP_WIFI_MODULE_RESET_PIN PG0 +#define ESP_WIFI_MODULE_ENABLE_PIN PG1 +#define ESP_WIFI_MODULE_GPIO0_PIN PF14 +#define ESP_WIFI_MODULE_GPIO2_PIN PF15 diff --git a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h index 8205cd9f4d..497db5817b 100644 --- a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h +++ b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -31,8 +31,7 @@ #define BOARD_WEBSITE_URL "github.com/FLYmaker/FLYF407ZG" #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME -#undef E2END -#define E2END 0xFFF // 4KB +#define MARLIN_EEPROM_SIZE 0x1000 // 4KB // // Servos @@ -164,7 +163,11 @@ #define SDIO_CK_PIN PC12 #define SDIO_CMD_PIN PD2 -#if !defined(SDCARD_CONNECTION) || SDCARD_CONNECTION == ONBOARD +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#if SD_CONNECTION_IS(ONBOARD) #define SDIO_SUPPORT // Use SDIO for onboard SD #ifndef SDIO_SUPPORT @@ -254,12 +257,12 @@ // // ST7920 Delays // -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(96) +#ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) #endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(48) +#ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) #endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(715) +#ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(715) #endif diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h index bdadbe36c2..03960584fb 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -34,21 +34,24 @@ #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME #endif -// change the prio to 3 , 2 is for software serial +// Change the priority to 3. Priority 2 is for software serial. //#define TEMP_TIMER_IRQ_PRIO 3 // // EEPROM Emulation // -#define FLASH_EEPROM_EMULATION -#if ENABLED(FLASH_EEPROM_EMULATION) - #define FLASH_EEPROM_LEVELING +#if NO_EEPROM_SELECTED + #define FLASH_EEPROM_EMULATION + //#define SRAM_EEPROM_EMULATION + //#define I2C_EEPROM #endif -//#define SRAM_EEPROM_EMULATION -//#define I2C_EEPROM -#ifdef 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 + +#if ENABLED(FLASH_EEPROM_EMULATION) + // Decrease delays and flash wear by spreading writes across the + // 128 kB sector allocated for EEPROM emulation. + #define FLASH_EEPROM_LEVELING +#elif ENABLED(I2C_EEPROM) + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB #endif // @@ -188,11 +191,10 @@ #define LCD_PINS_ENABLE PD1 #define LCD_PINS_D4 PC12 - // 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 + // CR10_STOCKDISPLAY default timing is too fast + #undef BOARD_ST7920_DELAY_1 + #undef BOARD_ST7920_DELAY_2 + #undef BOARD_ST7920_DELAY_3 #else @@ -239,14 +241,14 @@ // Alter timing for graphical display #if HAS_GRAPHICAL_LCD - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(96) + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(48) + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(600) + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(600) #endif #endif diff --git a/Marlin/src/pins/stm32f4/pins_GENERIC_STM32F4.h b/Marlin/src/pins/stm32f4/pins_GENERIC_STM32F4.h index 924b94c4f1..b84c724667 100644 --- a/Marlin/src/pins/stm32f4/pins_GENERIC_STM32F4.h +++ b/Marlin/src/pins/stm32f4/pins_GENERIC_STM32F4.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -36,8 +36,8 @@ //#define I2C_EEPROM -#ifndef E2END - #define E2END 0xFFF // 4KB +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB #endif // Ignore temp readings during development. @@ -126,7 +126,9 @@ #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 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN PC7 +#endif // // Misc. Functions @@ -183,7 +185,13 @@ // 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) + #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 diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_K.h b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h index d21cdd0958..126d571464 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_K.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -29,13 +29,10 @@ #define I2C_EEPROM -// Ignore temp readings during develpment. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - // // Servos // -//#define SERVO0_PIN PD12 +//#define SERVO0_PIN PB11 // // Limit Switches @@ -48,14 +45,14 @@ // Z Probe (when not Z_MIN_PIN) // //#ifndef Z_MIN_PROBE_PIN -// #define Z_MIN_PROBE_PIN PB15 +// #define Z_MIN_PROBE_PIN PG6 //#endif // // Filament runout // -#define FIL_RUNOUT_PIN PE6 -#define FIL_RUNOUT2_PIN PE7 +#define FIL_RUNOUT_PIN PE5 +#define FIL_RUNOUT2_PIN PE6 // // Steppers @@ -64,35 +61,35 @@ #define X_DIR_PIN PB10 #define X_ENABLE_PIN PG0 //#ifndef X_CS_PIN -// #define X_CS_PIN PE0 +// #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 +// #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 +// #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 +// #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 +// #define E1_CS_PIN PE4 //#endif // @@ -102,6 +99,12 @@ #define TEMP_1_PIN PC2 // Analog Input #define TEMP_BED_PIN PC0 // Analog Input +// Lergde-K can choose thermocouple/thermistor mode in software. +// For use with thermistors, these pins must be OUT/LOW. +// This is done automatically. +#define TEMP_0_TR_ENABLE_PIN PF10 +#define TEMP_1_TR_ENABLE_PIN PF9 + // // Heaters / Fans // @@ -110,12 +113,14 @@ #define HEATER_BED_PIN PA2 #ifndef FAN_PIN - #define FAN_PIN PC15 + #define FAN_PIN PF7 #endif #define FAN1_PIN PF6 -#define FAN2_PIN PF7 +#define FAN2_PIN PF8 -#define ORIG_E0_AUTO_FAN_PIN FAN1_PIN // Use this by NOT overriding E0_AUTO_FAN_PIN +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN PF6 +#endif // // LED / Lighting @@ -123,12 +128,15 @@ //#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 +#ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PB7 +#endif +#ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PB8 +#endif +#ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PB9 +#endif // // SD support @@ -139,39 +147,34 @@ // Misc. Functions // #define SDSS PC11 -#define LED_PIN PC7 // Alive +#define LED_PIN PA15 // Alive #define PS_ON_PIN -1 #define KILL_PIN -1 -#define POWER_LOSS_PIN -1 // Power-loss / nAC_FAULT +#define POWER_LOSS_PIN PA4 // Power-loss / nAC_FAULT #define SCK_PIN PC12 #define MISO_PIN PC8 #define MOSI_PIN PD2 #define SS_PIN PC11 +#define SD_DETECT_PIN PA8 +#define BEEPER_PIN PC7 + // // 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 TFT_RESET_PIN PD6 +#define TFT_BACKLIGHT_PIN PD3 -#define BTN_EN1 PE3 -#define BTN_EN2 PE4 -#define BTN_ENC PE2 +#define TFT_CS_PIN PD7 +#define TFT_RS_PIN PD11 -// -// 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 +#define TOUCH_CS_PIN PG15 +#define TOUCH_SCK_PIN PB3 +#define TOUCH_MOSI_PIN PB5 +#define TOUCH_MISO_PIN PB4 + +#define BTN_EN1 PG10 +#define BTN_EN2 PG11 +#define BTN_ENC PG9 diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_S.h b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h new file mode 100644 index 0000000000..8f9a4339cd --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h @@ -0,0 +1,208 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 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 S supports up to 2 hotends / E-steppers." +#endif + +#define BOARD_INFO_NAME "Lerdge S" +#define DEFAULT_MACHINE_NAME "LERDGE" + +#define STEP_TIMER 4 +#define TEMP_TIMER 2 + +//#define I2C_EEPROM + +// +// Servos +// +#define SERVO0_PIN PD12 //confirmed +//#define SERVO1_PIN -1 + +// +// Limit Switches +// +#define X_MIN_PIN PG9 //confirmed +#define Y_MIN_PIN PG10 //confirmed +#define Z_MIN_PIN PG11 //confirmed + +#define X_MAX_PIN PG12 //confirmed +#define Y_MAX_PIN PG13 //confirmed +#define Z_MAX_PIN PG14 //confirmed + +// +// Filament runout +// +#define FIL_RUNOUT_PIN PC5 //confirmed + +// +// Z Probe (when not Z_MIN_PIN) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN PG8 //confirmed +#endif + +// +// Steppers +// +#define X_STEP_PIN PF7 //confirmed +#define X_DIR_PIN PF8 //confirmed +#define X_ENABLE_PIN PF6 //confirmed + +#define Y_STEP_PIN PF10 //confirmed +#define Y_DIR_PIN PF11 //confirmed +#define Y_ENABLE_PIN PF9 //confirmed + +#define Z_STEP_PIN PF13 //confirmed +#define Z_DIR_PIN PF14 //confirmed +#define Z_ENABLE_PIN PF12 //confirmed + +#define E0_STEP_PIN PG0 //confirmed +#define E0_DIR_PIN PG1 //confirmed +#define E0_ENABLE_PIN PF15 //confirmed + +#define E1_STEP_PIN PG3 //confirmed +#define E1_DIR_PIN PG4 //confirmed +#define E1_ENABLE_PIN PG2 //confirmed + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC0 // See below for activation of thermistor readings +#define TEMP_1_PIN PC1 // See below for activation of thermistor readings +#define TEMP_BED_PIN PC3 //confirmed + +// Lergde-S can choose thermocouple/thermistor mode in software. +// For use with thermistors, these pins must be OUT/LOW. +// This is done automatically. +#define TEMP_0_TR_ENABLE_PIN PF3 +#define TEMP_1_TR_ENABLE_PIN PF4 + +// MAX6675 Cold-Junction-Compensated K-Thermocouple to Digital Converter (0°C to +1024°C) +// https://datasheets.maximintegrated.com/en/ds/MAX6675.pdf + +#define MAX6675_SCK_PIN PB3 // max6675 datasheet: SCK pin, found with multimeter, not tested +#define MAX6675_DO_PIN PB4 // max6675 datasheet: SO pin, found with multimeter, not tested +#define MAX6675_SS_PIN PC4 // max6675 datasheet: /CS pin, found with multimeter, not tested and likely wrong + +// Expansion board with second max6675 +// Warning: Some boards leave the slot unpopulated. + +//#define MAX6675_SCK2_PIN PB3 // max6675 datasheet: SCK pin, found with multimeter, not tested +//#define MAX6675_DO2_PIN PB4 // max6675 datasheet: SO pin, found with multimeter, not tested +//#define MAX6675_SS2_PIN PF1 // max6675 datasheet: /CS pin, found with multimeter, not tested + +// +// Heaters / Fans +// +#define HEATER_0_PIN PA0 //confirmed +#define HEATER_1_PIN PA1 //confirmed +#define HEATER_BED_PIN PA3 //confirmed + +#define FAN_PIN PA15 // heater 0 fan 1 //confirmed +#define FAN1_PIN PB10 // heater 1 fan 2 //confirmed +#define FAN2_PIN PF5 // heater 0 fan 2 and heater 1 fan 1 (two sockets, switched together) //confirmed + +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN PF5 +#endif + +// +// Prusa i3 MK2 Multi Material Multiplexer Support +// +//#define E_MUX0_PIN -1 +//#define E_MUX1_PIN -1 + +// +// LED / Lighting +// +//Lerdge-S board has two LED connectors (this is the one on the mainboard) +#define CASE_LIGHT_PIN PC7 //confirmed + +//on the dual extrusion addon board is a RGB connector +#define RGB_LED_R_PIN PC7 // Shared with the mainboard LED light connector (CASE_LIGHT_PIN), confirmed +#define RGB_LED_G_PIN PB0 //confirmed +#define RGB_LED_B_PIN PB1 //confirmed + +// +// Misc. Functions +// +#define SDSS PC11 // SD is working using SDIO, not sure if this definition is needed? +#define LED_PIN PC6 // Mainboard soldered green LED, confirmed +#define PS_ON_PIN PB2 // Board has a power module connector, confirmed +#define KILL_PIN -1 // There is no reset button on the LCD +#define POWER_LOSS_PIN -1 // PB2 could be used for this as well + +// +// SD support +// +#define SDIO_SUPPORT + +#define SCK_PIN PC12 //confirmed working +#define MISO_PIN PC8 //confirmed working +#define MOSI_PIN PD2 //confirmed working +#define SS_PIN PC11 //confirmed working + +#define SD_DETECT_PIN PG15 //confirmed + +// +// Persistent Storage +// If no option is selected below the SD Card will be used +// (this section modelled after pins_LONGER3D_LK.h) +// Warning: Not tested yet! Pins traced with multimeter, mistakes are possible +//#define SPI_EEPROM + +#if ENABLED(SPI_EEPROM) + // Lerdge has an SPI EEPROM Winbond W25Q128 (128Mbits) https://www.pjrc.com/teensy/W25Q128FV.pdf + #define SPI_CHAN_EEPROM1 1 + #define SPI_EEPROM1_CS PB12 // datasheet: /CS pin, found with multimeter, not tested + #define EEPROM_SCK PB13 // datasheet: CLK pin, found with multimeter, not tested + #define EEPROM_MISO PB14 // datasheet: DO pin, found with multimeter, not tested + #define EEPROM_MOSI PB15 // datasheet: DI pin, found with multimeter, not tested + #define EEPROM_PAGE_SIZE 0x1000U // 4KB (from datasheet) + #define MARLIN_EEPROM_SIZE 16UL * (EEPROM_PAGE_SIZE) // Limit to 64KB for now... +#else + #define MARLIN_EEPROM_SIZE 0x800U // On SD, Limit to 2KB, require this amount of RAM +#endif + +// +// LCD / Controller +// + +// The LCD is initialized in FSMC mode +#define BEEPER_PIN PD13 //confirmed + +#define BTN_EN1 PC14 //confirmed +#define BTN_EN2 PC15 //confirmed +#define BTN_ENC PC13 //confirmed + +#define TFT_RESET_PIN PD6 //confirmed +#define TFT_BACKLIGHT_PIN PD3 //confirmed + +#define TFT_CS_PIN PD7 // TFT works +#define TFT_RS_PIN PD11 // TFT works + +// There is touch, but calibration is off +#define TOUCH_CS_PIN PB6 +#define TOUCH_SCK_PIN PB3 +#define TOUCH_MOSI_PIN PB5 +#define TOUCH_MISO_PIN PB4 diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_X.h b/Marlin/src/pins/stm32f4/pins_LERDGE_X.h index c54c5c1806..745d911e3a 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_X.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_X.h @@ -13,27 +13,29 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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." +#elif HOTENDS > 1 || E_STEPPERS > 1 + #error "LERDGE X supports only one hotend / E-steppers" #endif #define BOARD_INFO_NAME "Lerdge X" #define DEFAULT_MACHINE_NAME "LERDGE" -//#define I2C_EEPROM +#define STEP_TIMER 4 +#define TEMP_TIMER 2 + +#define I2C_EEPROM // // Servos // -//#define SERVO0_PIN PD12 -//#define SERVO1_PIN -1 +//#define SERVO0_PIN PD13 // // Limit Switches @@ -51,7 +53,7 @@ // Z Probe (when not Z_MIN_PIN) // //#ifndef Z_MIN_PROBE_PIN -// #define Z_MIN_PROBE_PIN PB15 +// #define Z_MIN_PROBE_PIN PB15 //#endif // @@ -60,37 +62,18 @@ #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 @@ -106,19 +89,15 @@ #define HEATER_1_PIN -1 #define HEATER_BED_PIN PA2 -#ifndef FAN_PIN -// #define FAN_PIN PC15 -#endif +//#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 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN PC15 // FAN1_PIN +#endif // // LED / Lighting @@ -134,7 +113,9 @@ #define LED_PIN PC7 // Alive #define PS_ON_PIN -1 #define KILL_PIN -1 -#define POWER_LOSS_PIN -1 // Power-loss / nAC_FAULT + +// Lerdge supports auto-power off and power loss sense through a single pin. +#define POWER_LOSS_PIN PC14 // Power-loss / nAC_FAULT #define SCK_PIN PC12 #define MISO_PIN PC8 @@ -145,30 +126,26 @@ // SD support // #define SDIO_SUPPORT +#define SD_DETECT_PIN PA8 // // 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 +#define TFT_RESET_PIN PD6 +#define TFT_BACKLIGHT_PIN PD3 -// -// 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 +#define TFT_CS_PIN PD7 +#define TFT_RS_PIN PD11 + +#define TOUCH_CS_PIN PB6 +#define TOUCH_SCK_PIN PB3 +#define TOUCH_MOSI_PIN PB5 +#define TOUCH_MISO_PIN PB4 diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h index 36298d05f5..bb04cb82ec 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -28,7 +28,7 @@ #endif #ifndef BOARD_INFO_NAME - #define BOARD_NAME "MKS_ROBIN2" + #define BOARD_INFO_NAME "MKS_ROBIN2" #endif #ifndef DEFAULT_MACHINE_NAME diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_AUS3D.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_AUS3D.h index cff34a2d86..de8d13c546 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_AUS3D.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_AUS3D.h @@ -16,27 +16,63 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once /** - * Pin assignments for the MKS RUMBA32 + * Pin assignments for the RUMBA32 * * https://aus3d.com.au/rumba32 * https://github.com/Aus3D/RUMBA32 - * - * The MKS and Aus3D versions have the same pinout but the MKS version - * has some added resistors and LEDs. The resistors needed for the - * TMC2208/9 UART interface are among the additions. Also added were - * connectors and resistors dedicated to the TMC2130 sensorless homing - * interface. */ -#define BOARD_INFO_NAME "Aus3D RUMBA32" +#define BOARD_INFO_NAME "RUMBA32" -#define RUMBA32_V1_0 -//#define I2C_EEPROM +#if NO_EEPROM_SELECTED + #if MB(RUMBA32_V1_0) + #define FLASH_EEPROM_EMULATION + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #elif MB(RUMBA32_V1_1) + #define I2C_EEPROM + #define MARLIN_EEPROM_SIZE 0x2000 // 8KB (24LC64T-I/OT) + #endif +#endif + +#if ENABLED(FLASH_EEPROM_EMULATION) + // Decrease delays and flash wear by spreading writes across the + // 128 kB sector allocated for EEPROM emulation. + #define FLASH_EEPROM_LEVELING +#endif #include "pins_RUMBA32_common.h" + +#if MB(RUMBA32_V1_1) + + #define SERVO0_PIN PA15 + #undef BTN_PIN + + #if HAS_TMC_UART + // + // TMC2208/TMC2209 stepper drivers - Software Serial is used according to below pins + // + #define X_SERIAL_TX_PIN PA14 + #define X_SERIAL_RX_PIN PC14 + + #define Y_SERIAL_TX_PIN PA13 + #define Y_SERIAL_RX_PIN PE4 + + #define Z_SERIAL_TX_PIN PB10 + #define Z_SERIAL_RX_PIN PE0 + + #define E0_SERIAL_TX_PIN PD11 + #define E0_SERIAL_RX_PIN PC13 + + #define E1_SERIAL_TX_PIN PB3 + #define E1_SERIAL_RX_PIN PD5 + + #define E2_SERIAL_TX_PIN PB4 + #define E2_SERIAL_RX_PIN PD1 + #endif +#endif diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h index 9fcd5a1474..d67962b1a6 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -35,27 +35,21 @@ #define BOARD_INFO_NAME "MKS RUMBA32" -#define RUMBA32_V1_0 +#if NO_EEPROM_SELECTED + #define FLASH_EEPROM_EMULATION + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif + +#if ENABLED(FLASH_EEPROM_EMULATION) + // Decrease delays and flash wear by spreading writes across the + // 128 kB sector allocated for EEPROM emulation. + #define FLASH_EEPROM_LEVELING +#endif + #define ENABLE_SPI1 -//#define I2C_EEPROM #include "pins_RUMBA32_common.h" -// -// Software SPI pins for TMC2130 stepper drivers -// -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI PA7 - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO PA6 - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK PA5 - #endif -#endif - #if HAS_TMC_UART /** * TMC2208/TMC2209 stepper drivers @@ -96,14 +90,3 @@ #define E2_SERIAL_TX_PIN PD12 #define E2_SERIAL_RX_PIN PD1 #endif - -// -// LCD / Controller -// - -// 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 diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h index 19853a78fe..aa481a8b74 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h @@ -16,13 +16,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once /** * Common pin assignments for all RUMBA32 boards + * */ #ifndef STM32F4 @@ -31,14 +32,22 @@ #error "RUMBA32 boards support up to 3 hotends / E-steppers." #endif -#define RUMBA32_V1_0 #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME -//#define I2C_EEPROM -#ifdef E2END - #undef E2END -#endif -#define E2END 0xFFF // 4KB +// Use soft PWM for fans - PWM is not working properly when paired with STM32 Arduino Core v1.7.0 +// This can be removed when Core version is updated and PWM behaviour is fixed. +#define FAN_SOFT_PWM + +// +// Configure Timers +// TIM6 is used for TONE +// TIM7 is used for SERVO +// TIMER_SERIAL defaults to TIM7 so we'll override it here +// +#define STEP_TIMER 10 +#define TEMP_TIMER 14 +#define TIMER_SERIAL TIM9 +#define HAL_TIMER_RATE F_CPU // // Limit Switches @@ -83,6 +92,18 @@ #define E2_ENABLE_PIN PD0 #define E2_CS_PIN PD1 +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PA7 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PA6 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PA5 + #endif +#endif + // // Temperature Sensors // @@ -104,7 +125,7 @@ #define FAN1_PIN PA8 // -// I2C +// SPI // #define SCK_PIN PA5 #define MISO_PIN PA6 @@ -146,4 +167,17 @@ #define LCD_PINS_D7 PE15 #endif + // Alter timing for graphical display + #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(600) + #endif + #endif + #endif diff --git a/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h b/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h index 1a008cd4ae..a0bd38b6ac 100644 --- a/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h +++ b/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -166,9 +166,12 @@ #define FAN_PIN 57 // PC4 E1_FAN PWM pin, Part cooling fan FET #define FAN1_PIN 58 // PC5 E2_FAN PWM pin, Extruder fan FET -#define ORIG_E0_AUTO_FAN_PIN FAN1_PIN #define FAN2_PIN 59 // PE8 E3_FAN PWM pin, Controller fan FET +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN 58 // FAN1_PIN +#endif + // // Misc functions // @@ -239,11 +242,12 @@ #define SDCARD_CONNECTION ONBOARD #endif -#if SDCARD_CONNECTION == ONBOARD +#if SD_CONNECTION_IS(ONBOARD) #define SDIO_SUPPORT // Use SDIO for onboard SD #ifndef SDIO_SUPPORT #define SOFTWARE_SPI // Use soft SPI for onboard SD + #undef SDSS #define SDSS SDIO_D3_PIN #define SCK_PIN SDIO_CK_PIN #define MISO_PIN SDIO_D0_PIN diff --git a/Marlin/src/pins/stm32f4/pins_VAKE403D.h b/Marlin/src/pins/stm32f4/pins_VAKE403D.h index 7eb95a4f50..01e9da590a 100644 --- a/Marlin/src/pins/stm32f4/pins_VAKE403D.h +++ b/Marlin/src/pins/stm32f4/pins_VAKE403D.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -28,11 +28,10 @@ #endif #define DEFAULT_MACHINE_NAME "STM32F446VET6" -#define BOARD_NAME "STM32F4 VAkE" +#define BOARD_INFO_NAME "STM32F4 VAkE" //#define I2C_EEPROM - -#define E2END 0xFFF // EEPROM end address (4kB) +#define MARLIN_EEPROM_SIZE 0x1000 // 4KB // // Servos @@ -135,7 +134,9 @@ #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 +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN PD13 +#endif // // Misc. Functions @@ -183,12 +184,12 @@ // // ST7920 Delays // -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(96) +#ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) #endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(48) +#ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) #endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(715) +#ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(715) #endif diff --git a/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h b/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h index 736445cdab..6706d26f64 100644 --- a/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h +++ b/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -28,7 +28,9 @@ #define BOARD_INFO_NAME "RemRam v1" #define DEFAULT_MACHINE_NAME "RemRam" -#define SRAM_EEPROM_EMULATION // Emulate the EEPROM using Backup SRAM +#if NO_EEPROM_SELECTED + #define SRAM_EEPROM_EMULATION // Emulate the EEPROM using Backup SRAM +#endif #if HOTENDS > 1 || E_STEPPERS > 1 #error "RemRam supports only one hotend / E-stepper." @@ -99,7 +101,9 @@ #endif #define FAN1_PIN 32 // "FAN2" -#define ORIG_E0_AUTO_FAN_PIN 32 // Use this by NOT overriding E0_AUTO_FAN_PIN +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN 32 +#endif // // Servos diff --git a/Marlin/src/pins/stm32f7/pins_THE_BORG.h b/Marlin/src/pins/stm32f7/pins_THE_BORG.h index 9968d9d1f1..fa4279920c 100644 --- a/Marlin/src/pins/stm32f7/pins_THE_BORG.h +++ b/Marlin/src/pins/stm32f7/pins_THE_BORG.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -30,8 +30,8 @@ #define BOARD_INFO_NAME "The-Borge" #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME -#ifndef E2END - #define E2END 0xFFF // EEPROM end address +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE 0x1000 #endif // Ignore temp readings during development. @@ -127,7 +127,9 @@ #define FAN1_PIN PA0 #define FAN2_PIN PA1 -#define ORIG_E0_AUTO_FAN_PIN PA1 // Use this by NOT overriding E0_AUTO_FAN_PIN +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN PA1 +#endif // // Misc. Functions diff --git a/Marlin/src/pins/teensy2/pins_5DPRINT.h b/Marlin/src/pins/teensy2/pins_5DPRINT.h index 4ee74660ea..f473ad145e 100644 --- a/Marlin/src/pins/teensy2/pins_5DPRINT.h +++ b/Marlin/src/pins/teensy2/pins_5DPRINT.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -31,7 +31,7 @@ * 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 + * Teensyduino - https://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 diff --git a/Marlin/src/pins/teensy2/pins_BRAINWAVE.h b/Marlin/src/pins/teensy2/pins_BRAINWAVE.h index f7597dbbae..ce1b4e3bbf 100644 --- a/Marlin/src/pins/teensy2/pins_BRAINWAVE.h +++ b/Marlin/src/pins/teensy2/pins_BRAINWAVE.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/teensy2/pins_BRAINWAVE_PRO.h b/Marlin/src/pins/teensy2/pins_BRAINWAVE_PRO.h index 575428f097..eeca39c14c 100644 --- a/Marlin/src/pins/teensy2/pins_BRAINWAVE_PRO.h +++ b/Marlin/src/pins/teensy2/pins_BRAINWAVE_PRO.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -44,7 +44,7 @@ * 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 + * Teensyduino - https://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 diff --git a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h index 68c548f833..51080b2fd1 100644 --- a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h +++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -31,7 +31,7 @@ * 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 + * Teensyduino - https://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 diff --git a/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h index f5f05ddeaf..7bf0f334f4 100644 --- a/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h +++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -246,7 +246,7 @@ //#define MOSI 22 // 12 B2 ICSP-03 EXP2-05 //#define MISO 23 // 13 B3 ICSP-06 EXP2-05 - // increase delays + // Alter timing for graphical display #define BOARD_ST7920_DELAY_1 DELAY_NS(313) #define BOARD_ST7920_DELAY_2 DELAY_NS(313) #define BOARD_ST7920_DELAY_3 DELAY_NS(313) diff --git a/Marlin/src/pins/teensy2/pins_SAV_MKI.h b/Marlin/src/pins/teensy2/pins_SAV_MKI.h index 01003b056d..cdd9b634bd 100644 --- a/Marlin/src/pins/teensy2/pins_SAV_MKI.h +++ b/Marlin/src/pins/teensy2/pins_SAV_MKI.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -31,7 +31,7 @@ * 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 + * Teensyduino - https://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 diff --git a/Marlin/src/pins/teensy2/pins_TEENSY2.h b/Marlin/src/pins/teensy2/pins_TEENSY2.h index eb116ee3e8..9ef31e84ba 100644 --- a/Marlin/src/pins/teensy2/pins_TEENSY2.h +++ b/Marlin/src/pins/teensy2/pins_TEENSY2.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -31,7 +31,7 @@ * 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 + * Teensyduino - https://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 @@ -65,8 +65,8 @@ /** * 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 + * https://www.pjrc.com/teensy/teensyduino.html + * See https://reprap.org/wiki/Printrboard for more info * * CLI build: HARDWARE_MOTHERBOARD=84 make * @@ -160,7 +160,10 @@ #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 + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 1 // D1 PWM2B MUST BE HARDWARE PWM +#endif // // LCD / Controller diff --git a/Marlin/src/pins/teensy2/pins_TEENSYLU.h b/Marlin/src/pins/teensy2/pins_TEENSYLU.h index 05f433cb89..8ee07a427d 100644 --- a/Marlin/src/pins/teensy2/pins_TEENSYLU.h +++ b/Marlin/src/pins/teensy2/pins_TEENSYLU.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -30,7 +30,7 @@ * 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 + * Teensyduino - https://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 @@ -134,7 +134,10 @@ // Misc. Functions // #define SDSS 20 // B0 JP31-6 -#define CASE_LIGHT_PIN 0 // D0 IO-14 PWM0B + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 0 // D0 IO-14 PWM0B +#endif // // LCD / Controller diff --git a/Marlin/src/pins/teensy3/pins_TEENSY31_32.h b/Marlin/src/pins/teensy3/pins_TEENSY31_32.h index 0f895c9e6b..863137e9c8 100644 --- a/Marlin/src/pins/teensy3/pins_TEENSY31_32.h +++ b/Marlin/src/pins/teensy3/pins_TEENSY31_32.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -24,7 +24,7 @@ /** * 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 + * https://www.pjrc.com/teensy/teensyduino.html */ #if !IS_32BIT_TEENSY @@ -72,7 +72,7 @@ // Heaters / Fans // #define HEATER_0_PIN 20 -// #define HEATER_1_PIN 36 +//#define HEATER_1_PIN 36 #define HEATER_BED_PIN 21 #ifndef FAN_PIN #define FAN_PIN 22 diff --git a/Marlin/src/pins/teensy3/pins_TEENSY35_36.h b/Marlin/src/pins/teensy3/pins_TEENSY35_36.h index 8528533d7b..02d8374f23 100644 --- a/Marlin/src/pins/teensy3/pins_TEENSY35_36.h +++ b/Marlin/src/pins/teensy3/pins_TEENSY35_36.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once @@ -24,7 +24,7 @@ /**************************************************************************************** * 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 +* https://www.pjrc.com/teensy/teensyduino.html ****************************************************************************************/ #if !IS_32BIT_TEENSY diff --git a/Marlin/src/sd/Sd2Card.cpp b/Marlin/src/sd/Sd2Card.cpp index ba233d36f6..c56d690b2e 100644 --- a/Marlin/src/sd/Sd2Card.cpp +++ b/Marlin/src/sd/Sd2Card.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -179,8 +179,11 @@ void Sd2Card::chipSelect() { * \return true for success, false for failure. */ bool Sd2Card::erase(uint32_t firstBlock, uint32_t lastBlock) { + if (ENABLED(SDCARD_READONLY)) return false; + csd_t csd; if (!readCSD(&csd)) goto FAIL; + // check for single block erase if (!csd.v1.erase_blk_en) { // erase size mask @@ -535,9 +538,10 @@ bool Sd2Card::waitNotBusy(const millis_t timeout_ms) { * \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 + if (ENABLED(SDCARD_READONLY)) return false; bool success = false; + if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; // Use address if not SDHC card if (!cardCommand(CMD24, blockNumber)) { if (writeData(DATA_START_BLOCK, src)) { if (waitNotBusy(SD_WRITE_TIMEOUT)) { // Wait for flashing to complete @@ -561,6 +565,8 @@ bool Sd2Card::writeBlock(uint32_t blockNumber, const uint8_t* src) { * \return true for success, false for failure. */ bool Sd2Card::writeData(const uint8_t* src) { + if (ENABLED(SDCARD_READONLY)) return false; + bool success = true; chipSelect(); // Wait for previous write to finish @@ -574,14 +580,9 @@ bool Sd2Card::writeData(const uint8_t* src) { // Send one block of data for write block or write multiple blocks bool Sd2Card::writeData(const uint8_t token, const uint8_t* src) { + if (ENABLED(SDCARD_READONLY)) return false; - uint16_t crc = - #if ENABLED(SD_CHECK_AND_RETRY) - CRC_CCITT(src, 512) - #else - 0xFFFF - #endif - ; + const uint16_t crc = TERN(SD_CHECK_AND_RETRY, CRC_CCITT(src, 512), 0xFFFF); spiSendBlock(token, src); spiSend(crc >> 8); spiSend(crc & 0xFF); @@ -607,6 +608,8 @@ bool Sd2Card::writeData(const uint8_t token, const uint8_t* src) { * \return true for success, false for failure. */ bool Sd2Card::writeStart(uint32_t blockNumber, const uint32_t eraseCount) { + if (ENABLED(SDCARD_READONLY)) return false; + 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 @@ -626,6 +629,8 @@ bool Sd2Card::writeStart(uint32_t blockNumber, const uint32_t eraseCount) { * \return true for success, false for failure. */ bool Sd2Card::writeStop() { + if (ENABLED(SDCARD_READONLY)) return false; + bool success = false; chipSelect(); if (waitNotBusy(SD_WRITE_TIMEOUT)) { diff --git a/Marlin/src/sd/Sd2Card.h b/Marlin/src/sd/Sd2Card.h index 72590451bc..da19283ef1 100644 --- a/Marlin/src/sd/Sd2Card.h +++ b/Marlin/src/sd/Sd2Card.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/sd/Sd2Card_sdio.h b/Marlin/src/sd/Sd2Card_sdio.h index 50399a3af9..10fb757359 100644 --- a/Marlin/src/sd/Sd2Card_sdio.h +++ b/Marlin/src/sd/Sd2Card_sdio.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index 27c191a6a6..98d762f10b 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -47,6 +47,8 @@ void (*SdBaseFile::dateTime_)(uint16_t* date, uint16_t* time) = 0; // add a cluster to a file bool SdBaseFile::addCluster() { + if (ENABLED(SDCARD_READONLY)) return false; + if (!vol_->allocContiguous(1, &curCluster_)) return false; // if first cluster of file link to directory entry @@ -60,6 +62,8 @@ bool SdBaseFile::addCluster() { // Add a cluster to a directory file and zero the cluster. // return with first block of cluster in the cache bool SdBaseFile::addDirCluster() { + if (ENABLED(SDCARD_READONLY)) return false; + uint32_t block; // max folder size if (fileSize_ / sizeof(dir_t) >= 0xFFFF) return false; @@ -153,6 +157,8 @@ bool SdBaseFile::contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock) { * */ bool SdBaseFile::createContiguous(SdBaseFile* dirFile, const char* path, uint32_t size) { + if (ENABLED(SDCARD_READONLY)) return false; + uint32_t count; // don't allow zero length file if (size == 0) return false; @@ -419,6 +425,8 @@ bool SdBaseFile::make83Name(const char* str, uint8_t* name, const char** ptr) { * directory, \a path is invalid or already exists in \a parent. */ bool SdBaseFile::mkdir(SdBaseFile* parent, const char* path, bool pFlag) { + if (ENABLED(SDCARD_READONLY)) return false; + uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile* sub = &dir1; @@ -449,6 +457,8 @@ bool SdBaseFile::mkdir(SdBaseFile* parent, const char* path, bool pFlag) { } bool SdBaseFile::mkdir(SdBaseFile* parent, const uint8_t dname[11]) { + if (ENABLED(SDCARD_READONLY)) return false; + uint32_t block; dir_t d; dir_t* p; @@ -632,7 +642,7 @@ bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t ofla } else { // don't create unless O_CREAT and O_WRITE - if (!(oflag & O_CREAT) || !(oflag & O_WRITE)) return false; + if ((oflag & (O_CREAT | O_WRITE)) != (O_CREAT | O_WRITE)) return false; if (emptyFound) { index = dirIndex_; p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); @@ -716,8 +726,14 @@ bool SdBaseFile::open(SdBaseFile* dirFile, uint16_t index, uint8_t oflag) { // open a cached directory entry. Assumes vol_ is initialized bool SdBaseFile::openCachedEntry(uint8_t dirIndex, uint8_t oflag) { + dir_t* p; + + #if ENABLED(SDCARD_READONLY) + if (oflag & (O_WRITE | O_CREAT | O_TRUNC)) goto FAIL; + #endif + // location of entry in cache - dir_t* p = &vol_->cache()->dir[dirIndex]; + 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)) { @@ -1135,6 +1151,8 @@ dir_t* SdBaseFile::readDirCache() { * or an I/O error occurred. */ bool SdBaseFile::remove() { + if (ENABLED(SDCARD_READONLY)) return false; + dir_t* d; // free any clusters - will fail if read-only or directory if (!truncate(0)) return false; @@ -1172,6 +1190,8 @@ bool SdBaseFile::remove() { * or an I/O error occurred. */ bool SdBaseFile::remove(SdBaseFile* dirFile, const char* path) { + if (ENABLED(SDCARD_READONLY)) return false; + SdBaseFile file; return file.open(dirFile, path, O_WRITE) ? file.remove() : false; } @@ -1187,6 +1207,8 @@ bool SdBaseFile::remove(SdBaseFile* dirFile, const char* path) { * file, newPath is invalid or already exists, or an I/O error occurs. */ bool SdBaseFile::rename(SdBaseFile* dirFile, const char* newPath) { + if (ENABLED(SDCARD_READONLY)) return false; + dir_t entry; uint32_t dirCluster = 0; SdBaseFile file; @@ -1279,6 +1301,8 @@ restore: * directory, is not empty, or an I/O error occurred. */ bool SdBaseFile::rmdir() { + if (ENABLED(SDCARD_READONLY)) return false; + // must be open subdirectory if (!isSubDir()) return false; @@ -1317,6 +1341,8 @@ bool SdBaseFile::rmdir() { * \return true for success, false for failure. */ bool SdBaseFile::rmRfStar() { + if (ENABLED(SDCARD_READONLY)) return false; + uint32_t index; SdBaseFile f; rewind(); @@ -1424,7 +1450,7 @@ void SdBaseFile::setpos(filepos_t* pos) { */ bool SdBaseFile::sync() { // only allow open files and directories - if (!isOpen()) goto FAIL; + if (ENABLED(SDCARD_READONLY) || !isOpen()) goto FAIL; if (flags_ & F_FILE_DIR_DIRTY) { dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); @@ -1524,6 +1550,8 @@ bool SdBaseFile::timestamp(SdBaseFile* file) { */ bool SdBaseFile::timestamp(uint8_t flags, uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second) { + if (ENABLED(SDCARD_READONLY)) return false; + uint16_t dirDate, dirTime; dir_t* d; @@ -1575,6 +1603,8 @@ bool SdBaseFile::timestamp(uint8_t flags, uint16_t year, uint8_t month, * \a length is greater than the current file size or an I/O error occurs. */ bool SdBaseFile::truncate(uint32_t length) { + if (ENABLED(SDCARD_READONLY)) return false; + uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) return false; @@ -1636,6 +1666,10 @@ bool SdBaseFile::truncate(uint32_t length) { * */ int16_t SdBaseFile::write(const void* buf, uint16_t nbyte) { + #if ENABLED(SDCARD_READONLY) + writeError = true; return -1; + #endif + // convert void* to uint8_t* - must be before goto statements const uint8_t* src = reinterpret_cast(buf); diff --git a/Marlin/src/sd/SdBaseFile.h b/Marlin/src/sd/SdBaseFile.h index dbdcf0b582..13a1be863d 100644 --- a/Marlin/src/sd/SdBaseFile.h +++ b/Marlin/src/sd/SdBaseFile.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/sd/SdFatConfig.h b/Marlin/src/sd/SdFatConfig.h index 5057d16a8d..2e03a4181f 100644 --- a/Marlin/src/sd/SdFatConfig.h +++ b/Marlin/src/sd/SdFatConfig.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/sd/SdFatStructs.h b/Marlin/src/sd/SdFatStructs.h index b09a6d289a..e06e05981a 100644 --- a/Marlin/src/sd/SdFatStructs.h +++ b/Marlin/src/sd/SdFatStructs.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/sd/SdFatUtil.cpp b/Marlin/src/sd/SdFatUtil.cpp index 08b21e5f35..e2c467c5b6 100644 --- a/Marlin/src/sd/SdFatUtil.cpp +++ b/Marlin/src/sd/SdFatUtil.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/sd/SdFatUtil.h b/Marlin/src/sd/SdFatUtil.h index d820d3cb4d..7afed2ede0 100644 --- a/Marlin/src/sd/SdFatUtil.h +++ b/Marlin/src/sd/SdFatUtil.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/sd/SdFile.cpp b/Marlin/src/sd/SdFile.cpp index cc0e7fc347..a4f048d950 100644 --- a/Marlin/src/sd/SdFile.cpp +++ b/Marlin/src/sd/SdFile.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/sd/SdFile.h b/Marlin/src/sd/SdFile.h index 4f235f4976..52c8f1f0db 100644 --- a/Marlin/src/sd/SdFile.h +++ b/Marlin/src/sd/SdFile.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/sd/SdInfo.h b/Marlin/src/sd/SdInfo.h index 61d2804ddb..bfa5a01ae2 100644 --- a/Marlin/src/sd/SdInfo.h +++ b/Marlin/src/sd/SdInfo.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/sd/SdVolume.cpp b/Marlin/src/sd/SdVolume.cpp index 1d4c56a344..63731f728c 100644 --- a/Marlin/src/sd/SdVolume.cpp +++ b/Marlin/src/sd/SdVolume.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -46,6 +46,8 @@ // find a contiguous group of clusters bool SdVolume::allocContiguous(uint32_t count, uint32_t* curCluster) { + if (ENABLED(SDCARD_READONLY)) return false; + // start of group uint32_t bgnCluster; // end of group @@ -117,18 +119,20 @@ bool SdVolume::allocContiguous(uint32_t count, uint32_t* curCluster) { } bool SdVolume::cacheFlush() { - if (cacheDirty_) { - if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) - return false; - - // mirror FAT tables - if (cacheMirrorBlock_) { - if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) + #if DISABLED(SDCARD_READONLY) + if (cacheDirty_) { + if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) return false; - cacheMirrorBlock_ = 0; + + // mirror FAT tables + if (cacheMirrorBlock_) { + if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) + return false; + cacheMirrorBlock_ = 0; + } + cacheDirty_ = 0; } - cacheDirty_ = 0; - } + #endif return true; } @@ -190,6 +194,8 @@ bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { // Store a FAT entry bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { + if (ENABLED(SDCARD_READONLY)) return false; + uint32_t lba; // error if reserved cluster if (cluster < 2) return false; diff --git a/Marlin/src/sd/SdVolume.h b/Marlin/src/sd/SdVolume.h index 1912b7adf6..1ffa888468 100644 --- a/Marlin/src/sd/SdVolume.h +++ b/Marlin/src/sd/SdVolume.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 80e94b88b5..bc1f88083a 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -28,11 +28,16 @@ #include "../MarlinCore.h" #include "../lcd/ultralcd.h" + +#if ENABLED(DWIN_CREALITY_LCD) + #include "../lcd/dwin/dwin.h" +#endif + #include "../module/planner.h" // for synchronize #include "../module/printcounter.h" -#include "../core/language.h" #include "../gcode/queue.h" #include "../module/configuration_store.h" +#include "../module/stepper/indirection.h" #if ENABLED(EMERGENCY_PARSER) #include "../feature/e_parser.h" @@ -52,7 +57,7 @@ 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 +#if BOTH(HAS_MULTI_SERIAL, BINARY_FILE_TRANSFER) int8_t CardReader::transfer_port_index; #endif @@ -155,12 +160,13 @@ char *createFilename(char * const buffer, const dir_t &p) { // 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]; + //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 + if ( (p.attributes & DIR_ATT_HIDDEN) // Hidden by attribute + // When readDir() > 0 these must be false: + //|| 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 ) return false; flag.filenameIsDir = DIR_IS_SUBDIR(&p); // We know it's a File or Folder @@ -180,7 +186,7 @@ int CardReader::countItems(SdFile dir) { while (dir.readDir(&p, longFilename) > 0) c += is_dir_or_gcode(p); - #if ENABLED(SDCARD_SORT_ALPHA) && SDSORT_USES_RAM && SDSORT_CACHE_NAMES + #if ALL(SDCARD_SORT_ALPHA, SDSORT_USES_RAM, SDSORT_CACHE_NAMES) nrFiles = c; #endif @@ -369,18 +375,65 @@ void CardReader::mount() { else { flag.mounted = true; SERIAL_ECHO_MSG(STR_SD_CARD_OK); - #if ENABLED(SDCARD_EEPROM_EMULATION) - settings.first_load(); - #endif } cdroot(); ui.refresh(); } +/** + * Handle SD card events + */ +#if MB(FYSETC_CHEETAH, FYSETC_AIO_II) + #include "../module/stepper.h" +#endif + +void CardReader::manage_media() { + static uint8_t prev_stat = 2; // First call, no prior state + uint8_t stat = uint8_t(IS_SD_INSERTED()); + if (stat == prev_stat) return; + + flag.workDirIsRoot = true; // Return to root on mount/release + + if (ui.detected()) { + + uint8_t old_stat = prev_stat; + prev_stat = stat; // Change now to prevent re-entry + + if (stat) { // Media Inserted + safe_delay(500); // Some boards need a delay to get settled + mount(); // Try to mount the media + #if MB(FYSETC_CHEETAH, FYSETC_CHEETAH_V12, FYSETC_AIO_II) + reset_stepper_drivers(); // Workaround for Cheetah bug + #endif + if (!isMounted()) stat = 0; // Not mounted? + } + else { + #if PIN_EXISTS(SD_DETECT) + release(); // Card is released + #endif + } + + ui.media_changed(old_stat, stat); // Update the UI + + if (stat) { + TERN_(SDCARD_EEPROM_EMULATION, settings.first_load()); + if (old_stat == 2) // First mount? + TERN(POWER_LOSS_RECOVERY, + recovery.check(), // Check for PLR file. (If not there it will beginautostart) + beginautostart() // Look for auto0.g on the next loop + ); + } + } +} + void CardReader::release() { endFilePrint(); flag.mounted = false; + flag.workDirIsRoot = true; + #if ALL(SDCARD_SORT_ALPHA, SDSORT_USES_RAM, SDSORT_CACHE_NAMES) + nrFiles = 0; + #endif } void CardReader::openAndPrintFile(const char *name) { @@ -395,30 +448,21 @@ void CardReader::openAndPrintFile(const char *name) { void CardReader::startFileprint() { if (isMounted()) { flag.sdprinting = true; - #if SD_RESORT - flush_presort(); - #endif + TERN_(SD_RESORT, flush_presort()); } } -void CardReader::endFilePrint( - #if SD_RESORT - const bool re_sort/*=false*/ - #endif -) { - #if ENABLED(ADVANCED_PAUSE_FEATURE) - did_pause_print = 0; - #endif +void CardReader::endFilePrint(TERN_(SD_RESORT, const bool re_sort/*=false*/)) { + TERN_(ADVANCED_PAUSE_FEATURE, did_pause_print = 0); + TERN_(DWIN_CREALITY_LCD, HMI_flag.print_finish = flag.sdprinting); flag.sdprinting = flag.abort_sd_printing = false; if (isFileOpen()) file.close(); - #if SD_RESORT - if (re_sort) presort(); - #endif + TERN_(SD_RESORT, if (re_sort) presort()); } void CardReader::openLogFile(char * const path) { - flag.logging = true; - openFileWrite(path); + flag.logging = DISABLED(SDCARD_READONLY); + TERN(SDCARD_READONLY,,openFileWrite(path)); } // @@ -483,8 +527,8 @@ void CardReader::openFileRead(char * const path, const uint8_t subcall_type/*=0* // Too deep? The firmware has to bail. if (file_subcall_ctr > 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(); + SERIAL_ERROR_MSG("Exceeded max SUBROUTINE depth:" STRINGIFY(SD_PROCEDURE_DEPTH)); + kill(GET_TEXT(MSG_KILL_SUBCALL_OVERFLOW)); return; } @@ -544,17 +588,19 @@ void CardReader::openFileWrite(char * const path) { const char * const fname = diveToFile(false, curDir, path); if (!fname) return; - if (file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) { - flag.saving = true; - selectFileByName(fname); - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.disable(); - #endif - echo_write_to_file(fname); - ui.set_status(fname); - } - else + #if ENABLED(SDCARD_READONLY) openFailed(fname); + #else + if (file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) { + flag.saving = true; + selectFileByName(fname); + TERN_(EMERGENCY_PARSER, emergency_parser.disable()); + echo_write_to_file(fname); + ui.set_status(fname); + } + else + openFailed(fname); + #endif } // @@ -569,15 +615,17 @@ void CardReader::removeFile(const char * const name) { const char * const fname = diveToFile(false, 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, "."); + #if ENABLED(SDCARD_READONLY) + SERIAL_ECHOLNPAIR("Deletion failed (read-only), File: ", fname, "."); + #else + if (file.remove(curDir, fname)) { + SERIAL_ECHOLNPAIR("File deleted:", fname); + sdpos = 0; + TERN_(SDCARD_SORT_ALPHA, presort()); + } + else + SERIAL_ECHOLNPAIR("Deletion failed, File: ", fname, "."); + #endif } void CardReader::report_status() { @@ -621,15 +669,10 @@ void CardReader::checkautostart() { if (autostart_index < 0 || flag.sdprinting) return; if (!isMounted()) mount(); - #if ENABLED(SDCARD_EEPROM_EMULATION) - else settings.first_load(); - #endif + TERN_(SDCARD_EEPROM_EMULATION, else settings.first_load()); - if (isMounted() - #if ENABLED(POWER_LOSS_RECOVERY) - && !recovery.valid() // Don't run auto#.g when a resume file exists - #endif - ) { + // Don't run auto#.g when a PLR file exists + if (isMounted() && TERN1(POWER_LOSS_RECOVERY, !recovery.valid())) { char autoname[8]; sprintf_P(autoname, PSTR("auto%c.g"), autostart_index + '0'); dir_t p; @@ -656,9 +699,7 @@ void CardReader::closefile(const bool store_location) { file.close(); flag.saving = flag.logging = false; sdpos = 0; - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.enable(); - #endif + TERN_(EMERGENCY_PARSER, emergency_parser.enable()); if (store_location) { //future: store printer state, filename and position for continuing a stopped print @@ -781,9 +822,7 @@ void CardReader::cd(const char * relpath) { flag.workDirIsRoot = false; if (workDirDepth < MAX_DIR_DEPTH) workDirParents[workDirDepth++] = workDir; - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif + TERN_(SDCARD_SORT_ALPHA, presort()); } else { SERIAL_ECHO_START(); @@ -794,9 +833,7 @@ void CardReader::cd(const char * 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 + TERN_(SDCARD_SORT_ALPHA, presort()); } if (!workDirDepth) flag.workDirIsRoot = true; return workDirDepth; @@ -805,9 +842,7 @@ int8_t CardReader::cdup() { void CardReader::cdroot() { workDir = root; flag.workDirIsRoot = true; - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif + TERN_(SDCARD_SORT_ALPHA, presort()); } #if ENABLED(SDCARD_SORT_ALPHA) @@ -816,12 +851,8 @@ void CardReader::cdroot() { * 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 - ); + selectFileByIndex(TERN1(SDSORT_GCODE, sort_alpha) && (nr < sort_count) + ? sort_order[nr] : nr); } #if ENABLED(SDSORT_USES_RAM) @@ -867,9 +898,7 @@ void CardReader::cdroot() { flush_presort(); // Sorting may be turned off - #if ENABLED(SDSORT_GCODE) - if (!sort_alpha) return; - #endif + if (TERN0(SDSORT_GCODE, !sort_alpha)) return; // If there are files, sort up to the limit uint16_t fileCnt = countFilesInWorkDir(); @@ -880,9 +909,7 @@ void CardReader::cdroot() { 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 + TERN_(SDSORT_DYNAMIC_RAM, sort_order = new uint8_t[fileCnt]); // Use RAM to store the entire directory during pre-sort. // SDSORT_LIMIT should be set to prevent over-allocation. @@ -920,11 +947,7 @@ void CardReader::cdroot() { // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { - sort_order[i] = ( - #if ENABLED(SDCARD_RATHERRECENTFIRST) - fileCnt - 1 - - #endif - i); + sort_order[i] = i; // If using RAM then read all filenames now. #if ENABLED(SDSORT_USES_RAM) selectFileByIndex(i); @@ -936,7 +959,7 @@ void CardReader::cdroot() { #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); + if (flag.filenameIsDir) SBI(isDir[ind], bit); #endif #endif } @@ -948,9 +971,7 @@ void CardReader::cdroot() { #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 + TERN_(HAS_FOLDER_SORTING, bool dir1 = flag.filenameIsDir); #endif for (uint16_t j = 0; j < i; ++j) { @@ -966,7 +987,7 @@ void CardReader::cdroot() { #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) + #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 @@ -1002,9 +1023,7 @@ void CardReader::cdroot() { // 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 + TERN_(HAS_FOLDER_SORTING, dir1 = dir2); strcpy(name1, name2); #endif } @@ -1015,9 +1034,7 @@ void CardReader::cdroot() { #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 + TERN_(HAS_FOLDER_SORTING, free(isDir)); #endif #endif } @@ -1060,13 +1077,14 @@ void CardReader::cdroot() { #endif // SDCARD_SORT_ALPHA uint16_t CardReader::get_num_Files() { - return - #if ENABLED(SDCARD_SORT_ALPHA) && SDSORT_USES_RAM && SDSORT_CACHE_NAMES + if (!isMounted()) return 0; + return ( + #if ALL(SDCARD_SORT_ALPHA, SDSORT_USES_RAM, SDSORT_CACHE_NAMES) nrFiles // no need to access the SD card for filenames #else countFilesInWorkDir() #endif - ; + ); } // @@ -1082,11 +1100,7 @@ void CardReader::fileHasFinished() { startFileprint(); } else { - endFilePrint(); - - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif + endFilePrint(TERN_(SD_RESORT, true)); marlin_state = MF_SD_COMPLETE; } @@ -1095,7 +1109,7 @@ void CardReader::fileHasFinished() { #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 + #if HAS_MULTI_SERIAL int8_t CardReader::auto_report_port; #endif diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 955a8b69b3..62a6d87acf 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -16,16 +16,26 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once #include "../inc/MarlinConfig.h" +#define IFSD(A,B) TERN(SDSUPPORT,A,B) + #if ENABLED(SDSUPPORT) -#define SD_RESORT BOTH(SDCARD_SORT_ALPHA, SDSORT_DYNAMIC_RAM) +#if BOTH(SDCARD_SORT_ALPHA, SDSORT_DYNAMIC_RAM) + #define SD_RESORT 1 +#endif + +#if ENABLED(SDCARD_RATHERRECENTFIRST) && DISABLED(SDCARD_SORT_ALPHA) + #define SD_ORDER(N,C) ((C) - 1 - (N)) +#else + #define SD_ORDER(N,C) N +#endif #define MAX_DIR_DEPTH 10 // Maximum folder depth #define MAXDIRNAMELENGTH 8 // DOS folder name size @@ -55,7 +65,7 @@ public: // Fast! binary file transfer #if ENABLED(BINARY_FILE_TRANSFER) - #if NUM_SERIAL > 1 + #if HAS_MULTI_SERIAL static int8_t transfer_port_index; #else static constexpr int8_t transfer_port_index = 0; @@ -73,6 +83,9 @@ public: static inline bool isMounted() { return flag.mounted; } static void ls(); + // Handle media insert/remove + static void manage_media(); + // SD Card Logging static void openLogFile(char * const path); static void write_command(char * const buf); @@ -110,11 +123,7 @@ public: static void getAbsFilename(char *dst); static void printFilename(); static void startFileprint(); - static void endFilePrint( - #if SD_RESORT - const bool re_sort=false - #endif - ); + static void endFilePrint(TERN_(SD_RESORT, const bool re_sort=false)); static void report_status(); static inline void pauseSDPrint() { flag.sdprinting = false; } static inline bool isPaused() { return isFileOpen() && !flag.sdprinting; } @@ -147,6 +156,7 @@ public: static inline bool isFileOpen() { return isMounted() && file.isOpen(); } static inline uint32_t getIndex() { return sdpos; } + static inline uint32_t getFileSize() { return filesize; } 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; } @@ -159,9 +169,7 @@ public: #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 + TERN_(HAS_MULTI_SERIAL, auto_report_port = serial_port_index); NOMORE(v, 60); auto_report_sd_interval = v; next_sd_report_ms = millis() + 1000UL * v; @@ -253,7 +261,7 @@ private: #if ENABLED(AUTO_REPORT_SD_STATUS) static uint8_t auto_report_sd_interval; static millis_t next_sd_report_ms; - #if NUM_SERIAL > 1 + #if HAS_MULTI_SERIAL static int8_t auto_report_port; #endif #endif diff --git a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp index c132b4a3b6..78f338fdae 100644 --- a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp +++ b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ diff --git a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h index f7e59a282a..55a1099a3a 100644 --- a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h +++ b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp index 9092633b84..8f0dbf42e9 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp @@ -19,7 +19,7 @@ * ------------------- * * Circuits At Home, LTD - * Web : http://www.circuitsathome.com + * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ /* USB functions */ @@ -428,7 +428,7 @@ void USB::Task() { //USB state machine uint8_t rcode; uint8_t tmpdata; static uint32_t delay = 0; - //USB_DEVICE_DESCRIPTOR buf; + //USB_FD_DEVICE_DESCRIPTOR buf; bool lowspeed = false; MAX3421E::Task(); @@ -647,8 +647,8 @@ uint8_t USB::Configuring(uint8_t parent, uint8_t port, bool lowspeed) { //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); + uint8_t buf[sizeof (USB_FD_DEVICE_DESCRIPTOR)]; + USB_FD_DEVICE_DESCRIPTOR *udd = reinterpret_cast(buf); UsbDevice *p = nullptr; EpInfo *oldep_ptr = nullptr; EpInfo epInfo; @@ -678,13 +678,13 @@ uint8_t USB::Configuring(uint8_t parent, uint8_t port, bool lowspeed) { p->lowspeed = lowspeed; // Get device descriptor - rcode = getDevDescr(0, 0, sizeof (USB_DEVICE_DESCRIPTOR), (uint8_t*)buf); + rcode = getDevDescr(0, 0, sizeof (USB_FD_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"); + //printf("Configuring error: Can't get USB_FD_DEVICE_DESCRIPTOR\r\n"); return rcode; } @@ -762,7 +762,7 @@ uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t con 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); + USB_FD_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast(buf); uint8_t ret = getConfDescr(addr, ep, 9, conf, buf); if (ret) return ret; diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.h index 195b26e940..b1ec146999 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.h @@ -19,7 +19,7 @@ * ------------------- * * Circuits At Home, LTD - * Web : http://www.circuitsathome.com + * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ #pragma once diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h index 472fed59cf..838b927678 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h @@ -19,7 +19,7 @@ * ------------------- * * Circuits At Home, LTD - * Web : http://www.circuitsathome.com + * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/address.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/address.h index f51e43f0ea..373b95a7f9 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/address.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/address.h @@ -19,7 +19,7 @@ * ------------------- * * Circuits At Home, LTD - * Web : http://www.circuitsathome.com + * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ #pragma once diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/confdescparser.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/confdescparser.h index 5d4ddaf175..9ed35fff65 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/confdescparser.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/confdescparser.h @@ -19,7 +19,7 @@ * ------------------- * * Circuits At Home, LTD - * Web : http://www.circuitsathome.com + * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ #pragma once @@ -30,10 +30,10 @@ 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 ConfigXtract(const USB_FD_CONFIGURATION_DESCRIPTOR *conf) = 0; + //virtual void InterfaceXtract(uint8_t conf, const USB_FD_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))) { + 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_FD_ENDPOINT_DESCRIPTOR *ep __attribute__((unused))) { } }; @@ -50,7 +50,7 @@ class ConfigDescParser : public USBReadParser { MultiValueBuffer theBuffer; MultiByteValueParser valParser; ByteSkipper theSkipper; - uint8_t varBuffer[16 /*sizeof(USB_CONFIGURATION_DESCRIPTOR)*/]; + uint8_t varBuffer[16 /*sizeof(USB_FD_CONFIGURATION_DESCRIPTOR)*/]; uint8_t stateParseDescr; // ParseDescriptor state @@ -97,8 +97,8 @@ void ConfigDescParser::Parse(const uin 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); + USB_FD_CONFIGURATION_DESCRIPTOR* ucd = reinterpret_cast(varBuffer); + USB_FD_INTERFACE_DESCRIPTOR* uid = reinterpret_cast(varBuffer); switch (stateParseDescr) { case 0: theBuffer.valueSize = 2; @@ -155,7 +155,7 @@ bool ConfigDescParser::ParseDescriptor case USB_DESCRIPTOR_ENDPOINT: if (!valParser.Parse(pp, pcntdn)) return false; if (isGoodInterface && theXtractor) - theXtractor->EndpointXtract(confValue, ifaceNumber, ifaceAltSet, protoValue, (USB_ENDPOINT_DESCRIPTOR*)varBuffer); + theXtractor->EndpointXtract(confValue, ifaceNumber, ifaceAltSet, protoValue, (USB_FD_ENDPOINT_DESCRIPTOR*)varBuffer); break; //case HID_DESCRIPTOR_HID: // if (!valParser.Parse(pp, pcntdn)) return false; diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/hexdump.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/hexdump.h index 59c3b48f67..c948e5aba0 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/hexdump.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/hexdump.h @@ -19,7 +19,7 @@ * ------------------- * * Circuits At Home, LTD - * Web : http://www.circuitsathome.com + * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ #pragma once diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/macros.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/macros.h index 0fb5c02ff1..40e3e02a2f 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/macros.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/macros.h @@ -19,7 +19,7 @@ * ------------------- * * Circuits At Home, LTD - * Web : http://www.circuitsathome.com + * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ #pragma once diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp index a57245f78a..8ead0b0093 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp @@ -19,7 +19,7 @@ * ------------------- * * Circuits At Home, LTD - * Web : http://www.circuitsathome.com + * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ @@ -250,10 +250,10 @@ bLastUsbError(0) { */ uint8_t BulkOnly::ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed) { - const uint8_t constBufSize = sizeof (USB_DEVICE_DESCRIPTOR); + const uint8_t constBufSize = sizeof (USB_FD_DEVICE_DESCRIPTOR); uint8_t buf[constBufSize]; - USB_DEVICE_DESCRIPTOR * udd = reinterpret_cast(buf); + USB_FD_DEVICE_DESCRIPTOR * udd = reinterpret_cast(buf); uint8_t rcode; UsbDevice *p = nullptr; EpInfo *oldep_ptr = nullptr; @@ -529,7 +529,7 @@ uint8_t BulkOnly::Init(uint8_t parent __attribute__((unused)), uint8_t port __at * @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) { +void BulkOnly::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto __attribute__((unused)), const USB_FD_ENDPOINT_DESCRIPTOR * pep) { ErrorMessage (PSTR("Conf.Val"), conf); ErrorMessage (PSTR("Iface Num"), iface); ErrorMessage (PSTR("Alt.Set"), alt); @@ -1166,7 +1166,7 @@ uint8_t BulkOnly::HandleSCSIError(uint8_t status) { * * @param ep_ptr */ -void BulkOnly::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR * ep_ptr) { +void BulkOnly::PrintEndpointDescriptor(const USB_FD_ENDPOINT_DESCRIPTOR * ep_ptr) { Notify(PSTR("Endpoint descriptor:"), 0x80); Notify(PSTR("\r\nLength:\t\t"), 0x80); D_PrintHex (ep_ptr->bLength, 0x80); diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.h index 09b82fdb92..e6cece7ffd 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.h @@ -19,7 +19,7 @@ * ------------------- * * Circuits At Home, LTD - * Web : http://www.circuitsathome.com + * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ @@ -67,7 +67,7 @@ #define MASS_CMD_DIR_IN 0x80 //(1 << 7) /* - * Reference documents from T10 (http://www.t10.org) + * Reference documents from T10 (https://www.t10.org) * SCSI Primary Commands - 3 (SPC-3) * SCSI Block Commands - 2 (SBC-2) * Multi-Media Commands - 5 (MMC-5) @@ -491,7 +491,7 @@ protected: 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); + void PrintEndpointDescriptor(const USB_FD_ENDPOINT_DESCRIPTOR* ep_ptr); // Additional Initialization Method for Subclasses @@ -526,7 +526,7 @@ public: 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); + void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_FD_ENDPOINT_DESCRIPTOR *ep); virtual bool DEVCLASSOK(uint8_t klass) { return klass == USB_CLASS_MASS_STORAGE; } diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/max3421e.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/max3421e.h index 39845fb730..6451981fb7 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/max3421e.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/max3421e.h @@ -19,7 +19,7 @@ * ------------------- * * Circuits At Home, LTD - * Web : http://www.circuitsathome.com + * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ #pragma once diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp index 78a9ba1fd7..dcc309025a 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp @@ -19,7 +19,7 @@ * ------------------- * * Circuits At Home, LTD - * Web : http://www.circuitsathome.com + * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ @@ -37,7 +37,7 @@ int UsbDEBUGlvl = 0x80; void E_Notifyc(char c, int lvl) { if (UsbDEBUGlvl < lvl) return; USB_HOST_SERIAL.print(c - #if !defined(ARDUINO) || ARDUINO < 100 + #if !defined(ARDUINO) && !defined(ARDUINO_ARCH_LPC176X) , BYTE #endif ); diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.h index 960120d18d..12195dcf62 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.h @@ -19,7 +19,7 @@ * ------------------- * * Circuits At Home, LTD - * Web : http://www.circuitsathome.com + * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ #pragma once diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.cpp index 0c7061b77c..5d25576c40 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.cpp @@ -19,7 +19,7 @@ * ------------------- * * Circuits At Home, LTD - * Web : http://www.circuitsathome.com + * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.h index 28a2841446..403766da8f 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.h @@ -19,7 +19,7 @@ * ------------------- * * Circuits At Home, LTD - * Web : http://www.circuitsathome.com + * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ #pragma once diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/printhex.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/printhex.h index 2cde3fc341..1e369fde2c 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/printhex.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/printhex.h @@ -19,7 +19,7 @@ * ------------------- * * Circuits At Home, LTD - * Web : http://www.circuitsathome.com + * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ #pragma once diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h index 41821173d3..2de0d465e8 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h @@ -19,7 +19,7 @@ * ------------------- * * Circuits At Home, LTD - * Web : http://www.circuitsathome.com + * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ @@ -132,7 +132,7 @@ #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 + #define PROGMEM __attribute__((section(".progmem.data"))) // Workaround for https://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 diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h index 039215b1bb..99c628f888 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h @@ -19,7 +19,7 @@ * ------------------- * * Circuits At Home, LTD - * Web : http://www.circuitsathome.com + * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ @@ -116,7 +116,7 @@ typedef struct { 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; +} __attribute__((packed)) USB_FD_DEVICE_DESCRIPTOR; /* Configuration descriptor structure */ typedef struct { @@ -128,7 +128,7 @@ typedef struct { 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; +} __attribute__((packed)) USB_FD_CONFIGURATION_DESCRIPTOR; /* Interface descriptor structure */ typedef struct { @@ -141,7 +141,7 @@ typedef struct { 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; +} __attribute__((packed)) USB_FD_INTERFACE_DESCRIPTOR; /* Endpoint descriptor structure */ typedef struct { @@ -151,7 +151,7 @@ typedef struct { uint8_t bmAttributes; // Endpoint transfer type. uint16_t wMaxPacketSize; // Maximum packet size. uint8_t bInterval; // Polling interval in frames. -} __attribute__((packed)) USB_ENDPOINT_DESCRIPTOR; +} __attribute__((packed)) USB_FD_ENDPOINT_DESCRIPTOR; /* HID descriptor */ typedef struct { diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp index 16051b34c3..eb58f37d2f 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /* What follows is a modified version of the MAX3421e originally defined in diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h index 8fdad47ac2..07ca811a4d 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h index 6ad9cb5c8d..b35e53686e 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h @@ -20,7 +20,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ @@ -174,7 +174,7 @@ protected: 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); + void PrintEndpointDescriptor(const USB_FD_ENDPOINT_DESCRIPTOR* ep_ptr); public: UHS_Bulk_Storage(UHS_USB_HOST_BASE *p); diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h index a171b13818..45830de9a1 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h @@ -20,7 +20,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ @@ -1188,7 +1188,7 @@ uint8_t UHS_NI UHS_Bulk_Storage::HandleSCSIError(uint8_t status) { * * @param ep_ptr */ -void UHS_NI UHS_Bulk_Storage::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR * ep_ptr) { +void UHS_NI UHS_Bulk_Storage::PrintEndpointDescriptor(const USB_FD_ENDPOINT_DESCRIPTOR * ep_ptr) { Notify(PSTR("Endpoint descriptor:"), 0x80); Notify(PSTR("\r\nLength:\t\t"), 0x80); D_PrintHex (ep_ptr->bLength, 0x80); diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h index 1050d70c74..f127b4ed53 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h @@ -20,7 +20,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ @@ -28,7 +28,7 @@ e-mail : support@circuitsathome.com #define UHS_SCSI_H /* - * Reference documents from T10 (http://www.t10.org) + * Reference documents from T10 (https://www.t10.org) * SCSI Primary Commands - 3 (SPC-3) * SCSI Block Commands - 2 (SBC-2) * Multi-Media Commands - 5 (MMC-5) diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UNOFFICIAL_IDs.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UNOFFICIAL_IDs.h index 5c60f2d183..6442bcc4b7 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UNOFFICIAL_IDs.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UNOFFICIAL_IDs.h @@ -20,7 +20,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ #ifndef _UHS_UNOFFICIAL_IDs_h diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h index 190077d17c..73640d5c6f 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h @@ -20,7 +20,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h index 1c8b791910..4d9d35bd6d 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h @@ -20,7 +20,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h index bc111f7b61..945512cfcc 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h @@ -20,7 +20,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ #if !defined(_usb_h_) || defined(__HEXDUMP_H__) diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h index 7f7d18116c..5d711c1f74 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h @@ -20,7 +20,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ /* USB functions */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h index 908391a157..dec083390e 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h @@ -20,7 +20,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ @@ -206,7 +206,7 @@ uint8_t UHS_USB_HOST_BASE::doSoftReset(uint8_t parent, uint8_t port, uint8_t add * 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 + * https://www.ftdichip.com/Support/Documents/TechnicalNotes/TN_113_Simplified%20Description%20of%20USB%20Device%20Enumeration.pdf * * */ @@ -239,12 +239,12 @@ uint8_t UHS_USB_HOST_BASE::Configuring(uint8_t parent, uint8_t port, uint8_t spe // 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); + USB_FD_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); + USB_FD_DEVICE_DESCRIPTOR *udd = reinterpret_cast(buf); + USB_FD_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast(buf); #endif //for(devConfigIndex = 0; devConfigIndex < UHS_HOST_MAX_INTERFACE_DRIVERS; devConfigIndex++) { @@ -309,7 +309,7 @@ again: sof_delay(200); goto again; } - HOST_DEBUG("Configuring error: 0x%2.2x Can't get USB_DEVICE_DESCRIPTOR\r\n", rcode); + HOST_DEBUG("Configuring error: 0x%2.2x Can't get USB_FD_DEVICE_DESCRIPTOR\r\n", rcode); return rcode; } @@ -378,7 +378,7 @@ again: } // unwrapped, old large buf now invalid and discarded. uint8_t buf[18]; - USB_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast(buf); + USB_FD_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast(buf); #endif ei.address = addrPool.AllocAddress(parent, IsHub(ei.klass), port); @@ -415,9 +415,9 @@ again: 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); + rcode = getConfDescr(ei.address, sizeof (USB_FD_CONFIGURATION_DESCRIPTOR), conf, buf); if(rcode) { - HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR\r\n", rcode); + HOST_DEBUG("Configuring error: %2.2x Can't get USB_FD_INTERFACE_DESCRIPTOR\r\n", rcode); rcode = UHS_HOST_ERROR_FailGetConfDescr; continue; } @@ -438,7 +438,7 @@ again: 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); + HOST_DEBUG("Configuring error: %2.2x Can't get USB_FD_INTERFACE_DESCRIPTOR stream.\r\n", rcode); break; } for(; (numinf) && (!rcode); inf++) { @@ -451,7 +451,7 @@ again: break; } if(rcode) { - HOST_DEBUG("Configuring error: %2.2x Can't close USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode); + HOST_DEBUG("Configuring error: %2.2x Can't close USB_FD_INTERFACE_DESCRIPTOR stream.\r\n", rcode); continue; } rcode = TestInterface(&ei); @@ -471,9 +471,9 @@ again: if(!bestsuccess) rcode = UHS_HOST_ERROR_DEVICE_NOT_SUPPORTED; } if(!rcode) { - rcode = getConfDescr(ei.address, sizeof (USB_CONFIGURATION_DESCRIPTOR), bestconf, buf); + rcode = getConfDescr(ei.address, sizeof (USB_FD_CONFIGURATION_DESCRIPTOR), bestconf, buf); if(rcode) { - HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR\r\n", rcode); + HOST_DEBUG("Configuring error: %2.2x Can't get USB_FD_INTERFACE_DESCRIPTOR\r\n", rcode); rcode = UHS_HOST_ERROR_FailGetConfDescr; } } @@ -497,7 +497,7 @@ again: 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); + HOST_DEBUG("Configuring error: %2.2x Can't get USB_FD_INTERFACE_DESCRIPTOR stream.\r\n", rcode); } else { for(; (numinf) && (!rcode); inf++) { // iterate for each interface on this config @@ -508,7 +508,7 @@ again: break; } if(rcode) { - HOST_DEBUG("Configuring error: %2.2x Can't close USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode); + HOST_DEBUG("Configuring error: %2.2x Can't close USB_FD_INTERFACE_DESCRIPTOR stream.\r\n", rcode); continue; } @@ -721,7 +721,7 @@ uint8_t UHS_USB_HOST_BASE::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytes * @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) { +uint8_t UHS_USB_HOST_BASE::initDescrStream(ENUMERATION_INFO *ei, USB_FD_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; @@ -837,7 +837,7 @@ uint8_t UHS_USB_HOST_BASE::getNextInterface(ENUMERATION_INFO *ei, UHS_EpInfo *pe return rcode; } -uint8_t UHS_USB_HOST_BASE::seekInterface(ENUMERATION_INFO *ei, uint16_t inf, USB_CONFIGURATION_DESCRIPTOR *ucd) { +uint8_t UHS_USB_HOST_BASE::seekInterface(ENUMERATION_INFO *ei, uint16_t inf, USB_FD_CONFIGURATION_DESCRIPTOR *ucd) { if(!ei || !ucd) return UHS_HOST_ERROR_BAD_ARGUMENT; uint8_t data[ei->bMaxPacketSize0]; UHS_EpInfo *pep; diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h index 9c94e4d0ee..05c76d3998 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h @@ -20,7 +20,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h index f5ed3d8b40..c0cc78d15f 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h @@ -20,7 +20,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ #if !defined(_UHS_host_h_) || defined(__MESSAGE_H__) diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h index 4b8d387d27..4fc9b94079 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h @@ -20,7 +20,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h index 09e3365107..94015fba72 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h @@ -20,7 +20,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h index a401c28516..c516599d6b 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h @@ -20,7 +20,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ @@ -115,7 +115,7 @@ e-mail : support@circuitsathome.com #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 +#define PROGMEM __attribute__((section(".progmem.data"))) // Workaround for https://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 diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h index 34b8ad72e7..a9ed2e71a5 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h @@ -20,7 +20,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ @@ -164,7 +164,7 @@ typedef struct { 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; +} __attribute__((packed)) USB_FD_DEVICE_DESCRIPTOR; /* Configuration descriptor structure */ typedef struct { @@ -176,7 +176,7 @@ typedef struct { 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; +} __attribute__((packed)) USB_FD_CONFIGURATION_DESCRIPTOR; /* Interface descriptor structure */ typedef struct { @@ -189,7 +189,7 @@ typedef struct { 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; +} __attribute__((packed)) USB_FD_INTERFACE_DESCRIPTOR; /* Endpoint descriptor structure */ typedef struct { @@ -199,7 +199,7 @@ typedef struct { uint8_t bmAttributes; // Endpoint transfer type. uint16_t wMaxPacketSize; // Maximum packet size. uint8_t bInterval; // Polling interval in frames. -} __attribute__((packed)) USB_ENDPOINT_DESCRIPTOR; +} __attribute__((packed)) USB_FD_ENDPOINT_DESCRIPTOR; /* HID descriptor */ /* diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h index 9a6b110a15..625666170b 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h @@ -20,7 +20,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ @@ -207,7 +207,7 @@ public: interrupts(); } - uint8_t UHS_NI seekInterface(ENUMERATION_INFO *ei, uint16_t inf, USB_CONFIGURATION_DESCRIPTOR *ucd); + uint8_t UHS_NI seekInterface(ENUMERATION_INFO *ei, uint16_t inf, USB_FD_CONFIGURATION_DESCRIPTOR *ucd); uint8_t UHS_NI setEpInfoEntry(uint8_t addr, uint8_t iface, uint8_t epcount, volatile UHS_EpInfo* eprecord_ptr); @@ -261,7 +261,7 @@ public: 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 initDescrStream(ENUMERATION_INFO *ei, USB_FD_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); diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h index 4f53443fb0..52015b5987 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h @@ -20,7 +20,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/UHS_max3421e.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/UHS_max3421e.h index f42a806d70..8719293e73 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/UHS_max3421e.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/UHS_max3421e.h @@ -13,7 +13,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ #if !defined(USB_HOST_SHIELD_H) || defined(_max3421e_h_) diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h index f0cdae2b6b..56d6400979 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h @@ -13,7 +13,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h index ef2dfe0137..3166ae4b05 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h @@ -13,7 +13,7 @@ Contact information ------------------- Circuits At Home, LTD -Web : http://www.circuitsathome.com +Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ diff --git a/README.md b/README.md index 17f3e3ea06..d6f9662508 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ -Additional documentation can be found at the [Marlin Home Page](http://marlinfw.org/). -Please let us know if Marlin misbehaves in any way. Volunteers are standing by! +Additional documentation can be found at the [Marlin Home Page](https://marlinfw.org/). +Please test this firmware and let us know if it misbehaves in any way. Volunteers are standing by! ## Marlin 2.0 @@ -53,7 +53,7 @@ For best results getting help with configuration and troubleshooting, please use - [Marlin Discord](https://discord.gg/n5NJ59y) - Discuss issues with Marlin users and developers - Facebook Group ["Marlin Firmware"](https://www.facebook.com/groups/1049718498464482/) - RepRap.org [Marlin Forum](http://forums.reprap.org/list.php?415) -- [Tom's 3D Forums](https://discuss.toms3d.org/) +- [Tom's 3D Forums](https://forum.toms3d.org/) - Facebook Group ["Marlin Firmware for 3D Printers"](https://www.facebook.com/groups/3Dtechtalk/) - [Marlin Configuration](https://www.youtube.com/results?search_query=marlin+configuration) on YouTube @@ -61,11 +61,10 @@ For best results getting help with configuration and troubleshooting, please use The current Marlin dev team consists of: - - Scott Lahteine [[@thinkyhead](https://github.com/thinkyhead)] - USA   [Donate](http://www.thinkyhead.com/donate-to-marlin) / Flattr: [![Flattr Scott](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=thinkyhead&url=https://github.com/MarlinFirmware/Marlin&title=Marlin&language=&tags=github&category=software) + - Scott Lahteine [[@thinkyhead](https://github.com/thinkyhead)] - USA   [Donate](http://www.thinkyhead.com/donate-to-marlin) - Roxanne Neufeld [[@Roxy-3D](https://github.com/Roxy-3D)] - USA - Chris Pepper [[@p3p](https://github.com/p3p)] - UK - Bob Kuhn [[@Bob-the-Kuhn](https://github.com/Bob-the-Kuhn)] - USA - - João Brazio [[@jbrazio](https://github.com/jbrazio)] - Portugal - Erik van der Zalm [[@ErikZalm](https://github.com/ErikZalm)] - Netherlands   [![Flattr Erik](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=ErikZalm&url=https://github.com/MarlinFirmware/Marlin&title=Marlin&language=&tags=github&category=software) ## License diff --git a/buildroot/bin/.gitattributes b/buildroot/bin/.gitattributes new file mode 100644 index 0000000000..6313b56c57 --- /dev/null +++ b/buildroot/bin/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/buildroot/bin/format_code b/buildroot/bin/format_code new file mode 100755 index 0000000000..8ae04b1b6e --- /dev/null +++ b/buildroot/bin/format_code @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# +# format_code [dir/file...] +# + +HERE=`dirname $0` + +while [[ $# -gt 0 ]]; do + + val="$1" + + if [ -d "$val" ]; then + + find $val -name *.cpp -exec "$HERE/uncrust" '{}' \; + + elif [ -d "./Marlin/src/$val" ]; then + + find "./Marlin/src/$val" -name *.cpp -exec "$HERE/uncrust" '{}' \; + + elif [ -f "./Marlin/src/$val" ]; then + + uncrust "./Marlin/src/$val" + + elif [ -f "$val" ]; then + + uncrust "$val" + + fi + +done diff --git a/buildroot/bin/generate_version b/buildroot/bin/generate_version index 70efe824a7..b88e3de918 100755 --- a/buildroot/bin/generate_version +++ b/buildroot/bin/generate_version @@ -63,7 +63,7 @@ cat > "${DIR}/Version.h" <. + * along with this program. If not, see . * */ #pragma once diff --git a/buildroot/bin/uncrust b/buildroot/bin/uncrust new file mode 100755 index 0000000000..9893b5c380 --- /dev/null +++ b/buildroot/bin/uncrust @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# Run uncrustify for a file in-place +# + +TMPDIR=`mktemp -d` + +# Reformat a single file to tmp/ +uncrustify -l CPP -c ./buildroot/share/extras/uncrustify.cfg -f "$1" >$TMPDIR/uncrustify.out + +# Replace the original file +cp "$TMPDIR/uncrustify.out" "$1" + +# Clean up, deliberately +rm "$TMPDIR/uncrustify.out" +rmdir "$TMPDIR" diff --git a/buildroot/share/PlatformIO/boards/BigTree_Btt002.json b/buildroot/share/PlatformIO/boards/BigTree_Btt002.json index 6137aa6948..d0d092f1ea 100644 --- a/buildroot/share/PlatformIO/boards/BigTree_Btt002.json +++ b/buildroot/share/PlatformIO/boards/BigTree_Btt002.json @@ -14,29 +14,29 @@ "0x3748" ] ], - "ldscript": "stm32f407xg.ld", - "mcu": "stm32f407vet6", + "mcu": "stm32f407vgt6", "variant": "BIGTREE_BTT002" }, "debug": { - "jlink_device": "STM32F407VE", + "jlink_device": "STM32F407VG", "openocd_target": "stm32f4x", "svd_path": "STM32F40x.svd" }, "frameworks": [ "arduino" ], - "name": "STM32F407VE (192k RAM. 512k Flash)", + "name": "STM32F407VG (192k RAM. 1024k Flash)", "upload": { "disable_flushing": false, "maximum_ram_size": 131072, - "maximum_size": 524288, + "maximum_size": 1048576, "protocol": "stlink", "protocols": [ "stlink", "dfu", "jlink" ], + "offset_address": "0x8008000", "require_upload_port": true, "use_1200bps_touch": false, "wait_for_upload_port": false diff --git a/buildroot/share/PlatformIO/boards/BigTree_GTR_v1.json b/buildroot/share/PlatformIO/boards/BigTree_GTR_v1.json new file mode 100644 index 0000000000..32236301c3 --- /dev/null +++ b/buildroot/share/PlatformIO/boards/BigTree_GTR_v1.json @@ -0,0 +1,46 @@ +{ + "build": { + "core": "stm32", + "cpu": "cortex-m4", + "extra_flags": "-DSTM32F4 -DSTM32F407xx -DSTM32F40_41xxx", + "f_cpu": "168000000L", + "hwids": [ + [ + "0x1EAF", + "0x0003" + ], + [ + "0x0483", + "0x3748" + ] + ], + "mcu": "stm32f407zgt6", + "variant": "BIGTREE_GTR_V1" + }, + "debug": { + "jlink_device": "STM32F407ZG", + "openocd_target": "stm32f4x", + "svd_path": "STM32F40x.svd" + }, + "frameworks": [ + "arduino" + ], + "name": "STM32F407ZG (192k RAM. 1024k Flash)", + "upload": { + "disable_flushing": false, + "maximum_ram_size": 196608, + "maximum_size": 1048576, + "protocol": "stlink", + "protocols": [ + "stlink", + "dfu", + "jlink" + ], + "offset_address": "0x8008000", + "require_upload_port": true, + "use_1200bps_touch": false, + "wait_for_upload_port": false + }, + "url": "https://www.st.com/en/microcontrollers-microprocessors/stm32f407zg.html", + "vendor": "Generic" +} diff --git a/buildroot/share/PlatformIO/boards/BigTree_SKR_Pro.json b/buildroot/share/PlatformIO/boards/BigTree_SKR_Pro.json index dbbe8c8a6e..211ceacdca 100644 --- a/buildroot/share/PlatformIO/boards/BigTree_SKR_Pro.json +++ b/buildroot/share/PlatformIO/boards/BigTree_SKR_Pro.json @@ -14,7 +14,6 @@ "0x3748" ] ], - "ldscript": "stm32f407xg.ld", "mcu": "stm32f407zgt6", "variant": "BIGTREE_SKR_PRO_1v1" }, @@ -37,6 +36,7 @@ "dfu", "jlink" ], + "offset_address": "0x8008000", "require_upload_port": true, "use_1200bps_touch": false, "wait_for_upload_port": false diff --git a/buildroot/share/PlatformIO/boards/CHITU_F103.json b/buildroot/share/PlatformIO/boards/CHITU_F103.json new file mode 100644 index 0000000000..ecf7bff66c --- /dev/null +++ b/buildroot/share/PlatformIO/boards/CHITU_F103.json @@ -0,0 +1,48 @@ +{ + "build": { + "core": "maple", + "cpu": "cortex-m3", + "extra_flags": "-DSTM32F103xE -DSTM32F1", + "f_cpu": "72000000L", + "hwids": [ + [ + "0x1EAF", + "0x0003" + ], + [ + "0x1EAF", + "0x0004" + ] + ], + "mcu": "stm32f103zet6", + "variant": "CHITU_F103", + "ldscript": "chitu_f103.ld" + }, + "debug": { + "jlink_device": "STM32F103ZE", + "openocd_target": "stm32f1x", + "svd_path": "STM32F103xx.svd" + }, + "frameworks": [ + "arduino" + ], + "name": "CHITU STM32F103Z (64k RAM. 512k Flash)", + "upload": { + "disable_flushing": false, + "maximum_ram_size": 60536, + "maximum_size": 480288, + "protocol": "stlink", + "protocols": [ + "jlink", + "stlink", + "blackmagic", + "serial", + "dfu" + ], + "require_upload_port": true, + "use_1200bps_touch": false, + "wait_for_upload_port": false + }, + "url": "https://www.st.com/en/microcontrollers-microprocessors/stm32f103ze.html", + "vendor": "Generic" +} diff --git a/buildroot/share/PlatformIO/boards/FLYF407ZG.json b/buildroot/share/PlatformIO/boards/FLYF407ZG.json index 87a533be6e..7e585c5057 100644 --- a/buildroot/share/PlatformIO/boards/FLYF407ZG.json +++ b/buildroot/share/PlatformIO/boards/FLYF407ZG.json @@ -14,7 +14,6 @@ "0x3748" ] ], - "ldscript": "stm32f407xg.ld", "mcu": "stm32f407zgt6", "variant": "FLY_F407ZG" }, diff --git a/buildroot/share/PlatformIO/boards/LERDGE.json b/buildroot/share/PlatformIO/boards/LERDGE.json new file mode 100644 index 0000000000..21df8db48e --- /dev/null +++ b/buildroot/share/PlatformIO/boards/LERDGE.json @@ -0,0 +1,64 @@ +{ + "build": { + "core": "stm32", + "cpu": "cortex-m4", + "extra_flags": "-DSTM32F407xx", + "f_cpu": "168000000L", + "hwids": [ + [ + "0x1EAF", + "0x0003" + ], + [ + "0x0483", + "0x3748" + ] + ], + "mcu": "stm32f407zgt6", + "variant": "LERDGE" + }, + "debug": { + "jlink_device": "STM32F407ZG", + "openocd_target": "stm32f4x", + "svd_path": "STM32F40x.svd", + "tools": { + "stlink": { + "server": { + "arguments": [ + "-f", + "scripts/interface/stlink.cfg", + "-c", + "transport select hla_swd", + "-f", + "scripts/target/stm32f4x.cfg", + "-c", + "reset_config none" + ], + "executable": "bin/openocd", + "package": "tool-openocd" + } + } + } + }, + "frameworks": [ + "arduino", + "stm32cube" + ], + "name": "STM32F407ZGT6(192k RAM. 1024k Flash)", + "upload": { + "disable_flushing": false, + "maximum_ram_size": 196608, + "maximum_size": 1048576, + "protocol": "stlink", + "protocols": [ + "stlink", + "dfu", + "jlink" + ], + "require_upload_port": true, + "use_1200bps_touch": false, + "wait_for_upload_port": false + }, + "url": "https://www.st.com/en/microcontrollers-microprocessors/stm32f407ZG.html", + "vendor": "Generic" +} diff --git a/buildroot/share/PlatformIO/boards/MEEB_3DP.json b/buildroot/share/PlatformIO/boards/MEEB_3DP.json new file mode 100644 index 0000000000..870648b325 --- /dev/null +++ b/buildroot/share/PlatformIO/boards/MEEB_3DP.json @@ -0,0 +1,53 @@ +{ + "build": { + "core": "maple", + "cpu": "cortex-m3", + "extra_flags": "-DSTM32F103xE -DSTM32F1", + "f_cpu": "72000000L", + "hwids": [ + [ + "0x1EAF", + "0x0003" + ], + [ + "0x1EAF", + "0x0004" + ] + ], + "libopencm3": { + "ldscript": "stm32f103xc.ld" + }, + "mcu": "stm32f103rct6", + "variant": "MEEB_3DP" + }, + "debug": { + "jlink_device": "STM32F103RC", + "openocd_target": "stm32f1x", + "svd_path": "STM32F103xx.svd" + }, + "frameworks": [ + "arduino", + "cmsis", + "libopencm3", + "stm32cube" + ], + "name": "3D Printer control board for MEEB with 512k flash/rs422 bus/tmc2208 drivers", + "upload": { + "disable_flushing": false, + "maximum_ram_size": 49152, + "maximum_size": 524288, + "protocol": "dfu", + "protocols": [ + "jlink", + "stlink", + "blackmagic", + "serial", + "dfu" + ], + "require_upload_port": true, + "use_1200bps_touch": false, + "wait_for_upload_port": false + }, + "url": "https://github.com/ccrobot-online/MEEB_3DP", + "vendor": "CCROBOT-ONLINE" +} diff --git a/buildroot/share/PlatformIO/boards/blackSTM32F407VET6.json b/buildroot/share/PlatformIO/boards/blackSTM32F407VET6.json index 33f688e06f..1765634086 100644 --- a/buildroot/share/PlatformIO/boards/blackSTM32F407VET6.json +++ b/buildroot/share/PlatformIO/boards/blackSTM32F407VET6.json @@ -14,7 +14,6 @@ "0x3748" ] ], - "ldscript": "stm32f407xe.ld", "mcu": "stm32f407vet6", "variant": "MARLIN_F407VE" }, diff --git a/buildroot/share/PlatformIO/boards/malyanM200.json b/buildroot/share/PlatformIO/boards/malyanM200.json index eea7c13c00..4dbf760774 100644 --- a/buildroot/share/PlatformIO/boards/malyanM200.json +++ b/buildroot/share/PlatformIO/boards/malyanM200.json @@ -11,7 +11,6 @@ "ldscript": "jtagOffset.ld", "mcu": "stm32f103cb", "variant": "malyanM200", - "genericvariant" : "MALYAN_M200_V1", "vec_tab_addr": "0x8002000" }, "debug": { diff --git a/buildroot/share/PlatformIO/boards/malyanM200v2.json b/buildroot/share/PlatformIO/boards/malyanM200v2.json index 0d2090a93b..9e301ee79f 100644 --- a/buildroot/share/PlatformIO/boards/malyanM200v2.json +++ b/buildroot/share/PlatformIO/boards/malyanM200v2.json @@ -4,7 +4,7 @@ "extra_flags": "-DSTM32F070xB", "f_cpu": "48000000L", "mcu": "stm32f070rbt6", - "genericvariant" : "MALYAN_M200_V2", + "variant": "MALYANM200_F070CB", "vec_tab_addr": "0x8002000" }, "debug": { diff --git a/buildroot/share/PlatformIO/ldscripts/STM32F103RC_MEEB_3DP.ld b/buildroot/share/PlatformIO/ldscripts/STM32F103RC_MEEB_3DP.ld new file mode 100644 index 0000000000..01609b9b2c --- /dev/null +++ b/buildroot/share/PlatformIO/ldscripts/STM32F103RC_MEEB_3DP.ld @@ -0,0 +1,14 @@ +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K - 40 + rom (rx) : ORIGIN = 0x08002000, LENGTH = 512K - 8K - 4K +} + +/* Provide memory region aliases for common.inc */ +REGION_ALIAS("REGION_TEXT", rom); +REGION_ALIAS("REGION_DATA", ram); +REGION_ALIAS("REGION_BSS", ram); +REGION_ALIAS("REGION_RODATA", rom); + +/* Let common.inc handle the real work. */ +INCLUDE common.inc diff --git a/buildroot/share/PlatformIO/ldscripts/chitu_f103.ld b/buildroot/share/PlatformIO/ldscripts/chitu_f103.ld index cc58123636..0938e8e5e9 100644 --- a/buildroot/share/PlatformIO/ldscripts/chitu_f103.ld +++ b/buildroot/share/PlatformIO/ldscripts/chitu_f103.ld @@ -1,7 +1,7 @@ MEMORY { - ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - rom (rx) : ORIGIN = 0x08008800, LENGTH = 512K - 32K + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 60K + rom (rx) : ORIGIN = 0x08008800, LENGTH = 512K - 34K } /* Provide memory region aliases for common.inc */ diff --git a/buildroot/share/PlatformIO/ldscripts/creality.ld b/buildroot/share/PlatformIO/ldscripts/creality.ld new file mode 100644 index 0000000000..785345543c --- /dev/null +++ b/buildroot/share/PlatformIO/ldscripts/creality.ld @@ -0,0 +1,14 @@ +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - 40 + rom (rx) : ORIGIN = 0x08007000, LENGTH = 512K - 28K +} + +/* Provide memory region aliases for common.inc */ +REGION_ALIAS("REGION_TEXT", rom); +REGION_ALIAS("REGION_DATA", ram); +REGION_ALIAS("REGION_BSS", ram); +REGION_ALIAS("REGION_RODATA", rom); + +/* Let common.inc handle the real work. */ +INCLUDE common.inc diff --git a/buildroot/share/PlatformIO/ldscripts/fysetc_aio_ii.ld b/buildroot/share/PlatformIO/ldscripts/fysetc_stm32f103rc.ld similarity index 88% rename from buildroot/share/PlatformIO/ldscripts/fysetc_aio_ii.ld rename to buildroot/share/PlatformIO/ldscripts/fysetc_stm32f103rc.ld index f279347ee5..6777e59182 100644 --- a/buildroot/share/PlatformIO/ldscripts/fysetc_aio_ii.ld +++ b/buildroot/share/PlatformIO/ldscripts/fysetc_stm32f103rc.ld @@ -5,7 +5,7 @@ MEMORY { ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K - rom (rx) : ORIGIN = 0x08010000, LENGTH = 256K - 40K - 4K + rom (rx) : ORIGIN = 0x08008000, LENGTH = 256K - 32K } /* Provide memory region aliases for common.inc */ diff --git a/buildroot/share/PlatformIO/ldscripts/lerdge.ld b/buildroot/share/PlatformIO/ldscripts/lerdge.ld new file mode 100644 index 0000000000..aa0b1dd9cb --- /dev/null +++ b/buildroot/share/PlatformIO/ldscripts/lerdge.ld @@ -0,0 +1,186 @@ +/* +***************************************************************************** +** +** File : LinkerScript.ld +** +** Abstract : Linker script for STM32F407VGTx Device with +** 1024KByte FLASH, 128KByte RAM +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used. +** +** Target : STMicroelectronics STM32 +** +** +** Distribution: The file is distributed as is, without any warranty +** of any kind. +** +** (c)Copyright Ac6. +** You may use this file as-is or modify it according to the needs of your +** project. Distribution of this file (unmodified or modified) is not +** permitted. Ac6 permit registered System Workbench for MCU users the +** rights to distribute the assembled, compiled & linked contents of this +** file as part of an application binary file, provided that it is built +** using the System Workbench for MCU toolchain. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20010000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x200;; /* required amount of heap */ +_Min_Stack_Size = 0x400;; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET +RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE +CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text ALIGN(4): + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata ALIGN(4): + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM AT> FLASH + + _siccmram = LOADADDR(.ccmram); + + /* CCM-RAM section + * + * IMPORTANT NOTE! + * If initialized variables will be placed in this section, + * the startup code needs to be modified to copy the init-values. + */ + .ccmram : + { + . = ALIGN(4); + _sccmram = .; /* create a global symbol at ccmram start */ + *(.ccmram) + *(.ccmram*) + + . = ALIGN(4); + _eccmram = .; /* create a global symbol at ccmram end */ + } >CCMRAM AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(4); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(4); + } >RAM + + + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} diff --git a/buildroot/share/PlatformIO/ldscripts/mks_robin_e3.ld b/buildroot/share/PlatformIO/ldscripts/mks_robin_e3.ld new file mode 100644 index 0000000000..2404e7cac9 --- /dev/null +++ b/buildroot/share/PlatformIO/ldscripts/mks_robin_e3.ld @@ -0,0 +1,14 @@ +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K - 40 + rom (rx) : ORIGIN = 0x08005000, LENGTH = 256K - 20K - 4K +} + +/* Provide memory region aliases for common.inc */ +REGION_ALIAS("REGION_TEXT", rom); +REGION_ALIAS("REGION_DATA", ram); +REGION_ALIAS("REGION_BSS", ram); +REGION_ALIAS("REGION_RODATA", rom); + +/* Let common.inc handle the real work. */ +INCLUDE common.inc diff --git a/buildroot/share/PlatformIO/ldscripts/mks_robin_nano.ld b/buildroot/share/PlatformIO/ldscripts/mks_robin_nano.ld index 785345543c..d8a138ca2e 100755 --- a/buildroot/share/PlatformIO/ldscripts/mks_robin_nano.ld +++ b/buildroot/share/PlatformIO/ldscripts/mks_robin_nano.ld @@ -1,7 +1,7 @@ MEMORY { ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - 40 - rom (rx) : ORIGIN = 0x08007000, LENGTH = 512K - 28K + rom (rx) : ORIGIN = 0x08007000, LENGTH = 512K - 28K - 4K } /* Provide memory region aliases for common.inc */ diff --git a/buildroot/share/PlatformIO/scripts/STEVAL__F401XX.py b/buildroot/share/PlatformIO/scripts/STEVAL__F401XX.py index e132ff3af6..580529c9c1 100644 --- a/buildroot/share/PlatformIO/scripts/STEVAL__F401XX.py +++ b/buildroot/share/PlatformIO/scripts/STEVAL__F401XX.py @@ -7,5 +7,3 @@ for i, flag in enumerate(env["LINKFLAGS"]): env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script elif flag == "-T": env["LINKFLAGS"][i + 1] = custom_ld_script - - diff --git a/buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py b/buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py new file mode 100644 index 0000000000..547d80ace5 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py @@ -0,0 +1,59 @@ +try: + import configparser +except ImportError: + import ConfigParser as configparser + +import os +Import("env", "projenv") +# access to global build environment +print(env) +# access to project build environment (is used source files in "src" folder) +print(projenv) + +config = configparser.ConfigParser() +config.read("platformio.ini") + +#com_port = config.get("env:STM32F103RC_meeb", "upload_port") +#print('Use the {0:s} to reboot the board to dfu mode.'.format(com_port)) + +# +# Upload actions +# + +def before_upload(source, target, env): + print("before_upload") + # do some actions + # use com_port + # + env.Execute("pwd") + +def after_upload(source, target, env): + print("after_upload") + # do some actions + # + # + env.Execute("pwd") + +print("Current build targets", map(str, BUILD_TARGETS)) + +env.AddPreAction("upload", before_upload) +env.AddPostAction("upload", after_upload) + +flash_size = 0 +vect_tab_addr = 0 + +for define in env['CPPDEFINES']: + if define[0] == "VECT_TAB_ADDR": + vect_tab_addr = define[1] + if define[0] == "STM32_FLASH_SIZE": + flash_size = define[1] + +print('Use the {0:s} address as the marlin app entry point.'.format(vect_tab_addr)) +print('Use the {0:d}KB flash version of stm32f103rct6 chip.'.format(flash_size)) + +custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/STM32F103RC_MEEB_3DP.ld") +for i, flag in enumerate(env["LINKFLAGS"]): + if "-Wl,-T" in flag: + env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script + elif flag == "-T": + env["LINKFLAGS"][i + 1] = custom_ld_script diff --git a/buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py b/buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py index 67a75f5b47..b69f62578b 100644 --- a/buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py +++ b/buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py @@ -1,10 +1,20 @@ +import os from os.path import join from os.path import expandvars -Import("env", "projenv") +Import("env") -# Relocate firmware from 0x08000000 to 0x08002000 -#env['CPPDEFINES'].remove(("VECT_TAB_ADDR", 134217728)) -#env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08010000")) +# Relocate firmware from 0x08000000 to 0x08008000 +#for define in env['CPPDEFINES']: +# if define[0] == "VECT_TAB_ADDR": +# env['CPPDEFINES'].remove(define) +#env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08008000")) + +#custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/fysetc_stm32f103rc.ld") +#for i, flag in enumerate(env["LINKFLAGS"]): +# if "-Wl,-T" in flag: +# env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script +# elif flag == "-T": +# env["LINKFLAGS"][i + 1] = custom_ld_script # Custom HEX from ELF env.AddPostAction( @@ -14,14 +24,6 @@ env.AddPostAction( "\"" + join("$BUILD_DIR","${PROGNAME}.hex") + "\"", # Note: $BUILD_DIR is a full path ]), "Building $TARGET")) -# please keep $SOURCE variable, it will be replaced with a path to firmware - -# Generic -#env.Replace( -# UPLOADER="serial_upload.bat" -# UPLOADCMD="$UPLOADER stm32loader.py $SOURCE" -#) - # In-line command with arguments UPLOAD_TOOL="stm32flash" platform = env.PioPlatform() @@ -32,12 +34,3 @@ env.Replace( UPLOADER=UPLOAD_TOOL, UPLOADCMD=expandvars(UPLOAD_TOOL + " -v -i rts,-dtr,dtr -R -b 115200 -g 0x8000000 -w \"" + join("$BUILD_DIR","${PROGNAME}.hex")+"\"" + " $UPLOAD_PORT") ) - -# Python callback -#def on_upload(source, target, env): -# print source, target -# firmware_path = str(source[0]) -# # do something -# env.Execute(".\serial_upload.bat") - -#env.Replace(UPLOADCMD=on_upload) diff --git a/buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py b/buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py index af4c66cd21..ecdd57f594 100644 --- a/buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py +++ b/buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py @@ -1,6 +1,10 @@ import os Import("env") +for define in env['CPPDEFINES']: + if define[0] == "VECT_TAB_ADDR": + env['CPPDEFINES'].remove(define) + # Relocate firmware from 0x08000000 to 0x08007000 env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) diff --git a/buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py b/buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py new file mode 100644 index 0000000000..4849f59ceb --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py @@ -0,0 +1,34 @@ +import os,shutil +from SCons.Script import DefaultEnvironment +from platformio import util + +def copytree(src, dst, symlinks=False, ignore=None): + for item in os.listdir(src): + s = os.path.join(src, item) + d = os.path.join(dst, item) + if os.path.isdir(s): + shutil.copytree(s, d, symlinks, ignore) + else: + shutil.copy2(s, d) + +env = DefaultEnvironment() +platform = env.PioPlatform() +board = env.BoardConfig() + +FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoststm32-maple") +assert os.path.isdir(FRAMEWORK_DIR) +assert os.path.isdir("buildroot/share/PlatformIO/variants") + +variant = board.get("build.variant") +variant_dir = os.path.join(FRAMEWORK_DIR, "STM32F1", "variants", variant) + +source_dir = os.path.join("buildroot/share/PlatformIO/variants", variant) +assert os.path.isdir(source_dir) + +if os.path.isdir(variant_dir): + shutil.rmtree(variant_dir) + +if not os.path.isdir(variant_dir): + os.mkdir(variant_dir) + +copytree(source_dir, variant_dir) diff --git a/buildroot/share/PlatformIO/scripts/chitu_crypt.py b/buildroot/share/PlatformIO/scripts/chitu_crypt.py index d706665e90..26e5612e3c 100644 --- a/buildroot/share/PlatformIO/scripts/chitu_crypt.py +++ b/buildroot/share/PlatformIO/scripts/chitu_crypt.py @@ -1,12 +1,12 @@ -import os -import struct Import("env") +import os +import random +import struct +import uuid # Relocate firmware from 0x08000000 to 0x08008800 -for define in env['CPPDEFINES']: - if define[0] == "VECT_TAB_ADDR": - env['CPPDEFINES'].remove(define) -env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x8008800")) +env['CPPDEFINES'].remove(("VECT_TAB_ADDR", "0x8000000")) +env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08008800")) custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/chitu_f103.ld") for i, flag in enumerate(env["LINKFLAGS"]): @@ -73,7 +73,9 @@ def encrypt_file(input, output_file, file_length): input_file = bytearray(input.read()) block_size = 0x800 key_length = 0x18 - file_key = 0xDAB27F94 + + uid_value = uuid.uuid4() + file_key = int(uid_value.hex[0:8], 16) xor_crc = 0xef3d4323; @@ -87,11 +89,11 @@ def encrypt_file(input, output_file, file_length): # encrypt the contents using a known file header key # write the file_key - output_file.write(struct.pack(">I", 0x947FB2DA)) + output_file.write(struct.pack(". + * + */ +#pragma once + +/** + * The purpose of this file is just include Marlin Configuration files, + * to discover which FEATURES are enabled, without any HAL include. + * Used by common-dependencies.py + */ + +#include + +// Include platform headers +//#include "../../../../Marlin/src/HAL/platforms.h" + +#include "../../../../Marlin/src/core/boards.h" +#include "../../../../Marlin/src/core/macros.h" +#include "../../../../Marlin/Configuration.h" + +#include "../../../../Marlin/Version.h" + +#include "../../../../Marlin/src/inc/Conditionals_LCD.h" + +#ifdef HAL_PATH + #include HAL_PATH(../../../../Marlin/src/HAL, inc/Conditionals_LCD.h) +#endif + +#include "../../../../Marlin/src/core/drivers.h" +#include "../../../../Marlin/Configuration_adv.h" + +#include "../../../../Marlin/src/inc/Conditionals_adv.h" + +#ifdef HAL_PATH + #include HAL_PATH(../../../../Marlin/src/HAL, inc/Conditionals_adv.h) +#endif + +//#include "../../../../Marlin/src/pins/pins.h" + +#ifdef HAL_PATH + #include HAL_PATH(../../../../Marlin/src/HAL, timers.h) + #include HAL_PATH(../../../../Marlin/src/HAL, spi_pins.h) +#endif + +#include "../../../../Marlin/src/inc/Conditionals_post.h" + +#ifdef HAL_PATH + #include HAL_PATH(../../../../Marlin/src/HAL, inc/Conditionals_post.h) +#endif diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.py b/buildroot/share/PlatformIO/scripts/common-dependencies.py new file mode 100644 index 0000000000..37efaa3743 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/common-dependencies.py @@ -0,0 +1,222 @@ +# +# common-dependencies.py +# Convenience script to check dependencies and add libs and sources for Marlin Enabled Features +# +import subprocess +import os +import re +try: + import configparser +except ImportError: + import ConfigParser as configparser +from platformio.managers.package import PackageManager + +Import("env") + +FEATURE_DEPENDENCIES = {} + +def load_config(): + config = configparser.ConfigParser() + config.read("platformio.ini") + items = config.items('features') + for key in items: + ukey = key[0].upper() + if not ukey in FEATURE_DEPENDENCIES: + FEATURE_DEPENDENCIES[ukey] = { + 'lib_deps': [] + } + deps = re.sub(',\\s*', '\n', key[1]).strip().split('\n') + for dep in deps: + parts = dep.split('=') + name = parts.pop(0) + rest = '='.join(parts) + if name in ['extra_scripts', 'src_filter', 'lib_ignore']: + FEATURE_DEPENDENCIES[ukey][name] = rest + else: + FEATURE_DEPENDENCIES[ukey]['lib_deps'] += [dep] + +def get_all_known_libs(): + known_libs = [] + for feature in FEATURE_DEPENDENCIES: + if not 'lib_deps' in FEATURE_DEPENDENCIES[feature]: + continue + for dep in FEATURE_DEPENDENCIES[feature]['lib_deps']: + name, _, _ = PackageManager.parse_pkg_uri(dep) + known_libs.append(name) + return known_libs + +def get_all_env_libs(): + env_libs = [] + lib_deps = env.GetProjectOption('lib_deps') + for dep in lib_deps: + name, _, _ = PackageManager.parse_pkg_uri(dep) + env_libs.append(name) + return env_libs + +def set_env_field(field, value): + proj = env.GetProjectConfig() + proj.set("env:" + env['PIOENV'], field, value) + +# All unused libs should be ignored so that if a library +# exists in .pio/lib_deps it will not break compilation. +def force_ignore_unused_libs(): + env_libs = get_all_env_libs() + known_libs = get_all_known_libs() + diff = (list(set(known_libs) - set(env_libs))) + lib_ignore = env.GetProjectOption('lib_ignore') + diff + print("Ignoring libs:", lib_ignore) + set_env_field('lib_ignore', lib_ignore) + +def install_features_dependencies(): + load_config() + for feature in FEATURE_DEPENDENCIES: + if not env.MarlinFeatureIsEnabled(feature): + continue + + if 'lib_deps' in FEATURE_DEPENDENCIES[feature]: + print("Adding lib_deps for %s... " % feature) + + # deps to add + deps_to_add = {} + for dep in FEATURE_DEPENDENCIES[feature]['lib_deps']: + name, _, _ = PackageManager.parse_pkg_uri(dep) + deps_to_add[name] = dep + + # Does the env already have the dependency? + deps = env.GetProjectOption('lib_deps') + for dep in deps: + name, _, _ = PackageManager.parse_pkg_uri(dep) + if name in deps_to_add: + del deps_to_add[name] + + # Are there any libraries that should be ignored? + lib_ignore = env.GetProjectOption('lib_ignore') + for dep in deps: + name, _, _ = PackageManager.parse_pkg_uri(dep) + if name in deps_to_add: + del deps_to_add[name] + + # Is there anything left? + if len(deps_to_add) > 0: + # Only add the missing dependencies + set_env_field('lib_deps', deps + list(deps_to_add.values())) + + if 'extra_scripts' in FEATURE_DEPENDENCIES[feature]: + print("Executing extra_scripts for %s... " % feature) + env.SConscript(FEATURE_DEPENDENCIES[feature]['extra_scripts'], exports="env") + + if 'src_filter' in FEATURE_DEPENDENCIES[feature]: + print("Adding src_filter for %s... " % feature) + src_filter = ' '.join(env.GetProjectOption('src_filter')) + # first we need to remove the references to the same folder + my_srcs = re.findall( r'[+-](<.*?>)', FEATURE_DEPENDENCIES[feature]['src_filter']) + cur_srcs = re.findall( r'[+-](<.*?>)', src_filter) + for d in my_srcs: + if d in cur_srcs: + src_filter = re.sub(r'[+-]' + d, '', src_filter) + + src_filter = FEATURE_DEPENDENCIES[feature]['src_filter'] + ' ' + src_filter + set_env_field('src_filter', [src_filter]) + env.Replace(SRC_FILTER=src_filter) + + if 'lib_ignore' in FEATURE_DEPENDENCIES[feature]: + print("Ignoring libs for %s... " % feature) + lib_ignore = env.GetProjectOption('lib_ignore') + [FEATURE_DEPENDENCIES[feature]['lib_ignore']] + set_env_field('lib_ignore', lib_ignore) + +# +# Find a compiler, considering the OS +# +ENV_BUILD_PATH = os.path.join(env.Dictionary('PROJECT_BUILD_DIR'), env['PIOENV']) +GCC_PATH_CACHE = os.path.join(ENV_BUILD_PATH, ".gcc_path") +def search_compiler(): + if os.path.exists(GCC_PATH_CACHE): + print('Getting g++ path from cache') + with open(GCC_PATH_CACHE, 'r') as f: + return f.read() + + # PlatformIO inserts the toolchain bin folder on the front of the $PATH + # Find the current platform compiler by searching the $PATH + if env['PLATFORM'] == 'win32': + path_separator = ';' + path_regex = r'platformio\\packages.*\\bin' + gcc = "g++.exe" + else: + path_separator = ':' + path_regex = r'platformio/packages.*/bin' + gcc = "g++" + + # Search for the compiler + for path in env['ENV']['PATH'].split(path_separator): + if not re.search(path_regex, path): + continue + for file in os.listdir(path): + if not file.endswith(gcc): + continue + + # Cache the g++ path to no search always + if os.path.exists(ENV_BUILD_PATH): + print('Caching g++ for current env') + with open(GCC_PATH_CACHE, 'w+') as f: + f.write(file) + + return file + + file = env.get('CXX') + print("Couldn't find a compiler! Fallback to", file) + return file + +# +# Use the compiler to get a list of all enabled features +# +def load_marlin_features(): + if "MARLIN_FEATURES" in env: + return + + # Process defines + #print(env.Dump()) + build_flags = env.get('BUILD_FLAGS') + build_flags = env.ParseFlagsExtended(build_flags) + + cxx = search_compiler() + cmd = [cxx] + + # Build flags from board.json + #if 'BOARD' in env: + # cmd += [env.BoardConfig().get("build.extra_flags")] + for s in build_flags['CPPDEFINES']: + if isinstance(s, tuple): + cmd += ['-D' + s[0] + '=' + str(s[1])] + else: + cmd += ['-D' + s] + + cmd += ['-w -dM -E -x c++ buildroot/share/PlatformIO/scripts/common-dependencies.h'] + cmd = ' '.join(cmd) + print(cmd) + define_list = subprocess.check_output(cmd, shell=True).splitlines() + marlin_features = {} + for define in define_list: + feature = define[8:].strip().decode().split(' ') + feature, definition = feature[0], ' '.join(feature[1:]) + marlin_features[feature] = definition + env["MARLIN_FEATURES"] = marlin_features + +# +# Return True if a matching feature is enabled +# +def MarlinFeatureIsEnabled(env, feature): + load_marlin_features() + r = re.compile(feature) + matches = list(filter(r.match, env["MARLIN_FEATURES"])) + return len(matches) > 0 + +# +# Add a method for other PIO scripts to query enabled features +# +env.AddMethod(MarlinFeatureIsEnabled) + +# +# Add dependencies for enabled Marlin features +# +install_features_dependencies() +force_ignore_unused_libs() diff --git a/buildroot/share/PlatformIO/scripts/copy_marlin_variant_to_framework.py b/buildroot/share/PlatformIO/scripts/copy_marlin_variant_to_framework.py new file mode 100644 index 0000000000..02957ec470 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/copy_marlin_variant_to_framework.py @@ -0,0 +1,34 @@ +import os,shutil +from SCons.Script import DefaultEnvironment +from platformio import util + +def copytree(src, dst, symlinks=False, ignore=None): + for item in os.listdir(src): + s = os.path.join(src, item) + d = os.path.join(dst, item) + if os.path.isdir(s): + shutil.copytree(s, d, symlinks, ignore) + else: + shutil.copy2(s, d) + +env = DefaultEnvironment() +platform = env.PioPlatform() +board = env.BoardConfig() +variant = board.get("build.variant") + +FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoststm32") +assert os.path.isdir(FRAMEWORK_DIR) +assert os.path.isdir("buildroot/share/PlatformIO/variants") + +variant_dir = os.path.join(FRAMEWORK_DIR, "variants", variant) + +source_dir = os.path.join("buildroot/share/PlatformIO/variants", variant) +assert os.path.isdir(source_dir) + +if os.path.isdir(variant_dir): + shutil.rmtree(variant_dir) + +if not os.path.isdir(variant_dir): + os.mkdir(variant_dir) + +copytree(source_dir, variant_dir) diff --git a/buildroot/share/PlatformIO/scripts/creality.py b/buildroot/share/PlatformIO/scripts/creality.py new file mode 100644 index 0000000000..b9d7d7039b --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/creality.py @@ -0,0 +1,17 @@ +import os +Import("env") + +# Relocate firmware from 0x08000000 to 0x08007000 +for define in env['CPPDEFINES']: + if define[0] == "VECT_TAB_ADDR": + env['CPPDEFINES'].remove(define) + +env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) + +custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/creality.ld") + +for i, flag in enumerate(env['LINKFLAGS']): + if "-Wl,-T" in flag: + env['LINKFLAGS'][i] = "-Wl,-T" + custom_ld_script + elif flag == "-T": + env['LINKFLAGS'][i + 1] = custom_ld_script diff --git a/buildroot/share/PlatformIO/scripts/download_mks_assets.py b/buildroot/share/PlatformIO/scripts/download_mks_assets.py new file mode 100644 index 0000000000..ae2ce467e8 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/download_mks_assets.py @@ -0,0 +1,46 @@ +Import("env") +import os +import requests +import zipfile +import tempfile +import shutil + +url = "https://github.com/makerbase-mks/Mks-Robin-Nano-Marlin2.0-Firmware/archive/master.zip" +zip_path = os.path.join(env.Dictionary("PROJECT_LIBDEPS_DIR"), "mks-assets.zip") +assets_path = os.path.join(env.Dictionary("PROJECT_BUILD_DIR"), env.Dictionary("PIOENV"), "assets") + +def download_mks_assets(): + print("Downloading MKS Assets") + r = requests.get(url, stream=True) + # the user may have a very clean workspace, + # so create the PROJECT_LIBDEPS_DIR directory if not exits + if os.path.exists(env.Dictionary("PROJECT_LIBDEPS_DIR")) == False: + os.mkdir(env.Dictionary("PROJECT_LIBDEPS_DIR")) + with open(zip_path, 'wb') as fd: + for chunk in r.iter_content(chunk_size=128): + fd.write(chunk) + +def copy_mks_assets(): + print("Copying MKS Assets") + output_path = tempfile.mkdtemp() + zip_obj = zipfile.ZipFile(zip_path, 'r') + zip_obj.extractall(output_path) + zip_obj.close() + if os.path.exists(assets_path) == True and os.path.isdir(assets_path) == False: + os.unlink(assets_path) + if os.path.exists(assets_path) == False: + os.mkdir(assets_path) + base_path = '' + for filename in os.listdir(output_path): + base_path = filename + for filename in os.listdir(os.path.join(output_path, base_path, 'Firmware', 'mks_font')): + shutil.copy(os.path.join(output_path, base_path, 'Firmware', 'mks_font', filename), assets_path) + for filename in os.listdir(os.path.join(output_path, base_path, 'Firmware', 'mks_pic')): + shutil.copy(os.path.join(output_path, base_path, 'Firmware', 'mks_pic', filename), assets_path) + shutil.rmtree(output_path, ignore_errors=True) + +if os.path.exists(zip_path) == False: + download_mks_assets() + +if os.path.exists(assets_path) == False: + copy_mks_assets() diff --git a/buildroot/share/PlatformIO/scripts/fysetc_STM32S6.py b/buildroot/share/PlatformIO/scripts/fysetc_STM32S6.py index be010b10fe..f6598ede65 100644 --- a/buildroot/share/PlatformIO/scripts/fysetc_STM32S6.py +++ b/buildroot/share/PlatformIO/scripts/fysetc_STM32S6.py @@ -31,25 +31,3 @@ for file_name in os.listdir(source_dir): full_file_name = os.path.join(source_dir, file_name) if os.path.isfile(full_file_name): shutil.copy(full_file_name, variant_dir) - -# Relocate firmware from 0x08000000 to 0x08002000 -#env['CPPDEFINES'].remove(("VECT_TAB_ADDR", 134217728)) -#env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08010000")) -#env.Replace(LDSCRIPT_PATH="buildroot/share/PlatformIO/ldscripts/fysetc_aio_ii.ld") - -# Custom HEX from ELF -env.AddPostAction( - "$BUILD_DIR/${PROGNAME}.elf", - env.VerboseAction(" ".join([ - "$OBJCOPY", - "-O", - "ihex", - "$BUILD_DIR/${PROGNAME}.elf", - "$BUILD_DIR/${PROGNAME}.hex" - ]), "Building $TARGET")) - -# In-line command with arguments -env.Replace( - UPLOADER=platform.get_package_dir("tool-stm32duino") + '/stm32flash/stm32flash', - UPLOADCMD='"${UPLOADER}" -v -i rts,-dtr,dtr,-rts -R -b 115200 -g 0x8000000 -w "${BUILD_DIR}/${PROGNAME}.hex" ${UPLOAD_PORT}' -) diff --git a/buildroot/share/PlatformIO/scripts/lerdge.py b/buildroot/share/PlatformIO/scripts/lerdge.py new file mode 100644 index 0000000000..fd934a1278 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/lerdge.py @@ -0,0 +1,46 @@ +import os,sys +Import("env") + +from SCons.Script import DefaultEnvironment +board = DefaultEnvironment().BoardConfig() + +custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/lerdge.ld") +for i, flag in enumerate(env["LINKFLAGS"]): + if "-Wl,-T" in flag: + env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script + elif flag == "-T": + env["LINKFLAGS"][i + 1] = custom_ld_script + +def encryptByte(byte): + byte = 0xFF & ((byte << 6) | (byte >> 2)) + i = 0x58 + byte + j = 0x05 + byte + (i >> 8) + byte = (0xF8 & i) | (0x07 & j) + return byte + +def encrypt_file(input, output_file, file_length): + input_file = bytearray(input.read()) + for i in range(len(input_file)): + result = encryptByte(input_file[i]) + input_file[i] = result + + output_file.write(input_file) + return + +# Encrypt ${PROGNAME}.bin and save it as build.firmware +def encrypt(source, target, env): + print("Encrypting to:", board.get("build.firmware")) + firmware = open(target[0].path, "rb") + result = open(target[0].dir.path + "/" + board.get("build.firmware"), "wb") + length = os.path.getsize(target[0].path) + + encrypt_file(firmware, result, length) + + firmware.close() + result.close() + +if 'firmware' in board.get("build").keys(): + env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); +else: + print("You need to define output file via board_build.firmware = 'filename' parameter") + exit(1); diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_e3.py b/buildroot/share/PlatformIO/scripts/mks_robin_e3.py new file mode 100644 index 0000000000..3af623cce0 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/mks_robin_e3.py @@ -0,0 +1,40 @@ +import os +Import("env") + +# Relocate firmware from 0x08000000 to 0x08005000 +for define in env['CPPDEFINES']: + if define[0] == "VECT_TAB_ADDR": + env['CPPDEFINES'].remove(define) +env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08005000")) + +custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_e3.ld") +for i, flag in enumerate(env["LINKFLAGS"]): + if "-Wl,-T" in flag: + env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script + elif flag == "-T": + env["LINKFLAGS"][i + 1] = custom_ld_script + + +# Encrypt ${PROGNAME}.bin and save it as 'mksLite.bin' +def encrypt(source, target, env): + import sys + + key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] + + firmware = open(target[0].path, "rb") + robin = open(target[0].dir.path +'/Robin_e3.bin', "wb") + length = os.path.getsize(target[0].path) + position = 0 + try: + while position < length: + byte = firmware.read(1) + if position >= 320 and position < 31040: + byte = chr(ord(byte) ^ key[position & 31]) + if sys.version_info[0] > 2: + byte = bytes(byte, 'latin1') + robin.write(byte) + position += 1 + finally: + firmware.close() + robin.close() +env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_nano35.py b/buildroot/share/PlatformIO/scripts/mks_robin_nano35.py new file mode 100644 index 0000000000..0047289adf --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/mks_robin_nano35.py @@ -0,0 +1,40 @@ +import os +Import("env") + +# Relocate firmware from 0x08000000 to 0x08007000 +for define in env['CPPDEFINES']: + if define[0] == "VECT_TAB_ADDR": + env['CPPDEFINES'].remove(define) +env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) + +custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_nano.ld") +for i, flag in enumerate(env["LINKFLAGS"]): + if "-Wl,-T" in flag: + env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script + elif flag == "-T": + env["LINKFLAGS"][i + 1] = custom_ld_script + + +# Encrypt ${PROGNAME}.bin and save it as 'Robin_nano35.bin' +def encrypt(source, target, env): + import sys + + key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] + + firmware = open(target[0].path, "rb") + robin = open(target[0].dir.path +'/Robin_nano35.bin', "wb") + length = os.path.getsize(target[0].path) + position = 0 + try: + while position < length: + byte = firmware.read(1) + if position >= 320 and position < 31040: + byte = chr(ord(byte) ^ key[position & 31]) + if sys.version_info[0] > 2: + byte = bytes(byte, 'latin1') + robin.write(byte) + position += 1 + finally: + firmware.close() + robin.close() +env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); diff --git a/buildroot/share/PlatformIO/scripts/random-bin.py b/buildroot/share/PlatformIO/scripts/random-bin.py new file mode 100644 index 0000000000..4d7ca5dc09 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/random-bin.py @@ -0,0 +1,5 @@ +Import("env") + +from datetime import datetime + +env['PROGNAME'] = datetime.now().strftime("firmware-%Y%m%d-%H%M%S") diff --git a/buildroot/share/PlatformIO/scripts/stm32_bootloader.py b/buildroot/share/PlatformIO/scripts/stm32_bootloader.py new file mode 100644 index 0000000000..d517f1c8d1 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/stm32_bootloader.py @@ -0,0 +1,30 @@ +import os,sys,shutil +Import("env") + +from SCons.Script import DefaultEnvironment +board = DefaultEnvironment().BoardConfig() + +def noencrypt(source, target, env): + firmware = os.path.join(target[0].dir.path, board.get("build.firmware")) + # do not overwrite encrypted firmware if present + if not os.path.isfile(firmware): + shutil.copy(target[0].path, firmware) + +if 'offset' in board.get("build").keys(): + LD_FLASH_OFFSET = board.get("build.offset") + + for define in env['CPPDEFINES']: + if define[0] == "VECT_TAB_OFFSET": + env['CPPDEFINES'].remove(define) + env['CPPDEFINES'].append(("VECT_TAB_OFFSET", LD_FLASH_OFFSET)) + + maximum_ram_size = board.get("upload.maximum_ram_size") + + for i, flag in enumerate(env["LINKFLAGS"]): + if "-Wl,--defsym=LD_FLASH_OFFSET" in flag: + env["LINKFLAGS"][i] = "-Wl,--defsym=LD_FLASH_OFFSET=" + LD_FLASH_OFFSET + if "-Wl,--defsym=LD_MAX_DATA_SIZE" in flag: + env["LINKFLAGS"][i] = "-Wl,--defsym=LD_MAX_DATA_SIZE=" + str(maximum_ram_size - 40) + + if 'firmware' in board.get("build").keys(): + env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", noencrypt); diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/PeripheralPins.c b/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/PeripheralPins.c index 7f5ca78356..cff269db0b 100644 --- a/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/PeripheralPins.c +++ b/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/PeripheralPins.c @@ -123,12 +123,18 @@ const PinMap PinMap_PWM[] = { {PE_6, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 FAN2 {PC_9, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4 EXTENSION1-4 - //probably unused on SKR-Pro. confirmation needed, please. + /** + * Unused by specifications on BTT002. (PLEASE CONFIRM) + * Uncomment the corresponding line if you want to have HardwarePWM on some pins. + * WARNING: check timers' usage first to avoid conflicts. + * If you don't know what you're doing leave things as they are or you WILL break something (including hardware) + * If you alter this section DO NOT report bugs to Marlin team since they are most likely caused by you. Thank you. + */ //{PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 //{PA_0, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 - //{PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 is bltouch analog? + //{PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 BLTOUCH is a "servo" //{PA_1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 - //{PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 is bltouch analog? + //{PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 BLTOUCH is a "servo" //{PA_2, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 //{PA_2, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 //{PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/PinNamesVar.h b/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/PinNamesVar.h index 2424885937..b4bb9d45f8 100644 --- a/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/PinNamesVar.h +++ b/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/PinNamesVar.h @@ -25,25 +25,25 @@ #endif /* USB */ #ifdef USBCON - USB_OTG_FS_SOF = PA_8, - USB_OTG_FS_VBUS = PA_9, - USB_OTG_FS_ID = PA_10, - USB_OTG_FS_DM = PA_11, - USB_OTG_FS_DP = PA_12, - USB_OTG_HS_ULPI_D0 = PA_3, - USB_OTG_HS_SOF = PA_4, - USB_OTG_HS_ULPI_CK = PA_5, - USB_OTG_HS_ULPI_D1 = PB_0, - USB_OTG_HS_ULPI_D2 = PB_1, - USB_OTG_HS_ULPI_D7 = PB_5, - USB_OTG_HS_ULPI_D3 = PB_10, - USB_OTG_HS_ULPI_D4 = PB_11, - USB_OTG_HS_ID = PB_12, - USB_OTG_HS_ULPI_D5 = PB_12, - USB_OTG_HS_ULPI_D6 = PB_13, - USB_OTG_HS_VBUS = PB_13, - USB_OTG_HS_DM = PB_14, - USB_OTG_HS_DP = PB_15, + USB_OTG_FS_SOF = PA_8, + USB_OTG_FS_VBUS = PA_9, + USB_OTG_FS_ID = PA_10, + USB_OTG_FS_DM = PA_11, + USB_OTG_FS_DP = PA_12, + USB_OTG_HS_ULPI_D0 = PA_3, + USB_OTG_HS_SOF = PA_4, + USB_OTG_HS_ULPI_CK = PA_5, + USB_OTG_HS_ULPI_D1 = PB_0, + USB_OTG_HS_ULPI_D2 = PB_1, + USB_OTG_HS_ULPI_D7 = PB_5, + USB_OTG_HS_ULPI_D3 = PB_10, + USB_OTG_HS_ULPI_D4 = PB_11, + USB_OTG_HS_ID = PB_12, + USB_OTG_HS_ULPI_D5 = PB_12, + USB_OTG_HS_ULPI_D6 = PB_13, + USB_OTG_HS_VBUS = PB_13, + USB_OTG_HS_DM = PB_14, + USB_OTG_HS_DP = PB_15, USB_OTG_HS_ULPI_STP = PC_0, USB_OTG_HS_ULPI_DIR = PC_2, USB_OTG_HS_ULPI_NXT = PC_3, diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/variant.h b/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/variant.h index ca56b5f456..ecc319f47c 100644 --- a/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/variant.h +++ b/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/variant.h @@ -245,11 +245,9 @@ extern "C" { // Timer Definitions //Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c -#define TIMER_TONE TIM6 -#define TIMER_SERIAL TIM7 - -// Do not use basic timer: OC is required -#define TIMER_SERVO TIM2 //TODO: advanced-control timers don't work +#define TIMER_TONE TIM7 +#define TIMER_SERVO TIM5 +#define TIMER_SERIAL TIM2 // UART Definitions // Define here Serial instance number to map on Serial generic name diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/PeripheralPins.c b/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/PeripheralPins.c new file mode 100644 index 0000000000..4014a519a3 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/PeripheralPins.c @@ -0,0 +1,373 @@ +/* + ******************************************************************************* + * Copyright (c) 2019, STMicroelectronics + * 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. 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. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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. + ******************************************************************************* + * Automatically generated from STM32F407Z(E-G)Tx.xml + */ +#include +#include + +/* ===== + * Note: Commented lines are alternative possibilities which are not used by default. + * If you change them, you should know what you're doing first. + * ===== + */ + +//*** ADC *** + +#ifdef HAL_ADC_MODULE_ENABLED +const PinMap PinMap_ADC[] = { + {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0 E0_DIR + {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 BLTOUCH_2 + {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 BLTOUCH_4 + {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 E1_EN + {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 TF_SS + {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 TF_SCLK + {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 TF_MISO + {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 LED + {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 HEATER2 + {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 HEATER0 + {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 Z_EN + {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11 EXP_14 + {PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12 Z_DIR + {PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13 E0_EN + {PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_IN14 EXP_8 + {PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15 EXP_7 + + #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio, 24 ADC + {PF_3, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC3_IN9 TH_0 + {PF_4, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC3_IN14 TH_1 + {PF_5, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC3_IN15 TH_2 + {PF_6, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC3_IN4 TH_3 + {PF_7, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC3_IN5 EXP_13 + {PF_8, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC3_IN6 EXP_3 + {PF_9, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC3_IN7 EXP_6 + {PF_10, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC3_IN8 EXP_5 + #endif + {NC, NP, 0} +}; +#endif + +//*** DAC *** + +#ifdef HAL_DAC_MODULE_ENABLED +const PinMap PinMap_DAC[] = { + {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1 + {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 + {NC, NP, 0} +}; +#endif + +//*** I2C *** + +#ifdef HAL_I2C_MODULE_ENABLED +const PinMap PinMap_I2C_SDA[] = { + {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PC_9, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + #if STM32F4X_PIN_NUM >= 144 // 144 pins mcu, 114 gpio + #if STM32F4X_PIN_NUM >= 176 + {PH_5, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PH_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + #else + {PF_0, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + #endif + #endif + {NC, NP, 0} +}; +#endif + +#ifdef HAL_I2C_MODULE_ENABLED +const PinMap PinMap_I2C_SCL[] = { + {PA_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + #if STM32F4X_PIN_NUM >= 144 // 144 pins mcu, 114 gpio + #if STM32F4X_PIN_NUM >= 176 + //{PF_1, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PH_4, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PH_7, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + #else + {PF_1, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + #endif + #endif + {NC, NP, 0} +}; +#endif + +//*** PWM *** + +#ifdef HAL_TIM_MODULE_ENABLED +const PinMap PinMap_PWM[] = { + {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 HEATER0 + {PD_14, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 HEATER1 + {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 HEATER2 + {PD_12, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 BED + {PC_8, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 0)}, // TIM8_CH3 FAN0 + {PE_5, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 FAN1 + {PE_6, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 FAN2 + {PC_9, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4 EXTENSION1-4 + {PA_1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 BL-TOUCH-SERVO + + // These pins have been defined for something else on the board but they MIGHT be + // used by the user as PWM pins if they aren't used for their primary purpose. + {PC_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 ESP8266 connector. Available if 8266 isn't used + {PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 ESP8266 connector. Available if 8266 isn't used + {PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 I2C connector, SDA pin. Available if I2C isn't used. + // TIM5_CH1 is used by the Servo Library + {PA_2, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 BL-TOUCH port. Available if Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + + /** + * Unused by specifications on SKR-Pro. + * Uncomment the corresponding line if you want to have HardwarePWM on some pins. + * WARNING: check timers' usage first to avoid conflicts. + * If you don't know what you're doing leave things as they are or you WILL break something (including hardware) + * If you alter this section DO NOT report bugs to Marlin team since they are most likely caused by you. Thank you. + */ + //{PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + //{PA_0, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 + {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 BLTOUCH is a "servo" + {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 BLTOUCH is a "servo" + //{PA_1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 + //{PA_2, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 + //{PA_2, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 + //{PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + //{PA_3, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 + //{PA_3, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 + //{PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + //{PA_5, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N + //{PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + //{PA_6, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1 + //{PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + //{PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + //{PA_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N + //{PA_7, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1 + //{PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 + //{PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 + //{PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 + //{PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 + //{PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + //{PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + //{PB_0, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N + //{PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + //{PB_1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N + //{PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + //{PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + //{PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + //{PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 + //{PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 + //{PB_8, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 + //{PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + //{PB_9, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 + //{PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 + {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + //{PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + //{PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + //{PB_14, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N + //{PB_14, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 1, 0)}, // TIM12_CH1 + //{PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + //{PB_15, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N + //{PB_15, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 2, 0)}, // TIM12_CH2 + //{PC_6, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 0)}, // TIM8_CH1 + //{PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + //{PC_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2 + //{PC_8, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + //{PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + {PD_13, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 + {PD_15, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + //{PE_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + {PE_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 + //{PE_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + {PE_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 + //{PE_12, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + {PE_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 + {PE_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 + #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio + //{PF_6, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 + //{PF_7, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 + //{PF_8, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1 + //{PF_9, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1 + #endif + #if STM32F4X_PIN_NUM >= 176 //176 pins mcu, 140 gpio + {PH_10, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 + {PH_6, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 1, 0)}, // TIM12_CH1 + //{PH_11, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 + {PI_5, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 0)}, // TIM8_CH1 + {PI_6, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2 + #endif + {NC, NP, 0} +}; +#endif + +//*** SERIAL *** + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_TX[] = { + {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PD_8, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PC_6, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio + //{PG_14, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + #endif + //{PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + //{PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + //{PD_5, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + //{PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + //{PC_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + //{PA_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + //{PC_10, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + //{PC_12, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, + {NC, NP, 0} +}; + +const PinMap PinMap_UART_RX[] = { + {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PD_9, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PC_7, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + //{PA_1, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + //{PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + //{PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + //{PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + //{PC_11, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + //{PC_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + //{PD_2, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, + //{PD_6, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio + //{PG_9, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + #endif + {NC, NP, 0} +}; + +const PinMap PinMap_UART_RTS[] = { + //{PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + //{PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + //{PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + //{PD_4, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + //{PD_12, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio + //{PG_8, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + //{PG_12, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + #endif + {NC, NP, 0} +}; + +const PinMap PinMap_UART_CTS[] = { + //{PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + //{PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + //{PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + //{PD_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + //{PD_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio + //{PG_13, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + //{PG_15, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + #endif + {NC, NP, 0} +}; +#endif + +//*** SPI *** + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_MOSI[] = { + //{PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, + {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, + {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_12, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; + +const PinMap PinMap_SPI_MISO[] = { + {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, + {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_11, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; + +const PinMap PinMap_SPI_SCLK[] = { + {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, + {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_10, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; + +const PinMap PinMap_SPI_SSEL[] = { + {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, + {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PA_15, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +//*** CAN *** + +#ifdef HAL_CAN_MODULE_ENABLED +#error "CAN bus isn't available on this board. Driver should be disabled." +#endif + +//*** ETHERNET *** +#ifdef HAL_ETH_MODULE_ENABLED +#error "Ethernet port isn't available on this board. Driver should be disabled." +#endif + +//*** No QUADSPI *** + +//*** USB *** +#ifdef HAL_PCD_MODULE_ENABLED +const PinMap PinMap_USB_OTG_FS[] = { + //{PA_8, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF used by LCD + //{PA_9, USB_OTG_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS available on wifi port, if empty + //{PA_10, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID available on UART1_RX if not used + {PA_11, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM + {PA_12, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP + {NC, NP, 0} +}; + +const PinMap PinMap_USB_OTG_HS[] = { /* + #ifdef USE_USB_HS_IN_FS + {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_ID + {PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_HS_VBUS + {PB_14, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_DM + {PB_15, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_DP + #else + #error "USB in HS mode isn't supported by the board" + {PA_3, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D0 + {PB_0, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D1 + {PB_1, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D2 + {PB_5, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D7 + {PB_10, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D3 + {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D5 + {PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D6 + {PC_0, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_STP + {PC_2, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_DIR + {PC_3, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_NXT + #endif // USE_USB_HS_IN_FS + */ + {NC, NP, 0} +}; +#endif diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/PinNamesVar.h b/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/PinNamesVar.h new file mode 100644 index 0000000000..b4bb9d45f8 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/PinNamesVar.h @@ -0,0 +1,50 @@ +/* SYS_WKUP */ +#ifdef PWR_WAKEUP_PIN1 + SYS_WKUP1 = PA_0, +#endif +#ifdef PWR_WAKEUP_PIN2 + SYS_WKUP2 = NC, +#endif +#ifdef PWR_WAKEUP_PIN3 + SYS_WKUP3 = NC, +#endif +#ifdef PWR_WAKEUP_PIN4 + SYS_WKUP4 = NC, +#endif +#ifdef PWR_WAKEUP_PIN5 + SYS_WKUP5 = NC, +#endif +#ifdef PWR_WAKEUP_PIN6 + SYS_WKUP6 = NC, +#endif +#ifdef PWR_WAKEUP_PIN7 + SYS_WKUP7 = NC, +#endif +#ifdef PWR_WAKEUP_PIN8 + SYS_WKUP8 = NC, +#endif +/* USB */ +#ifdef USBCON + USB_OTG_FS_SOF = PA_8, + USB_OTG_FS_VBUS = PA_9, + USB_OTG_FS_ID = PA_10, + USB_OTG_FS_DM = PA_11, + USB_OTG_FS_DP = PA_12, + USB_OTG_HS_ULPI_D0 = PA_3, + USB_OTG_HS_SOF = PA_4, + USB_OTG_HS_ULPI_CK = PA_5, + USB_OTG_HS_ULPI_D1 = PB_0, + USB_OTG_HS_ULPI_D2 = PB_1, + USB_OTG_HS_ULPI_D7 = PB_5, + USB_OTG_HS_ULPI_D3 = PB_10, + USB_OTG_HS_ULPI_D4 = PB_11, + USB_OTG_HS_ID = PB_12, + USB_OTG_HS_ULPI_D5 = PB_12, + USB_OTG_HS_ULPI_D6 = PB_13, + USB_OTG_HS_VBUS = PB_13, + USB_OTG_HS_DM = PB_14, + USB_OTG_HS_DP = PB_15, + USB_OTG_HS_ULPI_STP = PC_0, + USB_OTG_HS_ULPI_DIR = PC_2, + USB_OTG_HS_ULPI_NXT = PC_3, +#endif diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/hal_conf_extra.h new file mode 100644 index 0000000000..e0e8239aac --- /dev/null +++ b/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/hal_conf_extra.h @@ -0,0 +1,52 @@ +#pragma once + +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +//#define HAL_RTC_MODULE_ENABLED Real Time Clock...do we use it? +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +//#define HAL_UART_MODULE_ENABLED // by default +//#define HAL_PCD_MODULE_ENABLED // Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE) + +#undef HAL_SD_MODULE_ENABLED +#undef HAL_DAC_MODULE_ENABLED +#undef HAL_FLASH_MODULE_ENABLED +#undef HAL_CAN_MODULE_ENABLED +#undef HAL_CAN_LEGACY_MODULE_ENABLED +#undef HAL_CEC_MODULE_ENABLED +#undef HAL_CRYP_MODULE_ENABLED +#undef HAL_DCMI_MODULE_ENABLED +#undef HAL_DMA2D_MODULE_ENABLED +#undef HAL_ETH_MODULE_ENABLED +#undef HAL_NAND_MODULE_ENABLED +#undef HAL_NOR_MODULE_ENABLED +#undef HAL_PCCARD_MODULE_ENABLED +#undef HAL_SRAM_MODULE_ENABLED +#undef HAL_SDRAM_MODULE_ENABLED +#undef HAL_HASH_MODULE_ENABLED +#undef HAL_EXTI_MODULE_ENABLED +#undef HAL_SMBUS_MODULE_ENABLED +#undef HAL_I2S_MODULE_ENABLED +#undef HAL_IWDG_MODULE_ENABLED +#undef HAL_LTDC_MODULE_ENABLED +#undef HAL_DSI_MODULE_ENABLED +#undef HAL_QSPI_MODULE_ENABLED +#undef HAL_RNG_MODULE_ENABLED +#undef HAL_SAI_MODULE_ENABLED +#undef HAL_IRDA_MODULE_ENABLED +#undef HAL_SMARTCARD_MODULE_ENABLED +#undef HAL_WWDG_MODULE_ENABLED +#undef HAL_HCD_MODULE_ENABLED +#undef HAL_FMPI2C_MODULE_ENABLED +#undef HAL_SPDIFRX_MODULE_ENABLED +#undef HAL_DFSDM_MODULE_ENABLED +#undef HAL_LPTIM_MODULE_ENABLED +#undef HAL_MMC_MODULE_ENABLED diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/ldscript.ld b/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/ldscript.ld new file mode 100644 index 0000000000..0c060d1751 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/ldscript.ld @@ -0,0 +1,204 @@ +/* +***************************************************************************** +** + +** File : LinkerScript.ld +** +** Abstract : Linker script for STM32F407ZGTx Device with +** 1024KByte FLASH, 128KByte RAM +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used. +** +** Target : STMicroelectronics STM32 +** +** +** Distribution: The file is distributed as is, without any warranty +** of any kind. +** +***************************************************************************** +** @attention +** +**

© COPYRIGHT(c) 2014 Ac6

+** +** 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. Neither the name of Ac6 nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** 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. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20020000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x200;; /* required amount of heap */ +_Min_Stack_Size = 0x400;; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +FLASH (rx) : ORIGIN = 0x8008000, LENGTH = 1024K +RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K +CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text ALIGN(4): + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata ALIGN(4): + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM AT> FLASH + + _siccmram = LOADADDR(.ccmram); + + /* CCM-RAM section + * + * IMPORTANT NOTE! + * If initialized variables will be placed in this section, + * the startup code needs to be modified to copy the init-values. + */ + .ccmram : + { + . = ALIGN(4); + _sccmram = .; /* create a global symbol at ccmram start */ + *(.ccmram) + *(.ccmram*) + + . = ALIGN(4); + _eccmram = .; /* create a global symbol at ccmram end */ + } >CCMRAM AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(4); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(4); + } >RAM + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/variant.cpp b/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/variant.cpp new file mode 100644 index 0000000000..1486b21830 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/variant.cpp @@ -0,0 +1,260 @@ +/* + ******************************************************************************* + * Copyright (c) 2017, STMicroelectronics + * 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. 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. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 "pins_arduino.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Pin number +// This array allows to wrap Arduino pin number(Dx or x) +// to STM32 PinName (PX_n) +const PinName digitalPin[] = { +#if STM32F4X_PIN_NUM >= 64 //64 pins mcu, 51 gpio + PC_13, //D0 + PC_14, //D1 - OSC32_IN + PC_15, //D2 - OSC32_OUT + PH_0, //D3 - OSC_IN + PH_1, //D4 - OSC_OUT + PB_2, //D5 - BOOT1 + PB_10, //D6 - 1:SPI2_SCK / I2C2_SCL / USART3_TX / TIM2_CH3 + PB_11, //D7 - 1:I2C2_SDA / USART3_RX / TIM2_CH4 + PB_12, //D8 - 1:SPI2_NSS / OTG_HS_ID + PB_13, //D9 - 1:SPI2_SCK 2:OTG_HS_VBUS + PB_14, //D10 - 1:SPI2_MISO / TIM12_CH1 / OTG_HS_DM + PB_15, //D11 - SPI2_MOSI / TIM12_CH2 / OTG_HS_DP + PC_6, //D12 - 1:TIM8_CH1 / SDIO_D6 / USART6_TX / TIM3_CH1 + PC_7, //D13 - 1:TIM8_CH2 / SDIO_D7 / USART6_RX / TIM3_CH2 + PC_8, //D14 - 1:TIM8_CH3 / SDIO_D0 / TIM3_CH3 + PC_9, //D15 - 1:TIM8_CH4 / SDIO_D1 / TIM3_CH4 + PA_8, //D16 - 1:TIM1_CH1 / I2C3_SCL / OTG_FS_SOF + PA_9, //D17 - 1:USART1_TX / TIM1_CH2 2:OTG_FS_VBUS + PA_10, //D18 - 1:USART1_RX / TIM1_CH3 / OTG_FS_ID + PA_11, //D19 - 1:TIM1_CH4 / OTG_FS_DM + PA_12, //D20 - 1:OTG_FS_DP + PA_13, //D21 - 0:JTMS-SWDIO + PA_14, //D22 - 0:JTCK-SWCLK + PA_15, //D23 - 0:JTDI 1:SPI3_NSS / SPI1_NSS + PC_10, //D24 - 1:UART4_TX / SPI3_SCK / SDIO_D2 / USART3_TX + PC_11, //D25 - 1:UART4_RX / SPI3_MISO / SDIO_D3 / USART3_RX + PC_12, //D26 - 1:UART5_TX / SPI3_MOSI / SDIO_CK + PD_2, //D27 - 1:UART5_RX / SDIO_CMD + PB_3, //D28 - 0:JTDO 1:SPI3_SCK / TIM2_CH2 / SPI1_SCK + PB_4, //D29 - 0:NJTRST 1:SPI3_MISO / TIM3_CH1 / SPI1_MISO + PB_5, //D30 - 1:TIM3_CH2 / SPI1_MOSI / SPI3_MOSI + PB_6, //D31 - 1:I2C1_SCL / TIM4_CH1 / USART1_TX + PB_7, //D32 - 1:I2C1_SDA / TIM4_CH2 / USART1_RX + PB_8, //D33 - 1:I2C1_SCL / TIM4_CH3 / SDIO_D4 / TIM10_CH1 + PB_9, //D34 - 1:I2C1_SDA / TIM4_CH4 / SDIO_D5 / TIM11_CH1 / SPI2_NSS + PA_0, //D35/A0 - 1:UART4_TX / TIM5_CH1 2:ADC123_IN0 + PA_1, //D36/A1 - 1:UART4_RX / TIM5_CH2 / TIM2_CH2 2:ADC123_IN1 + PA_2, //D37/A2 - 1:USART2_TX /TIM5_CH3 / TIM9_CH1 / TIM2_CH3 2:ADC123_IN2 + PA_3, //D38/A3 - 1:USART2_RX /TIM5_CH4 / TIM9_CH2 / TIM2_CH4 2:ADC123_IN3 + PA_4, //D39/A4 - NOT FT 1:SPI1_NSS / SPI3_NSS / USART2_CK 2:ADC12_IN4 / DAC_OUT1 + PA_5, //D40/A5 - NOT FT 1:SPI1_SCK 2:ADC12_IN5 / DAC_OUT2 + PA_6, //D41/A6 - 1:SPI1_MISO / TIM13_CH1 / TIM3_CH1 2:ADC12_IN6 + PA_7, //D42/A7 - 1:SPI1_MOSI / TIM14_CH1 / TIM3_CH2 2:ADC12_IN7 + PB_0, //D43/A8 - 1:TIM3_CH3 2:ADC12_IN8 + PB_1, //D44/A9 - 1:TIM3_CH4 2:ADC12_IN9 + PC_0, //D45/A10 - 1: 2:ADC123_IN10 + PC_1, //D46/A11 - 1: 2:ADC123_IN11 + PC_2, //D47/A12 - 1:SPI2_MISO 2:ADC123_IN12 + PC_3, //D48/A13 - 1:SPI2_MOSI 2:ADC123_IN13 + PC_4, //D49/A14 - 1: 2:ADC12_IN14 + PC_5, //D50/A15 - 1: 2:ADC12_IN15 + #if STM32F4X_PIN_NUM >= 144 + PF_3, //D51/A16 - 1:FSMC_A3 2:ADC3_IN9 + PF_4, //D52/A17 - 1:FSMC_A4 2:ADC3_IN14 + PF_5, //D53/A18 - 1:FSMC_A5 2:ADC3_IN15 + PF_6, //D54/A19 - 1:TIM10_CH1 2:ADC3_IN4 + PF_7, //D55/A20 - 1:TIM11_CH1 2:ADC3_IN5 + PF_8, //D56/A21 - 1:TIM13_CH1 2:ADC3_IN6 + PF_9, //D57/A22 - 1;TIM14_CH1 2:ADC3_IN7 + PF_10, //D58/A23 - 2:ADC3_IN8 + #endif +#endif +#if STM32F4X_PIN_NUM >= 100 //100 pins mcu, 82 gpio + PE_2, //D59 - 1:FSMC_A23 + PE_3, //D60 - 1:FSMC_A19 + PE_4, //D61 - 1:FSMC_A20 + PE_5, //D62 - 1:FSMC_A21 + PE_6, //D63 - 1:FSMC_A22 + PE_7, //D64 - 1:FSMC_D4 + PE_8, //D65 - 1:FSMC_D5 + PE_9, //D66 - 1:FSMC_D6 / TIM1_CH1 + PE_10, //D67 - 1:FSMC_D7 + PE_11, //D68 - 1:FSMC_D8 / TIM1_CH2 + PE_12, //D69 - 1:FSMC_D9 + PE_13, //D70 - 1:FSMC_D10 / TIM1_CH3 + PE_14, //D71 - 1:FSMC_D11 / TIM1_CH4 + PE_15, //D72 - 1:FSMC_D12 + PD_8, //D73 - 1:FSMC_D13 / USART3_TX + PD_9, //D74 - 1:FSMC_D14 / USART3_RX + PD_10, //D75 - 1:FSMC_D15 + PD_11, //D76 - 1:FSMC_A16 + PD_12, //D77 - 1:FSMC_A17 / TIM4_CH1 + PD_13, //D78 - 1:FSMC_A18 / TIM4_CH2 + PD_14, //D79 - 1:FSMC_D0 / TIM4_CH3 + PD_15, //D80 - 1:FSMC_D1 / TIM4_CH4 + PD_0, //D81 - 1:FSMC_D2 + PD_1, //D82 - 1:FSMC_D3 + PD_3, //D83 - 1:FSMC_CLK + PD_4, //D84 - 1:FSMC_NOE + PD_5, //D85 - 1:USART2_TX + PD_6, //D86 - 1:USART2_RX + PD_7, //D87 + PE_0, //D88 + PE_1, //D89 +#endif +#if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio + PF_0, //D90 - 1:FSMC_A0 / I2C2_SDA + PF_1, //D91 - 1:FSMC_A1 / I2C2_SCL + PF_2, //D92 - 1:FSMC_A2 + PF_11, //D93 + PF_12, //D94 - 1:FSMC_A6 + PF_13, //D95 - 1:FSMC_A7 + PF_14, //D96 - 1:FSMC_A8 + PF_15, //D97 - 1:FSMC_A9 + PG_0, //D98 - 1:FSMC_A10 + PG_1, //D99 - 1:FSMC_A11 + PG_2, //D100 - 1:FSMC_A12 + PG_3, //D101 - 1:FSMC_A13 + PG_4, //D102 - 1:FSMC_A14 + PG_5, //D103 - 1:FSMC_A15 + PG_6, //D104 + PG_7, //D105 + PG_8, //D106 + PG_9, //D107 - 1:USART6_RX + PG_10, //D108 - 1:FSMC_NE3 + PG_11, //D109 + PG_12, //D110 - 1:FSMC_NE4 + PG_13, //D111 - 1:FSMC_A24 + PG_14, //D112 - 1:FSMC_A25 / USART6_TX + PG_15, //D113 +#endif +#if STM32F4X_PIN_NUM >= 176 //176 pins mcu, 140 gpio + PI_8, //D114 + PI_9, //D115 + PI_10, //D116 + PI_11, //D117 + PH_2, //D118 + PH_3, //D119 + PH_4, //D120 - 1:I2C2_SCL + PH_5, //D121 - 1:I2C2_SDA + PH_6, //D122 - 1:TIM12_CH1 + PH_7, //D123 - 1:I2C3_SCL + PH_8, //D124 - 1:I2C3_SDA + PH_9, //D125 - 1:TIM12_CH2 + PH_10, //D126 - 1:TIM5_CH1 + PH_11, //D127 - 1:TIM5_CH2 + PH_12, //D128 - 1:TIM5_CH3 + PH_13, //D129 + PH_14, //D130 + PH_15, //D131 + PI_0, //D132 - 1:TIM5_CH4 / SPI2_NSS + PI_1, //D133 - 1:SPI2_SCK + PI_2, //D134 - 1:TIM8_CH4 /SPI2_MISO + PI_3, //D135 - 1:SPI2_MOS + PI_4, //D136 + PI_5, //D137 - 1:TIM8_CH1 + PI_6, //D138 - 1:TIM8_CH2 + PI_7, //D139 - 1:TIM8_CH3 +#endif +}; + +#ifdef __cplusplus +} +#endif + +// ------------------------ + +#ifdef __cplusplus +extern "C" { +#endif + + /** + * @brief System Clock Configuration + * @param None + * @retval None + */ +WEAK void SystemClock_Config() { + + RCC_OscInitTypeDef RCC_OscInitStruct; + RCC_ClkInitTypeDef RCC_ClkInitStruct; + + /**Configure the main internal regulator output voltage + */ + __HAL_RCC_PWR_CLK_ENABLE(); + + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + + /**Initializes the CPU, AHB and APB busses clocks + */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = 8; + RCC_OscInitStruct.PLL.PLLN = 336; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; + RCC_OscInitStruct.PLL.PLLQ = 7; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + _Error_Handler(__FILE__, __LINE__); + } + + /**Initializes the CPU, AHB and APB busses clocks + */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK + | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; + + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { + _Error_Handler(__FILE__, __LINE__); + } + + /**Configure the Systick interrupt time + */ + HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); + + /**Configure the Systick + */ + HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); + + /* SysTick_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); +} + +#ifdef __cplusplus +} +#endif diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/variant.h b/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/variant.h new file mode 100644 index 0000000000..1ba0a18d6a --- /dev/null +++ b/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/variant.h @@ -0,0 +1,322 @@ +/* + ******************************************************************************* + * Copyright (c) 2017, STMicroelectronics + * 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. 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. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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. + ******************************************************************************* + */ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ + +#ifdef STM32F405RX + #define STM32F4X_PIN_NUM 64 //64 pins mcu, 51 gpio + #define STM32F4X_GPIO_NUM 51 + #define STM32F4X_ADC_NUM 16 +#elif defined(STM32F407_5VX) + #define STM32F4X_PIN_NUM 100 //100 pins mcu, 82 gpio + #define STM32F4X_GPIO_NUM 82 + #define STM32F4X_ADC_NUM 16 +#elif defined(STM32F407_5ZX) + #define STM32F4X_PIN_NUM 144 //144 pins mcu, 114 gpio + #define STM32F4X_GPIO_NUM 114 + #define STM32F4X_ADC_NUM 24 +#elif defined(STM32F407IX) + #define STM32F4X_PIN_NUM 176 //176 pins mcu, 140 gpio + #define STM32F4X_GPIO_NUM 140 + #define STM32F4X_ADC_NUM 24 +#else + #error "no match MCU defined" +#endif + +#if STM32F4X_PIN_NUM >= 64 //64 pins mcu, 51 gpio + #define PC13 0 + #define PC14 1 //OSC32_IN + #define PC15 2 //OSC32_OUT + #define PH0 3 //OSC_IN + #define PH1 4 //OSC_OUT + #define PB2 5 //BOOT1 + #define PB10 6 //1:SPI2_SCK / I2C2_SCL / USART3_TX / TIM2_CH3 + #define PB11 7 //1:I2C2_SDA / USART3_RX / TIM2_CH4 + #define PB12 8 //1:SPI2_NSS / OTG_HS_ID + #define PB13 9 //1:SPI2_SCK 2:OTG_HS_VBUS + #define PB14 10 //1:SPI2_MISO / TIM12_CH1 / OTG_HS_DM + #define PB15 11 //SPI2_MOSI / TIM12_CH2 / OTG_HS_DP + #define PC6 12 //1:TIM8_CH1 / SDIO_D6 / USART6_TX / TIM3_CH1 + #define PC7 13 //1:TIM8_CH2 / SDIO_D7 / USART6_RX / TIM3_CH2 + #define PC8 14 //1:TIM8_CH3 / SDIO_D0 / TIM3_CH3 + #define PC9 15 //1:TIM8_CH4 / SDIO_D1 / TIM3_CH4 + #define PA8 16 //1:TIM1_CH1 / I2C3_SCL / OTG_FS_SOF + #define PA9 17 //1:USART1_TX / TIM1_CH2 2:OTG_FS_VBUS + #define PA10 18 //1:USART1_RX / TIM1_CH3 / OTG_FS_ID + #define PA11 19 //1:TIM1_CH4 / OTG_FS_DM + #define PA12 20 //1:OTG_FS_DP + #define PA13 21 //0:JTMS-SWDIO + #define PA14 22 //0:JTCK-SWCLK + #define PA15 23 //0:JTDI 1:SPI3_NSS / SPI1_NSS + #define PC10 24 //1:UART4_TX / SPI3_SCK / SDIO_D2 / USART3_TX + #define PC11 25 //1:UART4_RX / SPI3_MISO / SDIO_D3 / USART3_RX + #define PC12 26 //1:UART5_TX / SPI3_MOSI / SDIO_CK + #define PD2 27 //1:UART5_RX / SDIO_CMD + #define PB3 28 //0:JTDO 1:SPI3_SCK / TIM2_CH2 / SPI1_SCK + #define PB4 29 //0:NJTRST 1:SPI3_MISO / TIM3_CH1 / SPI1_MISO + #define PB5 30 //1:TIM3_CH2 / SPI1_MOSI / SPI3_MOSI + #define PB6 31 //1:I2C1_SCL / TIM4_CH1 / USART1_TX + #define PB7 32 //1:I2C1_SDA / TIM4_CH2 / USART1_RX + #define PB8 33 //1:I2C1_SCL / TIM4_CH3 / SDIO_D4 / TIM10_CH1 + #define PB9 34 //1:I2C1_SDA / TIM4_CH4 / SDIO_D5 / TIM11_CH1 / SPI2_NSS + #define PA0 35 //1:UART4_TX / TIM5_CH1 2:ADC123_IN0 + #define PA1 36 //1:UART4_RX / TIM5_CH2 / TIM2_CH2 2:ADC123_IN1 + #define PA2 37 //1:USART2_TX /TIM5_CH3 / TIM9_CH1 / TIM2_CH3 2:ADC123_IN2 + #define PA3 38 //1:USART2_RX /TIM5_CH4 / TIM9_CH2 / TIM2_CH4 2:ADC123_IN3 + #define PA4 39 //NOT FT 1:SPI1_NSS / SPI3_NSS / USART2_CK 2:ADC12_IN4 / DAC_OUT1 + #define PA5 40 //NOT FT 1:SPI1_SCK 2:ADC12_IN5 / DAC_OUT2 + #define PA6 41 //1:SPI1_MISO / TIM13_CH1 / TIM3_CH1 2:ADC12_IN6 + #define PA7 42 //1:SPI1_MOSI / TIM14_CH1 / TIM3_CH2 2:ADC12_IN7 + #define PB0 43 //1:TIM3_CH3 2:ADC12_IN8 + #define PB1 44 //1:TIM3_CH4 2:ADC12_IN9 + #define PC0 45 //1: 2:ADC123_IN10 + #define PC1 46 //1: 2:ADC123_IN11 + #define PC2 47 //1:SPI2_MISO 2:ADC123_IN12 + #define PC3 48 //1:SPI2_MOSI 2:ADC123_IN13 + #define PC4 49 //1: 2:ADC12_IN14 + #define PC5 50 //1: 2:ADC12_IN15 + #if STM32F4X_PIN_NUM >= 144 + #define PF3 51 //1:FSMC_A3 2:ADC3_IN9 + #define PF4 52 //1:FSMC_A4 2:ADC3_IN14 + #define PF5 53 //1:FSMC_A5 2:ADC3_IN15 + #define PF6 54 //1:TIM10_CH1 2:ADC3_IN4 + #define PF7 55 //1:TIM11_CH1 2:ADC3_IN5 + #define PF8 56 //1:TIM13_CH1 2:ADC3_IN6 + #define PF9 57 //1;TIM14_CH1 2:ADC3_IN7 + #define PF10 58 //2:ADC3_IN8 + #endif +#endif +#if STM32F4X_PIN_NUM >= 100 //100 pins mcu, 82 gpio + #define PE2 (35+STM32F4X_ADC_NUM) //1:FSMC_A23 + #define PE3 (36+STM32F4X_ADC_NUM) //1:FSMC_A19 + #define PE4 (37+STM32F4X_ADC_NUM) //1:FSMC_A20 + #define PE5 (38+STM32F4X_ADC_NUM) //1:FSMC_A21 + #define PE6 (39+STM32F4X_ADC_NUM) //1:FSMC_A22 + #define PE7 (40+STM32F4X_ADC_NUM) //1:FSMC_D4 + #define PE8 (41+STM32F4X_ADC_NUM) //1:FSMC_D5 + #define PE9 (42+STM32F4X_ADC_NUM) //1:FSMC_D6 / TIM1_CH1 + #define PE10 (43+STM32F4X_ADC_NUM) //1:FSMC_D7 + #define PE11 (44+STM32F4X_ADC_NUM) //1:FSMC_D8 / TIM1_CH2 + #define PE12 (45+STM32F4X_ADC_NUM) //1:FSMC_D9 + #define PE13 (46+STM32F4X_ADC_NUM) //1:FSMC_D10 / TIM1_CH3 + #define PE14 (47+STM32F4X_ADC_NUM) //1:FSMC_D11 / TIM1_CH4 + #define PE15 (48+STM32F4X_ADC_NUM) //1:FSMC_D12 + #define PD8 (49+STM32F4X_ADC_NUM) //1:FSMC_D13 / USART3_TX + #define PD9 (50+STM32F4X_ADC_NUM) //1:FSMC_D14 / USART3_RX + #define PD10 (51+STM32F4X_ADC_NUM) //1:FSMC_D15 + #define PD11 (52+STM32F4X_ADC_NUM) //1:FSMC_A16 + #define PD12 (53+STM32F4X_ADC_NUM) //1:FSMC_A17 / TIM4_CH1 + #define PD13 (54+STM32F4X_ADC_NUM) //1:FSMC_A18 / TIM4_CH2 + #define PD14 (55+STM32F4X_ADC_NUM) //1:FSMC_D0 / TIM4_CH3 + #define PD15 (56+STM32F4X_ADC_NUM) //1:FSMC_D1 / TIM4_CH4 + #define PD0 (57+STM32F4X_ADC_NUM) //1:FSMC_D2 + #define PD1 (58+STM32F4X_ADC_NUM) //1:FSMC_D3 + #define PD3 (59+STM32F4X_ADC_NUM) //1:FSMC_CLK + #define PD4 (60+STM32F4X_ADC_NUM) //1:FSMC_NOE + #define PD5 (61+STM32F4X_ADC_NUM) //1:USART2_TX + #define PD6 (62+STM32F4X_ADC_NUM) //1:USART2_RX + #define PD7 (63+STM32F4X_ADC_NUM) + #define PE0 (64+STM32F4X_ADC_NUM) + #define PE1 (65+STM32F4X_ADC_NUM) +#endif +#if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio + #define PF0 (66+STM32F4X_ADC_NUM) //1:FSMC_A0 / I2C2_SDA + #define PF1 (67+STM32F4X_ADC_NUM) //1:FSMC_A1 / I2C2_SCL + #define PF2 (68+STM32F4X_ADC_NUM) //1:FSMC_A2 + #define PF11 (69+STM32F4X_ADC_NUM) + #define PF12 (70+STM32F4X_ADC_NUM) //1:FSMC_A6 + #define PF13 (71+STM32F4X_ADC_NUM) //1:FSMC_A7 + #define PF14 (72+STM32F4X_ADC_NUM) //1:FSMC_A8 + #define PF15 (73+STM32F4X_ADC_NUM) //1:FSMC_A9 + #define PG0 (74+STM32F4X_ADC_NUM) //1:FSMC_A10 + #define PG1 (75+STM32F4X_ADC_NUM) //1:FSMC_A11 + #define PG2 (76+STM32F4X_ADC_NUM) //1:FSMC_A12 + #define PG3 (77+STM32F4X_ADC_NUM) //1:FSMC_A13 + #define PG4 (78+STM32F4X_ADC_NUM) //1:FSMC_A14 + #define PG5 (79+STM32F4X_ADC_NUM) //1:FSMC_A15 + #define PG6 (80+STM32F4X_ADC_NUM) + #define PG7 (81+STM32F4X_ADC_NUM) + #define PG8 (82+STM32F4X_ADC_NUM) + #define PG9 (83+STM32F4X_ADC_NUM) //1:USART6_RX + #define PG10 (84+STM32F4X_ADC_NUM) //1:FSMC_NE3 + #define PG11 (85+STM32F4X_ADC_NUM) + #define PG12 (86+STM32F4X_ADC_NUM) //1:FSMC_NE4 + #define PG13 (87+STM32F4X_ADC_NUM) //1:FSMC_A24 + #define PG14 (88+STM32F4X_ADC_NUM) //1:FSMC_A25 / USART6_TX + #define PG15 (89+STM32F4X_ADC_NUM) +#endif +#if STM32F4X_PIN_NUM >= 176 //176 pins mcu, 140 gpio + #define PI8 (90+STM32F4X_ADC_NUM) + #define PI9 (91+STM32F4X_ADC_NUM) + #define PI10 (92+STM32F4X_ADC_NUM) + #define PI11 (93+STM32F4X_ADC_NUM) + #define PH2 (94+STM32F4X_ADC_NUM) + #define PH3 (95+STM32F4X_ADC_NUM) + #define PH4 (96+STM32F4X_ADC_NUM) //1:I2C2_SCL + #define PH5 (97+STM32F4X_ADC_NUM) //1:I2C2_SDA + #define PH6 (98+STM32F4X_ADC_NUM) //1:TIM12_CH1 + #define PH7 (99+STM32F4X_ADC_NUM) //1:I2C3_SCL + #define PH8 (100+STM32F4X_ADC_NUM) //1:I2C3_SDA + #define PH9 (101+STM32F4X_ADC_NUM) //1:TIM12_CH2 + #define PH10 (102+STM32F4X_ADC_NUM) //1:TIM5_CH1 + #define PH11 (103+STM32F4X_ADC_NUM) //1:TIM5_CH2 + #define PH12 (104+STM32F4X_ADC_NUM) //1:TIM5_CH3 + #define PH13 (105+STM32F4X_ADC_NUM) + #define PH14 (106+STM32F4X_ADC_NUM) + #define PH15 (107+STM32F4X_ADC_NUM) + #define PI0 (108+STM32F4X_ADC_NUM) //1:TIM5_CH4 / SPI2_NSS + #define PI1 (109+STM32F4X_ADC_NUM) //1:SPI2_SCK + #define PI2 (110+STM32F4X_ADC_NUM) //1:TIM8_CH4 /SPI2_MISO + #define PI3 (111+STM32F4X_ADC_NUM) //1:SPI2_MOS + #define PI4 (112+STM32F4X_ADC_NUM) + #define PI5 (113+STM32F4X_ADC_NUM) //1:TIM8_CH1 + #define PI6 (114+STM32F4X_ADC_NUM) //1:TIM8_CH2 + #define PI7 (115+STM32F4X_ADC_NUM) //1:TIM8_CH3 +#endif + + +// This must be a literal +#define NUM_DIGITAL_PINS (STM32F4X_GPIO_NUM) +// This must be a literal with a value less than or equal to MAX_ANALOG_INPUTS +#define NUM_ANALOG_INPUTS (STM32F4X_ADC_NUM) +#define NUM_ANALOG_FIRST 35 + +// Below ADC, DAC and PWM definitions already done in the core +// Could be redefined here if needed +// ADC resolution is 12bits +//#define ADC_RESOLUTION 12 +//#define DACC_RESOLUTION 12 + +// PWM resolution +/* + * BEWARE: + * Changing this value from the default (1000) will affect the PWM output value of analogWrite (to a PWM pin) + * Since the pin is toggled on capture, if you change the frequency of the timer you have to adapt the compare value (analogWrite thinks you did) + */ +//#define PWM_FREQUENCY 20000 +//The bottom values are the default and don't need to be redefined +//#define PWM_RESOLUTION 8 +//#define PWM_MAX_DUTY_CYCLE 255 + +// On-board LED pin number +#define LED_BUILTIN PA7 +#define LED_GREEN LED_BUILTIN + +// Below SPI and I2C definitions already done in the core +// Could be redefined here if differs from the default one +// SPI Definitions +#define PIN_SPI_MOSI PB15 +#define PIN_SPI_MISO PB14 +#define PIN_SPI_SCK PB13 +#define PIN_SPI_SS PB12 + +// I2C Definitions +#if STM32F4X_PIN_NUM >= 176 + #define PIN_WIRE_SDA PH5 + #define PIN_WIRE_SCL PH4 +#else + #define PIN_WIRE_SDA PB7 + #define PIN_WIRE_SCL PB6 +#endif + +// Timer Definitions +//Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c +#define TIMER_TONE TIM2 +#define TIMER_SERVO TIM5 // Only 1 Servo PIN on SKR-PRO, so use the same timer as defined in PeripheralPins +#define TIMER_SERIAL TIM7 + +// UART Definitions +//#define ENABLE_HWSERIAL1 done automatically by the #define SERIAL_UART_INSTANCE below +#define ENABLE_HWSERIAL3 +#define ENABLE_HWSERIAL6 + +// Define here Serial instance number to map on Serial generic name (if not already used by SerialUSB) +#define SERIAL_UART_INSTANCE 1 //1 for Serial = Serial1 (USART1) + +// DEBUG_UART could be redefined to print on another instance than 'Serial' +//#define DEBUG_UART ((USART_TypeDef *) U(S)ARTX) // ex: USART3 +// DEBUG_UART baudrate, default: 9600 if not defined +//#define DEBUG_UART_BAUDRATE x +// DEBUG_UART Tx pin name, default: the first one found in PinMap_UART_TX for DEBUG_UART +//#define DEBUG_PINNAME_TX PX_n // PinName used for TX + +// Default pin used for 'Serial' instance (ex: ST-Link) +// Mandatory for Firmata +#define PIN_SERIAL_RX PA10 +#define PIN_SERIAL_TX PA9 + +// Optional PIN_SERIALn_RX and PIN_SERIALn_TX where 'n' is the U(S)ART number +// Used when user instanciate a hardware Serial using its peripheral name. +// Example: HardwareSerial mySerial(USART3); +// will use PIN_SERIAL3_RX and PIN_SERIAL3_TX if defined. +#define PIN_SERIAL1_RX PA10 +#define PIN_SERIAL1_TX PA9 +#define PIN_SERIAL3_RX PD9 +#define PIN_SERIAL3_TX PD8 +#define PIN_SERIAL6_RX PC7 +#define PIN_SERIAL6_TX PC6 +//#define PIN_SERIALLP1_RX x // For LPUART1 RX +//#define PIN_SERIALLP1_TX x // For LPUART1 TX + +#ifdef __cplusplus +} // extern "C" +#endif +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_MONITOR Serial +#define SERIAL_PORT_HARDWARE Serial1 +#define SERIAL_PORT_HARDWARE_OPEN Serial3 +#define SERIAL_PORT_HARDWARE_OPEN1 Serial6 +#endif diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PeripheralPins.c b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PeripheralPins.c index a772f64fb7..6dc8b05158 100644 --- a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PeripheralPins.c +++ b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PeripheralPins.c @@ -94,7 +94,7 @@ const PinMap PinMap_I2C_SDA[] = { #if STM32F4X_PIN_NUM >= 176 {PH_5, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, {PH_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, - #else + #else {PF_0, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, #endif #endif @@ -113,7 +113,7 @@ const PinMap PinMap_I2C_SCL[] = { //{PF_1, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, {PH_4, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, {PH_7, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, - #else + #else {PF_1, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, #endif #endif @@ -152,8 +152,8 @@ const PinMap PinMap_PWM[] = { */ //{PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 //{PA_0, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 - {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 is bltouch analog? - {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 is bltouch analog? + //{PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 BLTOUCH is a "servo" + //{PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 BLTOUCH is a "servo" //{PA_1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 //{PA_2, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 //{PA_2, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 @@ -186,7 +186,7 @@ const PinMap PinMap_PWM[] = { //{PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 //{PB_9, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 //{PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 - {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + //{PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 //{PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N //{PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N //{PB_14, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N @@ -199,15 +199,15 @@ const PinMap PinMap_PWM[] = { //{PC_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2 //{PC_8, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 //{PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 - {PD_13, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 - {PD_15, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + //{PD_13, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 + //{PD_15, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 //{PE_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N - {PE_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 + //{PE_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 //{PE_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N - {PE_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 + //{PE_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 //{PE_12, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N - {PE_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 - {PE_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 + //{PE_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 + //{PE_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio //{PF_6, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 //{PF_7, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 @@ -295,8 +295,7 @@ const PinMap PinMap_UART_CTS[] = { #ifdef HAL_SPI_MODULE_ENABLED const PinMap PinMap_SPI_MOSI[] = { - //{PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, - {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, + {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, {PC_12, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, {NC, NP, 0} diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PinNamesVar.h b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PinNamesVar.h index 2424885937..b4bb9d45f8 100644 --- a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PinNamesVar.h +++ b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PinNamesVar.h @@ -25,25 +25,25 @@ #endif /* USB */ #ifdef USBCON - USB_OTG_FS_SOF = PA_8, - USB_OTG_FS_VBUS = PA_9, - USB_OTG_FS_ID = PA_10, - USB_OTG_FS_DM = PA_11, - USB_OTG_FS_DP = PA_12, - USB_OTG_HS_ULPI_D0 = PA_3, - USB_OTG_HS_SOF = PA_4, - USB_OTG_HS_ULPI_CK = PA_5, - USB_OTG_HS_ULPI_D1 = PB_0, - USB_OTG_HS_ULPI_D2 = PB_1, - USB_OTG_HS_ULPI_D7 = PB_5, - USB_OTG_HS_ULPI_D3 = PB_10, - USB_OTG_HS_ULPI_D4 = PB_11, - USB_OTG_HS_ID = PB_12, - USB_OTG_HS_ULPI_D5 = PB_12, - USB_OTG_HS_ULPI_D6 = PB_13, - USB_OTG_HS_VBUS = PB_13, - USB_OTG_HS_DM = PB_14, - USB_OTG_HS_DP = PB_15, + USB_OTG_FS_SOF = PA_8, + USB_OTG_FS_VBUS = PA_9, + USB_OTG_FS_ID = PA_10, + USB_OTG_FS_DM = PA_11, + USB_OTG_FS_DP = PA_12, + USB_OTG_HS_ULPI_D0 = PA_3, + USB_OTG_HS_SOF = PA_4, + USB_OTG_HS_ULPI_CK = PA_5, + USB_OTG_HS_ULPI_D1 = PB_0, + USB_OTG_HS_ULPI_D2 = PB_1, + USB_OTG_HS_ULPI_D7 = PB_5, + USB_OTG_HS_ULPI_D3 = PB_10, + USB_OTG_HS_ULPI_D4 = PB_11, + USB_OTG_HS_ID = PB_12, + USB_OTG_HS_ULPI_D5 = PB_12, + USB_OTG_HS_ULPI_D6 = PB_13, + USB_OTG_HS_VBUS = PB_13, + USB_OTG_HS_DM = PB_14, + USB_OTG_HS_DP = PB_15, USB_OTG_HS_ULPI_STP = PC_0, USB_OTG_HS_ULPI_DIR = PC_2, USB_OTG_HS_ULPI_NXT = PC_3, diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.h b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.h index 5ff2ea5768..1ba0a18d6a 100644 --- a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.h +++ b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.h @@ -234,7 +234,7 @@ extern "C" { // On-board LED pin number #define LED_BUILTIN PA7 -//#define LED_GREEN LED_BUILTIN should be defined here but omitted to avoid redefinition in SailfishRGB_LED +#define LED_GREEN LED_BUILTIN // Below SPI and I2C definitions already done in the core // Could be redefined here if differs from the default one @@ -245,8 +245,13 @@ extern "C" { #define PIN_SPI_SS PB12 // I2C Definitions -#define PIN_WIRE_SDA PB7 -#define PIN_WIRE_SCL PB6 +#if STM32F4X_PIN_NUM >= 176 + #define PIN_WIRE_SDA PH5 + #define PIN_WIRE_SCL PH4 +#else + #define PIN_WIRE_SDA PB7 + #define PIN_WIRE_SCL PB6 +#endif // Timer Definitions //Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/board.cpp b/buildroot/share/PlatformIO/variants/CHITU_F103/board.cpp new file mode 100755 index 0000000000..6083664b94 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/board.cpp @@ -0,0 +1,233 @@ +/****************************************************************************** + * The MIT License + * + * Copyright (c) 2011 LeafLabs, LLC. + * + * 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. + *****************************************************************************/ + +/** + * @file wirish/boards/maple/board.cpp + * @author Marti Bolivar + * @brief Maple board file. + */ + +#include // For this board's header file + +/* Roger Clark. Added next to includes for changes to Serial */ +#include +#include + +#include // For stm32_pin_info and its contents + // (these go into PIN_MAP). + +#include "boards_private.h" // For PMAP_ROW(), which makes + // PIN_MAP easier to read. + +// boardInit(): nothing special to do for Maple. +// +// When defining your own board.cpp, you can put extra code in this +// function if you have anything you want done on reset, before main() +// or setup() are called. +// +// If there's nothing special you need done, feel free to leave this +// function out, as we do here. +/* +void boardInit(void) { +} +*/ + +// Pin map: this lets the basic I/O functions (digitalWrite(), +// analogRead(), pwmWrite()) translate from pin numbers to STM32 +// peripherals. +// +// PMAP_ROW() lets us specify a row (really a struct stm32_pin_info) +// in the pin map. Its arguments are: +// +// - GPIO device for the pin (&gpioa, etc.) +// - GPIO bit for the pin (0 through 15) +// - Timer device, or NULL if none +// - Timer channel (1 to 4, for PWM), or 0 if none +// - ADC device, or NULL if none +// - ADC channel, or ADCx if none + +extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { + /* + gpio_dev *gpio_device; GPIO device + timer_dev *timer_device; Pin's timer device, if any. + const adc_dev *adc_device; ADC device, if any. + uint8 gpio_bit; Pin's GPIO port bit. + uint8 timer_channel; Timer channel, or 0 if none. + uint8 adc_channel; Pin ADC channel, or ADCx if none. + */ + + {&gpioa, &timer2, &adc1, 0, 1, 0}, /* PA0 */ + {&gpioa, &timer2, &adc1, 1, 2, 1}, /* PA1 */ + {&gpioa, &timer2, &adc1, 2, 3, 2}, /* PA2 */ + {&gpioa, &timer2, &adc1, 3, 4, 3}, /* PA3 */ + {&gpioa, NULL, &adc1, 4, 0, 4}, /* PA4 */ + {&gpioa, NULL, &adc1, 5, 0, 5}, /* PA5 */ + {&gpioa, &timer3, &adc1, 6, 1, 6}, /* PA6 */ + {&gpioa, &timer3, &adc1, 7, 2, 7}, /* PA7 */ + {&gpioa, &timer1, NULL, 8, 1, ADCx}, /* PA8 */ + {&gpioa, &timer1, NULL, 9, 2, ADCx}, /* PA9 */ + {&gpioa, &timer1, NULL, 10, 3, ADCx}, /* PA10 */ + {&gpioa, NULL, NULL, 11, 0, ADCx}, /* PA11 */ + {&gpioa, NULL, NULL, 12, 0, ADCx}, /* PA12 */ + {&gpioa, NULL, NULL, 13, 0, ADCx}, /* PA13 */ + {&gpioa, NULL, NULL, 14, 0, ADCx}, /* PA14 */ + {&gpioa, NULL, NULL, 15, 0, ADCx}, /* PA15 */ + + {&gpiob, &timer3, &adc1, 0, 3, 8}, /* PB0 */ + {&gpiob, &timer3, &adc1, 1, 4, 9}, /* PB1 */ + {&gpiob, &timer3, &adc1, 2, 4, 9}, /* PB2 */ + {&gpiob, NULL, NULL, 3, 0, ADCx}, /* PB3 */ + {&gpiob, NULL, NULL, 4, 0, ADCx}, /* PB4 */ + {&gpiob, NULL, NULL, 5, 0, ADCx}, /* PB5 */ + {&gpiob, &timer4, NULL, 6, 1, ADCx}, /* PB6 */ + {&gpiob, &timer4, NULL, 7, 2, ADCx}, /* PB7 */ + {&gpiob, &timer4, NULL, 8, 3, ADCx}, /* PB8 */ + {&gpiob, &timer4, NULL, 9, 4, ADCx}, /* PB9 */ + {&gpiob, NULL, NULL, 10, 0, ADCx}, /* PB10 */ + {&gpiob, NULL, NULL, 11, 0, ADCx}, /* PB11 */ + {&gpiob, NULL, NULL, 12, 0, ADCx}, /* PB12 */ + {&gpiob, NULL, NULL, 13, 0, ADCx}, /* PB13 */ + {&gpiob, NULL, NULL, 14, 0, ADCx}, /* PB14 */ + {&gpiob, NULL, NULL, 15, 0, ADCx}, /* PB15 */ + + + {&gpioc, NULL, &adc1, 0, 0, 10}, /* PC0 */ + {&gpioc, NULL, &adc1, 1, 0, 11}, /* PC1 */ + {&gpioc, NULL, &adc1, 2, 0, 12}, /* PC2 */ + {&gpioc, NULL, &adc1, 3, 0, 13}, /* PC3 */ + {&gpioc, NULL, &adc1, 4, 0, 14}, /* PC4 */ + {&gpioc, NULL, &adc1, 5, 0, 15}, /* PC5 */ + {&gpioc, &timer8, NULL, 6, 1, ADCx}, /* PC6 */ + {&gpioc, &timer8, NULL, 7, 2, ADCx}, /* PC7 */ + {&gpioc, &timer8, NULL, 8, 3, ADCx}, /* PC8 */ + {&gpioc, &timer8, NULL, 9, 4, ADCx}, /* PC9 */ + {&gpioc, NULL, NULL, 10, 0, ADCx}, /* PC10 UART4_TX/SDIO_D2 */ + {&gpioc, NULL, NULL, 11, 0, ADCx}, /* PC11 UART4_RX/SDIO_D3 */ + {&gpioc, NULL, NULL, 12, 0, ADCx}, /* PC12 UART5_TX/SDIO_CK */ + {&gpioc, NULL, NULL, 13, 0, ADCx}, /* PC13 TAMPER-RTC */ + {&gpioc, NULL, NULL, 14, 0, ADCx}, /* PC14 OSC32_IN */ + {&gpioc, NULL, NULL, 15, 0, ADCx}, /* PC15 OSC32_OUT */ + + {&gpiod, NULL, NULL, 0, 0, ADCx} , /* PD0 OSC_IN */ + {&gpiod, NULL, NULL, 1, 0, ADCx} , /* PD1 OSC_OUT */ + {&gpiod, NULL, NULL, 2, 0, ADCx} , /* PD2 TIM3_ETR/UART5_RX SDIO_CMD */ + + {&gpiod, NULL, NULL, 3, 0, ADCx} , /* PD3 FSMC_CLK */ + {&gpiod, NULL, NULL, 4, 0, ADCx} , /* PD4 FSMC_NOE */ + {&gpiod, NULL, NULL, 5, 0, ADCx} , /* PD5 FSMC_NWE */ + {&gpiod, NULL, NULL, 6, 0, ADCx} , /* PD6 FSMC_NWAIT */ + {&gpiod, NULL, NULL, 7, 0, ADCx} , /* PD7 FSMC_NE1/FSMC_NCE2 */ + {&gpiod, NULL, NULL, 8, 0, ADCx} , /* PD8 FSMC_D13 */ + {&gpiod, NULL, NULL, 9, 0, ADCx} , /* PD9 FSMC_D14 */ + {&gpiod, NULL, NULL, 10, 0, ADCx} , /* PD10 FSMC_D15 */ + {&gpiod, NULL, NULL, 11, 0, ADCx} , /* PD11 FSMC_A16 */ + {&gpiod, NULL, NULL, 12, 0, ADCx} , /* PD12 FSMC_A17 */ + {&gpiod, NULL, NULL, 13, 0, ADCx} , /* PD13 FSMC_A18 */ + {&gpiod, NULL, NULL, 14, 0, ADCx} , /* PD14 FSMC_D0 */ + {&gpiod, NULL, NULL, 15, 0, ADCx} , /* PD15 FSMC_D1 */ + + {&gpioe, NULL, NULL, 0, 0, ADCx} , /* PE0 */ + {&gpioe, NULL, NULL, 1, 0, ADCx} , /* PE1 */ + {&gpioe, NULL, NULL, 2, 0, ADCx} , /* PE2 */ + {&gpioe, NULL, NULL, 3, 0, ADCx} , /* PE3 */ + {&gpioe, NULL, NULL, 4, 0, ADCx} , /* PE4 */ + {&gpioe, NULL, NULL, 5, 0, ADCx} , /* PE5 */ + {&gpioe, NULL, NULL, 6, 0, ADCx} , /* PE6 */ + {&gpioe, NULL, NULL, 7, 0, ADCx} , /* PE7 */ + {&gpioe, NULL, NULL, 8, 0, ADCx} , /* PE8 */ + {&gpioe, NULL, NULL, 9, 0, ADCx} , /* PE9 */ + {&gpioe, NULL, NULL, 10, 0, ADCx} , /* PE10 */ + {&gpioe, NULL, NULL, 11, 0, ADCx} , /* PE11 */ + {&gpioe, NULL, NULL, 12, 0, ADCx} , /* PE12 */ + {&gpioe, NULL, NULL, 13, 0, ADCx} , /* PE13 */ + {&gpioe, NULL, NULL, 14, 0, ADCx} , /* PE14 */ + {&gpioe, NULL, NULL, 15, 0, ADCx} , /* PE15 */ + + {&gpiof, NULL, NULL, 0, 0, ADCx} , /* PF0 */ + {&gpiof, NULL, NULL, 1, 0, ADCx} , /* PF1 */ + {&gpiof, NULL, NULL, 2, 0, ADCx} , /* PF2 */ + {&gpiof, NULL, NULL, 3, 0, ADCx} , /* PF3 */ + {&gpiof, NULL, NULL, 4, 0, ADCx} , /* PF4 */ + {&gpiof, NULL, NULL, 5, 0, ADCx} , /* PF5 */ + {&gpiof, NULL, NULL, 6, 0, ADCx} , /* PF6 */ + {&gpiof, NULL, NULL, 7, 0, ADCx} , /* PF7 */ + {&gpiof, NULL, NULL, 8, 0, ADCx} , /* PF8 */ + {&gpiof, NULL, NULL, 9, 0, ADCx} , /* PF9 */ + {&gpiof, NULL, NULL, 10, 0, ADCx} , /* PF10 */ + {&gpiof, NULL, NULL, 11, 0, ADCx} , /* PF11 */ + {&gpiof, NULL, NULL, 12, 0, ADCx} , /* PF12 */ + {&gpiof, NULL, NULL, 13, 0, ADCx} , /* PF13 */ + {&gpiof, NULL, NULL, 14, 0, ADCx} , /* PF14 */ + {&gpiof, NULL, NULL, 15, 0, ADCx} , /* PF15 */ + + {&gpiog, NULL, NULL, 0, 0, ADCx} , /* PG0 */ + {&gpiog, NULL, NULL, 1, 0, ADCx} , /* PG1 */ + {&gpiog, NULL, NULL, 2, 0, ADCx} , /* PG2 */ + {&gpiog, NULL, NULL, 3, 0, ADCx} , /* PG3 */ + {&gpiog, NULL, NULL, 4, 0, ADCx} , /* PG4 */ + {&gpiog, NULL, NULL, 5, 0, ADCx} , /* PG5 */ + {&gpiog, NULL, NULL, 6, 0, ADCx} , /* PG6 */ + {&gpiog, NULL, NULL, 7, 0, ADCx} , /* PG7 */ + {&gpiog, NULL, NULL, 8, 0, ADCx} , /* PG8 */ + {&gpiog, NULL, NULL, 9, 0, ADCx} , /* PG9 */ + {&gpiog, NULL, NULL, 10, 0, ADCx} , /* PG10 */ + {&gpiog, NULL, NULL, 11, 0, ADCx} , /* PG11 */ + {&gpiog, NULL, NULL, 12, 0, ADCx} , /* PG12 */ + {&gpiog, NULL, NULL, 13, 0, ADCx} , /* PG13 */ + {&gpiog, NULL, NULL, 14, 0, ADCx} , /* PG14 */ + {&gpiog, NULL, NULL, 15, 0, ADCx} /* PG15 */ +}; + +/* Basically everything that is defined as having a timer us PWM */ +extern const uint8 boardPWMPins[BOARD_NR_PWM_PINS] __FLASH__ = { + PA0,PA1,PA2,PA3,PA6,PA7,PA8,PA9,PA10,PB0,PB1,PB6,PB7,PB8,PB9,PC6,PC7,PC8,PC9 +}; + +/* Basically everything that is defined having ADC */ +extern const uint8 boardADCPins[BOARD_NR_ADC_PINS] __FLASH__ = { + PA0,PA1,PA2,PA3,PA4,PA5,PA6,PA7,PB0,PB1,PC0,PC1,PC2,PC3,PC4,PC5 +}; + +/* not sure what this us used for */ +extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = { + BOARD_JTMS_SWDIO_PIN, + BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN +}; + + +#ifdef SERIAL_USB + DEFINE_HWSERIAL(Serial1, 1); + DEFINE_HWSERIAL(Serial2, 2); + DEFINE_HWSERIAL(Serial3, 3); + DEFINE_HWSERIAL_UART(Serial4, 4); + DEFINE_HWSERIAL_UART(Serial5, 5); +#else + DEFINE_HWSERIAL(Serial, 1); + DEFINE_HWSERIAL(Serial1, 2); + DEFINE_HWSERIAL(Serial2, 3); + DEFINE_HWSERIAL_UART(Serial3, 4); + DEFINE_HWSERIAL_UART(Serial4, 5); +#endif diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/board/board.h b/buildroot/share/PlatformIO/variants/CHITU_F103/board/board.h new file mode 100755 index 0000000000..20fd9d379f --- /dev/null +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/board/board.h @@ -0,0 +1,240 @@ +/****************************************************************************** + * The MIT License + * + * Copyright (c) 2011 LeafLabs, LLC. + * + * 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. + *****************************************************************************/ + +/** + * @file maple_RET6.h + * @author Marti Bolivar + * @brief Private include file for Maple RET6 Edition in boards.h + * + * See maple.h for more information on these definitions. + */ + +#ifndef _BOARDS_GENERIC_STM32F103Z_H_ +#define _BOARDS_GENERIC_STM32F103Z_H_ + +/* A few of these values will seem strange given that it's a + * high-density board. */ + +#define CYCLES_PER_MICROSECOND 72 +#define SYSTICK_RELOAD_VAL (F_CPU/1000) - 1 /* takes a cycle to reload */ + +// USARTS +#define BOARD_NR_USARTS 5 +#define BOARD_USART1_TX_PIN PA9 +#define BOARD_USART1_RX_PIN PA10 + +#define BOARD_USART2_TX_PIN PA2 +#define BOARD_USART2_RX_PIN PA3 + +#define BOARD_USART3_TX_PIN PB10 +#define BOARD_USART3_RX_PIN PB11 + +#define BOARD_USART4_TX_PIN PC10 +#define BOARD_USART4_RX_PIN PC11 + +#define BOARD_USART5_TX_PIN PC12 +#define BOARD_USART5_RX_PIN PD2 + +/* Note: + * + * SPI3 is unusable due to pin 43 (PB4) and NRST tie-together :(, but + * leave the definitions so as not to clutter things up. This is only + * OK since RET6 Ed. is specifically advertised as a beta board. */ +#define BOARD_NR_SPI 3 +#define BOARD_SPI1_NSS_PIN PA4 +#define BOARD_SPI1_SCK_PIN PA5 +#define BOARD_SPI1_MISO_PIN PA6 +#define BOARD_SPI1_MOSI_PIN PA7 + + + +#define BOARD_SPI2_NSS_PIN PB12 +#define BOARD_SPI2_SCK_PIN PB13 +#define BOARD_SPI2_MISO_PIN PB14 +#define BOARD_SPI2_MOSI_PIN PB15 + + +#define BOARD_SPI3_NSS_PIN PA15 +#define BOARD_SPI3_SCK_PIN PB3 +#define BOARD_SPI3_MISO_PIN PB4 +#define BOARD_SPI3_MOSI_PIN PB5 + + +/* GPIO A to E = 5 * 16 - BOOT1 not used = 79*/ +#define BOARD_NR_GPIO_PINS 112 +/* Note: NOT 19. The missing one is D38 a.k.a. BOARD_BUTTON_PIN, which + * isn't broken out to a header and is thus unusable for PWM. */ +#define BOARD_NR_PWM_PINS 19 +#define BOARD_NR_ADC_PINS 16 +#define BOARD_NR_USED_PINS 7 + +#define BOARD_JTMS_SWDIO_PIN 39 +#define BOARD_JTCK_SWCLK_PIN 40 +#define BOARD_JTDI_PIN 41 +#define BOARD_JTDO_PIN 42 +#define BOARD_NJTRST_PIN 43 + +/* USB configuration. BOARD_USB_DISC_DEV is the GPIO port containing + * the USB_DISC pin, and BOARD_USB_DISC_BIT is that pin's bit. */ +#define BOARD_USB_DISC_DEV GPIOC +#define BOARD_USB_DISC_BIT 12 + +/* + * SDIO Pins + */ +#define BOARD_SDIO_D0 PC8 +#define BOARD_SDIO_D1 PC9 +#define BOARD_SDIO_D2 PC10 +#define BOARD_SDIO_D3 PC11 +#define BOARD_SDIO_CLK PC12 +#define BOARD_SDIO_CMD PD2 + +/* Pin aliases: these give the GPIO port/bit for each pin as an + * enum. These are optional, but recommended. They make it easier to + * write code using low-level GPIO functionality. */ +enum { +PA0,PA1,PA2,PA3,PA4,PA5,PA6,PA7,PA8,PA9,PA10,PA11,PA12,PA13,PA14,PA15, +PB0,PB1,PB2,PB3,PB4,PB5,PB6,PB7,PB8,PB9,PB10,PB11,PB12,PB13,PB14,PB15, +PC0,PC1,PC2,PC3,PC4,PC5,PC6,PC7,PC8,PC9,PC10,PC11,PC12,PC13,PC14,PC15, +PD0,PD1,PD2,PD3,PD4,PD5,PD6,PD7,PD8,PD9,PD10,PD11,PD12,PD13,PD14,PD15, +PE0,PE1,PE2,PE3,PE4,PE5,PE6,PE7,PE8,PE9,PE10,PE11,PE12,PE13,PE14,PE15, +PF0,PF1,PF2,PF3,PF4,PF5,PF6,PF7,PF8,PF9,PF10,PF11,PF12,PF13,PF14,PF15, +PG0,PG1,PG2,PG3,PG4,PG5,PG6,PG7,PG8,PG9,PG10,PG11,PG12,PG13,PG14,PG15 +};/* Note PB2 is skipped as this is Boot1 and is not going to be much use as its likely to be pulled permanently low */ +/* +#define PA0 0 +#define PA1 1 +#define PA2 2 +#define PA3 3 +#define PA4 4 +#define PA5 5 +#define PA6 6 +#define PA7 7 +#define PA8 8 +#define PA9 9 +#define PA10 10 +#define PA11 11 +#define PA12 12 +#define PA13 13 +#define PA14 14 +#define PA15 15 +#define PB0 16 +#define PB1 17 +#define PB2 18 +#define PB3 19 +#define PB4 20 +#define PB5 21 +#define PB6 22 +#define PB7 23 +#define PB8 24 +#define PB9 25 +#define PB10 26 +#define PB11 27 +#define PB12 28 +#define PB13 29 +#define PB14 30 +#define PB15 31 +#define PC0 32 +#define PC1 33 +#define PC2 34 +#define PC3 35 +#define PC4 36 +#define PC5 37 +#define PC6 38 +#define PC7 39 +#define PC8 40 +#define PC9 41 +#define PC10 42 +#define PC11 43 +#define PC12 44 +#define PC13 45 +#define PC14 46 +#define PC15 47 +#define PD0 48 +#define PD1 49 +#define PD2 50 +#define PD3 51 +#define PD4 52 +#define PD5 53 +#define PD6 54 +#define PD7 55 +#define PD8 56 +#define PD9 57 +#define PD10 58 +#define PD11 59 +#define PD12 60 +#define PD13 61 +#define PD14 62 +#define PD15 63 +#define PE0 64 +#define PE1 65 +#define PE2 66 +#define PE3 67 +#define PE4 68 +#define PE5 69 +#define PE6 70 +#define PE7 71 +#define PE8 72 +#define PE9 73 +#define PE10 74 +#define PE11 75 +#define PE12 76 +#define PE13 77 +#define PE14 78 +#define PE15 79 +#define PF0 80 +#define PF1 81 +#define PF2 82 +#define PF3 83 +#define PF4 84 +#define PF5 85 +#define PF6 86 +#define PF7 87 +#define PF8 88 +#define PF9 89 +#define PF10 90 +#define PF11 91 +#define PF12 92 +#define PF13 93 +#define PF14 94 +#define PF15 95 +#define PG0 96 +#define PG1 97 +#define PG2 98 +#define PG3 99 +#define PG4 100 +#define PG5 101 +#define PG6 102 +#define PG7 103 +#define PG8 104 +#define PG9 105 +#define PG10 106 +#define PG11 107 +#define PG12 108 +#define PG13 109 +#define PG14 110 +#define PG15 111 */ +#endif diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/ld/common.inc b/buildroot/share/PlatformIO/variants/CHITU_F103/ld/common.inc new file mode 100755 index 0000000000..e086a58bca --- /dev/null +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/ld/common.inc @@ -0,0 +1,220 @@ +/* + * Linker script for libmaple. + * + * Original author "lanchon" from ST forums, with modifications by LeafLabs. + */ + +OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") + +/* + * Configure other libraries we want in the link. + * + * libgcc, libc, and libm are common across supported toolchains. + * However, some toolchains require additional archives which aren't + * present everywhere (e.g. ARM's gcc-arm-embedded releases). + * + * To hack around this, we let the build system specify additional + * archives by putting the right extra_libs.inc (in a directory under + * toolchains/) in our search path. + */ +GROUP(libgcc.a libc.a libm.a) +INCLUDE extra_libs.inc + +/* + * These force the linker to search for vector table symbols. + * + * These symbols vary by STM32 family (and also within families). + * It's up to the build system to configure the link's search path + * properly for the target MCU. + */ +INCLUDE vector_symbols.inc + +/* STM32 vector table. */ +EXTERN(__stm32_vector_table) + +/* C runtime initialization function. */ +EXTERN(start_c) + +/* main entry point */ +EXTERN(main) + +/* Initial stack pointer value. */ +EXTERN(__msp_init) +PROVIDE(__msp_init = ORIGIN(ram) + LENGTH(ram)); + +/* Reset vector and chip reset entry point */ +EXTERN(__start__) +ENTRY(__start__) +PROVIDE(__exc_reset = __start__); + +/* Heap boundaries, for libmaple */ +EXTERN(_lm_heap_start); +EXTERN(_lm_heap_end); + +SECTIONS +{ + .text : + { + __text_start__ = .; + /* + * STM32 vector table. Leave this here. Yes, really. + */ + *(.stm32.interrupt_vector) + + /* + * Program code and vague linking + */ + *(.text .text.* .gnu.linkonce.t.*) + *(.plt) + *(.gnu.warning) + *(.glue_7t) *(.glue_7) *(.vfp11_veneer) + + *(.ARM.extab* .gnu.linkonce.armextab.*) + *(.gcc_except_table) + *(.eh_frame_hdr) + *(.eh_frame) + + . = ALIGN(4); + KEEP(*(.init)) + + . = ALIGN(4); + __preinit_array_start = .; + KEEP (*(.preinit_array)) + __preinit_array_end = .; + + . = ALIGN(4); + __init_array_start = .; + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + __init_array_end = .; + + . = ALIGN(0x4); + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*crtend.o(.ctors)) + + . = ALIGN(4); + KEEP(*(.fini)) + + . = ALIGN(4); + __fini_array_start = .; + KEEP (*(.fini_array)) + KEEP (*(SORT(.fini_array.*))) + __fini_array_end = .; + + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*crtend.o(.dtors)) + } > REGION_TEXT + + /* + * End of text + */ + .text.align : + { + . = ALIGN(8); + __text_end__ = .; + } > REGION_TEXT + + /* + * .ARM.exidx exception unwinding; mandated by ARM's C++ ABI + */ + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > REGION_RODATA + __exidx_end = .; + + /* + * .data + */ + .data : + { + __data_start__ = .; + LONG(0) + . = ALIGN(8); + + *(.got.plt) *(.got) + *(.data .data.* .gnu.linkonce.d.*) + + . = ALIGN(8); + __data_end__ = .; + } > REGION_DATA AT> REGION_RODATA + + /* + * Read-only data + */ + .rodata : + { + *(.rodata .rodata.* .gnu.linkonce.r.*) + /* .USER_FLASH: We allow users to allocate into Flash here */ + *(.USER_FLASH) + /* ROM image configuration; for C startup */ + . = ALIGN(4); + _lm_rom_img_cfgp = .; + LONG(LOADADDR(.data)); + /* + * Heap: Linker scripts may choose a custom heap by overriding + * _lm_heap_start and _lm_heap_end. Otherwise, the heap is in + * internal SRAM, beginning after .bss, and growing towards + * the stack. + * + * I'm shoving these here naively; there's probably a cleaner way + * to go about this. [mbolivar] + */ + _lm_heap_start = DEFINED(_lm_heap_start) ? _lm_heap_start : _end; + _lm_heap_end = DEFINED(_lm_heap_end) ? _lm_heap_end : __msp_init; + } > REGION_RODATA + + /* + * .bss + */ + .bss : + { + . = ALIGN(8); + __bss_start__ = .; + *(.bss .bss.* .gnu.linkonce.b.*) + *(COMMON) + . = ALIGN (8); + __bss_end__ = .; + _end = __bss_end__; + } > REGION_BSS + + /* + * Debugging sections + */ + .stab 0 (NOLOAD) : { *(.stab) } + .stabstr 0 (NOLOAD) : { *(.stabstr) } + /* DWARF debug sections. + * Symbols in the DWARF debugging sections are relative to the beginning + * of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + + .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) } + .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) } + /DISCARD/ : { *(.note.GNU-stack) } +} diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/ld/extra_libs.inc b/buildroot/share/PlatformIO/variants/CHITU_F103/ld/extra_libs.inc new file mode 100755 index 0000000000..dd2c84fa45 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/ld/extra_libs.inc @@ -0,0 +1,7 @@ +/* + * Extra archives needed by ARM's GCC ARM Embedded arm-none-eabi- + * releases (https://launchpad.net/gcc-arm-embedded/). + */ + +/* This is for the provided newlib. */ +GROUP(libnosys.a) diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103z_dfu.ld b/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103z_dfu.ld new file mode 100755 index 0000000000..81eaa8b06b --- /dev/null +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103z_dfu.ld @@ -0,0 +1,29 @@ +/* + * libmaple linker script + * + * This build puts .text (and .rodata) in Flash, and + * .data/.bss/heap (of course) in SRAM, but links starting at the + * Flash and SRAM starting addresses (0x08000000 and 0x20000000 + * respectively). This will wipe out a Maple bootloader if there's one + * on the board, so only use this if you know what you're doing. + * + * This build is perfectly usable for upload over SWD, + * the system memory bootloader, etc. The name is just a historical + * artifact. + */ + + +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K + rom (rx) : ORIGIN = 0x08002000, LENGTH = 504K +} + +/* Provide memory region aliases for common.inc */ +REGION_ALIAS("REGION_TEXT", rom); +REGION_ALIAS("REGION_DATA", ram); +REGION_ALIAS("REGION_BSS", ram); +REGION_ALIAS("REGION_RODATA", rom); + +/* Let common.inc handle the real work. */ +INCLUDE common.inc diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103zc.ld b/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103zc.ld new file mode 100755 index 0000000000..37bc3da0dc --- /dev/null +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103zc.ld @@ -0,0 +1,27 @@ +/* + * libmaple linker script + * + * This build puts .text (and .rodata) in Flash, and + * .data/.bss/heap (of course) in SRAM, but links starting at the + * Flash and SRAM starting addresses (0x08000000 and 0x20000000 + * respectively). This will wipe out a Maple bootloader if there's one + * on the board, so only use this if you know what you're doing. + * + * This build is perfectly usable for upload over SWD, + * the system memory bootloader, etc. The name is just a historical + * artifact. + */ +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K + rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K +} + +/* Provide memory region aliases for common.inc */ +REGION_ALIAS("REGION_TEXT", rom); +REGION_ALIAS("REGION_DATA", ram); +REGION_ALIAS("REGION_BSS", ram); +REGION_ALIAS("REGION_RODATA", rom); + +/* Let common.inc handle the real work. */ +INCLUDE common.inc diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103zd.ld b/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103zd.ld new file mode 100755 index 0000000000..f3f218059f --- /dev/null +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103zd.ld @@ -0,0 +1,27 @@ +/* + * libmaple linker script + * + * This build puts .text (and .rodata) in Flash, and + * .data/.bss/heap (of course) in SRAM, but links starting at the + * Flash and SRAM starting addresses (0x08000000 and 0x20000000 + * respectively). This will wipe out a Maple bootloader if there's one + * on the board, so only use this if you know what you're doing. + * + * This build is perfectly usable for upload over SWD, + * the system memory bootloader, etc. The name is just a historical + * artifact. + */ +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K + rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K +} + +/* Provide memory region aliases for common.inc */ +REGION_ALIAS("REGION_TEXT", rom); +REGION_ALIAS("REGION_DATA", ram); +REGION_ALIAS("REGION_BSS", ram); +REGION_ALIAS("REGION_RODATA", rom); + +/* Let common.inc handle the real work. */ +INCLUDE common.inc diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103ze.ld b/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103ze.ld new file mode 100755 index 0000000000..2f86c3f071 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103ze.ld @@ -0,0 +1,29 @@ +/* + * libmaple linker script + * + * This build puts .text (and .rodata) in Flash, and + * .data/.bss/heap (of course) in SRAM, but links starting at the + * Flash and SRAM starting addresses (0x08000000 and 0x20000000 + * respectively). This will wipe out a Maple bootloader if there's one + * on the board, so only use this if you know what you're doing. + * + * This build is perfectly usable for upload over SWD, + * the system memory bootloader, etc. The name is just a historical + * artifact. + */ + + +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K + rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K +} + +/* Provide memory region aliases for common.inc */ +REGION_ALIAS("REGION_TEXT", rom); +REGION_ALIAS("REGION_DATA", ram); +REGION_ALIAS("REGION_BSS", ram); +REGION_ALIAS("REGION_RODATA", rom); + +/* Let common.inc handle the real work. */ +INCLUDE common.inc diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/ld/vector_symbols.inc b/buildroot/share/PlatformIO/variants/CHITU_F103/ld/vector_symbols.inc new file mode 100755 index 0000000000..f8519bba44 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/ld/vector_symbols.inc @@ -0,0 +1,78 @@ +EXTERN(__msp_init) +EXTERN(__exc_reset) +EXTERN(__exc_nmi) +EXTERN(__exc_hardfault) +EXTERN(__exc_memmanage) +EXTERN(__exc_busfault) +EXTERN(__exc_usagefault) +EXTERN(__stm32reservedexception7) +EXTERN(__stm32reservedexception8) +EXTERN(__stm32reservedexception9) +EXTERN(__stm32reservedexception10) +EXTERN(__exc_svc) +EXTERN(__exc_debug_monitor) +EXTERN(__stm32reservedexception13) +EXTERN(__exc_pendsv) +EXTERN(__exc_systick) + +EXTERN(__irq_wwdg) +EXTERN(__irq_pvd) +EXTERN(__irq_tamper) +EXTERN(__irq_rtc) +EXTERN(__irq_flash) +EXTERN(__irq_rcc) +EXTERN(__irq_exti0) +EXTERN(__irq_exti1) +EXTERN(__irq_exti2) +EXTERN(__irq_exti3) +EXTERN(__irq_exti4) +EXTERN(__irq_dma1_channel1) +EXTERN(__irq_dma1_channel2) +EXTERN(__irq_dma1_channel3) +EXTERN(__irq_dma1_channel4) +EXTERN(__irq_dma1_channel5) +EXTERN(__irq_dma1_channel6) +EXTERN(__irq_dma1_channel7) +EXTERN(__irq_adc) +EXTERN(__irq_usb_hp_can_tx) +EXTERN(__irq_usb_lp_can_rx0) +EXTERN(__irq_can_rx1) +EXTERN(__irq_can_sce) +EXTERN(__irq_exti9_5) +EXTERN(__irq_tim1_brk) +EXTERN(__irq_tim1_up) +EXTERN(__irq_tim1_trg_com) +EXTERN(__irq_tim1_cc) +EXTERN(__irq_tim2) +EXTERN(__irq_tim3) +EXTERN(__irq_tim4) +EXTERN(__irq_i2c1_ev) +EXTERN(__irq_i2c1_er) +EXTERN(__irq_i2c2_ev) +EXTERN(__irq_i2c2_er) +EXTERN(__irq_spi1) +EXTERN(__irq_spi2) +EXTERN(__irq_usart1) +EXTERN(__irq_usart2) +EXTERN(__irq_usart3) +EXTERN(__irq_exti15_10) +EXTERN(__irq_rtcalarm) +EXTERN(__irq_usbwakeup) + +EXTERN(__irq_tim8_brk) +EXTERN(__irq_tim8_up) +EXTERN(__irq_tim8_trg_com) +EXTERN(__irq_tim8_cc) +EXTERN(__irq_adc3) +EXTERN(__irq_fsmc) +EXTERN(__irq_sdio) +EXTERN(__irq_tim5) +EXTERN(__irq_spi3) +EXTERN(__irq_uart4) +EXTERN(__irq_uart5) +EXTERN(__irq_tim6) +EXTERN(__irq_tim7) +EXTERN(__irq_dma2_channel1) +EXTERN(__irq_dma2_channel2) +EXTERN(__irq_dma2_channel3) +EXTERN(__irq_dma2_channel4_5) diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/pins_arduino.h b/buildroot/share/PlatformIO/variants/CHITU_F103/pins_arduino.h new file mode 100755 index 0000000000..d5dce114d5 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/pins_arduino.h @@ -0,0 +1,2 @@ +// API compatibility +#include "variant.h" diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/variant.h b/buildroot/share/PlatformIO/variants/CHITU_F103/variant.h new file mode 100755 index 0000000000..cd10bb3c07 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/variant.h @@ -0,0 +1,17 @@ +#pragma once + +#define digitalPinToPort(P) ( PIN_MAP[P].gpio_device ) +#define digitalPinToBitMask(P) ( BIT(PIN_MAP[P].gpio_bit) ) +#define portOutputRegister(port) ( &(port->regs->ODR) ) +#define portInputRegister(port) ( &(port->regs->IDR) ) + +#define portSetRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BSRR) ) +#define portClearRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BRR) ) + +#define portConfigRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->CRL) ) + +static const uint8_t SS = BOARD_SPI1_NSS_PIN; +static const uint8_t SS1 = BOARD_SPI2_NSS_PIN; +static const uint8_t MOSI = BOARD_SPI1_MOSI_PIN; +static const uint8_t MISO = BOARD_SPI1_MISO_PIN; +static const uint8_t SCK = BOARD_SPI1_SCK_PIN; diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/boards.cpp b/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/boards.cpp new file mode 100755 index 0000000000..93ae231518 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/boards.cpp @@ -0,0 +1,225 @@ +/****************************************************************************** + * The MIT License + * + * Copyright (c) 2010 Perry Hung. + * Copyright (c) 2011, 2012 LeafLabs, LLC. + * + * 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. + *****************************************************************************/ + +/** + * @file wirish/boards.cpp + * @brief init() and board routines. + * + * This file is mostly interesting for the init() function, which + * configures Flash, the core clocks, and a variety of other available + * peripherals on the board so the rest of Wirish doesn't have to turn + * things on before using them. + * + * Prior to returning, init() calls boardInit(), which allows boards + * to perform any initialization they need to. This file includes a + * weak no-op definition of boardInit(), so boards that don't need any + * special initialization don't have to define their own. + * + * How init() works is chip-specific. See the boards_setup.cpp files + * under e.g. wirish/stm32f1/, wirish/stmf32f2 for the details, but be + * advised: their contents are unstable, and can/will change without + * notice. + */ + +#include +#include +#include +#include +#include +#include "boards_private.h" + +static void setup_flash(void); +static void setup_clocks(void); +static void setup_nvic(void); +static void setup_adcs(void); +static void setup_timers(void); + +/* + * Exported functions + */ + +void init(void) { + setup_flash(); + setup_clocks(); + setup_nvic(); + systick_init(SYSTICK_RELOAD_VAL); + wirish::priv::board_setup_gpio(); + setup_adcs(); + setup_timers(); + wirish::priv::board_setup_usb(); + wirish::priv::series_init(); + boardInit(); +} + +/* Provide a default no-op boardInit(). */ +__weak void boardInit(void) { +} + +/* You could farm this out to the files in boards/ if e.g. it takes + * too long to test on boards with lots of pins. */ +bool boardUsesPin(uint8 pin) { + for (int i = 0; i < BOARD_NR_USED_PINS; i++) { + if (pin == boardUsedPins[i]) { + return true; + } + } + return false; +} + +/* + * Auxiliary routines + */ + +static void setup_flash(void) { + // Turn on as many Flash "go faster" features as + // possible. flash_enable_features() just ignores any flags it + // can't support. + flash_enable_features(FLASH_PREFETCH | FLASH_ICACHE | FLASH_DCACHE); + // Configure the wait states, assuming we're operating at "close + // enough" to 3.3V. + flash_set_latency(FLASH_SAFE_WAIT_STATES); +} + +static void setup_clocks(void) { + // Turn on HSI. We'll switch to and run off of this while we're + // setting up the main PLL. + rcc_turn_on_clk(RCC_CLK_HSI); + + // Turn off and reset the clock subsystems we'll be using, as well + // as the clock security subsystem (CSS). Note that resetting CFGR + // to its default value of 0 implies a switch to HSI for SYSCLK. + RCC_BASE->CFGR = 0x00000000; + rcc_disable_css(); + rcc_turn_off_clk(RCC_CLK_PLL); + rcc_turn_off_clk(RCC_CLK_HSE); + wirish::priv::board_reset_pll(); + // Clear clock readiness interrupt flags and turn off clock + // readiness interrupts. + RCC_BASE->CIR = 0x00000000; +#if !USE_HSI_CLOCK + // Enable HSE, and wait until it's ready. + rcc_turn_on_clk(RCC_CLK_HSE); + while (!rcc_is_clk_ready(RCC_CLK_HSE)) + ; +#endif + // Configure AHBx, APBx, etc. prescalers and the main PLL. + wirish::priv::board_setup_clock_prescalers(); + rcc_configure_pll(&wirish::priv::w_board_pll_cfg); + + // Enable the PLL, and wait until it's ready. + rcc_turn_on_clk(RCC_CLK_PLL); + while(!rcc_is_clk_ready(RCC_CLK_PLL)) + ; + + // Finally, switch to the now-ready PLL as the main clock source. + rcc_switch_sysclk(RCC_CLKSRC_PLL); +} + +/* + * These addresses are where usercode starts when a bootloader is + * present. If no bootloader is present, the user NVIC usually starts + * at the Flash base address, 0x08000000. + */ +#if defined(BOOTLOADER_maple) + #define USER_ADDR_ROM 0x08005000 +#else + #define USER_ADDR_ROM 0x08000000 +#endif +#define USER_ADDR_RAM 0x20000C00 +extern char __text_start__; + +static void setup_nvic(void) { + +nvic_init((uint32)VECT_TAB_ADDR, 0); + +/* Roger Clark. We now control nvic vector table in boards.txt using the build.vect paramater +#ifdef VECT_TAB_FLASH + nvic_init(USER_ADDR_ROM, 0); +#elif defined VECT_TAB_RAM + nvic_init(USER_ADDR_RAM, 0); +#elif defined VECT_TAB_BASE + nvic_init((uint32)0x08000000, 0); +#elif defined VECT_TAB_ADDR + // A numerically supplied value + nvic_init((uint32)VECT_TAB_ADDR, 0); +#else + // Use the __text_start__ value from the linker script; this + // should be the start of the vector table. + nvic_init((uint32)&__text_start__, 0); +#endif + +*/ +} + +static void adc_default_config(adc_dev *dev) { + adc_enable_single_swstart(dev); + adc_set_sample_rate(dev, wirish::priv::w_adc_smp); +} + +static void setup_adcs(void) { + adc_set_prescaler(wirish::priv::w_adc_pre); + adc_foreach(adc_default_config); +} + +static void timer_default_config(timer_dev *dev) { + timer_adv_reg_map *regs = (dev->regs).adv; + const uint16 full_overflow = 0xFFFF; + const uint16 half_duty = 0x8FFF; + + timer_init(dev); + timer_pause(dev); + + regs->CR1 = TIMER_CR1_ARPE; + regs->PSC = 1; + regs->SR = 0; + regs->DIER = 0; + regs->EGR = TIMER_EGR_UG; + switch (dev->type) { + case TIMER_ADVANCED: + regs->BDTR = TIMER_BDTR_MOE | TIMER_BDTR_LOCK_OFF; + // fall-through + case TIMER_GENERAL: + timer_set_reload(dev, full_overflow); + for (uint8 channel = 1; channel <= 4; channel++) { + if (timer_has_cc_channel(dev, channel)) { + timer_set_compare(dev, channel, half_duty); + timer_oc_set_mode(dev, channel, TIMER_OC_MODE_PWM_1, + TIMER_OC_PE); + } + } + // fall-through + case TIMER_BASIC: + break; + } + + timer_generate_update(dev); + timer_resume(dev); +} + +static void setup_timers(void) { + timer_foreach(timer_default_config); +} diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/boards_setup.cpp b/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/boards_setup.cpp new file mode 100755 index 0000000000..c3f524720d --- /dev/null +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/boards_setup.cpp @@ -0,0 +1,128 @@ +/****************************************************************************** + * The MIT License + * + * Copyright (c) 2012 LeafLabs, LLC. + * + * 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. +*****************************************************************************/ + +/** + * @file wirish/stm32f1/boards_setup.cpp + * @author Marti Bolivar + * @brief STM32F1 chip setup. + * + * This file controls how init() behaves on the STM32F1. Be very + * careful when changing anything here. Many of these values depend + * upon each other. + */ + +#include "boards_private.h" + +#include +#include + +#include +#include + +// Allow boards to provide a PLL multiplier. This is useful for +// e.g. STM32F100 value line MCUs, which use slower multipliers. +// (We're leaving the default to RCC_PLLMUL_9 for now, since that +// works for F103 performance line MCUs, which is all that LeafLabs +// currently officially supports). +#ifndef BOARD_RCC_PLLMUL + #if !USE_HSI_CLOCK + #if F_CPU==128000000 + #define BOARD_RCC_PLLMUL RCC_PLLMUL_16 + #elif F_CPU==72000000 + #define BOARD_RCC_PLLMUL RCC_PLLMUL_9 + #elif F_CPU==48000000 + #define BOARD_RCC_PLLMUL RCC_PLLMUL_6 + #elif F_CPU==16000000 + #define BOARD_RCC_PLLMUL RCC_PLLMUL_2 + #endif + #else + #define BOARD_RCC_PLLMUL RCC_PLLMUL_16 + #endif +#endif + +namespace wirish { + namespace priv { + + static stm32f1_rcc_pll_data pll_data = {BOARD_RCC_PLLMUL}; +#if !USE_HSI_CLOCK + __weak rcc_pll_cfg w_board_pll_cfg = {RCC_PLLSRC_HSE, &pll_data}; +#else + __weak rcc_pll_cfg w_board_pll_cfg = {RCC_PLLSRC_HSI_DIV_2, &pll_data}; +#endif + __weak adc_prescaler w_adc_pre = ADC_PRE_PCLK2_DIV_6; + __weak adc_smp_rate w_adc_smp = ADC_SMPR_55_5; + + __weak void board_reset_pll(void) { + // TODO + } + + __weak void board_setup_clock_prescalers(void) { + rcc_set_prescaler(RCC_PRESCALER_AHB, RCC_AHB_SYSCLK_DIV_1); + rcc_set_prescaler(RCC_PRESCALER_APB1, RCC_APB1_HCLK_DIV_2); + rcc_set_prescaler(RCC_PRESCALER_APB2, RCC_APB2_HCLK_DIV_1); + rcc_clk_disable(RCC_USB); +#if F_CPU == 72000000 + rcc_set_prescaler(RCC_PRESCALER_USB, RCC_USB_SYSCLK_DIV_1_5); +#elif F_CPU == 48000000 + rcc_set_prescaler(RCC_PRESCALER_USB, RCC_USB_SYSCLK_DIV_1); +#endif + } + + __weak void board_setup_gpio(void) { + /** + * PA14 is a pull up pin. But, some V5 boards it start with LOW state! And just behave properly when the Z- PROBE is actived at least once. + * So, if the sensor isnt actived, the PA14 pin will be forever in LOW state, telling Marlin the probe IS ALWAYS ACTIVE, that isnt the case! + * Chitu original firmware seems to start with every pullup PIN with HIGH to workaround this. + * So we are doing the same here. + * This hack only works if applied *before* the GPIO Init, it's the reason I did it here. + */ + #ifdef CHITU_V5_Z_MIN_BUGFIX + GPIOA->regs->BSRR = (1U << PA14); + #endif + gpio_init_all(); + } + + __weak void board_setup_usb(void) { +#ifdef SERIAL_USB +#ifdef GENERIC_BOOTLOADER + // Reset the USB interface on generic boards - developed by Victor PV + gpio_set_mode(PIN_MAP[PA12].gpio_device, PIN_MAP[PA12].gpio_bit, GPIO_OUTPUT_PP); + gpio_write_bit(PIN_MAP[PA12].gpio_device, PIN_MAP[PA12].gpio_bit,0); + + for (volatile unsigned int i = 0; i < 512; i++); // Only small delay seems to be needed, and USB pins will get configured in Serial.begin + gpio_set_mode(PIN_MAP[PA12].gpio_device, PIN_MAP[PA12].gpio_bit, GPIO_INPUT_FLOATING); +#endif + Serial.begin(); // Roger Clark. Changed SerialUSB to Serial for Arduino sketch compatibility +#endif + } + + __weak void series_init(void) { + // Initialize AFIO here, too, so peripheral remaps and external + // interrupts work out of the box. + afio_init(); + } + } +} diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/start.S b/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/start.S new file mode 100755 index 0000000000..8b181aa993 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/start.S @@ -0,0 +1,57 @@ +/****************************************************************************** + * The MIT License + * + * Copyright (c) 2011 LeafLabs, LLC. + * + * 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. + *****************************************************************************/ + +/* + * This file is a modified version of a file obtained from + * CodeSourcery Inc. (now part of Mentor Graphics Corp.), in which the + * following text appeared: + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + + .text + .code 16 + .thumb_func + + .globl __start__ + .type __start__, %function +__start__: + .fnstart + ldr r1,=__msp_init + mov sp,r1 + ldr r1,=start_c + bx r1 + .pool + .cantunwind + .fnend diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/start_c.c b/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/start_c.c new file mode 100755 index 0000000000..d305e6d5b9 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/start_c.c @@ -0,0 +1,144 @@ +/****************************************************************************** + * The MIT License + * + * Copyright (c) 2011 LeafLabs, LLC. + * + * 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. + *****************************************************************************/ + +/* + * This file is a modified version of a file obtained from + * CodeSourcery Inc. (now part of Mentor Graphics Corp.), in which the + * following text appeared: + * + * Copyright (c) 2006, 2007 CodeSourcery Inc + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +#include +#include +#include + +#include "rcc_private.h" + +#include +#include +#include "usart_private.h" + +#include +#include + +extern void __libc_init_array(void); + +extern int main(int, char**, char**); + +extern void exit(int) __attribute__((noreturn, weak)); + +/* The linker must ensure that these are at least 4-byte aligned. */ +extern char __data_start__, __data_end__; +extern char __bss_start__, __bss_end__; + +struct rom_img_cfg { + int *img_start; +}; + +extern char _lm_rom_img_cfgp; +extern void __lm_error(); +extern void timer_disable_all(); + + /* Turn off ADC */ +extern void adc_disable_all(); + + /* Turn off all USARTs */ +extern void usart_disable_all(); +extern void DisableEverything(); + +void __attribute__((noreturn)) start_c(void) { + struct rom_img_cfg *img_cfg = (struct rom_img_cfg*)&_lm_rom_img_cfgp; + int *src = img_cfg->img_start; + int *dst = (int*)&__data_start__; + int exit_code; + + asm("CPSID I"); + /* Reset the RCC clock configuration to the default reset state(for debug purpose) */ + /* Set HSION bit */ + RCC_BASE->CR |= 0x00000001U; + + /* Reset SW, HPRE, PPRE1, PPRE2, ADCPRE and MCO bits */ + RCC_BASE->CFGR &= 0xF0FF0000U; + + /* Reset HSEON, CSSON and PLLON bits */ + RCC_BASE->CR &= 0xFEF6FFFFU; + + /* Reset HSEBYP bit */ + RCC_BASE->CR &= 0xFFFBFFFFU; + + /* Reset PLLSRC, PLLXTPRE, PLLMUL and USBPRE/OTGFSPRE bits */ + RCC_BASE->CFGR &= 0xFF80FFFFU; + + /* Disable all interrupts and clear pending bits */ + RCC_BASE->CIR = 0x009F0000U; + + USART1_BASE->CR1 = 0; + USART1_BASE->CR2 = 0; + USART1_BASE->CR3 = 0; + + memset(SDIO_BASE, 0, sizeof(sdio_reg_map)); + asm("CPSIE I"); + + /* Initialize .data, if necessary. */ + if (src != dst) { + int *end = (int*)&__data_end__; + while (dst < end) { + *dst++ = *src++; + } + } + + /* Zero .bss. */ + dst = (int*)&__bss_start__; + while (dst < (int*)&__bss_end__) { + *dst++ = 0; + } + + /* Run initializers. */ + __libc_init_array(); + + /* Jump to main. */ + exit_code = main(0, 0, 0); + if (exit) { + exit(exit_code); + } + + /* If exit is NULL, make sure we don't return. */ + for (;;) + continue; +} diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/syscalls.c b/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/syscalls.c new file mode 100755 index 0000000000..ec1c34dbad --- /dev/null +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/syscalls.c @@ -0,0 +1,176 @@ +/****************************************************************************** + * The MIT License + * + * Copyright (c) 2010 Perry Hung. + * Copyright (c) 2011, 2012 LeafLabs, LLC. + * + * 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. + *****************************************************************************/ + +/** + * @file wirish/syscalls.c + * @brief newlib stubs + * + * Low level system routines used by newlib for basic I/O and memory + * allocation. You can override most of these. + */ + +#include + +#include +#include +#include + +/* If CONFIG_HEAP_START (or CONFIG_HEAP_END) isn't defined, then + * assume _lm_heap_start (resp. _lm_heap_end) is appropriately set by + * the linker */ +#ifndef CONFIG_HEAP_START +extern char _lm_heap_start; +#define CONFIG_HEAP_START ((void *)&_lm_heap_start) +#endif +#ifndef CONFIG_HEAP_END +extern char _lm_heap_end; +#define CONFIG_HEAP_END ((void *)&_lm_heap_end) +#endif + +/* + * _sbrk -- Increment the program break. + * + * Get incr bytes more RAM (for use by the heap). malloc() and + * friends call this function behind the scenes. + */ +void *_sbrk(int incr) { + static void * pbreak = NULL; /* current program break */ + void * ret; + + if (pbreak == NULL) { + pbreak = CONFIG_HEAP_START; + } + + if ((CONFIG_HEAP_END - pbreak < incr) || + (pbreak - CONFIG_HEAP_START < -incr)) { + errno = ENOMEM; + return (void *)-1; + } + + ret = pbreak; + pbreak += incr; + return ret; +} + +__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) { + return 1; +} + +__weak int _close(int fd __attribute__((unused))) { + return 0; +} + +__weak int _fstat(int fd __attribute__((unused)), struct stat *st) { + st->st_mode = S_IFCHR; + return 0; +} + +__weak int _isatty(int fd __attribute__((unused))) { + return 1; +} + +__weak int isatty(int fd __attribute__((unused))) { + return 1; +} + +__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) { + return -1; +} + +__weak unsigned char getch(void) { + return 0; +} + + +__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) { + *buf = getch(); + + return 1; +} + +__weak void putch(unsigned char c __attribute__((unused))) { +} + +__weak void cgets(char *s, int bufsize) { + char *p; + int c; + int i; + + for (i = 0; i < bufsize; i++) { + *(s+i) = 0; + } +// memset(s, 0, bufsize); + + p = s; + + for (p = s; p < s + bufsize-1;) { + c = getch(); + switch (c) { + case '\r' : + case '\n' : + putch('\r'); + putch('\n'); + *p = '\n'; + return; + + case '\b' : + if (p > s) { + *p-- = 0; + putch('\b'); + putch(' '); + putch('\b'); + } + break; + + default : + putch(c); + *p++ = c; + break; + } + } + return; +} + +__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) { + int i; + + for (i = 0; i < cnt; i++) + putch(buf[i]); + + return cnt; +} + +/* Override fgets() in newlib with a version that does line editing */ +__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) { + cgets(s, bufsize); + return s; +} + +__weak void _exit(int exitcode __attribute__((unused))) { + while (1) + ; +} diff --git a/buildroot/share/PlatformIO/variants/FLY_F407ZG/PinNamesVar.h b/buildroot/share/PlatformIO/variants/FLY_F407ZG/PinNamesVar.h index f3c4f0ee07..b4bb9d45f8 100644 --- a/buildroot/share/PlatformIO/variants/FLY_F407ZG/PinNamesVar.h +++ b/buildroot/share/PlatformIO/variants/FLY_F407ZG/PinNamesVar.h @@ -1,50 +1,50 @@ /* SYS_WKUP */ #ifdef PWR_WAKEUP_PIN1 -SYS_WKUP1 = PA_0, + SYS_WKUP1 = PA_0, #endif #ifdef PWR_WAKEUP_PIN2 -SYS_WKUP2 = NC, + SYS_WKUP2 = NC, #endif #ifdef PWR_WAKEUP_PIN3 -SYS_WKUP3 = NC, + SYS_WKUP3 = NC, #endif #ifdef PWR_WAKEUP_PIN4 -SYS_WKUP4 = NC, + SYS_WKUP4 = NC, #endif #ifdef PWR_WAKEUP_PIN5 -SYS_WKUP5 = NC, + SYS_WKUP5 = NC, #endif #ifdef PWR_WAKEUP_PIN6 -SYS_WKUP6 = NC, + SYS_WKUP6 = NC, #endif #ifdef PWR_WAKEUP_PIN7 -SYS_WKUP7 = NC, + SYS_WKUP7 = NC, #endif #ifdef PWR_WAKEUP_PIN8 -SYS_WKUP8 = NC, + SYS_WKUP8 = NC, #endif /* USB */ #ifdef USBCON -USB_OTG_FS_SOF = PA_8, -USB_OTG_FS_VBUS = PA_9, -USB_OTG_FS_ID = PA_10, -USB_OTG_FS_DM = PA_11, -USB_OTG_FS_DP = PA_12, -USB_OTG_HS_ULPI_D0 = PA_3, -USB_OTG_HS_SOF = PA_4, -USB_OTG_HS_ULPI_CK = PA_5, -USB_OTG_HS_ULPI_D1 = PB_0, -USB_OTG_HS_ULPI_D2 = PB_1, -USB_OTG_HS_ULPI_D7 = PB_5, -USB_OTG_HS_ULPI_D3 = PB_10, -USB_OTG_HS_ULPI_D4 = PB_11, -USB_OTG_HS_ID = PB_12, -USB_OTG_HS_ULPI_D5 = PB_12, -USB_OTG_HS_ULPI_D6 = PB_13, -USB_OTG_HS_VBUS = PB_13, -USB_OTG_HS_DM = PB_14, -USB_OTG_HS_DP = PB_15, -USB_OTG_HS_ULPI_STP = PC_0, -USB_OTG_HS_ULPI_DIR = PC_2, -USB_OTG_HS_ULPI_NXT = PC_3, + USB_OTG_FS_SOF = PA_8, + USB_OTG_FS_VBUS = PA_9, + USB_OTG_FS_ID = PA_10, + USB_OTG_FS_DM = PA_11, + USB_OTG_FS_DP = PA_12, + USB_OTG_HS_ULPI_D0 = PA_3, + USB_OTG_HS_SOF = PA_4, + USB_OTG_HS_ULPI_CK = PA_5, + USB_OTG_HS_ULPI_D1 = PB_0, + USB_OTG_HS_ULPI_D2 = PB_1, + USB_OTG_HS_ULPI_D7 = PB_5, + USB_OTG_HS_ULPI_D3 = PB_10, + USB_OTG_HS_ULPI_D4 = PB_11, + USB_OTG_HS_ID = PB_12, + USB_OTG_HS_ULPI_D5 = PB_12, + USB_OTG_HS_ULPI_D6 = PB_13, + USB_OTG_HS_VBUS = PB_13, + USB_OTG_HS_DM = PB_14, + USB_OTG_HS_DP = PB_15, + USB_OTG_HS_ULPI_STP = PC_0, + USB_OTG_HS_ULPI_DIR = PC_2, + USB_OTG_HS_ULPI_NXT = PC_3, #endif diff --git a/buildroot/share/PlatformIO/variants/FYSETC_S6/PinNamesVar.h b/buildroot/share/PlatformIO/variants/FYSETC_S6/PinNamesVar.h index 77f1689b3d..bff3f21349 100644 --- a/buildroot/share/PlatformIO/variants/FYSETC_S6/PinNamesVar.h +++ b/buildroot/share/PlatformIO/variants/FYSETC_S6/PinNamesVar.h @@ -1,30 +1,30 @@ /* SYS_WKUP */ #ifdef PWR_WAKEUP_PIN1 -SYS_WKUP1 = PA_0, /* SYS_WKUP0 */ + SYS_WKUP1 = PA_0, /* SYS_WKUP0 */ #endif #ifdef PWR_WAKEUP_PIN2 -SYS_WKUP2 = NC, + SYS_WKUP2 = NC, #endif #ifdef PWR_WAKEUP_PIN3 -SYS_WKUP3 = NC, + SYS_WKUP3 = NC, #endif #ifdef PWR_WAKEUP_PIN4 -SYS_WKUP4 = NC, + SYS_WKUP4 = NC, #endif #ifdef PWR_WAKEUP_PIN5 -SYS_WKUP5 = NC, + SYS_WKUP5 = NC, #endif #ifdef PWR_WAKEUP_PIN6 -SYS_WKUP6 = NC, + SYS_WKUP6 = NC, #endif #ifdef PWR_WAKEUP_PIN7 -SYS_WKUP7 = NC, + SYS_WKUP7 = NC, #endif #ifdef PWR_WAKEUP_PIN8 -SYS_WKUP8 = NC, + SYS_WKUP8 = NC, #endif /* USB */ #ifdef USBCON -USB_OTG_FS_DM = PA_11, -USB_OTG_FS_DP = PA_12, + USB_OTG_FS_DM = PA_11, + USB_OTG_FS_DP = PA_12, #endif diff --git a/buildroot/share/PlatformIO/variants/FYSETC_S6/variant.h b/buildroot/share/PlatformIO/variants/FYSETC_S6/variant.h index de34697fb3..da6a8249ee 100644 --- a/buildroot/share/PlatformIO/variants/FYSETC_S6/variant.h +++ b/buildroot/share/PlatformIO/variants/FYSETC_S6/variant.h @@ -132,7 +132,7 @@ extern "C" { // Timer Definitions // Do not use timer used by PWM pin. See PinMap_PWM. #define TIMER_TONE TIM6 -#define TIMER_SERVO TIM2 +#define TIMER_SERVO TIM5 #define TIMER_SERIAL TIM7 // UART Definitions diff --git a/buildroot/share/PlatformIO/variants/LERDGE/PeripheralPins.c b/buildroot/share/PlatformIO/variants/LERDGE/PeripheralPins.c new file mode 100644 index 0000000000..8cb0776ffa --- /dev/null +++ b/buildroot/share/PlatformIO/variants/LERDGE/PeripheralPins.c @@ -0,0 +1,418 @@ +/* + ******************************************************************************* + * Copyright (c) 2019, STMicroelectronics + * 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. 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. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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. + ******************************************************************************* + * Automatically generated from STM32F407Z(E-G)Tx.xml + */ +#include +#include + +/* ===== + * Note: Commented lines are alternative possibilities which are not used per default. + * If you change them, you will have to know what you do + * ===== + */ + +//*** ADC *** + +#ifdef HAL_ADC_MODULE_ENABLED +const PinMap PinMap_ADC[] = { + {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0 + //{PA_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC2_IN0 + //{PA_0, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC3_IN0 + {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 + //{PA_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC2_IN1 + //{PA_1, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC3_IN1 + //{PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 + {PA_2, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC2_IN2 + //{PA_2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC3_IN2 + //{PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 + //{PA_3, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_IN3 + {PA_3, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC3_IN3 + {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 + //{PA_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_IN4 + //{PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 + {PA_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_IN5 + {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 + //{PA_6, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC2_IN6 + {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 + //{PA_7, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_IN7 + //{PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 + {PB_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC2_IN8 + {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 + //{PB_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC2_IN9 + //{PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 + //{PC_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_IN10 + {PC_0, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC3_IN10 + {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11 + //{PC_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_IN11 + //{PC_1, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC3_IN11 + //{PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12 + {PC_2, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC2_IN12 + //{PC_2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC3_IN12 + //{PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13 + //{PC_3, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC2_IN13 + {PC_3, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC3_IN13 + //{PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_IN14 + {PC_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC2_IN14 + //{PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15 + {PC_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC2_IN15 + {PF_3, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC3_IN9 + {PF_4, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC3_IN14 + {PF_5, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC3_IN15 + {PF_6, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC3_IN4 + {PF_7, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC3_IN5 + {PF_8, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC3_IN6 + //{PF_9, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC3_IN7 + {PF_10, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC3_IN8 + {NC, NP, 0} +}; +#endif + +//*** DAC *** + +#ifdef HAL_DAC_MODULE_ENABLED +const PinMap PinMap_DAC[] = { + {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1 + {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 + {NC, NP, 0} +}; +#endif + +//*** I2C *** + +#ifdef HAL_I2C_MODULE_ENABLED +const PinMap PinMap_I2C_SDA[] = { + {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PC_9, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + {PF_0, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_I2C_MODULE_ENABLED +const PinMap PinMap_I2C_SCL[] = { + {PA_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PF_1, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {NC, NP, 0} +}; +#endif + +//*** PWM *** + +#ifdef HAL_TIM_MODULE_ENABLED +const PinMap PinMap_PWM[] = { + {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + //{PA_0, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 + {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + //{PA_1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 + {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 + //{PA_2, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 + //{PA_2, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 + {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + //{PA_3, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 + //{PA_3, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 + {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + //{PA_5, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N + {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + //{PA_6, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1 + //{PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + {PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + //{PA_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N + //{PA_7, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1 + {PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 + {PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 + {PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 + {PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 + //{PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + //{PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + //{PB_0, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N + //{PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + //{PB_1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N + //{PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + {PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + {PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 + {PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 + {PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 + {PB_8, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 + {PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + {PB_9, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 + {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 + {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + {PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + {PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + {PB_14, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N + {PB_14, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 1, 0)}, // TIM12_CH1 + {PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + {PB_15, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N + {PB_15, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 2, 0)}, // TIM12_CH2 + {PC_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + {PC_6, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 0)}, // TIM8_CH1 + {PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + {PC_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2 + {PC_8, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + {PC_8, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 0)}, // TIM8_CH3 + {PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + {PC_9, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4 + {PD_12, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 + {PD_13, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 + {PD_14, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 + {PD_15, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + {PE_5, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 + {PE_6, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 + {PE_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + {PE_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 + {PE_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + {PE_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 + {PE_12, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + {PE_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 + {PE_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 + {PF_6, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 + {PF_7, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 + {PF_8, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1 + {PF_9, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1 + {NC, NP, 0} +}; +#endif + +//*** SERIAL *** + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_TX[] = { + {PA_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PC_6, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + //{PC_10, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PC_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PC_12, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, + {PD_5, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PD_8, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PG_14, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_RX[] = { + {PA_1, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PC_7, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + //{PC_11, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PC_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PD_2, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, + {PD_6, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PD_9, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PG_9, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_RTS[] = { + {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PD_4, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PD_12, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PG_8, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + {PG_12, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_CTS[] = { + {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PD_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PD_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PG_13, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + {PG_15, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + {NC, NP, 0} +}; +#endif + +//*** SPI *** + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_MOSI[] = { + {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_5, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_3, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_12, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_MISO[] = { + {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_2, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_11, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_SCLK[] = { + {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_3, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PB_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_10, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_SSEL[] = { + {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PA_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PA_15, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PB_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {NC, NP, 0} +}; +#endif + +//*** CAN *** + +#ifdef HAL_CAN_MODULE_ENABLED +const PinMap PinMap_CAN_RD[] = { + {PA_11, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, + {PB_5, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, + {PB_8, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, + {PB_12, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, + {PD_0, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_CAN_MODULE_ENABLED +const PinMap PinMap_CAN_TD[] = { + {PA_12, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, + {PB_6, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, + {PB_9, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, + {PB_13, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, + {PD_1, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, + {NC, NP, 0} +}; +#endif + +//*** ETHERNET *** + +#ifdef HAL_ETH_MODULE_ENABLED +const PinMap PinMap_Ethernet[] = { + {PA_0, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_CRS + {PA_1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_REF_CLK|ETH_RX_CLK + {PA_2, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_MDIO + {PA_3, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_COL + {PA_7, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_CRS_DV|ETH_RX_DV + {PB_0, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD2 + {PB_1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD3 + {PB_5, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_PPS_OUT + {PB_8, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD3 + {PB_10, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RX_ER + {PB_11, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_EN + {PB_12, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD0 + {PB_13, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD1 + {PC_1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_MDC + {PC_2, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD2 + {PC_3, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_CLK + {PC_4, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD0 + {PC_5, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD1 + {PE_2, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD3 + {PG_8, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_PPS_OUT + {PG_11, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_EN + {PG_13, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD0 + {PG_14, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD1 + {NC, NP, 0} +}; +#endif + +//*** No QUADSPI *** + +//*** USB *** + +#ifdef HAL_PCD_MODULE_ENABLED +const PinMap PinMap_USB_OTG_FS[] = { + //{PA_8, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF + //{PA_9, USB_OTG_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS + //{PA_10, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID + {PA_11, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM + {PA_12, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP + {NC, NP, 0} +}; +#endif + +#ifdef HAL_PCD_MODULE_ENABLED +const PinMap PinMap_USB_OTG_HS[] = { +#ifdef USE_USB_HS_IN_FS + {PA_4, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_SOF + {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_ID + {PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_HS_VBUS + {PB_14, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_DM + {PB_15, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_DP +#else + {PA_3, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D0 + {PA_5, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_CK + {PB_0, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D1 + {PB_1, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D2 + {PB_5, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D7 + {PB_10, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D3 + {PB_11, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D4 + {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D5 + {PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D6 + {PC_0, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_STP + {PC_2, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_DIR + {PC_3, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_NXT +#endif /* USE_USB_HS_IN_FS */ + {NC, NP, 0} +}; +#endif diff --git a/buildroot/share/PlatformIO/variants/LERDGE/PinNamesVar.h b/buildroot/share/PlatformIO/variants/LERDGE/PinNamesVar.h new file mode 100644 index 0000000000..b4bb9d45f8 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/LERDGE/PinNamesVar.h @@ -0,0 +1,50 @@ +/* SYS_WKUP */ +#ifdef PWR_WAKEUP_PIN1 + SYS_WKUP1 = PA_0, +#endif +#ifdef PWR_WAKEUP_PIN2 + SYS_WKUP2 = NC, +#endif +#ifdef PWR_WAKEUP_PIN3 + SYS_WKUP3 = NC, +#endif +#ifdef PWR_WAKEUP_PIN4 + SYS_WKUP4 = NC, +#endif +#ifdef PWR_WAKEUP_PIN5 + SYS_WKUP5 = NC, +#endif +#ifdef PWR_WAKEUP_PIN6 + SYS_WKUP6 = NC, +#endif +#ifdef PWR_WAKEUP_PIN7 + SYS_WKUP7 = NC, +#endif +#ifdef PWR_WAKEUP_PIN8 + SYS_WKUP8 = NC, +#endif +/* USB */ +#ifdef USBCON + USB_OTG_FS_SOF = PA_8, + USB_OTG_FS_VBUS = PA_9, + USB_OTG_FS_ID = PA_10, + USB_OTG_FS_DM = PA_11, + USB_OTG_FS_DP = PA_12, + USB_OTG_HS_ULPI_D0 = PA_3, + USB_OTG_HS_SOF = PA_4, + USB_OTG_HS_ULPI_CK = PA_5, + USB_OTG_HS_ULPI_D1 = PB_0, + USB_OTG_HS_ULPI_D2 = PB_1, + USB_OTG_HS_ULPI_D7 = PB_5, + USB_OTG_HS_ULPI_D3 = PB_10, + USB_OTG_HS_ULPI_D4 = PB_11, + USB_OTG_HS_ID = PB_12, + USB_OTG_HS_ULPI_D5 = PB_12, + USB_OTG_HS_ULPI_D6 = PB_13, + USB_OTG_HS_VBUS = PB_13, + USB_OTG_HS_DM = PB_14, + USB_OTG_HS_DP = PB_15, + USB_OTG_HS_ULPI_STP = PC_0, + USB_OTG_HS_ULPI_DIR = PC_2, + USB_OTG_HS_ULPI_NXT = PC_3, +#endif diff --git a/buildroot/share/PlatformIO/variants/LERDGE/variant.cpp b/buildroot/share/PlatformIO/variants/LERDGE/variant.cpp new file mode 100644 index 0000000000..ebc1922eb8 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/LERDGE/variant.cpp @@ -0,0 +1,297 @@ +/* + ******************************************************************************* + * Copyright (c) 2017, STMicroelectronics + * 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. 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. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 "pins_arduino.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +const PinName digitalPin[] = { + PB_12, + PB_13, + PB_14, + PB_15, + PD_8, + PD_9, + PD_10, + PD_11, + PD_12, + PD_13, + PD_14, + PD_15, + PG_2, + PG_3, + PG_4, + PG_5, + PG_6, + PG_7, + PG_8, + PC_6, + PC_7, + PC_8, + PC_9, + PA_8, + PA_9, + PA_10, + PA_11, + PA_12, + PA_13, + PA_14, + PA_15, + PC_10, + PC_11, + PC_12, + PD_0, + PD_1, + PD_2, + PD_3, + PD_4, + PD_5, + PD_6, + PD_7, + PG_9, + PG_10, + PG_11, + PG_12, + PG_13, + PG_14, + PG_15, + PB_3, + PB_4, + PB_5, + PB_6, + PB_7, + PB_8, + PB_9, + PB_10, + PB_11, + PE_14, + PE_15, + PE_12, + PE_13, + PE_10, + PE_11, + PE_8, + PE_9, + PG_1, + PE_7, + PF_15, + PG_0, + PF_13, + PF_14, + PF_11, + PF_12, + PB_2, + PB_1, + PC_5, + PB_0, + PA_7, + PC_4, + PA_5, + PA_6, + PA_3, + PA_4, + PA_1, + PA_2, + PC_3, + PA_0, + PC_1, + PC_2, + PC_0, + PF_8, + PF_6, + PF_7, + PF_9, + PF_10, + PF_4, + PF_5, + PF_2, + PF_3, + PF_0, + PF_1, + PE_6, + PC_13, + PE_4, + PE_5, + PE_2, + PE_3, + PE_0, + PE_1, + PC_14, + PC_15, +}; + +#ifdef __cplusplus +} +#endif + +// ---------------------------------------------------------------------------- + +#ifdef __cplusplus +extern "C" { +#endif + +#define __fatal_error(X) + + +/** + * @brief System Clock Configuration + * + * The system Clock is configured for F4/F7 as follows: + * System Clock source = PLL (HSE) + * SYSCLK(Hz) = 168000000 + * HCLK(Hz) = 168000000 + * AHB Prescaler = 1 + * APB1 Prescaler = 4 + * APB2 Prescaler = 2 + * HSE Frequency(Hz) = HSE_VALUE + * PLL_M = HSE_VALUE/1000000 + * PLL_N = 336 + * PLL_P = 2 + * PLL_Q = 7 + * VDD(V) = 3.3 + * Main regulator output voltage = Scale1 mode + * Flash Latency(WS) = 5 + * + * The system Clock is configured for L4 as follows: + * System Clock source = PLL (MSI) + * SYSCLK(Hz) = 80000000 + * HCLK(Hz) = 80000000 + * AHB Prescaler = 1 + * APB1 Prescaler = 1 + * APB2 Prescaler = 1 + * MSI Frequency(Hz) = MSI_VALUE (4000000) + * LSE Frequency(Hz) = 32768 + * PLL_M = 1 + * PLL_N = 40 + * PLL_P = 7 + * PLL_Q = 2 + * PLL_R = 2 <= This is the source for SysClk, not as on F4/7 PLL_P + * Flash Latency(WS) = 4 + * @param None + * @retval None + * + * PLL is configured as follows: + * + * VCO_IN + * F4/F7 = HSE / M + * L4 = MSI / M + * VCO_OUT + * F4/F7 = HSE / M * N + * L4 = MSI / M * N + * PLLCLK + * F4/F7 = HSE / M * N / P + * L4 = MSI / M * N / R + * PLL48CK + * F4/F7 = HSE / M * N / Q + * L4 = MSI / M * N / Q USB Clock is obtained over PLLSAI1 + * + * SYSCLK = PLLCLK + * HCLK = SYSCLK / AHB_PRESC + * PCLKx = HCLK / APBx_PRESC + * + * Constraints on parameters: + * + * VCO_IN between 1MHz and 2MHz (2MHz recommended) + * VCO_OUT between 192MHz and 432MHz + * HSE = 8MHz + * M = 2 .. 63 (inclusive) + * N = 192 ... 432 (inclusive) + * P = 2, 4, 6, 8 + * Q = 2 .. 15 (inclusive) + * + * AHB_PRESC=1,2,4,8,16,64,128,256,512 + * APBx_PRESC=1,2,4,8,16 + * + * Output clocks: + * + * CPU SYSCLK max 168MHz + * USB,RNG,SDIO PLL48CK must be 48MHz for USB + * AHB HCLK max 168MHz + * APB1 PCLK1 max 42MHz + * APB2 PCLK2 max 84MHz + * + * Timers run from APBx if APBx_PRESC=1, else 2x APBx + */ +void SystemClock_Config(void) +{ + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; + + __PWR_CLK_ENABLE(); + + /* The voltage scaling allows optimizing the power consumption when the device is + clocked below the maximum system frequency, to update the voltage scaling value + regarding system frequency refer to product datasheet. */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + + /* Enable HSE Oscillator and activate PLL with HSE as source */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.HSIState = RCC_HSI_OFF; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 + clocks dividers */ + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + + RCC_OscInitStruct.PLL.PLLM = 25; + RCC_OscInitStruct.PLL.PLLN = 336; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; + RCC_OscInitStruct.PLL.PLLQ = 7; + + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; + + if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + __fatal_error("HAL_RCC_OscConfig"); + } + + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) + { + __fatal_error("HAL_RCC_ClockConfig"); + } + + /**Configure the Systick interrupt time */ + HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); + + /**Configure the Systick */ + HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); + + /* SysTick_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); +} + +#ifdef __cplusplus +} +#endif diff --git a/buildroot/share/PlatformIO/variants/LERDGE/variant.h b/buildroot/share/PlatformIO/variants/LERDGE/variant.h new file mode 100644 index 0000000000..87033a68e5 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/LERDGE/variant.h @@ -0,0 +1,238 @@ +/* + ******************************************************************************* + * Copyright (c) 2017, STMicroelectronics + * 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. 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. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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. + ******************************************************************************* + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ + +// Left Side +#define PB12 0 +#define PB13 1 +#define PB14 2 +#define PB15 3 +#define PD8 4 +#define PD9 5 +#define PD10 6 +#define PD11 7 +#define PD12 8 +#define PD13 9 +#define PD14 10 +#define PD15 11 +#define PG2 12 +#define PG3 13 +#define PG4 14 +#define PG5 15 +#define PG6 16 +#define PG7 17 +#define PG8 18 +#define PC6 19 +#define PC7 20 +#define PC8 21 +#define PC9 22 +#define PA8 23 +#define PA9 24 +#define PA10 25 +#define PA11 26 // USB_DM +#define PA12 27 // USB_DP +#define PA13 28 +#define PA14 29 +#define PA15 30 +#define PC10 31 +#define PC11 32 +#define PC12 33 +#define PD0 34 +#define PD1 35 +#define PD2 36 +#define PD3 37 +#define PD4 38 +#define PD5 39 +#define PD6 40 +#define PD7 41 +#define PG9 42 +#define PG10 43 +#define PG11 44 +#define PG12 45 +#define PG13 46 +#define PG14 47 +#define PG15 48 +#define PB3 49 +#define PB4 50 +#define PB5 51 +#define PB6 52 +#define PB7 53 +#define PB8 54 +#define PB9 55 + +// Right Side +#define PB10 56 +#define PB11 57 +#define PE14 58 +#define PE15 59 +#define PE12 60 +#define PE13 61 +#define PE10 62 +#define PE11 63 +#define PE8 64 +#define PE9 65 +#define PG1 66 +#define PE7 67 +#define PF15 68 +#define PG0 69 +#define PF13 70 +#define PF14 71 +#define PF11 72 +#define PF12 73 +#define PB2 74 +#define PB1 75 // A0 +#define PC5 76 // A1 +#define PB0 77 // A2 +#define PA7 78 // A3 +#define PC4 79 // A4 +#define PA5 80 // A5 +#define PA6 81 // A6 +#define PA3 82 // A7 +#define PA4 83 // A8 +#define PA1 84 // A9 +#define PA2 85 // A10 +#define PC3 86 // A11 +#define PA0 87 // A12/PA_0(WK_UP): BUT K_UP) +#define PC1 88 // A13 +#define PC2 89 // A14 +#define PC0 90 // A15 +#define PF8 91 // A16 +#define PF6 92 // A17 +#define PF7 93 // A18 +#define PF9 94 // LED D1 (active low) +#define PF10 95 // LED D2 (active low) +#define PF4 96 +#define PF5 97 +#define PF2 98 +#define PF3 99 +#define PF0 100 +#define PF1 101 +#define PE6 102 +#define PC13 103 +#define PE4 104 // BUT K0 +#define PE5 105 // BUT K1 +#define PE2 106 +#define PE3 107 +#define PE0 108 +#define PE1 109 +#define PC14 110 +#define PC15 111 +// This must be a literal +#define NUM_DIGITAL_PINS 112 +// This must be a literal with a value less than or equal to MAX_ANALOG_INPUTS +#define NUM_ANALOG_INPUTS 23 +#define NUM_ANALOG_FIRST 75 + + +// Below SPI and I2C definitions already done in the core +// Could be redefined here if differs from the default one +// SPI Definitions +#define PIN_SPI_SS PF11 +#define PIN_SPI_MOSI PB15 +#define PIN_SPI_MISO PB14 +#define PIN_SPI_SCK PB13 + + + +//max6675 +//#define PIN_SPI_SS PA4 +//#define PIN_SPI_SCK PA5 +//#define PIN_SPI_MISO PA6 +//#define PIN_SPI_MOSI PA7 + + + + +// I2C Definitions +#define PIN_WIRE_SDA PB7 +#define PIN_WIRE_SCL PB6 + +// Timer Definitions +//Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c +#define TIMER_TONE TIM6 + +// Do not use basic timer: OC is required +#define TIMER_SERVO TIM1 //TODO: advanced-control timers don't work + +// UART Definitions +// Define here Serial instance number to map on Serial generic name +#define SERIAL_UART_INSTANCE 1 //ex: 2 for Serial2 (USART2) +// DEBUG_UART could be redefined to print on another instance than 'Serial' +//#define DEBUG_UART ((USART_TypeDef *) U(S)ARTX) // ex: USART3 +// DEBUG_UART baudrate, default: 9600 if not defined +//#define DEBUG_UART_BAUDRATE x +// DEBUG_UART Tx pin name, default: the first one found in PinMap_UART_TX for DEBUG_UART +//#define DEBUG_PINNAME_TX PX_n // PinName used for TX + +// Default pin used for 'Serial' instance (ex: ST-Link) +// Mandatory for Firmata +#define PIN_SERIAL_RX PA10 +#define PIN_SERIAL_TX PA9 + +/* Extra HAL modules */ +//#define HAL_DAC_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED + +#ifdef __cplusplus +} // extern "C" +#endif +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_MONITOR Serial +#define SERIAL_PORT_HARDWARE Serial1 +#endif + diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/PinNamesVar.h index f3c4f0ee07..b4bb9d45f8 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/PinNamesVar.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/PinNamesVar.h @@ -1,50 +1,50 @@ /* SYS_WKUP */ #ifdef PWR_WAKEUP_PIN1 -SYS_WKUP1 = PA_0, + SYS_WKUP1 = PA_0, #endif #ifdef PWR_WAKEUP_PIN2 -SYS_WKUP2 = NC, + SYS_WKUP2 = NC, #endif #ifdef PWR_WAKEUP_PIN3 -SYS_WKUP3 = NC, + SYS_WKUP3 = NC, #endif #ifdef PWR_WAKEUP_PIN4 -SYS_WKUP4 = NC, + SYS_WKUP4 = NC, #endif #ifdef PWR_WAKEUP_PIN5 -SYS_WKUP5 = NC, + SYS_WKUP5 = NC, #endif #ifdef PWR_WAKEUP_PIN6 -SYS_WKUP6 = NC, + SYS_WKUP6 = NC, #endif #ifdef PWR_WAKEUP_PIN7 -SYS_WKUP7 = NC, + SYS_WKUP7 = NC, #endif #ifdef PWR_WAKEUP_PIN8 -SYS_WKUP8 = NC, + SYS_WKUP8 = NC, #endif /* USB */ #ifdef USBCON -USB_OTG_FS_SOF = PA_8, -USB_OTG_FS_VBUS = PA_9, -USB_OTG_FS_ID = PA_10, -USB_OTG_FS_DM = PA_11, -USB_OTG_FS_DP = PA_12, -USB_OTG_HS_ULPI_D0 = PA_3, -USB_OTG_HS_SOF = PA_4, -USB_OTG_HS_ULPI_CK = PA_5, -USB_OTG_HS_ULPI_D1 = PB_0, -USB_OTG_HS_ULPI_D2 = PB_1, -USB_OTG_HS_ULPI_D7 = PB_5, -USB_OTG_HS_ULPI_D3 = PB_10, -USB_OTG_HS_ULPI_D4 = PB_11, -USB_OTG_HS_ID = PB_12, -USB_OTG_HS_ULPI_D5 = PB_12, -USB_OTG_HS_ULPI_D6 = PB_13, -USB_OTG_HS_VBUS = PB_13, -USB_OTG_HS_DM = PB_14, -USB_OTG_HS_DP = PB_15, -USB_OTG_HS_ULPI_STP = PC_0, -USB_OTG_HS_ULPI_DIR = PC_2, -USB_OTG_HS_ULPI_NXT = PC_3, + USB_OTG_FS_SOF = PA_8, + USB_OTG_FS_VBUS = PA_9, + USB_OTG_FS_ID = PA_10, + USB_OTG_FS_DM = PA_11, + USB_OTG_FS_DP = PA_12, + USB_OTG_HS_ULPI_D0 = PA_3, + USB_OTG_HS_SOF = PA_4, + USB_OTG_HS_ULPI_CK = PA_5, + USB_OTG_HS_ULPI_D1 = PB_0, + USB_OTG_HS_ULPI_D2 = PB_1, + USB_OTG_HS_ULPI_D7 = PB_5, + USB_OTG_HS_ULPI_D3 = PB_10, + USB_OTG_HS_ULPI_D4 = PB_11, + USB_OTG_HS_ID = PB_12, + USB_OTG_HS_ULPI_D5 = PB_12, + USB_OTG_HS_ULPI_D6 = PB_13, + USB_OTG_HS_VBUS = PB_13, + USB_OTG_HS_DM = PB_14, + USB_OTG_HS_DP = PB_15, + USB_OTG_HS_ULPI_STP = PC_0, + USB_OTG_HS_ULPI_DIR = PC_2, + USB_OTG_HS_ULPI_NXT = PC_3, #endif diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/board.cpp b/buildroot/share/PlatformIO/variants/MEEB_3DP/board.cpp new file mode 100644 index 0000000000..5ddeb1f1d9 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/board.cpp @@ -0,0 +1,161 @@ +/****************************************************************************** + * The MIT License + * + * Copyright (c) 2011 LeafLabs, LLC. + * + * 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. + *****************************************************************************/ + +/** + * @file wirish/boards/maple/board.cpp + * @author Marti Bolivar + * @brief Maple board file. + */ + +#include // For this board's header file + + +/* Roger Clark. Added next to includes for changes to Serial */ +#include +#include + +#include // For stm32_pin_info and its contents + // (these go into PIN_MAP). + +#include "boards_private.h" // For PMAP_ROW(), which makes + // PIN_MAP easier to read. + +// boardInit(): nothing special to do for Maple. +// +// When defining your own board.cpp, you can put extra code in this +// function if you have anything you want done on reset, before main() +// or setup() are called. +// +// If there's nothing special you need done, feel free to leave this +// function out, as we do here. + +void boardInit(void) { + // afio_remap(AFIO_REMAP_I2C1); +} + +// Pin map: this lets the basic I/O functions (digitalWrite(), +// analogRead(), pwmWrite()) translate from pin numbers to STM32 +// peripherals. +// +// PMAP_ROW() lets us specify a row (really a struct stm32_pin_info) +// in the pin map. Its arguments are: +// +// - GPIO device for the pin (&gpioa, etc.) +// - GPIO bit for the pin (0 through 15) +// - Timer device, or NULL if none +// - Timer channel (1 to 4, for PWM), or 0 if none +// - ADC device, or NULL if none +// - ADC channel, or ADCx if none + +extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = { + /* + gpio_dev *gpio_device; GPIO device + timer_dev *timer_device; Pin's timer device, if any. + const adc_dev *adc_device; ADC device, if any. + uint8 gpio_bit; Pin's GPIO port bit. + uint8 timer_channel; Timer channel, or 0 if none. + uint8 adc_channel; Pin ADC channel, or ADCx if none. + */ + + {&gpioa, &timer2, &adc1, 0, 1, 0}, /* PA0 */ + {&gpioa, &timer2, &adc1, 1, 2, 1}, /* PA1 */ + {&gpioa, &timer2, &adc1, 2, 3, 2}, /* PA2 */ + {&gpioa, &timer2, &adc1, 3, 4, 3}, /* PA3 */ + {&gpioa, NULL, &adc1, 4, 0, 4}, /* PA4 */ + {&gpioa, NULL, &adc1, 5, 0, 5}, /* PA5 */ + {&gpioa, &timer3, &adc1, 6, 1, 6}, /* PA6 */ + {&gpioa, &timer3, &adc1, 7, 2, 7}, /* PA7 */ + {&gpioa, &timer1, NULL, 8, 1, ADCx}, /* PA8 */ + {&gpioa, &timer1, NULL, 9, 2, ADCx}, /* PA9 */ + {&gpioa, &timer1, NULL, 10, 3, ADCx}, /* PA10 */ + {&gpioa, NULL, NULL, 11, 0, ADCx}, /* PA11 */ + {&gpioa, NULL, NULL, 12, 0, ADCx}, /* PA12 */ + {&gpioa, NULL, NULL, 13, 0, ADCx}, /* PA13 */ + {&gpioa, NULL, NULL, 14, 0, ADCx}, /* PA14 */ + {&gpioa, NULL, NULL, 15, 0, ADCx}, /* PA15 */ + + {&gpiob, &timer3, &adc1, 0, 3, 8}, /* PB0 */ + {&gpiob, &timer3, &adc1, 1, 4, 9}, /* PB1 */ + {&gpiob, NULL, NULL, 2, 0, ADCx}, /* PB2 */ + {&gpiob, NULL, NULL, 3, 0, ADCx}, /* PB3 */ + {&gpiob, NULL, NULL, 4, 0, ADCx}, /* PB4 */ + {&gpiob, NULL, NULL, 5, 0, ADCx}, /* PB5 */ + {&gpiob, &timer4, NULL, 6, 1, ADCx}, /* PB6 */ + {&gpiob, &timer4, NULL, 7, 2, ADCx}, /* PB7 */ + {&gpiob, &timer4, NULL, 8, 3, ADCx}, /* PB8 */ + {&gpiob, NULL, NULL, 9, 0, ADCx}, /* PB9 */ + {&gpiob, NULL, NULL, 10, 0, ADCx}, /* PB10 */ + {&gpiob, NULL, NULL, 11, 0, ADCx}, /* PB11 */ + {&gpiob, NULL, NULL, 12, 0, ADCx}, /* PB12 */ + {&gpiob, NULL, NULL, 13, 0, ADCx}, /* PB13 */ + {&gpiob, NULL, NULL, 14, 0, ADCx}, /* PB14 */ + {&gpiob, NULL, NULL, 15, 0, ADCx}, /* PB15 */ + + + {&gpioc, NULL, &adc1, 0, 0, 10}, /* PC0 */ + {&gpioc, NULL, &adc1, 1, 0, 11}, /* PC1 */ + {&gpioc, NULL, &adc1, 2, 0, 12}, /* PC2 */ + {&gpioc, NULL, &adc1, 3, 0, 13}, /* PC3 */ + {&gpioc, NULL, &adc1, 4, 0, 14}, /* PC4 */ + {&gpioc, NULL, &adc1, 5, 0, 15}, /* PC5 */ + {&gpioc, &timer8, NULL, 6, 1, ADCx}, /* PC6 */ + {&gpioc, &timer8, NULL, 7, 2, ADCx}, /* PC7 */ + {&gpioc, &timer8, NULL, 8, 3, ADCx}, /* PC8 */ + {&gpioc, &timer8, NULL, 9, 4, ADCx}, /* PC9 */ + {&gpioc, NULL, NULL, 10, 0, ADCx}, /* PC10 UART4_TX/SDIO_D2 */ + {&gpioc, NULL, NULL, 11, 0, ADCx}, /* PC11 UART4_RX/SDIO_D3 */ + {&gpioc, NULL, NULL, 12, 0, ADCx}, /* PC12 UART5_TX/SDIO_CK */ + {&gpioc, NULL, NULL, 13, 0, ADCx}, /* PC13 TAMPER-RTC */ + {&gpioc, NULL, NULL, 14, 0, ADCx}, /* PC14 OSC32_IN */ + {&gpioc, NULL, NULL, 15, 0, ADCx}, /* PC15 OSC32_OUT */ + + {&gpiod, NULL, NULL, 0, 0, ADCx} , /* PD0 OSC_IN */ + {&gpiod, NULL, NULL, 1, 0, ADCx} , /* PD1 OSC_OUT */ + {&gpiod, NULL, NULL, 2, 0, ADCx} , /* PD2 TIM3_ETR/UART5_RX SDIO_CMD */ +}; + +/* Basically everything that is defined as having a timer us PWM */ +extern const uint8 boardPWMPins[BOARD_NR_PWM_PINS] __FLASH__ = { + PA0,PA1,PA2,PA3,PA6,PA7,PA8,PA9,PA10,PB0,PB1,PB6,PB7,PB8,PB9,PC6,PC7,PC8,PC9 +}; + +/* Basically everything that is defined having ADC */ +extern const uint8 boardADCPins[BOARD_NR_ADC_PINS] __FLASH__ = { + PA0,PA1,PA2,PA3,PA4,PA5,PA6,PA7,PB0,PB1,PC0,PC1,PC2,PC3,PC4,PC5 +}; + +/* not sure what this us used for */ +extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = { + BOARD_JTMS_SWDIO_PIN, + BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN +}; + +DEFINE_HWSERIAL(Serial1, 1); +DEFINE_HWSERIAL(Serial2, 2); +DEFINE_HWSERIAL(Serial3, 3); +DEFINE_HWSERIAL_UART(Serial4, 4); +DEFINE_HWSERIAL_UART(Serial5, 5); + diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/board/board.h b/buildroot/share/PlatformIO/variants/MEEB_3DP/board/board.h new file mode 100644 index 0000000000..da9ffd893f --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/board/board.h @@ -0,0 +1,125 @@ +/****************************************************************************** + * The MIT License + * + * Copyright (c) 2011 LeafLabs, LLC. + * + * 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. + *****************************************************************************/ + +/** + * @file maple_RET6.h + * @author Marti Bolivar + * @brief Private include file for Maple RET6 Edition in boards.h + * + * See maple.h for more information on these definitions. + */ + +#ifndef _BOARDS_GENERIC_STM32F103R_H_ +#define _BOARDS_GENERIC_STM32F103R_H_ + +/* A few of these values will seem strange given that it's a + * high-density board. */ + +#define CYCLES_PER_MICROSECOND 72 +#define SYSTICK_RELOAD_VAL (F_CPU/1000) - 1 /* takes a cycle to reload */ + +// USARTS +#define BOARD_NR_USARTS 5 +#define BOARD_USART1_TX_PIN PA9 +#define BOARD_USART1_RX_PIN PA10 + +#define BOARD_USART2_TX_PIN PA2 +#define BOARD_USART2_RX_PIN PA3 + +#define BOARD_USART3_TX_PIN PB10 +#define BOARD_USART3_RX_PIN PB11 + +#define BOARD_USART4_TX_PIN PC10 +#define BOARD_USART4_RX_PIN PC11 + +#define BOARD_USART5_TX_PIN PC12 +#define BOARD_USART5_RX_PIN PD2 + +/* Note: + * + * SPI3 is unusable due to pin 43 (PB4) and NRST tie-together :(, but + * leave the definitions so as not to clutter things up. This is only + * OK since RET6 Ed. is specifically advertised as a beta board. */ +#define BOARD_NR_SPI 3 +#define BOARD_SPI1_NSS_PIN PA4 +#define BOARD_SPI1_SCK_PIN PA5 +#define BOARD_SPI1_MISO_PIN PA6 +#define BOARD_SPI1_MOSI_PIN PA7 + + + +#define BOARD_SPI2_NSS_PIN PB12 +#define BOARD_SPI2_SCK_PIN PB13 +#define BOARD_SPI2_MISO_PIN PB14 +#define BOARD_SPI2_MOSI_PIN PB15 + + +#define BOARD_SPI3_NSS_PIN PA15 +#define BOARD_SPI3_SCK_PIN PB3 +#define BOARD_SPI3_MISO_PIN PB4 +#define BOARD_SPI3_MOSI_PIN PB5 + + +/* GPIO A to E = 5 * 16 - BOOT1 not used = 79*/ +#define BOARD_NR_GPIO_PINS 51 +/* Note: NOT 19. The missing one is D38 a.k.a. BOARD_BUTTON_PIN, which + * isn't broken out to a header and is thus unusable for PWM. */ +#define BOARD_NR_PWM_PINS 19 +#define BOARD_NR_ADC_PINS 16 +#define BOARD_NR_USED_PINS 7 + +#define BOARD_JTMS_SWDIO_PIN 39 +#define BOARD_JTCK_SWCLK_PIN 40 +#define BOARD_JTDI_PIN 41 +#define BOARD_JTDO_PIN 42 +#define BOARD_NJTRST_PIN 43 + +/* USB configuration. BOARD_USB_DISC_DEV is the GPIO port containing + * the USB_DISC pin, and BOARD_USB_DISC_BIT is that pin's bit. */ +#define BOARD_USB_DISC_DEV GPIOC +#define BOARD_USB_DISC_BIT 12 + +/* + * SDIO Pins + */ +#define BOARD_SDIO_D0 PC8 +#define BOARD_SDIO_D1 PC9 +#define BOARD_SDIO_D2 PC10 +#define BOARD_SDIO_D3 PC11 +#define BOARD_SDIO_CLK PC12 +#define BOARD_SDIO_CMD PD2 + +/* Pin aliases: these give the GPIO port/bit for each pin as an + * enum. These are optional, but recommended. They make it easier to + * write code using low-level GPIO functionality. */ +enum { +PA0,PA1,PA2,PA3,PA4,PA5,PA6,PA7,PA8,PA9,PA10,PA11,PA12,PA13,PA14,PA15, +PB0,PB1,PB2,PB3,PB4,PB5,PB6,PB7,PB8,PB9,PB10,PB11,PB12,PB13,PB14,PB15, +PC0,PC1,PC2,PC3,PC4,PC5,PC6,PC7,PC8,PC9,PC10,PC11,PC12,PC13,PC14,PC15, +PD0,PD1,PD2 +};/* Note PB2 is skipped as this is Boot1 and is not going to be much use as its likely to be pulled permanently low */ + +#endif diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/bootloader.ld b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/bootloader.ld new file mode 100644 index 0000000000..ca56532fdd --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/bootloader.ld @@ -0,0 +1,18 @@ +/* + * Linker script for Generic STM32F103RE boards, using the generic bootloader (which takes the lower 8k of memory) + */ +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K + rom (rx) : ORIGIN = 0x08002000, LENGTH = 504K +} + + +/* Provide memory region aliases for common.inc */ +REGION_ALIAS("REGION_TEXT", rom); +REGION_ALIAS("REGION_DATA", ram); +REGION_ALIAS("REGION_BSS", ram); +REGION_ALIAS("REGION_RODATA", rom); + +/* Let common.inc handle the real work. */ +INCLUDE common.inc diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/common.inc b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/common.inc new file mode 100644 index 0000000000..e086a58bca --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/common.inc @@ -0,0 +1,220 @@ +/* + * Linker script for libmaple. + * + * Original author "lanchon" from ST forums, with modifications by LeafLabs. + */ + +OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") + +/* + * Configure other libraries we want in the link. + * + * libgcc, libc, and libm are common across supported toolchains. + * However, some toolchains require additional archives which aren't + * present everywhere (e.g. ARM's gcc-arm-embedded releases). + * + * To hack around this, we let the build system specify additional + * archives by putting the right extra_libs.inc (in a directory under + * toolchains/) in our search path. + */ +GROUP(libgcc.a libc.a libm.a) +INCLUDE extra_libs.inc + +/* + * These force the linker to search for vector table symbols. + * + * These symbols vary by STM32 family (and also within families). + * It's up to the build system to configure the link's search path + * properly for the target MCU. + */ +INCLUDE vector_symbols.inc + +/* STM32 vector table. */ +EXTERN(__stm32_vector_table) + +/* C runtime initialization function. */ +EXTERN(start_c) + +/* main entry point */ +EXTERN(main) + +/* Initial stack pointer value. */ +EXTERN(__msp_init) +PROVIDE(__msp_init = ORIGIN(ram) + LENGTH(ram)); + +/* Reset vector and chip reset entry point */ +EXTERN(__start__) +ENTRY(__start__) +PROVIDE(__exc_reset = __start__); + +/* Heap boundaries, for libmaple */ +EXTERN(_lm_heap_start); +EXTERN(_lm_heap_end); + +SECTIONS +{ + .text : + { + __text_start__ = .; + /* + * STM32 vector table. Leave this here. Yes, really. + */ + *(.stm32.interrupt_vector) + + /* + * Program code and vague linking + */ + *(.text .text.* .gnu.linkonce.t.*) + *(.plt) + *(.gnu.warning) + *(.glue_7t) *(.glue_7) *(.vfp11_veneer) + + *(.ARM.extab* .gnu.linkonce.armextab.*) + *(.gcc_except_table) + *(.eh_frame_hdr) + *(.eh_frame) + + . = ALIGN(4); + KEEP(*(.init)) + + . = ALIGN(4); + __preinit_array_start = .; + KEEP (*(.preinit_array)) + __preinit_array_end = .; + + . = ALIGN(4); + __init_array_start = .; + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + __init_array_end = .; + + . = ALIGN(0x4); + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*crtend.o(.ctors)) + + . = ALIGN(4); + KEEP(*(.fini)) + + . = ALIGN(4); + __fini_array_start = .; + KEEP (*(.fini_array)) + KEEP (*(SORT(.fini_array.*))) + __fini_array_end = .; + + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*crtend.o(.dtors)) + } > REGION_TEXT + + /* + * End of text + */ + .text.align : + { + . = ALIGN(8); + __text_end__ = .; + } > REGION_TEXT + + /* + * .ARM.exidx exception unwinding; mandated by ARM's C++ ABI + */ + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > REGION_RODATA + __exidx_end = .; + + /* + * .data + */ + .data : + { + __data_start__ = .; + LONG(0) + . = ALIGN(8); + + *(.got.plt) *(.got) + *(.data .data.* .gnu.linkonce.d.*) + + . = ALIGN(8); + __data_end__ = .; + } > REGION_DATA AT> REGION_RODATA + + /* + * Read-only data + */ + .rodata : + { + *(.rodata .rodata.* .gnu.linkonce.r.*) + /* .USER_FLASH: We allow users to allocate into Flash here */ + *(.USER_FLASH) + /* ROM image configuration; for C startup */ + . = ALIGN(4); + _lm_rom_img_cfgp = .; + LONG(LOADADDR(.data)); + /* + * Heap: Linker scripts may choose a custom heap by overriding + * _lm_heap_start and _lm_heap_end. Otherwise, the heap is in + * internal SRAM, beginning after .bss, and growing towards + * the stack. + * + * I'm shoving these here naively; there's probably a cleaner way + * to go about this. [mbolivar] + */ + _lm_heap_start = DEFINED(_lm_heap_start) ? _lm_heap_start : _end; + _lm_heap_end = DEFINED(_lm_heap_end) ? _lm_heap_end : __msp_init; + } > REGION_RODATA + + /* + * .bss + */ + .bss : + { + . = ALIGN(8); + __bss_start__ = .; + *(.bss .bss.* .gnu.linkonce.b.*) + *(COMMON) + . = ALIGN (8); + __bss_end__ = .; + _end = __bss_end__; + } > REGION_BSS + + /* + * Debugging sections + */ + .stab 0 (NOLOAD) : { *(.stab) } + .stabstr 0 (NOLOAD) : { *(.stabstr) } + /* DWARF debug sections. + * Symbols in the DWARF debugging sections are relative to the beginning + * of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + + .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) } + .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) } + /DISCARD/ : { *(.note.GNU-stack) } +} diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/extra_libs.inc b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/extra_libs.inc new file mode 100644 index 0000000000..dd2c84fa45 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/extra_libs.inc @@ -0,0 +1,7 @@ +/* + * Extra archives needed by ARM's GCC ARM Embedded arm-none-eabi- + * releases (https://launchpad.net/gcc-arm-embedded/). + */ + +/* This is for the provided newlib. */ +GROUP(libnosys.a) diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/flash.ld b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/flash.ld new file mode 100644 index 0000000000..9e250cd747 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/flash.ld @@ -0,0 +1,26 @@ +/* + * libmaple linker script for "Flash" builds. + * + * A Flash build puts .text (and .rodata) in Flash, and + * .data/.bss/heap (of course) in SRAM, but offsets the sections by + * enough space to store the Maple bootloader, which lives in low + * Flash and uses low memory. + */ + +/* + * This pulls in the appropriate MEMORY declaration from the right + * subdirectory of stm32/mem/ (the environment must call ld with the + * right include directory flags to make this happen). Boards can also + * use this file to use any of libmaple's memory-related hooks (like + * where the heap should live). + */ +INCLUDE mem-flash.inc + +/* Provide memory region aliases for common.inc */ +REGION_ALIAS("REGION_TEXT", rom); +REGION_ALIAS("REGION_DATA", ram); +REGION_ALIAS("REGION_BSS", ram); +REGION_ALIAS("REGION_RODATA", rom); + +/* Let common.inc handle the real work. */ +INCLUDE common.inc diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/jtag.ld b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/jtag.ld new file mode 100644 index 0000000000..0612f95862 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/jtag.ld @@ -0,0 +1,31 @@ +/* + * libmaple linker script for "JTAG" builds. + * + * A "JTAG" build puts .text (and .rodata) in Flash, and + * .data/.bss/heap (of course) in SRAM, but links starting at the + * Flash and SRAM starting addresses (0x08000000 and 0x20000000 + * respectively). This will wipe out a Maple bootloader if there's one + * on the board, so only use this if you know what you're doing. + * + * Of course, a "JTAG" build is perfectly usable for upload over SWD, + * the system memory bootloader, etc. The name is just a historical + * artifact. + */ + +/* + * This pulls in the appropriate MEMORY declaration from the right + * subdirectory of stm32/mem/ (the environment must call ld with the + * right include directory flags to make this happen). Boards can also + * use this file to use any of libmaple's memory-related hooks (like + * where the heap should live). + */ +INCLUDE mem-jtag.inc + +/* Provide memory region aliases for common.inc */ +REGION_ALIAS("REGION_TEXT", rom); +REGION_ALIAS("REGION_DATA", ram); +REGION_ALIAS("REGION_BSS", ram); +REGION_ALIAS("REGION_RODATA", rom); + +/* Let common.inc handle the real work. */ +INCLUDE common.inc diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-flash.inc b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-flash.inc new file mode 100644 index 0000000000..ddb8876fa5 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-flash.inc @@ -0,0 +1,5 @@ +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 61K + rom (rx) : ORIGIN = 0x08005000, LENGTH = 492K +} diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-jtag.inc b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-jtag.inc new file mode 100644 index 0000000000..d3ed992481 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-jtag.inc @@ -0,0 +1,5 @@ +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K + rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K +} diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-ram.inc b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-ram.inc new file mode 100644 index 0000000000..360beafe9d --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-ram.inc @@ -0,0 +1,5 @@ +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 61K + rom (rx) : ORIGIN = 0x08005000, LENGTH = 0K +} diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/ram.ld b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/ram.ld new file mode 100644 index 0000000000..34b468e0a0 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/ram.ld @@ -0,0 +1,25 @@ +/* + * libmaple linker script for RAM builds. + * + * A Flash build puts .text, .rodata, and .data/.bss/heap (of course) + * in SRAM, but offsets the sections by enough space to store the + * Maple bootloader, which uses low memory. + */ + +/* + * This pulls in the appropriate MEMORY declaration from the right + * subdirectory of stm32/mem/ (the environment must call ld with the + * right include directory flags to make this happen). Boards can also + * use this file to use any of libmaple's memory-related hooks (like + * where the heap should live). + */ +INCLUDE mem-ram.inc + +/* Provide memory region aliases for common.inc */ +REGION_ALIAS("REGION_TEXT", ram); +REGION_ALIAS("REGION_DATA", ram); +REGION_ALIAS("REGION_BSS", ram); +REGION_ALIAS("REGION_RODATA", ram); + +/* Let common.inc handle the real work. */ +INCLUDE common.inc diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rb.ld b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rb.ld new file mode 100644 index 0000000000..094f2d2928 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rb.ld @@ -0,0 +1,18 @@ +/* + * Linker script for Generic STM32F103RB boards. + */ +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K + rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K +} + + +/* Provide memory region aliases for common.inc */ +REGION_ALIAS("REGION_TEXT", rom); +REGION_ALIAS("REGION_DATA", ram); +REGION_ALIAS("REGION_BSS", ram); +REGION_ALIAS("REGION_RODATA", rom); + +/* Let common.inc handle the real work. */ +INCLUDE common.inc diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rb_bootloader.ld b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rb_bootloader.ld new file mode 100644 index 0000000000..d045db9f4b --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rb_bootloader.ld @@ -0,0 +1,17 @@ +/* + * Linker script for Generic STM32F103RB boards, using the generic bootloader (which takes the lower 8k of memory) + */ +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K + rom (rx) : ORIGIN = 0x08002000, LENGTH = 120K +} + +/* Provide memory region aliases for common.inc */ +REGION_ALIAS("REGION_TEXT", rom); +REGION_ALIAS("REGION_DATA", ram); +REGION_ALIAS("REGION_BSS", ram); +REGION_ALIAS("REGION_RODATA", rom); + +/* Let common.inc handle the real work. */ +INCLUDE common.inc diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rc.ld b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rc.ld new file mode 100644 index 0000000000..c890d69f6d --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rc.ld @@ -0,0 +1,18 @@ +/* + * Linker script for Generic STM32F103RC boards. + */ +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K + rom (rx) : ORIGIN = 0x08000000, LENGTH = 256K +} + + +/* Provide memory region aliases for common.inc */ +REGION_ALIAS("REGION_TEXT", rom); +REGION_ALIAS("REGION_DATA", ram); +REGION_ALIAS("REGION_BSS", ram); +REGION_ALIAS("REGION_RODATA", rom); + +/* Let common.inc handle the real work. */ +INCLUDE common.inc diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rc_bootloader.ld b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rc_bootloader.ld new file mode 100644 index 0000000000..00b811b0e6 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rc_bootloader.ld @@ -0,0 +1,18 @@ +/* + * Linker script for Generic STM32F103RC boards, using the generic bootloader (which takes the lower 8k of memory) + */ + +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K + rom (rx) : ORIGIN = 0x08002000, LENGTH = 248K +} + +/* Provide memory region aliases for common.inc */ +REGION_ALIAS("REGION_TEXT", rom); +REGION_ALIAS("REGION_DATA", ram); +REGION_ALIAS("REGION_BSS", ram); +REGION_ALIAS("REGION_RODATA", rom); + +/* Let common.inc handle the real work. */ +INCLUDE common.inc diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103re.ld b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103re.ld new file mode 100644 index 0000000000..9f74fd5292 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103re.ld @@ -0,0 +1,18 @@ +/* + * Linker script for Generic STM32F103RE boards. + */ +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K + rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K +} + + +/* Provide memory region aliases for common.inc */ +REGION_ALIAS("REGION_TEXT", rom); +REGION_ALIAS("REGION_DATA", ram); +REGION_ALIAS("REGION_BSS", ram); +REGION_ALIAS("REGION_RODATA", rom); + +/* Let common.inc handle the real work. */ +INCLUDE common.inc diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/vector_symbols.inc b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/vector_symbols.inc new file mode 100644 index 0000000000..f8519bba44 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/vector_symbols.inc @@ -0,0 +1,78 @@ +EXTERN(__msp_init) +EXTERN(__exc_reset) +EXTERN(__exc_nmi) +EXTERN(__exc_hardfault) +EXTERN(__exc_memmanage) +EXTERN(__exc_busfault) +EXTERN(__exc_usagefault) +EXTERN(__stm32reservedexception7) +EXTERN(__stm32reservedexception8) +EXTERN(__stm32reservedexception9) +EXTERN(__stm32reservedexception10) +EXTERN(__exc_svc) +EXTERN(__exc_debug_monitor) +EXTERN(__stm32reservedexception13) +EXTERN(__exc_pendsv) +EXTERN(__exc_systick) + +EXTERN(__irq_wwdg) +EXTERN(__irq_pvd) +EXTERN(__irq_tamper) +EXTERN(__irq_rtc) +EXTERN(__irq_flash) +EXTERN(__irq_rcc) +EXTERN(__irq_exti0) +EXTERN(__irq_exti1) +EXTERN(__irq_exti2) +EXTERN(__irq_exti3) +EXTERN(__irq_exti4) +EXTERN(__irq_dma1_channel1) +EXTERN(__irq_dma1_channel2) +EXTERN(__irq_dma1_channel3) +EXTERN(__irq_dma1_channel4) +EXTERN(__irq_dma1_channel5) +EXTERN(__irq_dma1_channel6) +EXTERN(__irq_dma1_channel7) +EXTERN(__irq_adc) +EXTERN(__irq_usb_hp_can_tx) +EXTERN(__irq_usb_lp_can_rx0) +EXTERN(__irq_can_rx1) +EXTERN(__irq_can_sce) +EXTERN(__irq_exti9_5) +EXTERN(__irq_tim1_brk) +EXTERN(__irq_tim1_up) +EXTERN(__irq_tim1_trg_com) +EXTERN(__irq_tim1_cc) +EXTERN(__irq_tim2) +EXTERN(__irq_tim3) +EXTERN(__irq_tim4) +EXTERN(__irq_i2c1_ev) +EXTERN(__irq_i2c1_er) +EXTERN(__irq_i2c2_ev) +EXTERN(__irq_i2c2_er) +EXTERN(__irq_spi1) +EXTERN(__irq_spi2) +EXTERN(__irq_usart1) +EXTERN(__irq_usart2) +EXTERN(__irq_usart3) +EXTERN(__irq_exti15_10) +EXTERN(__irq_rtcalarm) +EXTERN(__irq_usbwakeup) + +EXTERN(__irq_tim8_brk) +EXTERN(__irq_tim8_up) +EXTERN(__irq_tim8_trg_com) +EXTERN(__irq_tim8_cc) +EXTERN(__irq_adc3) +EXTERN(__irq_fsmc) +EXTERN(__irq_sdio) +EXTERN(__irq_tim5) +EXTERN(__irq_spi3) +EXTERN(__irq_uart4) +EXTERN(__irq_uart5) +EXTERN(__irq_tim6) +EXTERN(__irq_tim7) +EXTERN(__irq_dma2_channel1) +EXTERN(__irq_dma2_channel2) +EXTERN(__irq_dma2_channel3) +EXTERN(__irq_dma2_channel4_5) diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/pins_arduino.h b/buildroot/share/PlatformIO/variants/MEEB_3DP/pins_arduino.h new file mode 100644 index 0000000000..d5dce114d5 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/pins_arduino.h @@ -0,0 +1,2 @@ +// API compatibility +#include "variant.h" diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/variant.h b/buildroot/share/PlatformIO/variants/MEEB_3DP/variant.h new file mode 100644 index 0000000000..cd10bb3c07 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/variant.h @@ -0,0 +1,17 @@ +#pragma once + +#define digitalPinToPort(P) ( PIN_MAP[P].gpio_device ) +#define digitalPinToBitMask(P) ( BIT(PIN_MAP[P].gpio_bit) ) +#define portOutputRegister(port) ( &(port->regs->ODR) ) +#define portInputRegister(port) ( &(port->regs->IDR) ) + +#define portSetRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BSRR) ) +#define portClearRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BRR) ) + +#define portConfigRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->CRL) ) + +static const uint8_t SS = BOARD_SPI1_NSS_PIN; +static const uint8_t SS1 = BOARD_SPI2_NSS_PIN; +static const uint8_t MOSI = BOARD_SPI1_MOSI_PIN; +static const uint8_t MISO = BOARD_SPI1_MISO_PIN; +static const uint8_t SCK = BOARD_SPI1_SCK_PIN; diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/boards.cpp b/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/boards.cpp new file mode 100644 index 0000000000..12321229de --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/boards.cpp @@ -0,0 +1,225 @@ +/****************************************************************************** + * The MIT License + * + * Copyright (c) 2010 Perry Hung. + * Copyright (c) 2011, 2012 LeafLabs, LLC. + * + * 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. + *****************************************************************************/ + +/** + * @file wirish/boards.cpp + * @brief init() and board routines. + * + * This file is mostly interesting for the init() function, which + * configures Flash, the core clocks, and a variety of other available + * peripherals on the board so the rest of Wirish doesn't have to turn + * things on before using them. + * + * Prior to returning, init() calls boardInit(), which allows boards + * to perform any initialization they need to. This file includes a + * weak no-op definition of boardInit(), so boards that don't need any + * special initialization don't have to define their own. + * + * How init() works is chip-specific. See the boards_setup.cpp files + * under e.g. wirish/stm32f1/, wirish/stmf32f2 for the details, but be + * advised: their contents are unstable, and can/will change without + * notice. + */ + +#include +#include +#include +#include +#include +#include "boards_private.h" + +static void setup_flash(void); +static void setup_clocks(void); +static void setup_nvic(void); +static void setup_adcs(void); +static void setup_timers(void); + +/* + * Exported functions + */ + +void init(void) { + setup_flash(); + setup_clocks(); + setup_nvic(); + systick_init(SYSTICK_RELOAD_VAL); + wirish::priv::board_setup_gpio(); + setup_adcs(); + setup_timers(); + wirish::priv::board_setup_usb(); + wirish::priv::series_init(); + boardInit(); +} + +/* Provide a default no-op boardInit(). */ +__weak void boardInit(void) { +} + +/* You could farm this out to the files in boards/ if e.g. it takes + * too long to test on boards with lots of pins. */ +bool boardUsesPin(uint8 pin) { + for (int i = 0; i < BOARD_NR_USED_PINS; i++) { + if (pin == boardUsedPins[i]) { + return true; + } + } + return false; +} + +/* + * Auxiliary routines + */ + +static void setup_flash(void) { + // Turn on as many Flash "go faster" features as + // possible. flash_enable_features() just ignores any flags it + // can't support. + flash_enable_features(FLASH_PREFETCH | FLASH_ICACHE | FLASH_DCACHE); + // Configure the wait states, assuming we're operating at "close + // enough" to 3.3V. + flash_set_latency(FLASH_SAFE_WAIT_STATES); +} + +static void setup_clocks(void) { + // Turn on HSI. We'll switch to and run off of this while we're + // setting up the main PLL. + rcc_turn_on_clk(RCC_CLK_HSI); + + // Turn off and reset the clock subsystems we'll be using, as well + // as the clock security subsystem (CSS). Note that resetting CFGR + // to its default value of 0 implies a switch to HSI for SYSCLK. + RCC_BASE->CFGR = 0x00000000; + rcc_disable_css(); + rcc_turn_off_clk(RCC_CLK_PLL); + rcc_turn_off_clk(RCC_CLK_HSE); + wirish::priv::board_reset_pll(); + // Clear clock readiness interrupt flags and turn off clock + // readiness interrupts. + RCC_BASE->CIR = 0x00000000; +#if !USE_HSI_CLOCK + // Enable HSE, and wait until it's ready. + rcc_turn_on_clk(RCC_CLK_HSE); + while (!rcc_is_clk_ready(RCC_CLK_HSE)) + ; +#endif + // Configure AHBx, APBx, etc. prescalers and the main PLL. + wirish::priv::board_setup_clock_prescalers(); + rcc_configure_pll(&wirish::priv::w_board_pll_cfg); + + // Enable the PLL, and wait until it's ready. + rcc_turn_on_clk(RCC_CLK_PLL); + while(!rcc_is_clk_ready(RCC_CLK_PLL)) + ; + + // Finally, switch to the now-ready PLL as the main clock source. + rcc_switch_sysclk(RCC_CLKSRC_PLL); +} + +/* + * These addresses are where usercode starts when a bootloader is + * present. If no bootloader is present, the user NVIC usually starts + * at the Flash base address, 0x08000000. + */ +#if defined(BOOTLOADER_maple) + #define USER_ADDR_ROM 0x08002000 +#else + #define USER_ADDR_ROM 0x08000000 +#endif +#define USER_ADDR_RAM 0x20000C00 +extern char __text_start__; + +static void setup_nvic(void) { + +nvic_init((uint32)VECT_TAB_ADDR, 0); + +/* Roger Clark. We now control nvic vector table in boards.txt using the build.vect paramater +#ifdef VECT_TAB_FLASH + nvic_init(USER_ADDR_ROM, 0); +#elif defined VECT_TAB_RAM + nvic_init(USER_ADDR_RAM, 0); +#elif defined VECT_TAB_BASE + nvic_init((uint32)0x08000000, 0); +#elif defined VECT_TAB_ADDR + // A numerically supplied value + nvic_init((uint32)VECT_TAB_ADDR, 0); +#else + // Use the __text_start__ value from the linker script; this + // should be the start of the vector table. + nvic_init((uint32)&__text_start__, 0); +#endif + +*/ +} + +static void adc_default_config(adc_dev *dev) { + adc_enable_single_swstart(dev); + adc_set_sample_rate(dev, wirish::priv::w_adc_smp); +} + +static void setup_adcs(void) { + adc_set_prescaler(wirish::priv::w_adc_pre); + adc_foreach(adc_default_config); +} + +static void timer_default_config(timer_dev *dev) { + timer_adv_reg_map *regs = (dev->regs).adv; + const uint16 full_overflow = 0xFFFF; + const uint16 half_duty = 0x8FFF; + + timer_init(dev); + timer_pause(dev); + + regs->CR1 = TIMER_CR1_ARPE; + regs->PSC = 1; + regs->SR = 0; + regs->DIER = 0; + regs->EGR = TIMER_EGR_UG; + switch (dev->type) { + case TIMER_ADVANCED: + regs->BDTR = TIMER_BDTR_MOE | TIMER_BDTR_LOCK_OFF; + // fall-through + case TIMER_GENERAL: + timer_set_reload(dev, full_overflow); + for (uint8 channel = 1; channel <= 4; channel++) { + if (timer_has_cc_channel(dev, channel)) { + timer_set_compare(dev, channel, half_duty); + timer_oc_set_mode(dev, channel, TIMER_OC_MODE_PWM_1, + TIMER_OC_PE); + } + } + // fall-through + case TIMER_BASIC: + break; + } + + timer_generate_update(dev); + timer_resume(dev); +} + +static void setup_timers(void) { + timer_foreach(timer_default_config); +} diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/boards_setup.cpp b/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/boards_setup.cpp new file mode 100644 index 0000000000..44418a52a4 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/boards_setup.cpp @@ -0,0 +1,106 @@ +/****************************************************************************** + * The MIT License + * + * Copyright (c) 2012 LeafLabs, LLC. + * + * 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. +*****************************************************************************/ + +/** + * @file wirish/stm32f1/boards_setup.cpp + * @author Marti Bolivar + * @brief STM32F1 chip setup. + * + * This file controls how init() behaves on the STM32F1. Be very + * careful when changing anything here. Many of these values depend + * upon each other. + */ + +#include "boards_private.h" + +#include +#include + +#include +#include + +// Allow boards to provide a PLL multiplier. This is useful for +// e.g. STM32F100 value line MCUs, which use slower multipliers. +// (We're leaving the default to RCC_PLLMUL_9 for now, since that +// works for F103 performance line MCUs, which is all that LeafLabs +// currently officially supports). + +namespace wirish { + namespace priv { + + static stm32f1_rcc_pll_data pll_data = {RCC_PLLMUL_6}; +#if !USE_HSI_CLOCK + __weak rcc_pll_cfg w_board_pll_cfg = {RCC_PLLSRC_HSE, &pll_data}; +#else + __weak rcc_pll_cfg w_board_pll_cfg = {RCC_PLLSRC_HSI_DIV_2, &pll_data}; +#endif + __weak adc_prescaler w_adc_pre = ADC_PRE_PCLK2_DIV_6; + __weak adc_smp_rate w_adc_smp = ADC_SMPR_55_5; + + __weak void board_reset_pll(void) { + // TODO + } + + __weak void board_setup_clock_prescalers(void) { + rcc_set_prescaler(RCC_PRESCALER_AHB, RCC_AHB_SYSCLK_DIV_1); + rcc_set_prescaler(RCC_PRESCALER_APB1, RCC_APB1_HCLK_DIV_2); + rcc_set_prescaler(RCC_PRESCALER_APB2, RCC_APB2_HCLK_DIV_1); + rcc_clk_disable(RCC_USB); + #if F_CPU == 72000000 + rcc_set_prescaler(RCC_PRESCALER_USB, RCC_USB_SYSCLK_DIV_1_5); + #elif F_CPU == 48000000 + rcc_set_prescaler(RCC_PRESCALER_USB, RCC_USB_SYSCLK_DIV_1); + #endif + } + + __weak void board_setup_gpio(void) { + gpio_init_all(); + } + + __weak void board_setup_usb(void) { +#ifdef SERIAL_USB + +#ifdef GENERIC_BOOTLOADER + //Reset the USB interface on generic boards - developed by Victor PV + gpio_set_mode(PIN_MAP[PA12].gpio_device, PIN_MAP[PA12].gpio_bit, GPIO_OUTPUT_PP); + gpio_write_bit(PIN_MAP[PA12].gpio_device, PIN_MAP[PA12].gpio_bit,0); + + for(volatile unsigned int i=0;i<512;i++);// Only small delay seems to be needed, and USB pins will get configured in Serial.begin + gpio_set_mode(PIN_MAP[PA12].gpio_device, PIN_MAP[PA12].gpio_bit, GPIO_INPUT_FLOATING); +#endif + + Serial.begin();// Roger Clark. Changed SerialUSB to Serial for Arduino sketch compatibility +#endif + } + + __weak void series_init(void) { + // Initialize AFIO here, too, so peripheral remaps and external + // interrupts work out of the box. + afio_init(); + } + + } +} diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/start.S b/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/start.S new file mode 100644 index 0000000000..8b181aa993 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/start.S @@ -0,0 +1,57 @@ +/****************************************************************************** + * The MIT License + * + * Copyright (c) 2011 LeafLabs, LLC. + * + * 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. + *****************************************************************************/ + +/* + * This file is a modified version of a file obtained from + * CodeSourcery Inc. (now part of Mentor Graphics Corp.), in which the + * following text appeared: + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + + .text + .code 16 + .thumb_func + + .globl __start__ + .type __start__, %function +__start__: + .fnstart + ldr r1,=__msp_init + mov sp,r1 + ldr r1,=start_c + bx r1 + .pool + .cantunwind + .fnend diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/start_c.c b/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/start_c.c new file mode 100644 index 0000000000..655fefb884 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/start_c.c @@ -0,0 +1,95 @@ +/****************************************************************************** + * The MIT License + * + * Copyright (c) 2011 LeafLabs, LLC. + * + * 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. + *****************************************************************************/ + +/* + * This file is a modified version of a file obtained from + * CodeSourcery Inc. (now part of Mentor Graphics Corp.), in which the + * following text appeared: + * + * Copyright (c) 2006, 2007 CodeSourcery Inc + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +extern void __libc_init_array(void); + +extern int main(int, char**, char**); + +extern void exit(int) __attribute__((noreturn, weak)); + +/* The linker must ensure that these are at least 4-byte aligned. */ +extern char __data_start__, __data_end__; +extern char __bss_start__, __bss_end__; + +struct rom_img_cfg { + int *img_start; +}; + +extern char _lm_rom_img_cfgp; + +void __attribute__((noreturn)) start_c(void) { + struct rom_img_cfg *img_cfg = (struct rom_img_cfg*)&_lm_rom_img_cfgp; + int *src = img_cfg->img_start; + int *dst = (int*)&__data_start__; + int exit_code; + + /* Initialize .data, if necessary. */ + if (src != dst) { + int *end = (int*)&__data_end__; + while (dst < end) { + *dst++ = *src++; + } + } + + /* Zero .bss. */ + dst = (int*)&__bss_start__; + while (dst < (int*)&__bss_end__) { + *dst++ = 0; + } + + /* Run initializers. */ + __libc_init_array(); + + /* Jump to main. */ + exit_code = main(0, 0, 0); + if (exit) { + exit(exit_code); + } + + /* If exit is NULL, make sure we don't return. */ + for (;;) + continue; +} diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/syscalls.c b/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/syscalls.c new file mode 100644 index 0000000000..d5f2d9fac3 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/syscalls.c @@ -0,0 +1,176 @@ +/****************************************************************************** + * The MIT License + * + * Copyright (c) 2010 Perry Hung. + * Copyright (c) 2011, 2012 LeafLabs, LLC. + * + * 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. + *****************************************************************************/ + +/** + * @file wirish/syscalls.c + * @brief newlib stubs + * + * Low level system routines used by newlib for basic I/O and memory + * allocation. You can override most of these. + */ + +#include + +#include +#include +#include + +/* If CONFIG_HEAP_START (or CONFIG_HEAP_END) isn't defined, then + * assume _lm_heap_start (resp. _lm_heap_end) is appropriately set by + * the linker */ +#ifndef CONFIG_HEAP_START +extern char _lm_heap_start; +#define CONFIG_HEAP_START ((void *)&_lm_heap_start) +#endif +#ifndef CONFIG_HEAP_END +extern char _lm_heap_end; +#define CONFIG_HEAP_END ((void *)&_lm_heap_end) +#endif + +/* + * _sbrk -- Increment the program break. + * + * Get incr bytes more RAM (for use by the heap). malloc() and + * friends call this function behind the scenes. + */ +void *_sbrk(int incr) { + static void * pbreak = NULL; /* current program break */ + void * ret; + + if (pbreak == NULL) { + pbreak = CONFIG_HEAP_START; + } + + if ((CONFIG_HEAP_END - pbreak < incr) || + (pbreak - CONFIG_HEAP_START < -incr)) { + errno = ENOMEM; + return (void *)-1; + } + + ret = pbreak; + pbreak += incr; + return ret; +} + +__weak int _open(const char *path, int flags, ...) { + return 1; +} + +__weak int _close(int fd) { + return 0; +} + +__weak int _fstat(int fd, struct stat *st) { + st->st_mode = S_IFCHR; + return 0; +} + +__weak int _isatty(int fd) { + return 1; +} + +__weak int isatty(int fd) { + return 1; +} + +__weak int _lseek(int fd, off_t pos, int whence) { + return -1; +} + +__weak unsigned char getch(void) { + return 0; +} + + +__weak int _read(int fd, char *buf, size_t cnt) { + *buf = getch(); + + return 1; +} + +__weak void putch(unsigned char c) { +} + +__weak void cgets(char *s, int bufsize) { + char *p; + int c; + int i; + + for (i = 0; i < bufsize; i++) { + *(s+i) = 0; + } +// memset(s, 0, bufsize); + + p = s; + + for (p = s; p < s + bufsize-1;) { + c = getch(); + switch (c) { + case '\r' : + case '\n' : + putch('\r'); + putch('\n'); + *p = '\n'; + return; + + case '\b' : + if (p > s) { + *p-- = 0; + putch('\b'); + putch(' '); + putch('\b'); + } + break; + + default : + putch(c); + *p++ = c; + break; + } + } + return; +} + +__weak int _write(int fd, const char *buf, size_t cnt) { + int i; + + for (i = 0; i < cnt; i++) + putch(buf[i]); + + return cnt; +} + +/* Override fgets() in newlib with a version that does line editing */ +__weak char *fgets(char *s, int bufsize, void *f) { + cgets(s, bufsize); + return s; +} + +__weak void _exit(int exitcode) { + while (1) + ; +} diff --git a/buildroot/share/PlatformIO/variants/STEVAL_F401VE/PinNamesVar.h b/buildroot/share/PlatformIO/variants/STEVAL_F401VE/PinNamesVar.h index 3082f8842a..6a1eb9b887 100644 --- a/buildroot/share/PlatformIO/variants/STEVAL_F401VE/PinNamesVar.h +++ b/buildroot/share/PlatformIO/variants/STEVAL_F401VE/PinNamesVar.h @@ -1,33 +1,33 @@ /* SYS_WKUP */ #ifdef PWR_WAKEUP_PIN1 -SYS_WKUP1 = PA_0, + SYS_WKUP1 = PA_0, #endif #ifdef PWR_WAKEUP_PIN2 -SYS_WKUP2 = NC, + SYS_WKUP2 = NC, #endif #ifdef PWR_WAKEUP_PIN3 -SYS_WKUP3 = NC, + SYS_WKUP3 = NC, #endif #ifdef PWR_WAKEUP_PIN4 -SYS_WKUP4 = NC, + SYS_WKUP4 = NC, #endif #ifdef PWR_WAKEUP_PIN5 -SYS_WKUP5 = NC, + SYS_WKUP5 = NC, #endif #ifdef PWR_WAKEUP_PIN6 -SYS_WKUP6 = NC, + SYS_WKUP6 = NC, #endif #ifdef PWR_WAKEUP_PIN7 -SYS_WKUP7 = NC, + SYS_WKUP7 = NC, #endif #ifdef PWR_WAKEUP_PIN8 -SYS_WKUP8 = NC, + SYS_WKUP8 = NC, #endif /* USB */ #ifdef USBCON -USB_OTG_FS_SOF = PA_8, -USB_OTG_FS_VBUS = PA_9, -USB_OTG_FS_ID = PA_10, -USB_OTG_FS_DM = PA_11, -USB_OTG_FS_DP = PA_12, + USB_OTG_FS_SOF = PA_8, + USB_OTG_FS_VBUS = PA_9, + USB_OTG_FS_ID = PA_10, + USB_OTG_FS_DM = PA_11, + USB_OTG_FS_DP = PA_12, #endif diff --git a/buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.cpp b/buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.cpp index a53a92c48c..4ecbff0ecc 100644 --- a/buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.cpp +++ b/buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.cpp @@ -34,7 +34,7 @@ extern "C" { #endif -#if defined(ARDUINO_STEVAL) +#ifdef ARDUINO_STEVAL // Pin number // This array allows to wrap Arduino pin number(Dx or x) // to STM32 PinName (PX_n) diff --git a/buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.h b/buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.h index 571f3207e9..df7295ab17 100644 --- a/buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.h +++ b/buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.h @@ -41,7 +41,7 @@ extern "C" { /*---------------------------------------------------------------------------- * Pins *----------------------------------------------------------------------------*/ -#if defined(ARDUINO_STEVAL) +#ifdef ARDUINO_STEVAL /*---------------------------------------------------------------------------- diff --git a/buildroot/share/extras/header.h b/buildroot/share/extras/header.h new file mode 100644 index 0000000000..5d2c73dfbe --- /dev/null +++ b/buildroot/share/extras/header.h @@ -0,0 +1,26 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * $(filename) + */ + diff --git a/buildroot/share/extras/uncrustify.cfg b/buildroot/share/extras/uncrustify.cfg new file mode 100644 index 0000000000..06661203f0 --- /dev/null +++ b/buildroot/share/extras/uncrustify.cfg @@ -0,0 +1,84 @@ +# +# Uncrustify Configuration File +# File Created With UncrustifyX 0.4.3 (252) +# +align_assign_span = 1 +cmt_cpp_to_c = false +cmt_indent_multi = false +cmt_insert_file_header = "./header.h" +cmt_reflow_mode = 1 +cmt_sp_after_star_cont = 1 +cmt_sp_before_star_cont = 1 +cmt_star_cont = true +eat_blanks_after_open_brace = false +eat_blanks_before_close_brace = false +indent_align_assign = false +indent_case_brace = 0 +indent_columns = 2 +indent_cpp_lambda_body = false +indent_func_call_param = true +indent_func_def_param = true +indent_switch_case = 2 +indent_with_tabs = 0 +input_tab_size = 2 +mod_add_long_ifdef_else_comment = 40 +mod_add_long_ifdef_endif_comment = 40 +mod_full_brace_do = false +mod_full_brace_for = false +mod_full_brace_if = false +mod_full_brace_if_chain = true +mod_full_brace_while = false +mod_remove_extra_semicolon = true +newlines = lf +nl_after_brace_close = true +nl_after_brace_open = true +nl_assign_leave_one_liners = true +nl_brace_else = add +nl_class_leave_one_liners = true +nl_create_for_one_liner = true +nl_create_if_one_liner = false +nl_create_while_one_liner = true +nl_else_brace = remove +nl_end_of_file = add +nl_enum_brace = remove +nl_enum_leave_one_liners = true +nl_fdef_brace = remove +nl_for_brace = remove +nl_func_leave_one_liners = true +nl_getset_leave_one_liners = true +nl_if_brace = remove +nl_if_leave_one_liners = true +nl_multi_line_sparen_close = add +nl_squeeze_ifdef = false +nl_struct_brace = remove +nl_switch_brace = remove +nl_union_brace = remove +pp_define_at_level = true +pp_if_indent_code = true +pp_indent = add +pp_indent_at_level = true +pp_indent_count = 2 +pp_indent_if = 0 +sp_after_comma = add +sp_after_semi = add +sp_after_sparen = add +sp_arith = add +sp_assign = add +sp_assign_default = remove +sp_before_comma = remove +sp_before_sparen = add +sp_bool = add +sp_brace_else = add +sp_cmt_cpp_start = add +sp_compare = add +sp_cond_colon = add +sp_cond_question = add +sp_else_brace = add +sp_endif_cmt = true +sp_fparen_brace = add +sp_func_call_paren = remove +sp_func_proto_paren = remove +sp_inside_sparen = remove +sp_inside_square = remove +sp_paren_brace = add +sp_paren_paren = remove diff --git a/buildroot/share/fonts/README.md b/buildroot/share/fonts/README.md index 05d1adc853..cc09b52810 100644 --- a/buildroot/share/fonts/README.md +++ b/buildroot/share/fonts/README.md @@ -16,7 +16,7 @@ https://creativecommons.org/publicdomain/zero/1.0/ - ISO10646_Kana.fon ([fe2bd23](https://github.com/MarlinFirmware/Marlin/commit/fe2bd237d556439499dfdee852c1550c7a16430a)) - Marlin_symbols.fon ([fe2bd23](https://github.com/MarlinFirmware/Marlin/commit/fe2bd237d556439499dfdee852c1550c7a16430a)) -Additional changes to the original font files distributed with Marlin are copyrighted under the terms of the [GPLv3](http://www.gnu.org/licenses/gpl-3.0.txt) license. +Additional changes to the original font files distributed with Marlin are copyrighted under the terms of the [GPLv3](https://www.gnu.org/licenses/gpl-3.0.txt) license. ## Documentation diff --git a/buildroot/share/fonts/genallfont.sh b/buildroot/share/fonts/genallfont.sh index 7d4b551776..66f8e2c84f 100755 --- a/buildroot/share/fonts/genallfont.sh +++ b/buildroot/share/fonts/genallfont.sh @@ -62,7 +62,7 @@ OLDWD=`pwd` # # By default loop through all languages # -LANGS_DEFAULT="an bg ca cz da de el el_gr en 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" +LANGS_DEFAULT="an bg ca cz da de el el_gr en es eu fi fr gl hr hu it jp_kana ko_KR nl pl pt pt_br ro ru sk tr uk vi zh_CN zh_TW test" # # Generate data for language list MARLIN_LANGS or all if not provided @@ -116,7 +116,7 @@ if [ 1 = 1 ]; then * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ #include diff --git a/buildroot/share/git/firstpush b/buildroot/share/git/firstpush index 132795b617..9a68fc5afd 100755 --- a/buildroot/share/git/firstpush +++ b/buildroot/share/git/firstpush @@ -14,11 +14,9 @@ FORK=${INFO[1]} REPO=${INFO[2]} BRANCH=${INFO[5]} -git push --set-upstream origin $BRANCH +git push --set-upstream origin HEAD:$BRANCH -which xdg-open >/dev/null && TOOL=xdg-open -which gnome-open >/dev/null && TOOL=gnome-open -which open >/dev/null && TOOL=open +OPEN=$(echo $(which gnome-open xdg-open open) | awk '{ print $1 }') URL="https://github.com/$FORK/$REPO/commits/$BRANCH" if [ -z "$OPEN" ]; then diff --git a/buildroot/share/git/mfpr b/buildroot/share/git/mfpr index bff9834bc1..b853c6929e 100755 --- a/buildroot/share/git/mfpr +++ b/buildroot/share/git/mfpr @@ -23,9 +23,7 @@ OLDBRANCH=${INFO[5]} # See if it's been pushed yet if [ -z "$(git branch -vv | grep ^\* | grep \\[origin)" ]; then firstpush; fi -which xdg-open >/dev/null && TOOL=xdg-open -which gnome-open >/dev/null && TOOL=gnome-open -which open >/dev/null && TOOL=open +OPEN=$(echo $(which gnome-open xdg-open open) | awk '{ print $1 }') URL="https://github.com/$ORG/$REPO/compare/$TARG...$FORK:$BRANCH?expand=1" if [ -z "$OPEN" ]; then diff --git a/buildroot/share/git/mfpub b/buildroot/share/git/mfpub index 8ec28ad489..6a912e5515 100755 --- a/buildroot/share/git/mfpub +++ b/buildroot/share/git/mfpub @@ -67,11 +67,11 @@ if [[ $BRANCH == $TARG ]]; then # Allow working directly with the main fork echo echo -n "Pushing to origin/$TARG... " - git push -f origin + git push origin HEAD:$TARG echo echo -n "Pushing to upstream/$TARG... " - git push -f upstream + git push upstream HEAD:$TARG else @@ -126,7 +126,7 @@ git push -f origin git push -f upstream | { while IFS= read -r line do - [[ $line =~ "gh-pages -> gh-pages" ]] && opensite "http://marlinfw.org/" + [[ $line =~ "gh-pages -> gh-pages" ]] && opensite "https://marlinfw.org/" echo "$line" done } @@ -135,4 +135,4 @@ git push -f upstream | { rm -rf ${TMPFOLDER} # Go back to the branch we started from -[[ $BRANCH != $CURR ]] && git checkout $BRANCH && [[ $HAS_STASH == 1 ]] && git stash pop +git checkout $CURR && [[ $HAS_STASH == 1 ]] && git stash pop diff --git a/buildroot/share/git/mftest b/buildroot/share/git/mftest index 62186a5f82..3a88bf5f28 100755 --- a/buildroot/share/git/mftest +++ b/buildroot/share/git/mftest @@ -9,7 +9,8 @@ MFINFO=$(mfinfo) || exit 1 [[ -d Marlin/src ]] || { echo "Please 'cd' up to repo root." ; exit 1 ; } -TESTPATH=buildroot/share/tests +TESTPATH=buildroot/tests + STATE_FILE=$( echo ./.pio/.mftestrc ) SED=$(which gsed || which sed) diff --git a/buildroot/share/scripts/config-labels.py b/buildroot/share/scripts/config-labels.py new file mode 100755 index 0000000000..8effb54eed --- /dev/null +++ b/buildroot/share/scripts/config-labels.py @@ -0,0 +1,201 @@ +#!/usr/bin/env python +# +# for python3.5 or higher +#----------------------------------- +# Within Marlin project MarlinFirmware/Configurations, this program visits all folders +# under .../config/examples/*, processing each Configuration.h, Configuration_adv.h, +# _Bootscreen.h, and _Statusscreen.h, to insert: +# #define CONFIG_EXAMPLES_DIR "examples/