diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 59269af81d..696a00b440 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -14,13 +14,13 @@ body: ## Before Reporting a Bug - - Read and understand Marlin's [Code of Conduct](https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/.github/code_of_conduct.md). You are expected to comply with it, including treating everyone with respect. + - Read and understand Marlin's [Code of Conduct](https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.1.x/.github/code_of_conduct.md). You are expected to comply with it, including treating everyone with respect. - - Test with the [`bugfix-2.0.x` branch](https://github.com/MarlinFirmware/Marlin/archive/bugfix-2.0.x.zip) to see whether the issue still exists. + - Test with the [`bugfix-2.1.x` branch](https://github.com/MarlinFirmware/Marlin/archive/bugfix-2.1.x.zip) to see whether the issue still exists. ## Instructions - Please follow the instructions below. Failure to do so may result in your issue being closed. See [Contributing to Marlin](https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/.github/contributing.md) for additional guidelines. + Please follow the instructions below. Failure to do so may result in your issue being closed. See [Contributing to Marlin](https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.1.x/.github/contributing.md) for additional guidelines. 1. Provide a good title starting with [BUG]. 2. Fill out all sections of this bug report form. @@ -28,10 +28,10 @@ body: - type: dropdown attributes: - label: Did you test the latest `bugfix-2.0.x` code? + label: Did you test the latest `bugfix-2.1.x` code? description: >- Always try the latest code to make sure the issue you are reporting is not already fixed. To download - the latest code just [click this link](https://github.com/MarlinFirmware/Marlin/archive/bugfix-2.0.x.zip). + the latest code just [click this link](https://github.com/MarlinFirmware/Marlin/archive/bugfix-2.1.x.zip). options: - Yes, and the problem still exists. - No, but I will test it now! @@ -50,6 +50,8 @@ body: Describe the bug in this section. Tell us what you were trying to do and what happened that you did not expect. Provide a clear and concise description of the problem and include as many details as possible. + + When pasting formatted text don't forget to put ` ``` ` (on its own line) before and after to make it readable. placeholder: | Marlin doesn't work. validations: @@ -147,23 +149,20 @@ body: - Same as my slicer - Other (explain below) - - type: markdown + - type: checkboxes attributes: - value: >- - ## Other things to include - - Please also be sure to include these items to help with troubleshooting: - - * **A ZIP file** containing your `Configuration.h` and `Configuration_adv.h`. - (Please don't paste lengthy configuration text here.) - * **Log output** from the host. (`M111 S247` for maximum logging.) - * **Images or videos** demonstrating the problem, if it helps to make it clear. - * **A G-Code file** that exposes the problem, if not affecting _all_ G-code. - - If you've made any other modifications to the firmware, please describe them in detail in the space provided. - - When pasting formatted text into the box below don't forget to put ` ``` ` (on its own line) before and after to make it readable. + label: Other things to include + options: + - label: A ZIP file containing your `Configuration.h` and `Configuration_adv.h`. + required: true + - label: Log output from the host. (`M111 S247` for maximum logging.) + - label: Images or videos demonstrating the problem, if it helps to make it clear. + - label: A G-Code file that exposes the problem, if not affecting _all_ G-code. - type: textarea attributes: label: Additional information & file uploads + description: >- + If you've made any other modifications to the firmware, please describe them in detail. + + When pasting formatted text don't forget to put ` ``` ` (on its own line) before and after to make it readable. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index df1938ccd8..b64383cd48 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -17,7 +17,7 @@ body: - Read and understand Marlin's [Code of Conduct](https://github.com/MarlinFirmware/Marlin/blob/master/.github/code_of_conduct.md). You are expected to comply with it, including treating everyone with respect. - - Check the latest [`bugfix-2.0.x` branch](https://github.com/MarlinFirmware/Marlin/archive/bugfix-2.0.x.zip) to see if the feature already exists. + - Check the latest [`bugfix-2.1.x` branch](https://github.com/MarlinFirmware/Marlin/archive/bugfix-2.1.x.zip) to see if the feature already exists. - Before you proceed with your request, please consider if it is necessary to make it into a firmware feature, or if it may be better suited for a slicer or host feature. diff --git a/.github/contributing.md b/.github/contributing.md index 24b9dbdf8d..fcb87b0141 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -116,7 +116,7 @@ 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-2.0.x` and/or `bugfix-1.1.x`) and never to release branches (e.g., `2.0.x` and/or `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. +Pull Requests should always be targeted to working branches (e.g., `bugfix-2.1.x` and/or `bugfix-1.1.x`) and never to release branches (e.g., `2.0.x` and/or `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. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index d82fb0f9e3..cd5158b3ce 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,23 +1,33 @@ -### Requirements + ### Description +### Requirements + + + ### Benefits - + ### Configurations - + ### Related Issues - + diff --git a/.github/workflows/bump-date.yml b/.github/workflows/bump-date.yml new file mode 100644 index 0000000000..51b58ad493 --- /dev/null +++ b/.github/workflows/bump-date.yml @@ -0,0 +1,59 @@ +# +# bump-date.yml +# Bump the distribution date once per day +# + +name: Bump Distribution Date + +on: + schedule: + - cron: '0 */6 * * *' + +jobs: + bump_date: + name: Bump Distribution Date + if: github.repository == 'MarlinFirmware/Marlin' + + runs-on: ubuntu-latest + + steps: + + - name: Check out bugfix-2.1.x + uses: actions/checkout@v2 + with: + ref: bugfix-2.1.x + + - name: Bump Date (bugfix-2.0.x) + run: | + # Inline Bump Script + if [[ ! "$( git log -1 --pretty=%B )" =~ ^\[cron\] ]]; then + DIST=$( date +"%Y-%m-%d" ) + eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/Version.h" && \ + eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/Version.h" && \ + git config user.name "${GITHUB_ACTOR}" && \ + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \ + git add . && \ + git commit -m "[cron] Bump distribution date ($DIST)" && \ + git push + fi + exit 0 + + - name: Check out bugfix-2.1.x + uses: actions/checkout@v2 + with: + ref: bugfix-2.1.x + + - name: Bump Date (bugfix-2.1.x) + run: | + # Inline Bump Script + if [[ ! "$( git log -1 --pretty=%B )" =~ ^\[cron\] ]]; then + DIST=$( date +"%Y-%m-%d" ) + eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/Version.h" && \ + eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/Version.h" && \ + git config user.name "${GITHUB_ACTOR}" && \ + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \ + git add . && \ + git commit -m "[cron] Bump distribution date ($DIST)" && \ + git push + fi + exit 0 diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml new file mode 100644 index 0000000000..79d0b5e2d0 --- /dev/null +++ b/.github/workflows/check-pr.yml @@ -0,0 +1,34 @@ +# +# check-pr.yml +# Close PRs directed at release branches +# + +name: PR Bad Target + +on: + pull_request_target: + types: [opened] + branches: + - 1.0.x + - 1.1.x + - 2.0.x + - 2.1.x + +jobs: + bad_target: + name: PR Bad Target + if: github.repository == 'MarlinFirmware/Marlin' + + runs-on: ubuntu-latest + + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: > + Thanks for your contribution! Unfortunately we can't accept PRs directed at release branches. We make patches to the bugfix branches and only later do we push them out as releases. + + Please redo this PR starting with the `bugfix-2.1.x` branch and be careful to target `bugfix-2.1.x` when resubmitting the PR. Patches may also target `bugfix-2.0.x` if they are specifically for 2.0.9.x. + + It may help to set your fork's default branch to `bugfix-2.0.x`. + + See [this page](http://marlinfw.org/docs/development/getting_started_pull_requests.html) for full instructions. diff --git a/.github/workflows/clean-closed.yml b/.github/workflows/clean-closed.yml new file mode 100644 index 0000000000..befec4498f --- /dev/null +++ b/.github/workflows/clean-closed.yml @@ -0,0 +1,39 @@ +# +# clean-closed.yml +# Remove obsolete labels when an Issue or PR is closed +# + +name: Clean Closed + +on: + pull_request: + types: [closed] + issues: + types: [closed] + +jobs: + remove_label: + runs-on: ubuntu-latest + + strategy: + matrix: + label: + - "S: Don't Merge" + - "S: Hold for 2.1" + - "S: Please Merge" + - "S: Please Test" + - "help wanted" + - "Needs: Discussion" + - "Needs: Documentation" + - "Needs: More Data" + - "Needs: Patch" + - "Needs: Testing" + - "Needs: Work" + + steps: + - uses: actions/checkout@v2 + - name: Remove Labels + uses: actions-ecosystem/action-remove-labels@v1 + with: + github_token: ${{ github.token }} + labels: ${{ matrix.label }} diff --git a/.github/workflows/close-stale.yml b/.github/workflows/close-stale.yml new file mode 100644 index 0000000000..f90c079f66 --- /dev/null +++ b/.github/workflows/close-stale.yml @@ -0,0 +1,28 @@ +# +# close-stale.yml +# Close open issues after a period of inactivity +# + +name: Close Stale Issues + +on: + schedule: + - cron: "22 1 * * *" + +jobs: + stale: + name: Close Stale Issues + if: github.repository == 'MarlinFirmware/Marlin' + + runs-on: ubuntu-latest + + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 10 days.' + days-before-stale: 60 + days-before-close: 10 + stale-issue-label: 'stale-closing-soon' + exempt-all-assignees: true + exempt-issue-labels: 'Bug: Confirmed !,T: Feature Request,Needs: Discussion,Needs: Documentation,Needs: Patch,Needs: Work,Needs: Testing,help wanted,no-locking' diff --git a/.github/workflows/lock-closed.yml b/.github/workflows/lock-closed.yml new file mode 100644 index 0000000000..8cdcd7a836 --- /dev/null +++ b/.github/workflows/lock-closed.yml @@ -0,0 +1,32 @@ +# +# lock-closed.yml +# Lock closed issues after a period of inactivity +# + +name: Lock Closed Issues + +on: + schedule: + - cron: '0 1/13 * * *' + +jobs: + lock: + name: Lock Closed Issues + if: github.repository == 'MarlinFirmware/Marlin' + + runs-on: ubuntu-latest + + steps: + - uses: dessant/lock-threads@v2 + with: + github-token: ${{ github.token }} + process-only: 'issues' + issue-lock-inactive-days: '60' + issue-exclude-created-before: '' + issue-exclude-labels: 'no-locking' + issue-lock-labels: '' + issue-lock-comment: > + This issue has been automatically locked since there + has not been any recent activity after it was closed. + Please open a new issue for related bugs. + issue-lock-reason: '' diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index 498cfc1d1f..747095e07f 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -9,6 +9,7 @@ on: pull_request: branches: - bugfix-2.0.x + - bugfix-2.1.x paths-ignore: - config/** - data/** @@ -17,6 +18,7 @@ on: push: branches: - bugfix-2.0.x + - bugfix-2.1.x paths-ignore: - config/** - data/** diff --git a/.github/workflows/unlock-reopened.yml b/.github/workflows/unlock-reopened.yml new file mode 100644 index 0000000000..614ef3fab2 --- /dev/null +++ b/.github/workflows/unlock-reopened.yml @@ -0,0 +1,22 @@ +# +# unlock-reopened.yml +# Unlock an issue whenever it is re-opened +# + +name: "Unlock reopened issue" + +on: + issues: + types: [reopened] + +jobs: + unlock: + name: Unlock Reopened + if: github.repository == 'MarlinFirmware/Marlin' + + runs-on: ubuntu-latest + + steps: + - uses: OSDKDev/unlock-issues@v1.1 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 73e099e7a1..562deb4cf8 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -714,7 +714,7 @@ #if ENABLED(PIDTEMP) //#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] + // Set/get with G-code: M301 E[extruder number, 0-2] #if ENABLED(PID_PARAMS_PER_HOTEND) // Specify up to one value per hotend here, according to your setup. @@ -765,15 +765,15 @@ //#define MPC_FAN_0_ACTIVE_HOTEND #endif - #define FILAMENT_HEAT_CAPACITY_PERMM 5.6e-3f // 0.0056 J/K/mm for 1.75mm PLA (0.0149 J/K/mm for 2.85mm PLA). - //#define FILAMENT_HEAT_CAPACITY_PERMM 3.6e-3f // 0.0036 J/K/mm for 1.75mm PETG (0.0094 J/K/mm for 2.85mm PETG). + #define FILAMENT_HEAT_CAPACITY_PERMM { 5.6e-3f } // 0.0056 J/K/mm for 1.75mm PLA (0.0149 J/K/mm for 2.85mm PLA). + //#define FILAMENT_HEAT_CAPACITY_PERMM { 3.6e-3f } // 0.0036 J/K/mm for 1.75mm PETG (0.0094 J/K/mm for 2.85mm PETG). // Advanced options #define MPC_SMOOTHING_FACTOR 0.5f // (0.0...1.0) Noisy temperature sensors may need a lower value for stabilization. #define MPC_MIN_AMBIENT_CHANGE 1.0f // (K/s) Modeled ambient temperature rate of change, when correcting model inaccuracies. #define MPC_STEADYSTATE 0.5f // (K/s) Temperature change rate for steady state logic to be enforced. - #define MPC_TUNING_POS { X_CENTER, Y_CENTER, 1.0f } // (mm) M306 Autotuning position, ideally bed center just above the surface. + #define MPC_TUNING_POS { X_CENTER, Y_CENTER, 1.0f } // (mm) M306 Autotuning position, ideally bed center at first layer height. #define MPC_TUNING_END_Z 10.0f // (mm) M306 Autotuning final Z position. #endif @@ -2040,18 +2040,18 @@ #endif // Add a menu item to move between bed corners for manual bed adjustment -//#define LEVEL_BED_CORNERS +//#define LCD_BED_TRAMMING -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET_LFRB { 30, 30, 30, 30 } // (mm) Left, Front, Right, Back insets - #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points - #define LEVEL_CORNERS_Z_HOP 4.0 // (mm) Z height of nozzle between leveling points - //#define LEVEL_CENTER_TOO // Move to the center after the last corner - //#define LEVEL_CORNERS_USE_PROBE - #if ENABLED(LEVEL_CORNERS_USE_PROBE) - #define LEVEL_CORNERS_PROBE_TOLERANCE 0.1 - #define LEVEL_CORNERS_VERIFY_RAISED // After adjustment triggers the probe, re-probe to verify - //#define LEVEL_CORNERS_AUDIO_FEEDBACK +#if ENABLED(LCD_BED_TRAMMING) + #define BED_TRAMMING_INSET_LFRB { 30, 30, 30, 30 } // (mm) Left, Front, Right, Back insets + #define BED_TRAMMING_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + #define BED_TRAMMING_Z_HOP 4.0 // (mm) Z height of nozzle between leveling points + //#define BED_TRAMMING_INCLUDE_CENTER // Move to the center after the last corner + //#define BED_TRAMMING_USE_PROBE + #if ENABLED(BED_TRAMMING_USE_PROBE) + #define BED_TRAMMING_PROBE_TOLERANCE 0.1 // (mm) + #define BED_TRAMMING_VERIFY_RAISED // After adjustment triggers the probe, re-probe to verify + //#define BED_TRAMMING_AUDIO_FEEDBACK #endif /** @@ -2071,7 +2071,7 @@ * | 1 2 | | 1 4 | | 1 2 | | 2 | * LF --------- RF LF --------- RF LF --------- RF LF --------- RF */ - #define LEVEL_CORNERS_LEVELING_ORDER { LF, RF, RB, LB } + #define BED_TRAMMING_LEVELING_ORDER { LF, RF, RB, LB } #endif /** diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 6c02943ba0..c8437f9e7e 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3689,7 +3689,10 @@ #if ENABLED(SPINDLE_LASER_USE_PWM) #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, ESP32, and LPC) - #endif + // ESP32: If SPINDLE_LASER_PWM_PIN is onboard then <=78125Hz. For I2S expander + // the frequency determines the PWM resolution. 2500Hz = 0-100, 977Hz = 0-255, ... + // (250000 / SPINDLE_LASER_FREQUENCY) = max value. +#endif //#define AIR_EVACUATION // Cutter Vacuum / Laser Blower motor control with G-codes M10-M11 #if ENABLED(AIR_EVACUATION) @@ -3765,6 +3768,16 @@ #define LASER_TEST_PULSE_MIN 1 // Used with Laser Control Menu #define LASER_TEST_PULSE_MAX 999 // Caution: Menu may not show more than 3 characters + /** + * Laser Safety Timeout + * + * The laser should be turned off when there is no movement for a period of time. + * Consider material flammability, cut rate, and G-code order when setting this + * value. Too low and it could turn off during a very slow move; too high and + * the material could ignite. + */ + #define LASER_SAFETY_TIMEOUT_MS 1000 // (ms) + /** * 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) diff --git a/Marlin/Makefile b/Marlin/Makefile index f1c89ff7f5..563354fdbe 100644 --- a/Marlin/Makefile +++ b/Marlin/Makefile @@ -109,7 +109,7 @@ LIQUID_TWI2 ?= 0 # This defines if Wire is needed WIRE ?= 0 -# This defines if Tone is needed (i.e SPEAKER is defined in Configuration.h) +# This defines if Tone is needed (i.e., SPEAKER is defined in Configuration.h) # Disabling this (and SPEAKER) saves approximately 350 bytes of memory. TONE ?= 1 @@ -512,7 +512,7 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1324) else ifeq ($(HARDWARE_MOTHERBOARD),1325) # Intamsys 4.0 (Funmat HT) else ifeq ($(HARDWARE_MOTHERBOARD),1326) -# Malyan M180 Mainboard Version 2 (no display function, direct gcode only) +# Malyan M180 Mainboard Version 2 (no display function, direct G-code only) else ifeq ($(HARDWARE_MOTHERBOARD),1327) # Geeetech GT2560 Rev B for A20(M/T/D) else ifeq ($(HARDWARE_MOTHERBOARD),1328) diff --git a/Marlin/Version.h b/Marlin/Version.h index 577682a00b..a29fe8e37f 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -28,7 +28,7 @@ /** * Marlin release version identifier */ -//#define SHORT_BUILD_VERSION "bugfix-2.0.x" +//#define SHORT_BUILD_VERSION "bugfix-2.1.x" /** * Verbose version identifier which should contain a reference to the location @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2022-05-17" +//#define STRING_DISTRIBUTION_DATE "2022-06-08" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/HAL/AVR/pinsDebug.h b/Marlin/src/HAL/AVR/pinsDebug.h index 247ae32b8f..dab4e44715 100644 --- a/Marlin/src/HAL/AVR/pinsDebug.h +++ b/Marlin/src/HAL/AVR/pinsDebug.h @@ -74,7 +74,7 @@ #define MULTI_NAME_PAD 26 // space needed to be pretty if not first name assigned to a pin void PRINT_ARRAY_NAME(uint8_t x) { - char *name_mem_pointer = (PGM_P)pgm_read_ptr(&pin_array[x].name); + PGM_P const name_mem_pointer = (PGM_P)pgm_read_ptr(&pin_array[x].name); LOOP_L_N(y, MAX_NAME_LENGTH) { char temp_char = pgm_read_byte(name_mem_pointer + y); if (temp_char != 0) diff --git a/Marlin/src/HAL/DUE/eeprom_flash.cpp b/Marlin/src/HAL/DUE/eeprom_flash.cpp index 7ce4a84df5..607764155b 100644 --- a/Marlin/src/HAL/DUE/eeprom_flash.cpp +++ b/Marlin/src/HAL/DUE/eeprom_flash.cpp @@ -199,8 +199,7 @@ 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])); - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM PageWrite ", page); + DEBUG_ECHO_MSG("EEPROM PageWrite ", page); DEBUG_ECHOLNPGM(" in FLASH address ", (uint32_t)addrflash); DEBUG_ECHOLNPGM(" base address ", (uint32_t)getFlashStorage(0)); DEBUG_FLUSH(); @@ -245,8 +244,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) { // Reenable interrupts __enable_irq(); - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Unlock failure for page ", page); + DEBUG_ECHO_MSG("EEPROM Unlock failure for page ", page); return false; } @@ -270,8 +268,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) { // Reenable interrupts __enable_irq(); - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Write failure for page ", page); + DEBUG_ECHO_MSG("EEPROM Write failure for page ", page); return false; } @@ -286,8 +283,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) { if (memcmp(getFlashStorage(page),data,PageSize)) { #ifdef EE_EMU_DEBUG - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Verify Write failure for page ", page); + DEBUG_ECHO_MSG("EEPROM Verify Write failure for page ", page); ee_Dump( page, (uint32_t *)addrflash); ee_Dump(-page, data); @@ -325,8 +321,7 @@ static bool ee_PageErase(uint16_t page) { uint16_t i; uint32_t addrflash = uint32_t(getFlashStorage(page)); - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM PageErase ", page); + DEBUG_ECHO_MSG("EEPROM PageErase ", page); DEBUG_ECHOLNPGM(" in FLASH address ", (uint32_t)addrflash); DEBUG_ECHOLNPGM(" base address ", (uint32_t)getFlashStorage(0)); DEBUG_FLUSH(); @@ -370,8 +365,7 @@ static bool ee_PageErase(uint16_t page) { // Reenable interrupts __enable_irq(); - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Unlock failure for page ",page); + DEBUG_ECHO_MSG("EEPROM Unlock failure for page ",page); return false; } @@ -394,8 +388,7 @@ static bool ee_PageErase(uint16_t page) { // Reenable interrupts __enable_irq(); - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Erase failure for page ",page); + DEBUG_ECHO_MSG("EEPROM Erase failure for page ",page); return false; } @@ -410,8 +403,7 @@ 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) { - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Verify Erase failure for page ",page); + DEBUG_ECHO_MSG("EEPROM Verify Erase failure for page ",page); ee_Dump(page, (uint32_t *)addrflash); return false; } @@ -921,8 +913,7 @@ static void ee_Init() { // If all groups seem to be used, default to first group if (curGroup >= GroupCount) curGroup = 0; - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Current Group: ",curGroup); + DEBUG_ECHO_MSG("EEPROM Current Group: ",curGroup); DEBUG_FLUSH(); // Now, validate that all the other group pages are empty @@ -931,8 +922,7 @@ static void ee_Init() { for (int page = 0; page < PagesPerGroup; page++) { if (!ee_IsPageClean(grp * PagesPerGroup + page)) { - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Page ", page, " not clean on group ", grp); + DEBUG_ECHO_MSG("EEPROM Page ", page, " not clean on group ", grp); DEBUG_FLUSH(); ee_PageErase(grp * PagesPerGroup + page); } @@ -948,15 +938,13 @@ static void ee_Init() { } } - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Active page: ", curPage); + DEBUG_ECHO_MSG("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)) { - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Page ", page, " not clean on active group ", curGroup); + DEBUG_ECHO_MSG("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); diff --git a/Marlin/src/HAL/ESP32/HAL.cpp b/Marlin/src/HAL/ESP32/HAL.cpp index 65af39786e..29f3be3c02 100644 --- a/Marlin/src/HAL/ESP32/HAL.cpp +++ b/Marlin/src/HAL/ESP32/HAL.cpp @@ -65,6 +65,7 @@ portMUX_TYPE MarlinHAL::spinlock = portMUX_INITIALIZER_UNLOCKED; // ------------------------ uint16_t MarlinHAL::adc_result; +pwm_pin_t MarlinHAL::pwm_pin_data[MAX_EXPANDER_BITS]; // ------------------------ // Private Variables @@ -330,21 +331,46 @@ int8_t get_pwm_channel(const pin_t pin, const uint32_t freq, const uint16_t res) } void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=_BV(PWM_RESOLUTION)-1*/, const bool invert/*=false*/) { - const int8_t cid = get_pwm_channel(pin, PWM_FREQUENCY, PWM_RESOLUTION); - if (cid >= 0) { - uint32_t duty = map(invert ? v_size - v : v, 0, v_size, 0, _BV(PWM_RESOLUTION)-1); - ledcWrite(cid, duty); - } + #if ENABLED(I2S_STEPPER_STREAM) + if (pin > 127) { + const uint8_t pinlo = pin & 0x7F; + pwm_pin_t &pindata = pwm_pin_data[pinlo]; + const uint32_t duty = map(invert ? v_size - v : v, 0, v_size, 0, pindata.pwm_cycle_ticks); + if (duty == 0 || duty == pindata.pwm_cycle_ticks) { // max or min (i.e., on/off) + pindata.pwm_duty_ticks = 0; // turn off PWM for this pin + duty ? SBI32(i2s_port_data, pinlo) : CBI32(i2s_port_data, pinlo); // set pin level + } + else + pindata.pwm_duty_ticks = duty; // PWM duty count = # of 4µs ticks per full PWM cycle + } + else + #endif + { + const int8_t cid = get_pwm_channel(pin, PWM_FREQUENCY, PWM_RESOLUTION); + if (cid >= 0) { + const uint32_t duty = map(invert ? v_size - v : v, 0, v_size, 0, _BV(PWM_RESOLUTION)-1); + ledcWrite(cid, duty); + } + } } int8_t MarlinHAL::set_pwm_frequency(const pin_t pin, const uint32_t f_desired) { - const int8_t cid = channel_for_pin(pin); - if (cid >= 0) { - if (f_desired == ledcReadFreq(cid)) return cid; // no freq change - ledcDetachPin(chan_pin[cid]); - chan_pin[cid] = 0; // remove old freq channel - } - return get_pwm_channel(pin, f_desired, PWM_RESOLUTION); // try for new one + #if ENABLED(I2S_STEPPER_STREAM) + if (pin > 127) { + pwm_pin_data[pin & 0x7F].pwm_cycle_ticks = 1000000UL / f_desired / 4; // # of 4µs ticks per full PWM cycle + return 0; + } + else + #endif + { + const int8_t cid = channel_for_pin(pin); + if (cid >= 0) { + if (f_desired == ledcReadFreq(cid)) return cid; // no freq change + ledcDetachPin(chan_pin[cid]); + chan_pin[cid] = 0; // remove old freq channel + } + return get_pwm_channel(pin, f_desired, PWM_RESOLUTION); // try for new one + } } // use hardware PWM if avail, if not then ISR diff --git a/Marlin/src/HAL/ESP32/HAL.h b/Marlin/src/HAL/ESP32/HAL.h index a07303d489..600ca8f5ee 100644 --- a/Marlin/src/HAL/ESP32/HAL.h +++ b/Marlin/src/HAL/ESP32/HAL.h @@ -68,6 +68,9 @@ #define PWM_RESOLUTION 10u // Default PWM bit resolution #define CHANNEL_MAX_NUM 15u // max PWM channel # to allocate (7 to only use low speed, 15 to use low & high) #define MAX_PWM_IOPIN 33u // hardware pwm pins < 34 +#ifndef MAX_EXPANDER_BITS + #define MAX_EXPANDER_BITS 32 // I2S expander bit width (max 32) +#endif // ------------------------ // Types @@ -76,6 +79,12 @@ typedef double isr_float_t; // FPU ops are used for single-precision, so use double for ISRs. typedef int16_t pin_t; +typedef struct pwm_pin { + uint32_t pwm_cycle_ticks = 1000000UL / (PWM_FREQUENCY) / 4; // # ticks per pwm cycle + uint32_t pwm_tick_count = 0; // current tick count + uint32_t pwm_duty_ticks = 0; // # of ticks for current duty cycle +} pwm_pin_t; + class Servo; typedef Servo hal_servo_t; @@ -197,6 +206,8 @@ public: // Free SRAM static int freeMemory(); + static pwm_pin_t pwm_pin_data[MAX_EXPANDER_BITS]; + // // ADC Methods // diff --git a/Marlin/src/HAL/ESP32/i2s.cpp b/Marlin/src/HAL/ESP32/i2s.cpp index 3e77b65836..cf337eeb46 100644 --- a/Marlin/src/HAL/ESP32/i2s.cpp +++ b/Marlin/src/HAL/ESP32/i2s.cpp @@ -337,6 +337,26 @@ uint8_t i2s_state(uint8_t pin) { } void i2s_push_sample() { + // Every 4µs (when space in DMA buffer) toggle each expander PWM output using + // the current duty cycle/frequency so they sync with any steps (once + // through the DMA/FIFO buffers). PWM signal inversion handled by other functions + LOOP_L_N(p, MAX_EXPANDER_BITS) { + if (hal.pwm_pin_data[p].pwm_duty_ticks > 0) { // pin has active pwm? + if (hal.pwm_pin_data[p].pwm_tick_count == 0) { + if (TEST32(i2s_port_data, p)) { // hi->lo + CBI32(i2s_port_data, p); + hal.pwm_pin_data[p].pwm_tick_count = hal.pwm_pin_data[p].pwm_cycle_ticks - hal.pwm_pin_data[p].pwm_duty_ticks; + } + else { // lo->hi + SBI32(i2s_port_data, p); + hal.pwm_pin_data[p].pwm_tick_count = hal.pwm_pin_data[p].pwm_duty_ticks; + } + } + else + hal.pwm_pin_data[p].pwm_tick_count--; + } + } + dma.current[dma.rw_pos++] = i2s_port_data; } diff --git a/Marlin/src/HAL/ESP32/inc/Conditionals_adv.h b/Marlin/src/HAL/ESP32/inc/Conditionals_adv.h index 5f1c4b1601..3ca806897a 100644 --- a/Marlin/src/HAL/ESP32/inc/Conditionals_adv.h +++ b/Marlin/src/HAL/ESP32/inc/Conditionals_adv.h @@ -20,3 +20,10 @@ * */ #pragma once + +// +// Board-specific options need to be defined before HAL.h +// +#if MB(MKS_TINYBEE) + #define MAX_EXPANDER_BITS 24 // TinyBee has 3 x HC595 +#endif diff --git a/Marlin/src/HAL/ESP32/inc/SanityCheck.h b/Marlin/src/HAL/ESP32/inc/SanityCheck.h index 04d70ec14f..3ccb15989f 100644 --- a/Marlin/src/HAL/ESP32/inc/SanityCheck.h +++ b/Marlin/src/HAL/ESP32/inc/SanityCheck.h @@ -48,3 +48,7 @@ #if USING_PULLDOWNS #error "PULLDOWN pin mode is not available on ESP32 boards." #endif + +#if BOTH(I2S_STEPPER_STREAM, LIN_ADVANCE) + #error "I2S stream is currently incompatible with LIN_ADVANCE." +#endif diff --git a/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp b/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp index 5437e8181b..a445035b2b 100644 --- a/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp +++ b/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp @@ -23,24 +23,17 @@ */ #ifdef ARDUINO_ARCH_ESP32 -#include "../../inc/MarlinConfigPre.h" +#include "../../inc/MarlinConfig.h" #if EITHER(MKS_MINI_12864, FYSETC_MINI_12864_2_1) #include -#include "Arduino.h" #include "../shared/HAL_SPI.h" #include "HAL.h" #include "SPI.h" static SPISettings spiConfig; -#define MDOGLCD_MOSI 23 -#define MDOGLCD_SCK 18 -#define MLCD_RESET_PIN 0 -#define MLCD_PINS_DC 4 -#define MDOGLCD_CS 21 -#define MDOGLCD_A0 4 #ifndef LCD_SPI_SPEED #ifdef SD_SPI_SPEED @@ -61,24 +54,24 @@ uint8_t u8g_eps_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_pt case U8G_COM_MSG_STOP: break; case U8G_COM_MSG_INIT: - OUT_WRITE(MDOGLCD_CS, HIGH); - OUT_WRITE(MDOGLCD_A0, HIGH); - OUT_WRITE(MLCD_RESET_PIN, HIGH); + OUT_WRITE(DOGLCD_CS, HIGH); + OUT_WRITE(DOGLCD_A0, HIGH); + OUT_WRITE(LCD_RESET_PIN, HIGH); u8g_Delay(5); spiBegin(); spiInit(LCD_SPI_SPEED); break; case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ - WRITE(MDOGLCD_A0, arg_val ? HIGH : LOW); + WRITE(DOGLCD_A0, arg_val ? HIGH : LOW); break; case U8G_COM_MSG_CHIP_SELECT: /* arg_val == 0 means HIGH level of U8G_PI_CS */ - WRITE(MDOGLCD_CS, arg_val ? LOW : HIGH); + WRITE(DOGLCD_CS, arg_val ? LOW : HIGH); break; case U8G_COM_MSG_RESET: - WRITE(MLCD_RESET_PIN, arg_val); + WRITE(LCD_RESET_PIN, arg_val); break; case U8G_COM_MSG_WRITE_BYTE: diff --git a/Marlin/src/HAL/SAMD51/HAL.cpp b/Marlin/src/HAL/SAMD51/HAL.cpp index 648e0a4f14..bd1c98bfa1 100644 --- a/Marlin/src/HAL/SAMD51/HAL.cpp +++ b/Marlin/src/HAL/SAMD51/HAL.cpp @@ -598,7 +598,7 @@ void MarlinHAL::dma_init() { void MarlinHAL::init() { TERN_(DMA_IS_REQUIRED, dma_init()); #if ENABLED(SDSUPPORT) - #if SD_CONNECTION_IS(ONBOARD) && PIN_EXISTS(SD_DETECT) + #if HAS_SD_DETECT && SD_CONNECTION_IS(ONBOARD) SET_INPUT_PULLUP(SD_DETECT_PIN); #endif OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up diff --git a/Marlin/src/HAL/STM32/msc_sd.cpp b/Marlin/src/HAL/STM32/msc_sd.cpp index 4f85af0d44..a40bec9d64 100644 --- a/Marlin/src/HAL/STM32/msc_sd.cpp +++ b/Marlin/src/HAL/STM32/msc_sd.cpp @@ -57,7 +57,7 @@ public: auto sd2card = diskIODriver(); // single block if (blkLen == 1) { - watchdog_refresh(); + hal.watchdog_refresh(); sd2card->writeBlock(blkAddr, pBuf); return true; } @@ -65,7 +65,7 @@ public: // multi block optimization sd2card->writeStart(blkAddr, blkLen); while (blkLen--) { - watchdog_refresh(); + hal.watchdog_refresh(); sd2card->writeData(pBuf); pBuf += BLOCK_SIZE; } @@ -77,7 +77,7 @@ public: auto sd2card = diskIODriver(); // single block if (blkLen == 1) { - watchdog_refresh(); + hal.watchdog_refresh(); sd2card->readBlock(blkAddr, pBuf); return true; } @@ -85,7 +85,7 @@ public: // multi block optimization sd2card->readStart(blkAddr); while (blkLen--) { - watchdog_refresh(); + hal.watchdog_refresh(); sd2card->readData(pBuf); pBuf += BLOCK_SIZE; } diff --git a/Marlin/src/HAL/STM32/sdio.cpp b/Marlin/src/HAL/STM32/sdio.cpp index b26ec768e8..e958d8c3bc 100644 --- a/Marlin/src/HAL/STM32/sdio.cpp +++ b/Marlin/src/HAL/STM32/sdio.cpp @@ -35,42 +35,15 @@ // use local drivers #if defined(STM32F103xE) || defined(STM32F103xG) - #include - #include + #include #elif defined(STM32F4xx) - #include - #include - #include - #include + #include #elif defined(STM32F7xx) - #include - #include - #include - #include + #include +#elif defined(STM32H7xx) + #include #else - #error "SDIO only supported with STM32F103xE, STM32F103xG, STM32F4xx, or STM32F7xx." -#endif - -SD_HandleTypeDef hsd; // create SDIO structure -// F4 supports one DMA for RX and another for TX, but Marlin will never -// do read and write at same time, so we use the same DMA for both. -DMA_HandleTypeDef hdma_sdio; - -/* - SDIO_INIT_CLK_DIV is 118 - SDIO clock frequency is 48MHz / (TRANSFER_CLOCK_DIV + 2) - SDIO init clock frequency should not exceed 400kHz = 48MHz / (118 + 2) - - Default TRANSFER_CLOCK_DIV is 2 (118 / 40) - Default SDIO clock frequency is 48MHz / (2 + 2) = 12 MHz - This might be too fast for stable SDIO operations - - MKS Robin board seems to have stable SDIO with BusWide 1bit and ClockDiv 8 i.e. 4.8MHz SDIO clock frequency - Additional testing is required as there are clearly some 4bit initialization problems -*/ - -#ifndef USBD_OK - #define USBD_OK 0 + #error "SDIO only supported with STM32F103xE, STM32F103xG, STM32F4xx, STM32F7xx, or STM32H7xx." #endif // Target Clock, configurable. Default is 18MHz, from STM32F1 @@ -78,223 +51,209 @@ DMA_HandleTypeDef hdma_sdio; #define SDIO_CLOCK 18000000 // 18 MHz #endif -// SDIO retries, configurable. Default is 3, from STM32F1 -#ifndef SDIO_READ_RETRIES - #define SDIO_READ_RETRIES 3 -#endif +#define SD_TIMEOUT 1000 // ms // SDIO Max Clock (naming from STM Manual, don't change) #define SDIOCLK 48000000 -static uint32_t clock_to_divider(uint32_t clk) { - // limit the SDIO master clock to 8/3 of PCLK2. See STM32 Manuals - // Also limited to no more than 48Mhz (SDIOCLK). - const uint32_t pclk2 = HAL_RCC_GetPCLK2Freq(); - clk = min(clk, (uint32_t)(pclk2 * 8 / 3)); - clk = min(clk, (uint32_t)SDIOCLK); - // Round up divider, so we don't run the card over the speed supported, - // and subtract by 2, because STM32 will add 2, as written in the manual: - // SDIO_CK frequency = SDIOCLK / [CLKDIV + 2] - return pclk2 / clk + (pclk2 % clk != 0) - 2; +#if defined(STM32F1xx) + DMA_HandleTypeDef hdma_sdio; + extern "C" void DMA2_Channel4_5_IRQHandler(void) { + HAL_DMA_IRQHandler(&hdma_sdio); + } +#elif defined(STM32F4xx) + DMA_HandleTypeDef hdma_sdio_rx; + DMA_HandleTypeDef hdma_sdio_tx; + extern "C" void DMA2_Stream3_IRQHandler(void) { + HAL_DMA_IRQHandler(&hdma_sdio_rx); + } + + extern "C" void DMA2_Stream6_IRQHandler(void) { + HAL_DMA_IRQHandler(&hdma_sdio_tx); + } +#elif defined(STM32H7xx) + #define __HAL_RCC_SDIO_FORCE_RESET __HAL_RCC_SDMMC1_FORCE_RESET + #define __HAL_RCC_SDIO_RELEASE_RESET __HAL_RCC_SDMMC1_RELEASE_RESET + #define __HAL_RCC_SDIO_CLK_ENABLE __HAL_RCC_SDMMC1_CLK_ENABLE + #define SDIO SDMMC1 + #define SDIO_IRQn SDMMC1_IRQn + #define SDIO_IRQHandler SDMMC1_IRQHandler + #define SDIO_CLOCK_EDGE_RISING SDMMC_CLOCK_EDGE_RISING + #define SDIO_CLOCK_POWER_SAVE_DISABLE SDMMC_CLOCK_POWER_SAVE_DISABLE + #define SDIO_BUS_WIDE_1B SDMMC_BUS_WIDE_1B + #define SDIO_BUS_WIDE_4B SDMMC_BUS_WIDE_4B + #define SDIO_HARDWARE_FLOW_CONTROL_DISABLE SDMMC_HARDWARE_FLOW_CONTROL_DISABLE +#endif + +uint8_t waitingRxCplt = 0; +uint8_t waitingTxCplt = 0; +SD_HandleTypeDef hsd; + +extern "C" void SDIO_IRQHandler(void) { + HAL_SD_IRQHandler(&hsd); } -void go_to_transfer_speed() { - /* Default SDIO peripheral configuration for SD card initialization */ - hsd.Init.ClockEdge = hsd.Init.ClockEdge; - hsd.Init.ClockBypass = hsd.Init.ClockBypass; - hsd.Init.ClockPowerSave = hsd.Init.ClockPowerSave; - hsd.Init.BusWide = hsd.Init.BusWide; - hsd.Init.HardwareFlowControl = hsd.Init.HardwareFlowControl; - hsd.Init.ClockDiv = clock_to_divider(SDIO_CLOCK); - - /* Initialize SDIO peripheral interface with default configuration */ - SDIO_Init(hsd.Instance, hsd.Init); +void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsdio) { + waitingTxCplt = 0; } -void SD_LowLevel_Init(void) { - uint32_t tempreg; - - __HAL_RCC_GPIOC_CLK_ENABLE(); //enable GPIO clocks - __HAL_RCC_GPIOD_CLK_ENABLE(); //enable GPIO clocks - - GPIO_InitTypeDef GPIO_InitStruct; - - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = 1; //GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; - - #if DISABLED(STM32F1xx) - GPIO_InitStruct.Alternate = GPIO_AF12_SDIO; - #endif - - GPIO_InitStruct.Pin = GPIO_PIN_8 | GPIO_PIN_12; // D0 & SCK - HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); +void HAL_SD_RxCpltCallback(SD_HandleTypeDef *hsdio) { + waitingRxCplt = 0; +} +void HAL_SD_MspInit(SD_HandleTypeDef *hsd) { + pinmap_pinout(PC_12, PinMap_SD); + pinmap_pinout(PD_2, PinMap_SD); + pinmap_pinout(PC_8, PinMap_SD); #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 - HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + // D1-D3 + pinmap_pinout(PC_9, PinMap_SD); + pinmap_pinout(PC_10, PinMap_SD); + pinmap_pinout(PC_11, PinMap_SD); #endif - // Configure PD.02 CMD line - GPIO_InitStruct.Pin = GPIO_PIN_2; - HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); - - // Setup DMA - #if defined(STM32F1xx) - hdma_sdio.Init.Mode = DMA_NORMAL; - hdma_sdio.Instance = DMA2_Channel4; - HAL_NVIC_EnableIRQ(DMA2_Channel4_5_IRQn); - #elif defined(STM32F4xx) - hdma_sdio.Init.Mode = DMA_PFCTRL; - hdma_sdio.Instance = DMA2_Stream3; - hdma_sdio.Init.Channel = DMA_CHANNEL_4; - hdma_sdio.Init.FIFOMode = DMA_FIFOMODE_ENABLE; - hdma_sdio.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; - hdma_sdio.Init.MemBurst = DMA_MBURST_INC4; - hdma_sdio.Init.PeriphBurst = DMA_PBURST_INC4; - HAL_NVIC_EnableIRQ(DMA2_Stream3_IRQn); - #endif + __HAL_RCC_SDIO_CLK_ENABLE(); HAL_NVIC_EnableIRQ(SDIO_IRQn); - hdma_sdio.Init.PeriphInc = DMA_PINC_DISABLE; - hdma_sdio.Init.MemInc = DMA_MINC_ENABLE; - hdma_sdio.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD; - hdma_sdio.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; - hdma_sdio.Init.Priority = DMA_PRIORITY_LOW; - __HAL_LINKDMA(&hsd, hdmarx, hdma_sdio); - __HAL_LINKDMA(&hsd, hdmatx, hdma_sdio); + // DMA Config #if defined(STM32F1xx) - __HAL_RCC_SDIO_CLK_ENABLE(); __HAL_RCC_DMA2_CLK_ENABLE(); - #else - __HAL_RCC_SDIO_FORCE_RESET(); - delay(2); - __HAL_RCC_SDIO_RELEASE_RESET(); - delay(2); - __HAL_RCC_SDIO_CLK_ENABLE(); + HAL_NVIC_EnableIRQ(DMA2_Channel4_5_IRQn); + hdma_sdio.Instance = DMA2_Channel4; + hdma_sdio.Init.Direction = DMA_PERIPH_TO_MEMORY; + hdma_sdio.Init.PeriphInc = DMA_PINC_DISABLE; + hdma_sdio.Init.MemInc = DMA_MINC_ENABLE; + hdma_sdio.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD; + hdma_sdio.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; + hdma_sdio.Init.Mode = DMA_NORMAL; + hdma_sdio.Init.Priority = DMA_PRIORITY_LOW; + HAL_DMA_Init(&hdma_sdio); - __HAL_RCC_DMA2_FORCE_RESET(); - delay(2); - __HAL_RCC_DMA2_RELEASE_RESET(); - delay(2); + __HAL_LINKDMA(hsd, hdmarx ,hdma_sdio); + __HAL_LINKDMA(hsd, hdmatx, hdma_sdio); + #elif defined(STM32F4xx) __HAL_RCC_DMA2_CLK_ENABLE(); + HAL_NVIC_EnableIRQ(DMA2_Stream3_IRQn); + HAL_NVIC_EnableIRQ(DMA2_Stream6_IRQn); + hdma_sdio_rx.Instance = DMA2_Stream3; + hdma_sdio_rx.Init.Channel = DMA_CHANNEL_4; + hdma_sdio_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; + hdma_sdio_rx.Init.PeriphInc = DMA_PINC_DISABLE; + hdma_sdio_rx.Init.MemInc = DMA_MINC_ENABLE; + hdma_sdio_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD; + hdma_sdio_rx.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; + hdma_sdio_rx.Init.Mode = DMA_PFCTRL; + hdma_sdio_rx.Init.Priority = DMA_PRIORITY_LOW; + hdma_sdio_rx.Init.FIFOMode = DMA_FIFOMODE_ENABLE; + hdma_sdio_rx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; + hdma_sdio_rx.Init.MemBurst = DMA_MBURST_INC4; + hdma_sdio_rx.Init.PeriphBurst = DMA_PBURST_INC4; + HAL_DMA_Init(&hdma_sdio_rx); + + __HAL_LINKDMA(hsd,hdmarx,hdma_sdio_rx); + + hdma_sdio_tx.Instance = DMA2_Stream6; + hdma_sdio_tx.Init.Channel = DMA_CHANNEL_4; + hdma_sdio_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; + hdma_sdio_tx.Init.PeriphInc = DMA_PINC_DISABLE; + hdma_sdio_tx.Init.MemInc = DMA_MINC_ENABLE; + hdma_sdio_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD; + hdma_sdio_tx.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; + hdma_sdio_tx.Init.Mode = DMA_PFCTRL; + hdma_sdio_tx.Init.Priority = DMA_PRIORITY_LOW; + hdma_sdio_tx.Init.FIFOMode = DMA_FIFOMODE_ENABLE; + hdma_sdio_tx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; + hdma_sdio_tx.Init.MemBurst = DMA_MBURST_INC4; + hdma_sdio_tx.Init.PeriphBurst = DMA_PBURST_INC4; + HAL_DMA_Init(&hdma_sdio_tx); + + __HAL_LINKDMA(hsd,hdmatx,hdma_sdio_tx); #endif - - //Initialize the SDIO (with initial <400Khz Clock) - tempreg = 0; //Reset value - tempreg |= SDIO_CLKCR_CLKEN; // Clock enabled - tempreg |= SDIO_INIT_CLK_DIV; // 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; - - // Power up the SDIO - SDIO_PowerState_ON(SDIO); - hsd.Instance = SDIO; } -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 +void HAL_SD_MspDeInit(SD_HandleTypeDef *hsd) { + #if !defined(STM32F1xx) + __HAL_RCC_SDIO_FORCE_RESET(); + delay(10); + __HAL_RCC_SDIO_RELEASE_RESET(); + delay(10); + #endif +} + +static uint32_t clock_to_divider(uint32_t clk) { + #if defined(STM32H7xx) + // SDMMC_CK frequency = sdmmc_ker_ck / [2 * CLKDIV]. + uint32_t sdmmc_clk = HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_SDMMC); + return sdmmc_clk / (2U * SDIO_CLOCK) + (sdmmc_clk % (2U * SDIO_CLOCK) != 0); + #else + // limit the SDIO master clock to 8/3 of PCLK2. See STM32 Manuals + // Also limited to no more than 48Mhz (SDIOCLK). + const uint32_t pclk2 = HAL_RCC_GetPCLK2Freq(); + clk = min(clk, (uint32_t)(pclk2 * 8 / 3)); + clk = min(clk, (uint32_t)SDIOCLK); + // Round up divider, so we don't run the card over the speed supported, + // and subtract by 2, because STM32 will add 2, as written in the manual: + // SDIO_CK frequency = SDIOCLK / [CLKDIV + 2] + return pclk2 / clk + (pclk2 % clk != 0) - 2; + #endif } bool SDIO_Init() { - uint8_t retryCnt = SDIO_READ_RETRIES; + HAL_StatusTypeDef sd_state = HAL_OK; + if (hsd.Instance == SDIO) + HAL_SD_DeInit(&hsd); - bool status; + /* HAL SD initialization */ hsd.Instance = SDIO; - hsd.State = HAL_SD_STATE_RESET; + hsd.Init.ClockEdge = SDIO_CLOCK_EDGE_RISING; + hsd.Init.ClockPowerSave = SDIO_CLOCK_POWER_SAVE_DISABLE; + hsd.Init.BusWide = SDIO_BUS_WIDE_1B; + hsd.Init.HardwareFlowControl = SDIO_HARDWARE_FLOW_CONTROL_DISABLE; + hsd.Init.ClockDiv = clock_to_divider(SDIO_CLOCK); + sd_state = HAL_SD_Init(&hsd); - SD_LowLevel_Init(); - - uint8_t retry_Cnt = retryCnt; - for (;;) { - hal.watchdog_refresh(); - status = (bool) HAL_SD_Init(&hsd); - if (!status) break; - if (!--retry_Cnt) return false; // return failing status if retries are exhausted - } - - 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 (;;) { - hal.watchdog_refresh(); - 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 (;;) { - hal.watchdog_refresh(); - status = (bool) HAL_SD_Init(&hsd); - if (!status) break; - if (!--retry_Cnt) return false; // return failing status if retries are exhausted - } - go_to_transfer_speed(); + #if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) + if (sd_state == HAL_OK) { + sd_state = HAL_SD_ConfigWideBusOperation(&hsd, SDIO_BUS_WIDE_4B); } #endif - return true; -} - -static bool SDIO_ReadWriteBlock_DMA(uint32_t block, const uint8_t *src, uint8_t *dst) { - if (HAL_SD_GetCardState(&hsd) != HAL_SD_CARD_TRANSFER) return false; - - hal.watchdog_refresh(); - - HAL_StatusTypeDef ret; - if (src) { - hdma_sdio.Init.Direction = DMA_MEMORY_TO_PERIPH; - HAL_DMA_Init(&hdma_sdio); - ret = HAL_SD_WriteBlocks_DMA(&hsd, (uint8_t *)src, block, 1); - } - else { - hdma_sdio.Init.Direction = DMA_PERIPH_TO_MEMORY; - HAL_DMA_Init(&hdma_sdio); - ret = HAL_SD_ReadBlocks_DMA(&hsd, (uint8_t *)dst, block, 1); - } - - if (ret != HAL_OK) { - HAL_DMA_Abort_IT(&hdma_sdio); - HAL_DMA_DeInit(&hdma_sdio); - return false; - } - - millis_t timeout = millis() + 500; - // Wait the transfer - while (hsd.State != HAL_SD_STATE_READY) { - if (ELAPSED(millis(), timeout)) { - HAL_DMA_Abort_IT(&hdma_sdio); - HAL_DMA_DeInit(&hdma_sdio); - return false; - } - } - - while (__HAL_DMA_GET_FLAG(&hdma_sdio, __HAL_DMA_GET_TC_FLAG_INDEX(&hdma_sdio)) != 0 - || __HAL_DMA_GET_FLAG(&hdma_sdio, __HAL_DMA_GET_TE_FLAG_INDEX(&hdma_sdio)) != 0) { /* nada */ } - - HAL_DMA_Abort_IT(&hdma_sdio); - HAL_DMA_DeInit(&hdma_sdio); - - timeout = millis() + 500; - while (HAL_SD_GetCardState(&hsd) != HAL_SD_CARD_TRANSFER) if (ELAPSED(millis(), timeout)) return false; - - return true; + return (sd_state == HAL_OK) ? true : false; } bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) { - uint8_t retries = SDIO_READ_RETRIES; - while (retries--) if (SDIO_ReadWriteBlock_DMA(block, nullptr, dst)) return true; - return false; + uint32_t timeout = HAL_GetTick() + SD_TIMEOUT; + + while (HAL_SD_GetCardState(&hsd) != HAL_SD_CARD_TRANSFER) { + if (HAL_GetTick() >= timeout) return false; + } + + waitingRxCplt = 1; + if (HAL_SD_ReadBlocks_DMA(&hsd, (uint8_t *)dst, block, 1) != HAL_OK) + return false; + + timeout = HAL_GetTick() + SD_TIMEOUT; + while (waitingRxCplt) + if (HAL_GetTick() >= timeout) return false; + + return true; } bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) { - uint8_t retries = SDIO_READ_RETRIES; - while (retries--) if (SDIO_ReadWriteBlock_DMA(block, src, nullptr)) return true; - return false; + uint32_t timeout = HAL_GetTick() + SD_TIMEOUT; + + while (HAL_SD_GetCardState(&hsd) != HAL_SD_CARD_TRANSFER) + if (HAL_GetTick() >= timeout) return false; + + waitingTxCplt = 1; + if (HAL_SD_WriteBlocks_DMA(&hsd, (uint8_t *)src, block, 1) != HAL_OK) + return false; + + timeout = HAL_GetTick() + SD_TIMEOUT; + while (waitingTxCplt) + if (HAL_GetTick() >= timeout) return false; + + return true; } bool SDIO_IsReady() { @@ -305,16 +264,5 @@ uint32_t SDIO_GetCardSize() { return (uint32_t)(hsd.SdCard.BlockNbr) * (hsd.SdCard.BlockSize); } -#if defined(STM32F1xx) - #define DMA_IRQ_HANDLER DMA2_Channel4_5_IRQHandler -#elif defined(STM32F4xx) - #define DMA_IRQ_HANDLER DMA2_Stream3_IRQHandler -#else - #error "Unknown STM32 architecture." -#endif - -extern "C" void SDIO_IRQHandler(void) { HAL_SD_IRQHandler(&hsd); } -extern "C" void DMA_IRQ_HANDLER(void) { HAL_DMA_IRQHandler(&hdma_sdio); } - #endif // SDIO_SUPPORT #endif // HAL_STM32 diff --git a/Marlin/src/HAL/STM32F1/tft/tft_spi.cpp b/Marlin/src/HAL/STM32F1/tft/tft_spi.cpp index 9bf6bbb32b..f447cec811 100644 --- a/Marlin/src/HAL/STM32F1/tft/tft_spi.cpp +++ b/Marlin/src/HAL/STM32F1/tft/tft_spi.cpp @@ -30,7 +30,7 @@ SPIClass TFT_SPI::SPIx(1); void TFT_SPI::Init() { #if PIN_EXISTS(TFT_RESET) - OUT_WRITE(TFT_RST_PIN, HIGH); + OUT_WRITE(TFT_RESET_PIN, HIGH); delay(100); #endif diff --git a/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp b/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp index deaf09d2c0..e54661c770 100644 --- a/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp +++ b/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp @@ -221,7 +221,7 @@ bool resume_from_fault() { // So we'll just need to refresh the watchdog for a while and then stop for the system to reboot uint32_t last = start; while (PENDING(last, end)) { - watchdog_refresh(); + hal.watchdog_refresh(); while (millis() == last) { /* nada */ } last = millis(); MinSerial::TX('.'); diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 1397a65aba..a39e6ad53c 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -423,37 +423,38 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) { kill(); } + const bool has_blocks = planner.has_blocks_queued(); // Any moves in the planner? + if (has_blocks) gcode.reset_stepper_timeout(ms); // Reset timeout for M18/M84, M85 max 'kill', and laser. + // M18 / M84 : Handle steppers inactive time timeout - if (gcode.stepper_inactive_time) { + #if HAS_DISABLE_INACTIVE_AXIS + if (gcode.stepper_inactive_time) { - static bool already_shutdown_steppers; // = false + 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(ms); - else if (!do_reset_timeout && gcode.stepper_inactive_timeout()) { - if (!already_shutdown_steppers) { - already_shutdown_steppers = true; // L6470 SPI will consume 99% of free time without this + if (!has_blocks && !do_reset_timeout && 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 - TERN_(DISABLE_INACTIVE_X, stepper.disable_axis(X_AXIS)); - TERN_(DISABLE_INACTIVE_Y, stepper.disable_axis(Y_AXIS)); - TERN_(DISABLE_INACTIVE_Z, stepper.disable_axis(Z_AXIS)); - TERN_(DISABLE_INACTIVE_I, stepper.disable_axis(I_AXIS)); - TERN_(DISABLE_INACTIVE_J, stepper.disable_axis(J_AXIS)); - TERN_(DISABLE_INACTIVE_K, stepper.disable_axis(K_AXIS)); - TERN_(DISABLE_INACTIVE_U, stepper.disable_axis(U_AXIS)); - TERN_(DISABLE_INACTIVE_V, stepper.disable_axis(V_AXIS)); - TERN_(DISABLE_INACTIVE_W, stepper.disable_axis(W_AXIS)); - TERN_(DISABLE_INACTIVE_E, stepper.disable_e_steppers()); + // Individual axes will be disabled if configured + TERN_(DISABLE_INACTIVE_X, stepper.disable_axis(X_AXIS)); + TERN_(DISABLE_INACTIVE_Y, stepper.disable_axis(Y_AXIS)); + TERN_(DISABLE_INACTIVE_Z, stepper.disable_axis(Z_AXIS)); + TERN_(DISABLE_INACTIVE_I, stepper.disable_axis(I_AXIS)); + TERN_(DISABLE_INACTIVE_J, stepper.disable_axis(J_AXIS)); + TERN_(DISABLE_INACTIVE_K, stepper.disable_axis(K_AXIS)); + TERN_(DISABLE_INACTIVE_U, stepper.disable_axis(U_AXIS)); + TERN_(DISABLE_INACTIVE_V, stepper.disable_axis(V_AXIS)); + TERN_(DISABLE_INACTIVE_W, stepper.disable_axis(W_AXIS)); + TERN_(DISABLE_INACTIVE_E, stepper.disable_e_steppers()); - TERN_(AUTO_BED_LEVELING_UBL, bedlevel.steppers_were_disabled()); + TERN_(AUTO_BED_LEVELING_UBL, bedlevel.steppers_were_disabled()); + } } + else + already_shutdown_steppers = false; } - else - already_shutdown_steppers = false; - } + #endif #if ENABLED(PHOTO_GCODE) && PIN_EXISTS(CHDK) // Check if CHDK should be set to LOW (after M240 set it HIGH) @@ -1241,6 +1242,17 @@ void setup() { SETUP_RUN(tmc_serial_begin()); #endif + #if HAS_TMC_SPI + #if DISABLED(TMC_USE_SW_SPI) + SETUP_RUN(SPI.begin()); + #endif + SETUP_RUN(tmc_init_cs_pins()); + #endif + + #if HAS_L64XX + SETUP_RUN(L64xxManager.init()); // Set up SPI, init drivers + #endif + #if ENABLED(PSU_CONTROL) SETUP_LOG("PSU_CONTROL"); powerManager.init(); @@ -1250,21 +1262,10 @@ void setup() { SETUP_RUN(recovery.setup()); #endif - #if HAS_L64XX - SETUP_RUN(L64xxManager.init()); // Set up SPI, init drivers - #endif - #if HAS_STEPPER_RESET SETUP_RUN(disableStepperDrivers()); #endif - #if HAS_TMC_SPI - #if DISABLED(TMC_USE_SW_SPI) - SETUP_RUN(SPI.begin()); - #endif - SETUP_RUN(tmc_init_cs_pins()); - #endif - SETUP_RUN(hal.init_board()); SETUP_RUN(esp_wifi_init()); diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 653bbf1e17..ef750056d6 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -161,7 +161,7 @@ #define BOARD_PICA_REVB 1324 // PICA Shield (original version) #define BOARD_PICA 1325 // PICA Shield (rev C or later) #define BOARD_INTAMSYS40 1326 // Intamsys 4.0 (Funmat HT) -#define BOARD_MALYAN_M180 1327 // Malyan M180 Mainboard Version 2 (no display function, direct gcode only) +#define BOARD_MALYAN_M180 1327 // Malyan M180 Mainboard Version 2 (no display function, direct G-code only) #define BOARD_GT2560_V4_A20 1328 // Geeetech GT2560 Rev B for A20(M/T/D) #define BOARD_PROTONEER_CNC_SHIELD_V3 1329 // Mega controller & Protoneer CNC Shield V3.00 #define BOARD_WEEDO_62A 1330 // WEEDO 62A board (TINA2, Monoprice Cadet, etc.) @@ -228,33 +228,33 @@ #define BOARD_RAMPS_14_RE_ARM_EFF 2002 // Re-ARM with RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1) #define BOARD_RAMPS_14_RE_ARM_EEF 2003 // Re-ARM with RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan) #define BOARD_RAMPS_14_RE_ARM_SF 2004 // Re-ARM with RAMPS 1.4 (Power outputs: Spindle, Controller Fan) -#define BOARD_MKS_SBASE 2005 // MKS-Sbase (Power outputs: Hotend0, Hotend1, Bed, Fan) +#define BOARD_MKS_SBASE 2005 // MKS-Sbase #define BOARD_AZSMZ_MINI 2006 // AZSMZ Mini -#define BOARD_BIQU_BQ111_A4 2007 // BIQU BQ111-A4 (Power outputs: Hotend, Fan, Bed) -#define BOARD_SELENA_COMPACT 2008 // Selena Compact (Power outputs: Hotend0, Hotend1, Bed0, Bed1, Fan0, Fan1) -#define BOARD_BIQU_B300_V1_0 2009 // BIQU B300_V1.0 (Power outputs: Hotend0, Fan, Bed, SPI Driver) -#define BOARD_MKS_SGEN_L 2010 // MKS-SGen-L (Power outputs: Hotend0, Hotend1, Bed, Fan) +#define BOARD_BIQU_BQ111_A4 2007 // BIQU BQ111-A4 +#define BOARD_SELENA_COMPACT 2008 // Selena Compact +#define BOARD_BIQU_B300_V1_0 2009 // BIQU B300_V1.0 +#define BOARD_MKS_SGEN_L 2010 // MKS-SGen-L #define BOARD_GMARSH_X6_REV1 2011 // GMARSH X6, revision 1 prototype -#define BOARD_BTT_SKR_V1_1 2012 // BigTreeTech SKR v1.1 (Power outputs: Hotend0, Hotend1, Fan, Bed) -#define BOARD_BTT_SKR_V1_3 2013 // BigTreeTech SKR v1.3 (Power outputs: Hotend0, Hotend1, Fan, Bed) -#define BOARD_BTT_SKR_V1_4 2014 // BigTreeTech SKR v1.4 (Power outputs: Hotend0, Hotend1, Fan, Bed) +#define BOARD_BTT_SKR_V1_1 2012 // BigTreeTech SKR v1.1 +#define BOARD_BTT_SKR_V1_3 2013 // BigTreeTech SKR v1.3 +#define BOARD_BTT_SKR_V1_4 2014 // BigTreeTech SKR v1.4 // // LPC1769 ARM Cortex M3 // -#define BOARD_MKS_SGEN 2500 // MKS-SGen (Power outputs: Hotend0, Hotend1, Bed, Fan) -#define BOARD_AZTEEG_X5_GT 2501 // Azteeg X5 GT (Power outputs: Hotend0, Hotend1, Bed, Fan) -#define BOARD_AZTEEG_X5_MINI 2502 // Azteeg X5 Mini (Power outputs: Hotend0, Bed, Fan) -#define BOARD_AZTEEG_X5_MINI_WIFI 2503 // Azteeg X5 Mini Wifi (Power outputs: Hotend0, Bed, Fan) +#define BOARD_MKS_SGEN 2500 // MKS-SGen +#define BOARD_AZTEEG_X5_GT 2501 // Azteeg X5 GT +#define BOARD_AZTEEG_X5_MINI 2502 // Azteeg X5 Mini +#define BOARD_AZTEEG_X5_MINI_WIFI 2503 // Azteeg X5 Mini Wifi #define BOARD_COHESION3D_REMIX 2504 // Cohesion3D ReMix #define BOARD_COHESION3D_MINI 2505 // Cohesion3D Mini #define BOARD_SMOOTHIEBOARD 2506 // Smoothieboard #define BOARD_TH3D_EZBOARD 2507 // TH3D EZBoard v1.0 -#define BOARD_BTT_SKR_V1_4_TURBO 2508 // BigTreeTech SKR v1.4 TURBO (Power outputs: Hotend0, Hotend1, Fan, Bed) -#define BOARD_MKS_SGEN_L_V2 2509 // MKS SGEN_L V2 (Power outputs: Hotend0, Hotend1, Bed, Fan) -#define BOARD_BTT_SKR_E3_TURBO 2510 // BigTreeTech SKR E3 Turbo (Power outputs: Hotend0, Hotend1, Bed, Fan0, Fan1) -#define BOARD_FLY_CDY 2511 // FLYmaker FLY CDY (Power outputs: Hotend0, Hotend1, Hotend2, Bed, Fan0, Fan1, Fan2) +#define BOARD_BTT_SKR_V1_4_TURBO 2508 // BigTreeTech SKR v1.4 TURBO +#define BOARD_MKS_SGEN_L_V2 2509 // MKS SGEN_L V2 +#define BOARD_BTT_SKR_E3_TURBO 2510 // BigTreeTech SKR E3 Turbo +#define BOARD_FLY_CDY 2511 // FLYmaker FLY CDY // // SAM3X8E ARM Cortex M3 @@ -280,8 +280,8 @@ #define BOARD_RAMPS4DUE_EFF 3017 // RAMPS4DUE (Power outputs: Hotend, Fan0, Fan1) #define BOARD_RAMPS4DUE_EEF 3018 // RAMPS4DUE (Power outputs: Hotend0, Hotend1, Fan) #define BOARD_RAMPS4DUE_SF 3019 // RAMPS4DUE (Power outputs: Spindle, Controller Fan) -#define BOARD_RURAMPS4D_11 3020 // RuRAMPS4Duo v1.1 (Power outputs: Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed) -#define BOARD_RURAMPS4D_13 3021 // RuRAMPS4Duo v1.3 (Power outputs: Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed) +#define BOARD_RURAMPS4D_11 3020 // RuRAMPS4Duo v1.1 +#define BOARD_RURAMPS4D_13 3021 // RuRAMPS4Duo v1.3 #define BOARD_ULTRATRONICS_PRO 3022 // ReprapWorld Ultratronics Pro V1.0 #define BOARD_ARCHIM1 3023 // UltiMachine Archim1 (with DRV8825 drivers) #define BOARD_ARCHIM2 3024 // UltiMachine Archim2 (with TMC2130 drivers) @@ -293,7 +293,7 @@ // SAM3X8C ARM Cortex M3 // -#define BOARD_PRINTRBOARD_G2 3100 // PRINTRBOARD G2 +#define BOARD_PRINTRBOARD_G2 3100 // Printrboard G2 #define BOARD_ADSK 3101 // Arduino DUE Shield Kit (ADSK) // @@ -429,6 +429,8 @@ #define BOARD_T41U5XBB 5002 // T41U5XBB Teensy 4.1 breakout board #define BOARD_NUCLEO_F767ZI 5003 // ST NUCLEO-F767ZI Dev Board #define BOARD_BTT_SKR_SE_BX 5004 // BigTreeTech SKR SE BX (STM32H743II) +#define BOARD_BTT_SKR_V3_0 5005 // BigTreeTech SKR V3.0 (STM32H743VG) +#define BOARD_BTT_SKR_V3_0_EZ 5006 // BigTreeTech SKR V3.0 EZ (STM32H743VG) // // Espressif ESP32 WiFi diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index c12386b46b..b7d1ac916e 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -712,13 +712,22 @@ #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)) +// Call OP(A) with each item as an argument +#define _MAP(_MAP_OP,A,V...) \ + _MAP_OP(A) \ + IF_ELSE(HAS_ARGS(V)) \ + ( DEFER2(__MAP)()(_MAP_OP,V) ) \ + ( /* Do nothing */ ) +#define __MAP() _MAP + +#define MAP(OP,V...) EVAL(_MAP(OP,V)) + +// Emit a list of OP(A) with the given items +#define _MAPLIST(_MAP_OP,A,V...) \ + _MAP_OP(A) \ + IF_ELSE(HAS_ARGS(V)) \ + ( , DEFER2(__MAPLIST)()(_MAP_OP,V) ) \ + ( /* Do nothing */ ) +#define __MAPLIST() _MAPLIST + +#define MAPLIST(OP,V...) EVAL(_MAPLIST(OP,V)) diff --git a/Marlin/src/core/multi_language.h b/Marlin/src/core/multi_language.h index a605a6f024..05a713e435 100644 --- a/Marlin/src/core/multi_language.h +++ b/Marlin/src/core/multi_language.h @@ -45,6 +45,7 @@ typedef const char Language_Str[]; // Set unused languages equal to each other so the // compiler can optimize away the conditionals. +#define LCD_LANGUAGE_1 LCD_LANGUAGE #ifndef LCD_LANGUAGE_2 #define LCD_LANGUAGE_2 LCD_LANGUAGE #endif diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index 140a031b77..49e792110e 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -30,12 +30,15 @@ uint8_t marlin_debug_flags = MARLIN_DEBUG_NONE; // Commonly-used strings in serial output -PGMSTR(NUL_STR, ""); PGMSTR(SP_P_STR, " P"); PGMSTR(SP_T_STR, " T"); -PGMSTR(SP_A_STR, " A"); PGMSTR(SP_B_STR, " B"); PGMSTR(SP_C_STR, " C"); -LOGICAL_AXIS_CODE(PGMSTR(SP_E_STR, " E"), PGMSTR(SP_X_STR, " X"), PGMSTR(SP_Y_STR, " Y"), PGMSTR(SP_Z_STR, " Z"), PGMSTR(SP_I_STR, " " STR_I), PGMSTR(SP_J_STR, " " STR_J), PGMSTR(SP_K_STR, " " STR_K), PGMSTR(SP_U_STR, " " STR_U), PGMSTR(SP_V_STR, " " STR_V), PGMSTR(SP_W_STR, " " STR_W)); -LOGICAL_AXIS_CODE(PGMSTR(SP_E_LBL, " E:"), PGMSTR(SP_X_LBL, " X:"), PGMSTR(SP_Y_LBL, " Y:"), PGMSTR(SP_Z_LBL, " Z:"), PGMSTR(SP_I_LBL, " " STR_I ":"), PGMSTR(SP_J_LBL, " " STR_J ":"), PGMSTR(SP_K_LBL, " " STR_K ":"), PGMSTR(SP_U_LBL, " " STR_U ":"), PGMSTR(SP_V_LBL, " " STR_V ":"), PGMSTR(SP_W_LBL, " " STR_W ":")); -LOGICAL_AXIS_CODE(PGMSTR(E_STR, "E"), PGMSTR(X_STR, "X"), PGMSTR(Y_STR, "Y"), PGMSTR(Z_STR, "Z"), PGMSTR(I_STR, STR_I), PGMSTR(J_STR, STR_J), PGMSTR(K_STR, STR_K), PGMSTR(U_STR, STR_U), PGMSTR(V_STR, STR_V), PGMSTR(W_STR, STR_W)); -LOGICAL_AXIS_CODE(PGMSTR(E_LBL, "E:"), PGMSTR(X_LBL, "X:"), PGMSTR(Y_LBL, "Y:"), PGMSTR(Z_LBL, "Z:"), PGMSTR(I_LBL, STR_I ":"), PGMSTR(J_LBL, STR_J ":"), PGMSTR(K_LBL, STR_K ":"), PGMSTR(U_LBL, STR_U ":"), PGMSTR(V_LBL, STR_V ":"), PGMSTR(W_LBL, STR_W ":")); +PGMSTR(SP_A_STR, " A"); PGMSTR(SP_B_STR, " B"); PGMSTR(SP_C_STR, " C"); +PGMSTR(SP_P_STR, " P"); PGMSTR(SP_T_STR, " T"); PGMSTR(NUL_STR, ""); + +#define _N_STR(N) PGMSTR(N##_STR, STR_##N); +#define _N_LBL(N) PGMSTR(N##_LBL, STR_##N ":"); +#define _SP_N_STR(N) PGMSTR(SP_##N##_STR, " " STR_##N); +#define _SP_N_LBL(N) PGMSTR(SP_##N##_LBL, " " STR_##N ":"); +MAP(_N_STR, LOGICAL_AXIS_NAMES); MAP(_SP_N_STR, LOGICAL_AXIS_NAMES); +MAP(_N_LBL, LOGICAL_AXIS_NAMES); MAP(_SP_N_LBL, LOGICAL_AXIS_NAMES); // Hook Meatpack if it's enabled on the first leaf #if ENABLED(MEATPACK_ON_SERIAL_PORT_1) diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index 000e2060c5..c19bc08783 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -28,17 +28,6 @@ #include "../feature/meatpack.h" #endif -// Commonly-used strings in serial output -extern const char NUL_STR[], SP_P_STR[], SP_T_STR[], - SP_A_STR[], SP_B_STR[], SP_C_STR[], - LOGICAL_AXIS_LIST(SP_E_STR[], SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_I_STR[], SP_J_STR[], SP_K_STR[], SP_U_STR[], SP_V_STR[], SP_W_STR[]), - LOGICAL_AXIS_LIST(SP_E_LBL[], SP_X_LBL[], SP_Y_LBL[], SP_Z_LBL[], SP_I_LBL[], SP_J_LBL[], SP_K_LBL[], SP_U_LBL[], SP_V_LBL[], SP_W_LBL[]), - LOGICAL_AXIS_LIST(E_STR[], X_STR[], Y_STR[], Z_STR[], I_STR[], J_STR[], K_STR[], U_STR[], V_STR[], W_STR[]), - LOGICAL_AXIS_LIST(E_LBL[], X_LBL[], Y_LBL[], Z_LBL[], I_LBL[], J_LBL[], K_LBL[], U_LBL[], V_LBL[], W_LBL[]); - -PGM_P const SP_AXIS_LBL[] PROGMEM = LOGICAL_AXIS_ARRAY(SP_E_LBL, SP_X_LBL, SP_Y_LBL, SP_Z_LBL, SP_I_LBL, SP_J_LBL, SP_K_LBL, SP_U_LBL, SP_V_LBL, SP_W_LBL); -PGM_P const SP_AXIS_STR[] PROGMEM = LOGICAL_AXIS_ARRAY(SP_E_STR, SP_X_STR, SP_Y_STR, SP_Z_STR, SP_I_STR, SP_J_STR, SP_K_STR, SP_U_STR, SP_V_STR, SP_W_STR); - // // Debugging flags for use by M111 // @@ -354,3 +343,32 @@ inline void print_pos(const xyz_pos_t &xyz, FSTR_P const prefix=nullptr, FSTR_P #define SERIAL_POS(SUFFIX,VAR) do { print_pos(VAR, F(" " STRINGIFY(VAR) "="), F(" : " SUFFIX "\n")); }while(0) #define SERIAL_XYZ(PREFIX,V...) do { print_pos(V, F(PREFIX)); }while(0) + +// +// Commonly-used strings in serial output +// + +#define _N_STR(N) N##_STR +#define _N_LBL(N) N##_LBL +#define _N_STR_A(N) _N_STR(N)[] +#define _N_LBL_A(N) _N_LBL(N)[] +#define _SP_N_STR(N) SP_##N##_STR +#define _SP_N_LBL(N) SP_##N##_LBL +#define _SP_N_STR_A(N) _SP_N_STR(N)[] +#define _SP_N_LBL_A(N) _SP_N_LBL(N)[] + +extern const char SP_A_STR[], SP_B_STR[], SP_C_STR[], SP_P_STR[], SP_T_STR[], NUL_STR[], + MAPLIST(_N_STR_A, LOGICAL_AXIS_NAMES), MAPLIST(_SP_N_STR_A, LOGICAL_AXIS_NAMES), + MAPLIST(_N_LBL_A, LOGICAL_AXIS_NAMES), MAPLIST(_SP_N_LBL_A, LOGICAL_AXIS_NAMES); + +PGM_P const SP_AXIS_LBL[] PROGMEM = { MAPLIST(_SP_N_LBL, LOGICAL_AXIS_NAMES) }; +PGM_P const SP_AXIS_STR[] PROGMEM = { MAPLIST(_SP_N_STR, LOGICAL_AXIS_NAMES) }; + +#undef _N_STR +#undef _N_LBL +#undef _N_STR_A +#undef _N_LBL_A +#undef _SP_N_STR +#undef _SP_N_LBL +#undef _SP_N_STR_A +#undef _SP_N_LBL_A diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index dace435fd1..fc3ef178b6 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -39,20 +39,28 @@ struct IF { typedef L type; }; #define NUM_AXIS_GANG(V...) GANG_N(NUM_AXES, V) #define NUM_AXIS_CODE(V...) CODE_N(NUM_AXES, V) #define NUM_AXIS_LIST(V...) LIST_N(NUM_AXES, V) +#define NUM_AXIS_LIST_1(V) LIST_N_1(NUM_AXES, V) #define NUM_AXIS_ARRAY(V...) { NUM_AXIS_LIST(V) } +#define NUM_AXIS_ARRAY_1(V) { NUM_AXIS_LIST_1(V) } #define NUM_AXIS_ARGS(T...) NUM_AXIS_LIST(T x, T y, T z, T i, T j, T k, T u, T v, T w) #define NUM_AXIS_ELEM(O) NUM_AXIS_LIST(O.x, O.y, O.z, O.i, O.j, O.k, O.u, O.v, O.w) #define NUM_AXIS_DEFS(T,V) NUM_AXIS_LIST(T x=V, T y=V, T z=V, T i=V, T j=V, T k=V, T u=V, T v=V, T w=V) +#define MAIN_AXIS_NAMES NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W) +#define MAIN_AXIS_MAP(F) MAP(F, MAIN_AXIS_NAMES) +#define STR_AXES_MAIN NUM_AXIS_GANG("X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W) #define LOGICAL_AXIS_GANG(E,V...) NUM_AXIS_GANG(V) GANG_ITEM_E(E) #define LOGICAL_AXIS_CODE(E,V...) NUM_AXIS_CODE(V) CODE_ITEM_E(E) #define LOGICAL_AXIS_LIST(E,V...) NUM_AXIS_LIST(V) LIST_ITEM_E(E) +#define LOGICAL_AXIS_LIST_1(V) NUM_AXIS_LIST_1(V) LIST_ITEM_E(V) #define LOGICAL_AXIS_ARRAY(E,V...) { LOGICAL_AXIS_LIST(E,V) } +#define LOGICAL_AXIS_ARRAY_1(V) { LOGICAL_AXIS_LIST_1(V) } #define LOGICAL_AXIS_ARGS(T...) LOGICAL_AXIS_LIST(T e, T x, T y, T z, T i, T j, T k, T u, T v, T w) #define LOGICAL_AXIS_ELEM(O) LOGICAL_AXIS_LIST(O.e, O.x, O.y, O.z, O.i, O.j, O.k, O.u, O.v, O.w) #define LOGICAL_AXIS_DECL(T,V) LOGICAL_AXIS_LIST(T e=V, T x=V, T y=V, T z=V, T i=V, T j=V, T k=V, T u=V, T v=V, T w=V) - -#define LOGICAL_AXES_STRING LOGICAL_AXIS_GANG("E", "X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W) +#define LOGICAL_AXIS_NAMES LOGICAL_AXIS_LIST(E, X, Y, Z, I, J, K, U, V, W) +#define LOGICAL_AXIS_MAP(F) MAP(F, LOGICAL_AXIS_NAMES) +#define STR_AXES_LOGICAL LOGICAL_AXIS_GANG("E", "X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W) #define XYZ_GANG(V...) GANG_N(PRIMARY_LINEAR_AXES, V) #define XYZ_CODE(V...) CODE_N(PRIMARY_LINEAR_AXES, V) @@ -173,7 +181,6 @@ enum AxisEnum : uint8_t { }; typedef IF<(NUM_AXIS_ENUMS > 8), uint16_t, uint8_t>::type axis_bits_t; -typedef IF<(NUM_AXES > 8), uint16_t, uint8_t>::type linear_axis_bits_t; // // Loop over axes diff --git a/Marlin/src/core/utility.cpp b/Marlin/src/core/utility.cpp index bba2f0a986..84e4c1f696 100644 --- a/Marlin/src/core/utility.cpp +++ b/Marlin/src/core/utility.cpp @@ -132,11 +132,10 @@ void safe_delay(millis_t ms) { #else #if ENABLED(AUTO_BED_LEVELING_UBL) SERIAL_ECHOPGM("UBL Adjustment Z"); - const float rz = bedlevel.get_z_correction(current_position); #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) SERIAL_ECHOPGM("ABL Adjustment Z"); - const float rz = bedlevel.get_z_correction(current_position); #endif + const float rz = bedlevel.get_z_correction(current_position); SERIAL_ECHO(ftostr43sign(rz, '+')); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) if (planner.z_fade_height) { @@ -156,11 +155,13 @@ void safe_delay(millis_t ms) { SERIAL_ECHOPGM("Mesh Bed Leveling"); if (planner.leveling_active) { SERIAL_ECHOLNPGM(" (enabled)"); - SERIAL_ECHOPGM("MBL Adjustment Z", ftostr43sign(bedlevel.get_z(current_position), '+')); + const float z_offset = bedlevel.get_z_offset(), + z_correction = bedlevel.get_z_correction(current_position); + SERIAL_ECHOPGM("MBL Adjustment Z", ftostr43sign(z_offset + z_correction, '+')); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) if (planner.z_fade_height) { SERIAL_ECHOPGM(" (", ftostr43sign( - bedlevel.get_z(current_position, planner.fade_scaling_factor_for_z(current_position.z)), '+' + z_offset + z_correction * planner.fade_scaling_factor_for_z(current_position.z), '+' )); SERIAL_CHAR(')'); } diff --git a/Marlin/src/feature/dac/stepper_dac.cpp b/Marlin/src/feature/dac/stepper_dac.cpp index 53d5720cce..f5664bc598 100644 --- a/Marlin/src/feature/dac/stepper_dac.cpp +++ b/Marlin/src/feature/dac/stepper_dac.cpp @@ -29,7 +29,6 @@ #if HAS_MOTOR_CURRENT_DAC #include "stepper_dac.h" -#include "../../MarlinCore.h" // for SP_X_LBL... bool dac_present = false; constexpr xyze_uint8_t dac_order = DAC_STEPPER_ORDER; diff --git a/Marlin/src/feature/meatpack.cpp b/Marlin/src/feature/meatpack.cpp index b2899243b2..07ff41e5be 100644 --- a/Marlin/src/feature/meatpack.cpp +++ b/Marlin/src/feature/meatpack.cpp @@ -26,7 +26,7 @@ * Algorithm & Implementation: Scott Mudge - mail@scottmudge.com * Date: Dec. 2020 * - * Character Frequencies from ~30 MB of comment-stripped gcode: + * Character Frequencies from ~30 MB of comment-stripped G-code: * '1' -> 4451136 '4' -> 1353273 '\n' -> 1087683 '-' -> 90242 * '0' -> 4253577 '9' -> 1352147 'G' -> 1075806 'Z' -> 34109 * ' ' -> 3053297 '3' -> 1262929 'X' -> 975742 'M' -> 11879 diff --git a/Marlin/src/feature/meatpack.h b/Marlin/src/feature/meatpack.h index a56e65b6cc..98a535e592 100644 --- a/Marlin/src/feature/meatpack.h +++ b/Marlin/src/feature/meatpack.h @@ -29,7 +29,7 @@ * Specifically optimized for 3D printing G-Code, this is a zero-cost data compression method * which packs ~180-190% more data into the same amount of bytes going to the CNC controller. * As a majority of G-Code can be represented by a restricted alphabet, I performed histogram - * analysis on a wide variety of 3D printing gcode samples, and found ~93% of all gcode could + * analysis on a wide variety of 3D printing G-code samples, and found ~93% of all G-code could * be represented by the same 15-character alphabet. * * This allowed me to design a system of packing 2 8-bit characters into a single byte, assuming @@ -38,7 +38,7 @@ * * Combined with some logic to allow commingling of full-width characters outside of this 15- * character alphabet (at the cost of an extra 8-bits per full-width character), and by stripping - * out unnecessary comments, the end result is gcode which is roughly half the original size. + * out unnecessary comments, the end result is G-code which is roughly half the original size. * * Why did I do this? I noticed micro-stuttering and other data-bottleneck issues while printing * objects with high curvature, especially at high speeds. There is also the issue of the limited diff --git a/Marlin/src/feature/mmu/mmu2-serial-protocol.md b/Marlin/src/feature/mmu/mmu2-serial-protocol.md index 7ff0901742..93135e406f 100644 --- a/Marlin/src/feature/mmu/mmu2-serial-protocol.md +++ b/Marlin/src/feature/mmu/mmu2-serial-protocol.md @@ -51,7 +51,7 @@ When done, the MMU sends - MMU => 'ok\n' -We don't wait for a response here but immediately continue with the next gcode which should +We don't wait for a response here but immediately continue with the next G-code which should be one or more extruder moves to feed the filament into the hotend. diff --git a/Marlin/src/feature/mmu/mmu2.cpp b/Marlin/src/feature/mmu/mmu2.cpp index a469c988c9..a4718b53d9 100644 --- a/Marlin/src/feature/mmu/mmu2.cpp +++ b/Marlin/src/feature/mmu/mmu2.cpp @@ -939,7 +939,7 @@ bool MMU2::load_filament_to_nozzle(const uint8_t index) { * Load filament to nozzle of multimaterial printer * * This function is used only after T? (user select filament) and M600 (change filament). - * It is not used after T0 .. T4 command (select filament), in such case, gcode is responsible for loading + * It is not used after T0 .. T4 command (select filament), in such case, G-code is responsible for loading * filament to nozzle. */ void MMU2::load_to_nozzle() { @@ -1031,8 +1031,7 @@ void MMU2::execute_extruder_sequence(const E_Step * sequence, int steps) { const float es = pgm_read_float(&(step->extrude)); const feedRate_t fr_mm_m = pgm_read_float(&(step->feedRate)); - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("E step ", es, "/", fr_mm_m); + DEBUG_ECHO_MSG("E step ", es, "/", fr_mm_m); current_position.e += es; line_to_current_position(MMM_TO_MMS(fr_mm_m)); diff --git a/Marlin/src/feature/spindle_laser.cpp b/Marlin/src/feature/spindle_laser.cpp index ef3503c40d..8f70816c99 100644 --- a/Marlin/src/feature/spindle_laser.cpp +++ b/Marlin/src/feature/spindle_laser.cpp @@ -39,7 +39,8 @@ #endif SpindleLaser cutter; -uint8_t SpindleLaser::power; +uint8_t SpindleLaser::power, + SpindleLaser::last_power_applied; // = 0 // Basic power state tracking #if ENABLED(LASER_FEATURE) cutter_test_pulse_t SpindleLaser::testPulse = 50; // Test fire Pulse time ms value. #endif @@ -113,7 +114,6 @@ void SpindleLaser::init() { * @param opwr Power value. Range 0 to MAX. When 0 disable spindle/laser. */ 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; diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index 1f9bec7bf0..808fa634e1 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -41,8 +41,6 @@ #define PCT_TO_PWM(X) ((X) * 255 / 100) #define PCT_TO_SERVO(X) ((X) * 180 / 100) -// #define _MAP(N,S1,S2,D1,D2) ((N)*_MAX((D2)-(D1),0)/_MAX((S2)-(S1),1)+(D1)) - class SpindleLaser { public: static const inline uint8_t pct_to_ocr(const_float_t pct) { return uint8_t(PCT_TO_PWM(pct)); } @@ -91,7 +89,8 @@ public: #endif static bool isReady; // Ready to apply power setting from the UI to OCR - static uint8_t power; + static uint8_t power, + last_power_applied; // Basic power state tracking #if ENABLED(MARLIN_DEV_MODE) static cutter_frequency_t frequency; // Set PWM frequency; range: 2K-50K diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 2a1fec84ae..27551fb109 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -321,6 +321,9 @@ void GcodeSuite::G28() { stepperW.rms_current(W_CURRENT_HOME); if (DEBUGGING(LEVELING)) debug_current(F(STR_W), tmc_save_current_W, W_CURRENT_HOME); #endif + #if SENSORLESS_STALLGUARD_DELAY + safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle + #endif #endif #if ENABLED(IMPROVE_HOMING_RELIABILITY) @@ -576,6 +579,9 @@ void GcodeSuite::G28() { #if HAS_CURRENT_HOME(W) stepperW.rms_current(tmc_save_current_W); #endif + #if SENSORLESS_STALLGUARD_DELAY + safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle + #endif #endif // HAS_HOMING_CURRENT ui.refresh(); diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index 7f487abd6b..ffe53b63fb 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -71,9 +71,9 @@ float lcd_probe_pt(const xy_pos_t &xy); void ac_home() { endstops.enable(true); - TERN_(HAS_DELTA_SENSORLESS_PROBING, probe.set_homing_current(true)); + TERN_(SENSORLESS_HOMING, endstops.set_homing_current(true)); home_delta(); - TERN_(HAS_DELTA_SENSORLESS_PROBING, probe.set_homing_current(false)); + TERN_(SENSORLESS_HOMING, endstops.set_homing_current(false)); endstops.not_homing(); } @@ -390,6 +390,8 @@ static float auto_tune_a(const float dcr) { * X Don't activate stallguard on X. * Y Don't activate stallguard on Y. * Z Don't activate stallguard on Z. + * + * S Save offset_sensorless_adj */ void GcodeSuite::G33() { @@ -411,7 +413,8 @@ void GcodeSuite::G33() { dcr -= probe_at_offset ? _MAX(total_offset, PROBING_MARGIN) : total_offset; #endif NOMORE(dcr, DELTA_PRINTABLE_RADIUS); - if (parser.seenval('R')) dcr -= _MAX(parser.value_float(),0); + if (parser.seenval('R')) dcr -= _MAX(parser.value_float(), 0.0f); + TERN_(HAS_DELTA_SENSORLESS_PROBING, dcr *= sensorless_radius_factor); const float calibration_precision = parser.floatval('C', 0.0f); if (calibration_precision < 0) { @@ -434,9 +437,8 @@ void GcodeSuite::G33() { const bool stow_after_each = parser.seen_test('E'); #if HAS_DELTA_SENSORLESS_PROBING - probe.test_sensitivity.x = !parser.seen_test('X'); - TERN_(HAS_Y_AXIS, probe.test_sensitivity.y = !parser.seen_test('Y')); - TERN_(HAS_Z_AXIS, probe.test_sensitivity.z = !parser.seen_test('Z')); + probe.test_sensitivity = { !parser.seen_test('X'), !parser.seen_test('Y'), !parser.seen_test('Z') }; + const bool do_save_offset_adj = parser.seen_test('S'); #endif const bool _0p_calibration = probe_points == 0, @@ -475,6 +477,25 @@ void GcodeSuite::G33() { if (!_0p_calibration) ac_home(); + #if HAS_DELTA_SENSORLESS_PROBING + if (verbose_level > 0 && do_save_offset_adj) { + offset_sensorless_adj.reset(); + + auto caltower = [&](Probe::sense_bool_t s){ + float z_at_pt[NPP + 1]; + LOOP_CAL_ALL(rad) z_at_pt[rad] = 0.0f; + probe.test_sensitivity = s; + if (probe_calibration_points(z_at_pt, 1, dcr, false, false, probe_at_offset)) + probe.set_offset_sensorless_adj(z_at_pt[CEN]); + }; + caltower({ true, false, false }); // A + caltower({ false, true, false }); // B + caltower({ false, false, true }); // C + + probe.test_sensitivity = { true, true, true }; // reset to all + } + #endif + do { // start iterations float z_at_pt[NPP + 1] = { 0.0f }; @@ -598,8 +619,17 @@ void GcodeSuite::G33() { // print report - if (verbose_level == 3 || verbose_level == 0) + if (verbose_level == 3 || verbose_level == 0) { print_calibration_results(z_at_pt, _tower_results, _opposite_results); + #if HAS_DELTA_SENSORLESS_PROBING + if (verbose_level == 0 && probe_points == 1) { + if (do_save_offset_adj) + probe.set_offset_sensorless_adj(z_at_pt[CEN]); + else + probe.refresh_largest_sensorless_adj(); + } + #endif + } if (verbose_level != 0) { // !dry run if ((zero_std_dev >= test_precision && iterations > force_iterations) || zero_std_dev <= calibration_precision) { // end iterations @@ -660,6 +690,9 @@ void GcodeSuite::G33() { ac_cleanup(TERN_(HAS_MULTI_HOTEND, old_tool_index)); TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE)); + #if HAS_DELTA_SENSORLESS_PROBING + probe.test_sensitivity = { true, true, true }; + #endif } #endif // DELTA_AUTO_CALIBRATION diff --git a/Marlin/src/gcode/calibrate/M425.cpp b/Marlin/src/gcode/calibrate/M425.cpp index 77e0e5c094..a6c6ff9dae 100644 --- a/Marlin/src/gcode/calibrate/M425.cpp +++ b/Marlin/src/gcode/calibrate/M425.cpp @@ -47,19 +47,10 @@ void GcodeSuite::M425() { bool noArgs = true; auto axis_can_calibrate = [](const uint8_t a) { + #define _CAN_CASE(N) case N##_AXIS: return AXIS_CAN_CALIBRATE(N); switch (a) { default: return false; - NUM_AXIS_CODE( - case X_AXIS: return AXIS_CAN_CALIBRATE(X), - case Y_AXIS: return AXIS_CAN_CALIBRATE(Y), - case Z_AXIS: return AXIS_CAN_CALIBRATE(Z), - case I_AXIS: return AXIS_CAN_CALIBRATE(I), - case J_AXIS: return AXIS_CAN_CALIBRATE(J), - case K_AXIS: return AXIS_CAN_CALIBRATE(K), - case U_AXIS: return AXIS_CAN_CALIBRATE(U), - case V_AXIS: return AXIS_CAN_CALIBRATE(V), - case W_AXIS: return AXIS_CAN_CALIBRATE(W) - ); + MAIN_AXIS_MAP(_CAN_CASE) } }; diff --git a/Marlin/src/gcode/config/M200-M205.cpp b/Marlin/src/gcode/config/M200-M205.cpp index 5911f77f2e..87c1f2ce30 100644 --- a/Marlin/src/gcode/config/M200-M205.cpp +++ b/Marlin/src/gcode/config/M200-M205.cpp @@ -108,12 +108,21 @@ #endif // !NO_VOLUMETRICS /** - * M201: Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) + * M201: Set max acceleration in units/s^2 for print moves. * - * With multiple extruders use T to specify which one. + * X : Max Acceleration for X + * Y : Max Acceleration for Y + * Z : Max Acceleration for Z + * ... : etc + * E : Max Acceleration for Extruder + * T : Extruder index to set + * + * With XY_FREQUENCY_LIMIT: + * F : Frequency limit for XY...IJKUVW + * S : Speed factor percentage. */ void GcodeSuite::M201() { - if (!parser.seen("T" LOGICAL_AXES_STRING)) + if (!parser.seen("T" STR_AXES_LOGICAL TERN_(XY_FREQUENCY_LIMIT, "FS"))) return M201_report(); const int8_t target_extruder = get_target_extruder_from_command(); @@ -121,7 +130,7 @@ void GcodeSuite::M201() { #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; + if (parser.seenval('S')) planner.xy_freq_min_speed_factor = constrain(parser.value_float(), 1, 100) / 100; #endif LOOP_LOGICAL_AXES(i) { @@ -167,7 +176,7 @@ void GcodeSuite::M201_report(const bool forReplay/*=true*/) { * With multiple extruders use T to specify which one. */ void GcodeSuite::M203() { - if (!parser.seen("T" LOGICAL_AXES_STRING)) + if (!parser.seen("T" STR_AXES_LOGICAL)) return M203_report(); const int8_t target_extruder = get_target_extruder_from_command(); @@ -200,7 +209,7 @@ void GcodeSuite::M203_report(const bool forReplay/*=true*/) { ); #if ENABLED(DISTINCT_E_FACTORS) LOOP_L_N(i, E_STEPPERS) { - SERIAL_ECHO_START(); + if (!forReplay) SERIAL_ECHO_START(); SERIAL_ECHOLNPGM_P( PSTR(" M203 T"), i , SP_E_STR, VOLUMETRIC_UNIT(planner.settings.max_feedrate_mm_s[E_AXIS_N(i)]) diff --git a/Marlin/src/gcode/config/M92.cpp b/Marlin/src/gcode/config/M92.cpp index 3d1a9cb7ce..c7610b83a9 100644 --- a/Marlin/src/gcode/config/M92.cpp +++ b/Marlin/src/gcode/config/M92.cpp @@ -43,7 +43,7 @@ void GcodeSuite::M92() { if (target_extruder < 0) return; // No arguments? Show M92 report. - if (!parser.seen(LOGICAL_AXES_STRING TERN_(MAGIC_NUMBERS_GCODE, "HL"))) + if (!parser.seen(STR_AXES_LOGICAL TERN_(MAGIC_NUMBERS_GCODE, "HL"))) return M92_report(true, target_extruder); LOOP_LOGICAL_AXES(i) { diff --git a/Marlin/src/gcode/control/M17_M18_M84.cpp b/Marlin/src/gcode/control/M17_M18_M84.cpp index 715f7f2a37..c2c8a702a1 100644 --- a/Marlin/src/gcode/control/M17_M18_M84.cpp +++ b/Marlin/src/gcode/control/M17_M18_M84.cpp @@ -23,6 +23,7 @@ #include "../gcode.h" #include "../../MarlinCore.h" // for stepper_inactive_time, disable_e_steppers #include "../../lcd/marlinui.h" +#include "../../module/motion.h" // for e_axis_mask #include "../../module/stepper.h" #if ENABLED(AUTO_BED_LEVELING_UBL) @@ -43,7 +44,7 @@ inline stepper_flags_t selected_axis_bits() { selected.bits = _BV(INDEX_OF_AXIS(E_AXIS, e)); } else - selected.bits = selected.e_bits(); + selected.bits = e_axis_mask; } #endif selected.bits |= NUM_AXIS_GANG( @@ -210,7 +211,16 @@ void try_to_disable(const stepper_flags_t to_disable) { void GcodeSuite::M18_M84() { if (parser.seenval('S')) { reset_stepper_timeout(); - stepper_inactive_time = parser.value_millis_from_seconds(); + #if HAS_DISABLE_INACTIVE_AXIS + const millis_t ms = parser.value_millis_from_seconds(); + #if LASER_SAFETY_TIMEOUT_MS > 0 + if (ms && ms <= LASER_SAFETY_TIMEOUT_MS) { + SERIAL_ECHO_MSG("M18 timeout must be > ", MS_TO_SEC(LASER_SAFETY_TIMEOUT_MS + 999), " s for laser safety."); + return; + } + #endif + stepper_inactive_time = ms; + #endif } else { if (parser.seen_axis()) { diff --git a/Marlin/src/gcode/control/M3-M5.cpp b/Marlin/src/gcode/control/M3-M5.cpp index cdb37a1207..817ed4fcb4 100644 --- a/Marlin/src/gcode/control/M3-M5.cpp +++ b/Marlin/src/gcode/control/M3-M5.cpp @@ -66,6 +66,10 @@ * PWM duty cycle goes from 0 (off) to 255 (always on). */ void GcodeSuite::M3_M4(const bool is_M4) { + #if LASER_SAFETY_TIMEOUT_MS > 0 + reset_stepper_timeout(); // Reset timeout to allow subsequent G-code to power the laser (imm.) + #endif + #if EITHER(SPINDLE_LASER_USE_PWM, SPINDLE_SERVO) auto get_s_power = [] { if (parser.seenval('S')) { diff --git a/Marlin/src/gcode/control/M85.cpp b/Marlin/src/gcode/control/M85.cpp index 9c8c02c59a..ee868349ed 100644 --- a/Marlin/src/gcode/control/M85.cpp +++ b/Marlin/src/gcode/control/M85.cpp @@ -29,7 +29,14 @@ void GcodeSuite::M85() { if (parser.seen('S')) { reset_stepper_timeout(); - max_inactive_time = parser.value_millis_from_seconds(); + const millis_t ms = parser.value_millis_from_seconds(); + #if LASER_SAFETY_TIMEOUT_MS > 0 + if (ms && ms <= LASER_SAFETY_TIMEOUT_MS) { + SERIAL_ECHO_MSG("M85 timeout must be > ", MS_TO_SEC(LASER_SAFETY_TIMEOUT_MS + 999), " s for laser safety."); + return; + } + #endif + max_inactive_time = ms; } } diff --git a/Marlin/src/gcode/feature/clean/G12.cpp b/Marlin/src/gcode/feature/clean/G12.cpp index 999a9b10bd..0113170f1d 100644 --- a/Marlin/src/gcode/feature/clean/G12.cpp +++ b/Marlin/src/gcode/feature/clean/G12.cpp @@ -45,9 +45,10 @@ * X, Y, Z : Specify axes to move during cleaning. Default: ALL. */ void GcodeSuite::G12() { + // Don't allow nozzle cleaning without homing first - if (homing_needed_error(linear_bits & ~TERN0(NOZZLE_CLEAN_NO_Z, Z_AXIS) & ~TERN0(NOZZLE_CLEAN_NO_Y, Y_AXIS))) - return; + constexpr main_axes_bits_t clean_axis_mask = main_axes_mask & ~TERN0(NOZZLE_CLEAN_NO_Z, Z_AXIS) & ~TERN0(NOZZLE_CLEAN_NO_Y, Y_AXIS); + if (homing_needed_error(clean_axis_mask)) return; #ifdef WIPE_SEQUENCE_COMMANDS if (!parser.seen_any()) { diff --git a/Marlin/src/gcode/feature/digipot/M907-M910.cpp b/Marlin/src/gcode/feature/digipot/M907-M910.cpp index f1f1bcb484..9ebe713cde 100644 --- a/Marlin/src/gcode/feature/digipot/M907-M910.cpp +++ b/Marlin/src/gcode/feature/digipot/M907-M910.cpp @@ -48,7 +48,7 @@ void GcodeSuite::M907() { #if HAS_MOTOR_CURRENT_SPI - if (!parser.seen("BS" LOGICAL_AXES_STRING)) + if (!parser.seen("BS" STR_AXES_LOGICAL)) return M907_report(); if (parser.seenval('S')) LOOP_L_N(i, MOTOR_CURRENT_COUNT) stepper.set_digipot_current(i, parser.value_int()); diff --git a/Marlin/src/gcode/feature/pause/G60.cpp b/Marlin/src/gcode/feature/pause/G60.cpp index 9e0962fd34..b32935b341 100644 --- a/Marlin/src/gcode/feature/pause/G60.cpp +++ b/Marlin/src/gcode/feature/pause/G60.cpp @@ -50,14 +50,14 @@ void GcodeSuite::G60() { { const xyze_pos_t &pos = stored_position[slot]; DEBUG_ECHOPGM(STR_SAVED_POS " S", slot, " :"); - DEBUG_ECHOLNPAIR_F_P( + DEBUG_ECHOLNPGM_P( LIST_N(DOUBLE(NUM_AXES), - SP_Y_STR, pos.x, SP_Y_STR, pos.y, SP_Z_STR, pos.z, - SP_I_STR, pos.i, SP_J_STR, pos.j, SP_K_STR, pos.k, - SP_U_STR, pos.u, SP_V_STR, pos.v, SP_W_STR, pos.w + SP_X_LBL, pos.x, SP_Y_LBL, pos.y, SP_Z_LBL, pos.z, + SP_I_LBL, pos.i, SP_J_LBL, pos.j, SP_K_LBL, pos.k, + SP_U_LBL, pos.u, SP_V_LBL, pos.v, SP_W_LBL, pos.w ) #if HAS_EXTRUDERS - , SP_E_STR, pos.e + , SP_E_LBL, pos.e #endif ); } diff --git a/Marlin/src/gcode/feature/pause/G61.cpp b/Marlin/src/gcode/feature/pause/G61.cpp index b59e93ac07..b85487af45 100644 --- a/Marlin/src/gcode/feature/pause/G61.cpp +++ b/Marlin/src/gcode/feature/pause/G61.cpp @@ -68,7 +68,7 @@ void GcodeSuite::G61() { SYNC_E(stored_position[slot].e); } else { - if (parser.seen(NUM_AXIS_GANG("X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W))) { + if (parser.seen(STR_AXES_MAIN)) { DEBUG_ECHOPGM(STR_RESTORING_POS " S", slot); LOOP_NUM_AXES(i) { destination[i] = parser.seenval(AXIS_CHAR(i)) diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index b8668c74a8..5425fc701f 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -21,7 +21,7 @@ */ /** - * gcode.cpp - Temporary container for all gcode handlers + * gcode.cpp - Temporary container for all G-code handlers * Most will migrate to classes, by feature. */ @@ -73,8 +73,11 @@ GcodeSuite gcode; // 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); + GcodeSuite::max_inactive_time = 0; + +#if HAS_DISABLE_INACTIVE_AXIS + millis_t GcodeSuite::stepper_inactive_time = SEC_TO_MS(DEFAULT_STEPPER_DEACTIVE_TIME); +#endif // Relative motion mode for each logical axis static constexpr xyze_bool_t ar_init = AXIS_RELATIVE_MODES; diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 215d0d4f9b..1efcb1cf93 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -110,7 +110,7 @@ * M33 - Get the longname version of a path. (Requires LONG_FILENAME_HOST_SUPPORT) * M34 - Set SD Card sorting options. (Requires SDCARD_SORT_ALPHA) * - * M42 - Change pin status via gcode: M42 P S. LED pin assumed if P is omitted. (Requires DIRECT_PIN_CONTROL) + * M42 - Change pin status via G-code: M42 P S. LED pin assumed if P is omitted. (Requires DIRECT_PIN_CONTROL) * M43 - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins (Requires PINS_DEBUGGING) * M48 - Measure Z Probe repeatability: M48 P X Y V E L S. (Requires Z_MIN_PROBE_REPEATABILITY_TEST) * @@ -396,14 +396,20 @@ public: static bool select_coordinate_system(const int8_t _new); #endif - 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; } + static millis_t previous_move_ms, max_inactive_time; 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); - } + FORCE_INLINE static void reset_stepper_timeout(const millis_t ms=millis()) { previous_move_ms = ms; } + + #if HAS_DISABLE_INACTIVE_AXIS + static millis_t stepper_inactive_time; + FORCE_INLINE static bool stepper_inactive_timeout(const millis_t ms=millis()) { + return ELAPSED(ms, previous_move_ms + stepper_inactive_time); + } + #else + static bool stepper_inactive_timeout(const millis_t) { return false; } + #endif static void report_echo_start(const bool forReplay); static void report_heading(const bool forReplay, FSTR_P const fstr, const bool eol=true); diff --git a/Marlin/src/gcode/motion/G0_G1.cpp b/Marlin/src/gcode/motion/G0_G1.cpp index d647894d27..933bf3d5d9 100644 --- a/Marlin/src/gcode/motion/G0_G1.cpp +++ b/Marlin/src/gcode/motion/G0_G1.cpp @@ -92,7 +92,7 @@ void GcodeSuite::G0_G1(TERN_(HAS_FAST_MOVES, const bool fast_move/*=false*/)) { if (MIN_AUTORETRACT <= MAX_AUTORETRACT) { // When M209 Autoretract is enabled, convert E-only moves to firmware retract/recover moves if (fwretract.autoretract_enabled && parser.seen_test('E') - && !parser.seen(NUM_AXIS_GANG("X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W)) + && !parser.seen(STR_AXES_MAIN) ) { const float echange = destination.e - current_position.e; // Is this a retract or recover move? diff --git a/Marlin/src/gcode/motion/M290.cpp b/Marlin/src/gcode/motion/M290.cpp index 6f6afa3a55..4fe83ccd40 100644 --- a/Marlin/src/gcode/motion/M290.cpp +++ b/Marlin/src/gcode/motion/M290.cpp @@ -87,7 +87,7 @@ void GcodeSuite::M290() { } #endif - if (!parser.seen(NUM_AXIS_GANG("X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W)) || parser.seen('R')) { + if (!parser.seen(STR_AXES_MAIN) || parser.seen('R')) { SERIAL_ECHO_START(); #if ENABLED(BABYSTEP_ZPROBE_OFFSET) diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index c91a0de5f2..3f5290e81c 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -45,7 +45,7 @@ /** * GCode parser * - * - Parse a single gcode line for its letter, code, subcode, and parameters + * - Parse a single G-code line for its letter, code, subcode, and parameters * - FASTER_GCODE_PARSER: * - Flags existing params (1 bit each) * - Stores value offsets (1 byte each) @@ -225,7 +225,7 @@ public: #endif // !FASTER_GCODE_PARSER // Seen any axis parameter - static bool seen_axis() { return seen(LOGICAL_AXES_STRING); } + static bool seen_axis() { return seen(STR_AXES_LOGICAL); } #if ENABLED(GCODE_QUOTED_STRINGS) static char* unescape_string(char* &src); diff --git a/Marlin/src/gcode/probe/M951.cpp b/Marlin/src/gcode/probe/M951.cpp index c6a9cfbe20..7a06400e33 100644 --- a/Marlin/src/gcode/probe/M951.cpp +++ b/Marlin/src/gcode/probe/M951.cpp @@ -32,13 +32,13 @@ mpe_settings_t mpe_settings; inline void mpe_settings_report() { SERIAL_ECHO_MSG("Magnetic Parking Extruder"); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("L: Left parking :", mpe_settings.parking_xpos[0]); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("R: Right parking :", mpe_settings.parking_xpos[1]); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("I: Grab Offset :", mpe_settings.grab_distance); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("J: Normal speed :", long(MMS_TO_MMM(mpe_settings.slow_feedrate))); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("H: High speed :", long(MMS_TO_MMM(mpe_settings.fast_feedrate))); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("D: Distance trav.:", mpe_settings.travel_distance); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("C: Compenstion :", mpe_settings.compensation_factor); + SERIAL_ECHO_MSG("L: Left parking :", mpe_settings.parking_xpos[0]); + SERIAL_ECHO_MSG("R: Right parking :", mpe_settings.parking_xpos[1]); + SERIAL_ECHO_MSG("I: Grab Offset :", mpe_settings.grab_distance); + SERIAL_ECHO_MSG("J: Normal speed :", long(MMS_TO_MMM(mpe_settings.slow_feedrate))); + SERIAL_ECHO_MSG("H: High speed :", long(MMS_TO_MMM(mpe_settings.fast_feedrate))); + SERIAL_ECHO_MSG("D: Distance trav.:", mpe_settings.travel_distance); + SERIAL_ECHO_MSG("C: Compenstion :", mpe_settings.compensation_factor); } void mpe_settings_init() { diff --git a/Marlin/src/gcode/temp/M306.cpp b/Marlin/src/gcode/temp/M306.cpp index 0f286e73b2..7978922ff4 100644 --- a/Marlin/src/gcode/temp/M306.cpp +++ b/Marlin/src/gcode/temp/M306.cpp @@ -36,6 +36,7 @@ * C Block heat capacity. * E Extruder number to set. (Default: E0) * F Ambient heat transfer coefficient (fan on full). + * H Filament heat capacity per mm. * P Heater power. * R Sensor responsiveness (= transfer coefficient / heat capcity). */ @@ -43,7 +44,7 @@ void GcodeSuite::M306() { if (parser.seen_test('T')) { thermalManager.MPC_autotune(); return; } - if (parser.seen("ACFPR")) { + if (parser.seen("ACFPRH")) { const heater_id_t hid = (heater_id_t)parser.intval('E', 0); MPC_t &constants = thermalManager.temp_hotend[hid].constants; if (parser.seenval('P')) constants.heater_power = parser.value_float(); @@ -53,6 +54,7 @@ void GcodeSuite::M306() { #if ENABLED(MPC_INCLUDE_FAN) if (parser.seenval('F')) constants.fan255_adjustment = parser.value_float() - constants.ambient_xfer_coeff_fan0; #endif + if (parser.seenval('H')) constants.filament_heat_capacity_permm = parser.value_float(); return; } @@ -70,8 +72,10 @@ void GcodeSuite::M306_report(const bool forReplay/*=true*/) { SERIAL_ECHOPAIR_F(" R", constants.sensor_responsiveness, 4); SERIAL_ECHOPAIR_F(" A", constants.ambient_xfer_coeff_fan0, 4); #if ENABLED(MPC_INCLUDE_FAN) - SERIAL_ECHOLNPAIR_F(" F", constants.ambient_xfer_coeff_fan0 + constants.fan255_adjustment, 4); + SERIAL_ECHOPAIR_F(" F", constants.ambient_xfer_coeff_fan0 + constants.fan255_adjustment, 4); #endif + SERIAL_ECHOPAIR_F(" H", constants.filament_heat_capacity_permm, 4); + SERIAL_EOL(); } } diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index ba60e2481f..adb65f5f7d 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1241,7 +1241,7 @@ */ #if ENABLED(AUTO_BED_LEVELING_UBL) #undef LCD_BED_LEVELING - #if ENABLED(DELTA) + #if EITHER(DELTA, SEGMENT_LEVELED_MOVES) #define UBL_SEGMENTED 1 #endif #endif diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index caed384a63..130e68f61e 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -1044,3 +1044,7 @@ #undef CONFIGURATION_EMBEDDING #define CANNOT_EMBED_CONFIGURATION defined(__AVR__) #endif + +#if ANY(DISABLE_INACTIVE_X, DISABLE_INACTIVE_Y, DISABLE_INACTIVE_Z, DISABLE_INACTIVE_I, DISABLE_INACTIVE_J, DISABLE_INACTIVE_K, DISABLE_INACTIVE_U, DISABLE_INACTIVE_V, DISABLE_INACTIVE_W, DISABLE_INACTIVE_E) + #define HAS_DISABLE_INACTIVE_AXIS 1 +#endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 6c025b1dbb..9edcd6f1aa 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -266,7 +266,7 @@ * No adjustable bed on non-cartesians */ #if IS_KINEMATIC - #undef LEVEL_BED_CORNERS + #undef LCD_BED_TRAMMING #endif /** @@ -517,20 +517,28 @@ #define HAS_SHARED_MEDIA 1 #endif - // Set SD_DETECT_STATE based on hardware if not overridden - #if PIN_EXISTS(SD_DETECT) && !defined(SD_DETECT_STATE) - #if BOTH(HAS_MARLINUI_MENU, ELB_FULL_GRAPHIC_CONTROLLER) && (SD_CONNECTION_IS(LCD) || !defined(SDCARD_CONNECTION)) - #define SD_DETECT_STATE HIGH - #else - #define SD_DETECT_STATE LOW - #endif - #endif - // Extender cable doesn't support SD_DETECT_PIN #if ENABLED(NO_SD_DETECT) #undef SD_DETECT_PIN #endif + // Not onboard or custom cable + #if SD_CONNECTION_IS(LCD) || !defined(SDCARD_CONNECTION) + #define SD_CONNECTION_TYPICAL 1 + #endif + + // Set SD_DETECT_STATE based on hardware if not overridden + #if PIN_EXISTS(SD_DETECT) + #define HAS_SD_DETECT 1 + #ifndef SD_DETECT_STATE + #if ALL(SD_CONNECTION_TYPICAL, HAS_MARLINUI_MENU, ELB_FULL_GRAPHIC_CONTROLLER) + #define SD_DETECT_STATE HIGH + #else + #define SD_DETECT_STATE LOW + #endif + #endif + #endif + #if DISABLED(USB_FLASH_DRIVE_SUPPORT) || BOTH(MULTI_VOLUME, VOLUME_SD_ONBOARD) #if ENABLED(SDIO_SUPPORT) #define NEED_SD2CARD_SDIO 1 @@ -539,10 +547,10 @@ #endif #endif -#endif + #if HAS_SD_DETECT && NONE(HAS_GRAPHICAL_TFT, LCD_USE_DMA_FSMC, HAS_FSMC_GRAPHICAL_TFT, HAS_SPI_GRAPHICAL_TFT, IS_DWIN_MARLINUI, EXTENSIBLE_UI, HAS_DWIN_E3V2) + #define REINIT_NOISY_LCD 1 // Have the LCD re-init on SD insertion + #endif -#if PIN_EXISTS(SD_DETECT) && NONE(HAS_GRAPHICAL_TFT, LCD_USE_DMA_FSMC, HAS_FSMC_GRAPHICAL_TFT, HAS_SPI_GRAPHICAL_TFT, IS_DWIN_MARLINUI, EXTENSIBLE_UI, HAS_DWIN_E3V2) - #define REINIT_NOISY_LCD 1 // Have the LCD re-init on SD insertion #endif /** diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index f0dfffd5e4..8465b4bf9b 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -371,7 +371,7 @@ #elif defined(FILAMENT_CHANGE_LOAD_LENGTH) #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH." #elif defined(LEVEL_CORNERS_INSET) - #error "LEVEL_CORNERS_INSET is now LEVEL_CORNERS_INSET_LFRB." + #error "LEVEL_CORNERS_INSET is now BED_TRAMMING_INSET_LFRB." #elif defined(BEZIER_JERK_CONTROL) #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION." #elif HAS_JUNCTION_DEVIATION && defined(JUNCTION_DEVIATION_FACTOR) @@ -627,6 +627,12 @@ #error "Y_DUAL_STEPPER_DRIVERS is no longer needed and should be removed." #elif defined(NUM_Z_STEPPER_DRIVERS) #error "NUM_Z_STEPPER_DRIVERS is no longer needed and should be removed." +#elif defined(LEVEL_BED_CORNERS) + #error "LEVEL_BED_CORNERS is now LCD_BED_TRAMMING." +#elif defined(LEVEL_CORNERS_INSET_LFRB) || defined(LEVEL_CORNERS_HEIGHT) || defined(LEVEL_CORNERS_Z_HOP) || defined(LEVEL_CORNERS_USE_PROBE) || defined(LEVEL_CORNERS_PROBE_TOLERANCE) || defined(LEVEL_CORNERS_VERIFY_RAISED) || defined(LEVEL_CORNERS_AUDIO_FEEDBACK) + #error "LEVEL_CORNERS_* settings have been renamed BED_TRAMMING_*." +#elif defined(LEVEL_CENTER_TOO) + #error "LEVEL_CENTER_TOO is now BED_TRAMMING_INCLUDE_CENTER." #endif constexpr float arm[] = AXIS_RELATIVE_MODES; @@ -887,9 +893,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * SD Card Settings */ -#if ALL(SDSUPPORT, ELB_FULL_GRAPHIC_CONTROLLER, HAS_MARLINUI_MENU) && PIN_EXISTS(SD_DETECT) && SD_DETECT_STATE != HIGH && (SD_CONNECTION_IS(LCD) || !defined(SDCARD_CONNECTION)) +#if ALL(SDSUPPORT, HAS_SD_DETECT, SD_CONNECTION_TYPICAL, ELB_FULL_GRAPHIC_CONTROLLER, HAS_MARLINUI_MENU) && SD_DETECT_STATE == LOW #error "SD_DETECT_STATE must be set HIGH for SD on the ELB_FULL_GRAPHIC_CONTROLLER." #endif +#undef SD_CONNECTION_TYPICAL /** * SD File Sorting @@ -1824,14 +1831,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif -#if ENABLED(LEVEL_BED_CORNERS) - #ifndef LEVEL_CORNERS_INSET_LFRB - #error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values." - #elif ENABLED(LEVEL_CORNERS_USE_PROBE) +#if ENABLED(LCD_BED_TRAMMING) + #ifndef BED_TRAMMING_INSET_LFRB + #error "LCD_BED_TRAMMING requires BED_TRAMMING_INSET_LFRB values." + #elif ENABLED(BED_TRAMMING_USE_PROBE) #if !HAS_BED_PROBE - #error "LEVEL_CORNERS_USE_PROBE requires a real probe." + #error "BED_TRAMMING_USE_PROBE requires a real probe." #elif ENABLED(SENSORLESS_PROBING) - #error "LEVEL_CORNERS_USE_PROBE is incompatible with SENSORLESS_PROBING." + #error "BED_TRAMMING_USE_PROBE is incompatible with SENSORLESS_PROBING." #endif #endif #endif @@ -2952,8 +2959,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "DWIN_CREALITY_LCD does not support PID_EDIT_MENU or PID_AUTOTUNE_MENU." #elif EITHER(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU) #error "DWIN_CREALITY_LCD does not support MPC_EDIT_MENU or MPC_AUTOTUNE_MENU." - #elif ENABLED(LEVEL_BED_CORNERS) - #error "DWIN_CREALITY_LCD does not support LEVEL_BED_CORNERS." + #elif ENABLED(LCD_BED_TRAMMING) + #error "DWIN_CREALITY_LCD does not support LCD_BED_TRAMMING." #elif BOTH(LCD_BED_LEVELING, PROBE_MANUALLY) #error "DWIN_CREALITY_LCD does not support LCD_BED_LEVELING with PROBE_MANUALLY." #endif @@ -2964,8 +2971,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "DWIN_LCD_PROUI does not support PID_EDIT_MENU or PID_AUTOTUNE_MENU." #elif EITHER(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU) #error "DWIN_LCD_PROUI does not support MPC_EDIT_MENU or MPC_AUTOTUNE_MENU." - #elif ENABLED(LEVEL_BED_CORNERS) - #error "DWIN_LCD_PROUI does not support LEVEL_BED_CORNERS." + #elif ENABLED(LCD_BED_TRAMMING) + #error "DWIN_LCD_PROUI does not support LCD_BED_TRAMMING." #elif BOTH(LCD_BED_LEVELING, PROBE_MANUALLY) #error "DWIN_LCD_PROUI does not support LCD_BED_LEVELING with PROBE_MANUALLY." #endif @@ -3867,6 +3874,7 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #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." @@ -3934,6 +3942,11 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #endif #endif #undef _PIN_CONFLICT + + #ifdef LASER_SAFETY_TIMEOUT_MS + static_assert(LASER_SAFETY_TIMEOUT_MS < (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL, "LASER_SAFETY_TIMEOUT_MS must be less than DEFAULT_STEPPER_DEACTIVE_TIME (" STRINGIFY(DEFAULT_STEPPER_DEACTIVE_TIME) " seconds)"); + #endif + #endif #if ENABLED(COOLANT_MIST) && !PIN_EXISTS(COOLANT_MIST) @@ -4115,8 +4128,8 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #error "DGUS_LCD_UI_RELOADED requires a bed probe." #elif !HAS_MESH #error "DGUS_LCD_UI_RELOADED requires mesh leveling." - #elif DISABLED(LEVEL_BED_CORNERS) - #error "DGUS_LCD_UI_RELOADED requires LEVEL_BED_CORNERS." + #elif DISABLED(LCD_BED_TRAMMING) + #error "DGUS_LCD_UI_RELOADED requires LCD_BED_TRAMMING." #elif DISABLED(BABYSTEP_ALWAYS_AVAILABLE) #error "DGUS_LCD_UI_RELOADED requires BABYSTEP_ALWAYS_AVAILABLE." #elif DISABLED(BABYSTEP_ZPROBE_OFFSET) @@ -4137,3 +4150,8 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #elif ENABLED(DISABLE_JTAG) && !defined(JTAG_DISABLE) #error "DISABLE_JTAG is not supported for the selected MCU/Board." #endif + +// Check requirements for upload.py +#if ENABLED(XFER_BUILD) && !BOTH(BINARY_FILE_TRANSFER, CUSTOM_FIRMWARE_UPLOAD) + #error "BINARY_FILE_TRANSFER and CUSTOM_FIRMWARE_UPLOAD are required for custom upload." +#endif diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index fe5e5da905..5c05f2f021 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -25,7 +25,7 @@ * Release version. Leave the Marlin version or apply a custom scheme. */ #ifndef SHORT_BUILD_VERSION - #define SHORT_BUILD_VERSION "bugfix-2.0.x" + #define SHORT_BUILD_VERSION "bugfix-2.1.x" #endif /** @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2022-05-17" + #define STRING_DISTRIBUTION_DATE "2022-06-08" #endif /** diff --git a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp index 31b26aa5bb..1e82fe403d 100644 --- a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp +++ b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp @@ -992,7 +992,7 @@ void lcd_put_int(const int i) { lcd.print(i); } // return < 0 on error // return the advanced cols -int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { +int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length) { // find the HD44780 internal ROM first int ret; @@ -1047,9 +1047,9 @@ int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { * * Draw a UTF-8 string */ -static int lcd_put_u8str_max_cb(const char * utf8_str, uint8_t (*cb_read_byte)(uint8_t * str), pixel_len_t max_length) { +static int lcd_put_u8str_max_cb(const char * utf8_str, read_byte_cb_t cb_read_byte, const pixel_len_t max_length) { pixel_len_t ret = 0; - uint8_t *p = (uint8_t *)utf8_str; + const uint8_t *p = (uint8_t *)utf8_str; while (ret < max_length) { wchar_t ch = 0; p = get_utf8_value_cb(p, cb_read_byte, &ch); @@ -1059,11 +1059,11 @@ static int lcd_put_u8str_max_cb(const char * utf8_str, uint8_t (*cb_read_byte)(u return (int)ret; } -int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) { +int lcd_put_u8str_max(const char * utf8_str, const pixel_len_t max_length) { return lcd_put_u8str_max_cb(utf8_str, read_byte_ram, max_length); } -int lcd_put_u8str_max_P(PGM_P utf8_pstr, pixel_len_t max_length) { +int lcd_put_u8str_max_P(PGM_P utf8_pstr, const pixel_len_t max_length) { return lcd_put_u8str_max_cb(utf8_pstr, read_byte_rom, max_length); } diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 6c6ff47377..da4db8b2d4 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -410,7 +410,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); } // Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line void lcd_scroll(const lcd_uint_t col, const lcd_uint_t line, FSTR_P const ftxt, const uint8_t len, const int16_t time) { - uint8_t slen = utf8_strlen_P(FTOP(ftxt)); + uint8_t slen = utf8_strlen(ftxt); if (slen < len) { lcd_put_u8str_max(col, line, ftxt, len); for (; slen < len; ++slen) lcd_put_wchar(' '); @@ -437,10 +437,10 @@ void MarlinUI::clear_lcd() { lcd.clear(); } } } - static void logo_lines(PGM_P const extra) { - int16_t indent = (LCD_WIDTH - 8 - utf8_strlen_P(extra)) / 2; + static void logo_lines(FSTR_P const extra) { + int16_t indent = (LCD_WIDTH - 8 - utf8_strlen(extra)) / 2; lcd_put_wchar(indent, 0, '\x00'); lcd_put_u8str(F( "------" )); lcd_put_wchar('\x01'); - lcd_put_u8str(indent, 1, F("|Marlin|")); lcd_put_u8str_P(extra); + lcd_put_u8str(indent, 1, F("|Marlin|")); lcd_put_u8str(extra); lcd_put_wchar(indent, 2, '\x02'); lcd_put_u8str(F( "------" )); lcd_put_wchar('\x03'); } @@ -468,7 +468,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); } // // Show the Marlin logo, splash line1, and splash line 2 // - logo_lines(PSTR(" " SHORT_BUILD_VERSION)); + logo_lines(F(" " SHORT_BUILD_VERSION)); CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 2000); } else { @@ -476,7 +476,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); } // Show the Marlin logo and short build version // After a delay show the website URL // - logo_lines(NUL_STR); + logo_lines(FPSTR(NUL_STR)); CENTER_OR_SCROLL(SHORT_BUILD_VERSION, 1500); CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 1500); #ifdef STRING_SPLASH_LINE3 @@ -495,12 +495,13 @@ void MarlinUI::clear_lcd() { lcd.clear(); } #endif // SHOW_BOOTSCREEN void MarlinUI::draw_kill_screen() { - lcd_put_u8str(0, 0, status_message); - lcd_uint_t y = 2; + lcd_uint_t x = 0, y = 0; + lcd_put_u8str(x, y, status_message); + y = 2; #if LCD_HEIGHT >= 4 - lcd_put_u8str(0, y++, GET_TEXT_F(MSG_HALTED)); + lcd_put_u8str(x, y++, GET_TEXT_F(MSG_HALTED)); #endif - lcd_put_u8str(0, y, GET_TEXT_F(MSG_PLEASE_RESET)); + lcd_put_u8str(x, y, GET_TEXT_F(MSG_PLEASE_RESET)); } // @@ -1067,33 +1068,33 @@ void MarlinUI::draw_status_screen() { #endif // ADVANCED_PAUSE_FEATURE // Draw a static item with no left-right margin required. Centered by default. - void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { + void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { int8_t n = LCD_WIDTH; lcd_moveto(0, row); - const int8_t plen = pstr ? utf8_strlen_P(pstr) : 0, + const int8_t plen = fstr ? utf8_strlen(fstr) : 0, vlen = vstr ? utf8_strlen(vstr) : 0; if (style & SS_CENTER) { int8_t pad = (LCD_WIDTH - plen - vlen) / 2; while (--pad >= 0) { lcd_put_wchar(' '); n--; } } - if (plen) n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, n); + if (plen) n = lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n); if (vlen) n -= lcd_put_u8str_max(vstr, n); for (; n > 0; --n) lcd_put_wchar(' '); } // Draw a generic menu item with pre_char (if selected) and post_char - void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char) { + void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, 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, itemString, LCD_WIDTH - 2); + uint8_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, 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 inStr, const bool pgm) { + void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const ftpl, 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, itemString, LCD_WIDTH - 2 - vlen); + uint8_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2 - vlen); if (vlen) { lcd_put_wchar(':'); for (; n; --n) lcd_put_wchar(' '); @@ -1102,9 +1103,9 @@ void MarlinUI::draw_status_screen() { } // 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*/) { + void MenuEditItemBase::draw_edit_screen(FSTR_P const ftpl, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); - uint8_t n = lcd_put_u8str_ind_P(0, 1, pstr, itemIndex, itemString, LCD_WIDTH - 1); + uint8_t n = lcd_put_u8str(0, 1, ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 1); if (value) { lcd_put_wchar(':'); n--; const uint8_t len = utf8_strlen(value) + 1; // Plus one for a leading space @@ -1115,21 +1116,21 @@ void MarlinUI::draw_status_screen() { } // The Select Screen presents a prompt and two "buttons" - void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { + void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { ui.draw_select_screen_prompt(pref, string, suff); if (no) { SETCURSOR(0, LCD_HEIGHT - 1); - lcd_put_wchar(yesno ? ' ' : '['); lcd_put_u8str_P(no); lcd_put_wchar(yesno ? ' ' : ']'); + lcd_put_wchar(yesno ? ' ' : '['); lcd_put_u8str(no); lcd_put_wchar(yesno ? ' ' : ']'); } if (yes) { - SETCURSOR_RJ(utf8_strlen_P(yes) + 2, LCD_HEIGHT - 1); - lcd_put_wchar(yesno ? '[' : ' '); lcd_put_u8str_P(yes); lcd_put_wchar(yesno ? ']' : ' '); + SETCURSOR_RJ(utf8_strlen(yes) + 2, LCD_HEIGHT - 1); + lcd_put_wchar(yesno ? '[' : ' '); lcd_put_u8str(yes); lcd_put_wchar(yesno ? ']' : ' '); } } #if ENABLED(SDSUPPORT) - void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) { + void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { lcd_put_wchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' '); constexpr uint8_t maxlen = LCD_WIDTH - 2; uint8_t n = maxlen - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen); diff --git a/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp index d0cf5795d2..7b15b78605 100644 --- a/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp @@ -991,7 +991,7 @@ void lcd_put_int(const int i) { // return < 0 on error // return the advanced cols -int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { +int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length) { // find the HD44780 internal ROM first int ret; @@ -1045,9 +1045,9 @@ int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { * * Draw a UTF-8 string */ -static int lcd_put_u8str_max_cb(const char * utf8_str, uint8_t (*cb_read_byte)(uint8_t * str), pixel_len_t max_length) { +static int lcd_put_u8str_max_cb(const char * utf8_str, read_byte_cb_t cb_read_byte, const pixel_len_t max_length) { pixel_len_t ret = 0; - uint8_t *p = (uint8_t *)utf8_str; + const uint8_t *p = (uint8_t *)utf8_str; while (ret < max_length) { wchar_t ch = 0; p = get_utf8_value_cb(p, cb_read_byte, &ch); @@ -1057,11 +1057,11 @@ static int lcd_put_u8str_max_cb(const char * utf8_str, uint8_t (*cb_read_byte)(u return (int)ret; } -int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) { +int lcd_put_u8str_max(const char * utf8_str, const pixel_len_t max_length) { return lcd_put_u8str_max_cb(utf8_str, read_byte_ram, max_length); } -int lcd_put_u8str_max_P(PGM_P utf8_pstr, pixel_len_t max_length) { +int lcd_put_u8str_max_P(PGM_P utf8_pstr, const pixel_len_t max_length) { return lcd_put_u8str_max_cb(utf8_pstr, read_byte_rom, max_length); } diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index 5e418e2fe3..46564bb1e6 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -380,13 +380,14 @@ void MarlinUI::clear_lcd() { void MarlinUI::_set_contrast() { lcd.setContrast(contrast); } #endif -static void center_text_P(PGM_P pstart, uint8_t y) { - uint8_t len = utf8_strlen_P(pstart); - if (len < LCD_WIDTH) - lcd.setCursor((LCD_WIDTH - len) / 2, y); - else - lcd.setCursor(0, y); - lcd_put_u8str_P(pstart); +#if !IS_TFTGLCD_PANEL + void lcd_moveto(const uint8_t col, const uint8_t row) { lcd.setCursor(col, row); } +#endif + +static void center_text(FSTR_P const fstart, const uint8_t y) { + const uint8_t len = utf8_strlen(fstart); + lcd_moveto(len < LCD_WIDTH ? (LCD_WIDTH - len) / 2 : 0, y); + lcd_put_u8str(fstart); } #if ENABLED(SHOW_BOOTSCREEN) @@ -399,11 +400,11 @@ static void center_text_P(PGM_P pstart, uint8_t y) { uint8_t indent = (LCD_WIDTH - 8) / 2; // symbols 217 (bottom right corner) and 218 (top left corner) are using for letters in some languages // and they should be moved to beginning ASCII table as special symbols - lcd.setCursor(indent, 0); lcd.write(TLC); lcd_put_u8str(F("------")); lcd.write(TRC); - lcd.setCursor(indent, 1); lcd.write(LR); lcd_put_u8str(F("Marlin")); lcd.write(LR); - lcd.setCursor(indent, 2); lcd.write(BLC); lcd_put_u8str(F("------")); lcd.write(BRC); - center_text_P(PSTR(SHORT_BUILD_VERSION), 3); - center_text_P(PSTR(MARLIN_WEBSITE_URL), 4); + lcd_moveto(indent, 0); lcd.write(TLC); lcd_put_u8str(F("------")); lcd.write(TRC); + lcd_moveto(indent, 1); lcd.write(LR); lcd_put_u8str(F("Marlin")); lcd.write(LR); + lcd_moveto(indent, 2); lcd.write(BLC); lcd_put_u8str(F("------")); lcd.write(BRC); + center_text(F(SHORT_BUILD_VERSION), 3); + center_text(F(MARLIN_WEBSITE_URL), 4); picBits = ICON_LOGO; lcd.print_screen(); } @@ -417,11 +418,11 @@ static void center_text_P(PGM_P pstart, uint8_t y) { void MarlinUI::draw_kill_screen() { if (!PanelDetected) return; lcd.clear_buffer(); - lcd.setCursor(0, 3); lcd.write(COLOR_ERROR); - lcd.setCursor((LCD_WIDTH - utf8_strlen(status_message)) / 2 + 1, 3); + lcd_moveto(0, 3); lcd.write(COLOR_ERROR); + lcd_moveto((LCD_WIDTH - utf8_strlen(status_message)) / 2 + 1, 3); lcd_put_u8str(status_message); - center_text_P(GET_TEXT(MSG_HALTED), 5); - center_text_P(GET_TEXT(MSG_PLEASE_RESET), 6); + center_text(GET_TEXT_F(MSG_HALTED), 5); + center_text(GET_TEXT_F(MSG_PLEASE_RESET), 6); lcd.print_screen(); } @@ -456,25 +457,25 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const #if HOTENDS < 2 if (heater_id == H_E0) { - lcd.setCursor(2, 5); lcd.print(prefix); //HE - lcd.setCursor(1, 6); lcd.print(i16tostr3rj(t1)); - lcd.setCursor(1, 7); + lcd_moveto(2, 5); lcd.print(prefix); //HE + lcd_moveto(1, 6); lcd.print(i16tostr3rj(t1)); + lcd_moveto(1, 7); } else { - lcd.setCursor(6, 5); lcd.print(prefix); //BED - lcd.setCursor(6, 6); lcd.print(i16tostr3rj(t1)); - lcd.setCursor(6, 7); + lcd_moveto(6, 5); lcd.print(prefix); //BED + lcd_moveto(6, 6); lcd.print(i16tostr3rj(t1)); + lcd_moveto(6, 7); } #else if (heater_id > H_BED) { - lcd.setCursor(heater_id * 4, 5); lcd.print(prefix); // HE1 or HE2 or HE3 - lcd.setCursor(heater_id * 4, 6); lcd.print(i16tostr3rj(t1)); - lcd.setCursor(heater_id * 4, 7); + lcd_moveto(heater_id * 4, 5); lcd.print(prefix); // HE1 or HE2 or HE3 + lcd_moveto(heater_id * 4, 6); lcd.print(i16tostr3rj(t1)); + lcd_moveto(heater_id * 4, 7); } else { - lcd.setCursor(13, 5); lcd.print(prefix); //BED - lcd.setCursor(13, 6); lcd.print(i16tostr3rj(t1)); - lcd.setCursor(13, 7); + lcd_moveto(13, 5); lcd.print(prefix); //BED + lcd_moveto(13, 6); lcd.print(i16tostr3rj(t1)); + lcd_moveto(13, 7); } #endif // HOTENDS <= 1 @@ -515,9 +516,9 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const FORCE_INLINE void _draw_cooler_status(const bool blink) { const celsius_t t2 = thermalManager.degTargetCooler(); - lcd.setCursor(0, 5); lcd_put_u8str(F("COOL")); - lcd.setCursor(1, 6); lcd_put_u8str(i16tostr3rj(thermalManager.wholeDegCooler())); - lcd.setCursor(1, 7); + lcd_moveto(0, 5); lcd_put_u8str(F("COOL")); + lcd_moveto(1, 6); lcd_put_u8str(i16tostr3rj(thermalManager.wholeDegCooler())); + lcd_moveto(1, 7); #if !HEATER_IDLE_HANDLER UNUSED(blink); @@ -543,9 +544,9 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const #if ENABLED(LASER_COOLANT_FLOW_METER) FORCE_INLINE void _draw_flowmeter_status() { - lcd.setCursor(5, 5); lcd_put_u8str(F("FLOW")); - lcd.setCursor(7, 6); lcd_put_wchar('L'); - lcd.setCursor(6, 7); lcd_put_u8str(ftostr11ns(cooler.flowrate)); + lcd_moveto(5, 5); lcd_put_u8str(F("FLOW")); + lcd_moveto(7, 6); lcd_put_wchar('L'); + lcd_moveto(6, 7); lcd_put_u8str(ftostr11ns(cooler.flowrate)); if (cooler.flowrate) picBits |= ICON_FAN; else picBits &= ~ICON_FAN; @@ -556,18 +557,18 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const #if ENABLED(I2C_AMMETER) FORCE_INLINE void _draw_ammeter_status() { - lcd.setCursor(10, 5); lcd_put_u8str(F("ILAZ")); + lcd_moveto(10, 5); lcd_put_u8str(F("ILAZ")); ammeter.read(); - lcd.setCursor(11, 6); + lcd_moveto(11, 6); if (ammeter.current <= 0.999f) { lcd_put_u8str("mA"); - lcd.setCursor(10, 7); + lcd_moveto(10, 7); lcd_put_wchar(' '); lcd_put_u8str(ui16tostr3rj(uint16_t(ammeter.current * 1000 + 0.5f))); } else { lcd_put_u8str(" A"); - lcd.setCursor(10, 7); + lcd_moveto(10, 7); lcd_put_u8str(ftostr12ns(ammeter.current)); } @@ -580,16 +581,16 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const #if HAS_CUTTER FORCE_INLINE void _draw_cutter_status() { - lcd.setCursor(15, 5); lcd_put_u8str(F("CUTT")); + lcd_moveto(15, 5); lcd_put_u8str(F("CUTT")); #if CUTTER_UNIT_IS(RPM) - lcd.setCursor(16, 6); lcd_put_u8str(F("RPM")); - lcd.setCursor(15, 7); lcd_put_u8str(ftostr31ns(float(cutter.unitPower) / 1000)); + lcd_moveto(16, 6); lcd_put_u8str(F("RPM")); + lcd_moveto(15, 7); lcd_put_u8str(ftostr31ns(float(cutter.unitPower) / 1000)); lcd_put_wchar('K'); #elif CUTTER_UNIT_IS(PERCENT) - lcd.setCursor(17, 6); lcd_put_wchar('%'); - lcd.setCursor(18, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower)); + lcd_moveto(17, 6); lcd_put_wchar('%'); + lcd_moveto(18, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower)); #else - lcd.setCursor(17, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower)); + lcd_moveto(17, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower)); #endif if (cutter.unitPower) picBits |= ICON_HOT; @@ -625,10 +626,10 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const lcd.write('%'); lcd.write(percent); } else { // For progress bar test - lcd.setCursor(LCD_WIDTH / 2 - 2, MIDDLE_Y); - lcd.print(i16tostr3rj(percent)); lcd.write('%'); + lcd_moveto(LCD_WIDTH / 2 - 2, MIDDLE_Y); + lcd.print(i16tostr3rj(percent)); lcd.write('%'); lcd.print_line(); - lcd.setCursor(0, MIDDLE_Y + 1); + lcd_moveto(0, MIDDLE_Y + 1); lcd.write('%'); lcd.write(percent); lcd.print_line(); } @@ -638,7 +639,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const void MarlinUI::draw_status_message(const bool blink) { if (!PanelDetected) return; - lcd.setCursor(0, 3); + lcd_moveto(0, 3); #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) // Alternate Status message and Filament display @@ -787,7 +788,7 @@ void MarlinUI::draw_status_screen() { // Line 1 - XYZ coordinates // - lcd.setCursor(0, 0); + lcd_moveto(0, 0); const xyz_pos_t lpos = current_position.asLogical(); _draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink); lcd.write(' '); _draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink); lcd.write(' '); @@ -801,11 +802,11 @@ void MarlinUI::draw_status_screen() { // Line 2 - feedrate, , time // - lcd.setCursor(0, 1); + lcd_moveto(0, 1); lcd_put_u8str(F("FR")); lcd.print(i16tostr3rj(feedrate_percentage)); lcd.write('%'); #if BOTH(SDSUPPORT, HAS_PRINT_PROGRESS) - lcd.setCursor(LCD_WIDTH / 2 - 3, 1); + lcd_moveto(LCD_WIDTH / 2 - 3, 1); _draw_print_progress(); #endif @@ -813,14 +814,14 @@ void MarlinUI::draw_status_screen() { duration_t elapsed = print_job_timer.duration(); uint8_t len = elapsed.toDigital(buffer); - lcd.setCursor((LCD_WIDTH - 1) - len, 1); + lcd_moveto((LCD_WIDTH - 1) - len, 1); lcd.write(LCD_STR_CLOCK[0]); lcd.print(buffer); // // Line 3 - progressbar // - lcd.setCursor(0, 2); + lcd_moveto(0, 2); #if ENABLED(LCD_PROGRESS_BAR) draw_progress_bar(_get_progress()); #else @@ -839,7 +840,7 @@ void MarlinUI::draw_status_screen() { #if HOTENDS <= 1 || (HOTENDS <= 2 && !HAS_HEATED_BED) #if DUAL_MIXING_EXTRUDER - lcd.setCursor(0, 4); + lcd_moveto(0, 4); // Two-component mix / gradient instead of XY char mixer_messages[12]; const char *mix_label; @@ -895,9 +896,9 @@ void MarlinUI::draw_status_screen() { #else #define FANX 17 #endif - lcd.setCursor(FANX, 5); lcd_put_u8str(F("FAN")); - lcd.setCursor(FANX + 1, 6); lcd.write('%'); - lcd.setCursor(FANX, 7); + lcd_moveto(FANX, 5); lcd_put_u8str(F("FAN")); + lcd_moveto(FANX + 1, 6); lcd.write('%'); + lcd_moveto(FANX, 7); lcd.print(i16tostr3rj(per)); if (TERN0(HAS_FAN0, thermalManager.fan_speed[0]) || TERN0(HAS_FAN1, thermalManager.fan_speed[1]) || TERN0(HAS_FAN2, thermalManager.fan_speed[2])) @@ -930,7 +931,7 @@ void MarlinUI::draw_status_screen() { void MarlinUI::draw_hotend_status(const uint8_t row, const uint8_t extruder) { if (!PanelDetected) return; - lcd.setCursor((LCD_WIDTH - 14) / 2, row + 1); + lcd_moveto((LCD_WIDTH - 14) / 2, row + 1); lcd.write(LCD_STR_THERMOMETER[0]); lcd_put_u8str(F(" E")); lcd.write('1' + extruder); lcd.write(' '); lcd.print(i16tostr3rj(thermalManager.wholeDegHotend(extruder))); lcd.write(LCD_STR_DEGREE[0]); lcd.write('/'); lcd.print(i16tostr3rj(thermalManager.degTargetHotend(extruder))); lcd.write(LCD_STR_DEGREE[0]); @@ -940,58 +941,58 @@ void MarlinUI::draw_status_screen() { #endif // Draw a static item with no left-right margin required. Centered by default. - void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const valstr/*=nullptr*/) { + void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char * const valstr/*=nullptr*/) { if (!PanelDetected) return; uint8_t n = LCD_WIDTH; - lcd.setCursor(0, row); + lcd_moveto(0, row); if ((style & SS_CENTER) && !valstr) { - int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; + int8_t pad = (LCD_WIDTH - utf8_strlen(fstr)) / 2; while (--pad >= 0) { lcd.write(' '); n--; } } - n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, n); + n = lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n); if (valstr) n -= lcd_put_u8str_max(valstr, n); for (; n; --n) lcd.write(' '); lcd.print_line(); } // 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) { + void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char) { if (!PanelDetected) return; - lcd.setCursor(0, row); + lcd_moveto(0, row); lcd.write(sel ? pre_char : ' '); - uint8_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 2); + uint8_t n = lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2); for (; n; --n) lcd.write(' '); lcd.write(post_char); lcd.print_line(); } // 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) { + void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm) { if (!PanelDetected) return; - const uint8_t vlen = data ? (pgm ? utf8_strlen_P(data) : utf8_strlen(data)) : 0; - lcd.setCursor(0, row); + const uint8_t vlen = inStr ? (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)) : 0; + lcd_moveto(0, row); lcd.write(sel ? LCD_STR_ARROW_RIGHT[0] : ' '); - uint8_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 2 - vlen); + uint8_t n = lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2 - vlen); if (vlen) { lcd.write(':'); for (; n; --n) lcd.write(' '); - if (pgm) lcd_put_u8str_P(data); else lcd_put_u8str(data); + if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr); } lcd.print_line(); } // Low-level draw_edit_screen can be used to draw an edit screen from anyplace // This line moves to the last line of the screen for UBL plot screen on the panel side - void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) { + void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) { if (!PanelDetected) return; ui.encoder_direction_normal(); const uint8_t y = TERN0(AUTO_BED_LEVELING_UBL, ui.external_control) ? LCD_HEIGHT - 1 : MIDDLE_Y; - lcd.setCursor(0, y); + lcd_moveto(0, y); lcd.write(COLOR_EDIT); - lcd_put_u8str_P(pstr); + lcd_put_u8str(fstr); if (value) { lcd.write(':'); - lcd.setCursor((LCD_WIDTH - 1) - (utf8_strlen(value) + 1), y); // Right-justified, padded by spaces + lcd_moveto((LCD_WIDTH - 1) - (utf8_strlen(value) + 1), y); // Right-justified, padded by spaces lcd.write(' '); // Overwrite char if value gets shorter lcd.print(value); lcd.write(' '); @@ -1000,26 +1001,26 @@ void MarlinUI::draw_status_screen() { } // The Select Screen presents a prompt and two "buttons" - void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string, PGM_P const suff) { + void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string, FSTR_P const suff) { if (!PanelDetected) return; ui.draw_select_screen_prompt(pref, string, suff); lcd.write(COLOR_EDIT); if (no) { - lcd.setCursor(0, MIDDLE_Y); - lcd.write(yesno ? ' ' : '['); lcd_put_u8str_P(no); lcd.write(yesno ? ' ' : ']'); + lcd_moveto(0, MIDDLE_Y); + lcd.write(yesno ? ' ' : '['); lcd_put_u8str(no); lcd.write(yesno ? ' ' : ']'); } if (yes) { - lcd.setCursor(LCD_WIDTH - utf8_strlen_P(yes) - 3, MIDDLE_Y); - lcd.write(yesno ? '[' : ' '); lcd_put_u8str_P(yes); lcd.write(yesno ? ']' : ' '); + lcd_moveto(LCD_WIDTH - utf8_strlen(yes) - 3, MIDDLE_Y); + lcd.write(yesno ? '[' : ' '); lcd_put_u8str(yes); lcd.write(yesno ? ']' : ' '); } lcd.print_line(); } #if ENABLED(SDSUPPORT) - void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) { + void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { if (!PanelDetected) return; - lcd.setCursor(0, row); + lcd_moveto(0, row); lcd.write(sel ? LCD_STR_ARROW_RIGHT[0] : ' '); constexpr uint8_t maxlen = LCD_WIDTH - 2; uint8_t n = maxlen - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen); @@ -1058,30 +1059,30 @@ void MarlinUI::draw_status_screen() { lcd.clear_buffer(); //print only top left corner. All frame with grid points will be printed by panel - lcd.setCursor(0, 0); + lcd_moveto(0, 0); *fb++ = TLC; //top left corner - marker for plot parameters *fb = (GRID_MAX_POINTS_X << 4) + GRID_MAX_POINTS_Y; //set mesh size // Print plot position - lcd.setCursor(_LCD_W_POS, 0); - *fb++ = '('; lcd.print(i16tostr3left(x_plot)); - *fb++ = ','; lcd.print(i16tostr3left(y_plot)); *fb = ')'; + lcd_moveto(_LCD_W_POS, 0); + *fb++ = '('; lcd.print(i16tostr3left(x_plot)); + *fb++ = ','; lcd.print(i16tostr3left(y_plot)); *fb = ')'; // Show all values - lcd.setCursor(_LCD_W_POS, 1); lcd_put_u8str(F("X:")); + lcd_moveto(_LCD_W_POS, 1); lcd_put_u8str(F("X:")); lcd.print(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&bedlevel._mesh_index_to_xpos[x_plot])))); - lcd.setCursor(_LCD_W_POS, 2); lcd_put_u8str(F("Y:")); + lcd_moveto(_LCD_W_POS, 2); lcd_put_u8str(F("Y:")); lcd.print(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&bedlevel._mesh_index_to_ypos[y_plot])))); // Show the location value - lcd.setCursor(_LCD_W_POS, 3); lcd_put_u8str(F("Z:")); + lcd_moveto(_LCD_W_POS, 3); lcd_put_u8str(F("Z:")); if (!isnan(bedlevel.z_values[x_plot][y_plot])) lcd.print(ftostr43sign(bedlevel.z_values[x_plot][y_plot])); else lcd_put_u8str(F(" -----")); - center_text_P(GET_TEXT(MSG_UBL_FINE_TUNE_MESH), 8); + center_text(GET_TEXT_F(MSG_UBL_FINE_TUNE_MESH), 8); lcd.print_screen(); } diff --git a/Marlin/src/lcd/dogm/lcdprint_u8g.cpp b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp index f74a59a08c..f5c13798f2 100644 --- a/Marlin/src/lcd/dogm/lcdprint_u8g.cpp +++ b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp @@ -28,7 +28,7 @@ void lcd_put_int(const int i) { u8g.print(i); } // return < 0 on error // return the advanced pixels -int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { +int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length) { if (c < 256) { u8g.print((char)c); return u8g_GetFontBBXWidth(u8g.getU8g()); @@ -39,14 +39,14 @@ int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { return ret; } -int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) { +int lcd_put_u8str_max(const char * utf8_str, const pixel_len_t max_length) { u8g_uint_t x = u8g.getPrintCol(), y = u8g.getPrintRow(), ret = uxg_DrawUtf8Str(u8g.getU8g(), x, y, utf8_str, max_length); u8g.setPrintPos(x + ret, y); return ret; } -int lcd_put_u8str_max_P(PGM_P utf8_pstr, pixel_len_t max_length) { +int lcd_put_u8str_max_P(PGM_P utf8_pstr, const pixel_len_t max_length) { u8g_uint_t x = u8g.getPrintCol(), y = u8g.getPrintRow(), ret = uxg_DrawUtf8StrP(u8g.getU8g(), x, y, utf8_pstr, max_length); u8g.setPrintPos(x + ret, y); diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index eacd3d0afb..3c661a4429 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -330,13 +330,13 @@ void MarlinUI::update_language_font() { // The kill screen is displayed for unrecoverable conditions void MarlinUI::draw_kill_screen() { TERN_(LIGHTWEIGHT_UI, ST7920_Lite_Status_Screen::clear_text_buffer()); - const u8g_uint_t h4 = u8g.getHeight() / 4; + const u8g_uint_t x = 0, h4 = u8g.getHeight() / 4; u8g.firstPage(); do { set_font(FONT_MENU); - lcd_put_u8str(0, h4 * 1, status_message); - lcd_put_u8str(0, h4 * 2, GET_TEXT_F(MSG_HALTED)); - lcd_put_u8str(0, h4 * 3, GET_TEXT_F(MSG_PLEASE_RESET)); + lcd_put_u8str(x, h4 * 1, status_message); + lcd_put_u8str(x, h4 * 2, GET_TEXT_F(MSG_HALTED)); + lcd_put_u8str(x, h4 * 3, GET_TEXT_F(MSG_PLEASE_RESET)); } while (u8g.nextPage()); } @@ -412,28 +412,28 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop } // Draw a static line of text in the same idiom as a menu item - void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { + void MenuItem_static::draw(const uint8_t row, FSTR_P const ftpl, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { if (mark_as_selected(row, style & SS_INVERT)) { pixel_len_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed - const int plen = pstr ? calculateWidth(pstr) : 0, + const int plen = ftpl ? calculateWidth(ftpl) : 0, vlen = vstr ? utf8_strlen(vstr) : 0; if (style & SS_CENTER) { int pad = (LCD_PIXEL_WIDTH - plen - vlen * MENU_FONT_WIDTH) / MENU_FONT_WIDTH / 2; while (--pad >= 0) n -= lcd_put_wchar(' '); } - if (plen) n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH); + if (plen) n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH); if (vlen) n -= lcd_put_u8str_max(vstr, n); while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); } } // Draw a generic menu item - void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char, const char post_char) { + void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char, const char post_char) { if (mark_as_selected(row, sel)) { - pixel_len_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 1) * (MENU_FONT_WIDTH); + pixel_len_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, 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(' '); @@ -441,27 +441,27 @@ 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 inStr, const bool pgm) { + void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char * const inStr, const bool pgm) { if (mark_as_selected(row, sel)) { - 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)); + const uint8_t vallen = (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)), + pixelwidth = (pgm ? uxg_GetUtf8StrPixelWidthP(u8g.getU8g(), inStr) : uxg_GetUtf8StrPixelWidth(u8g.getU8g(), inStr)); const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1; - pixel_len_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 2 - vallen * prop) * (MENU_FONT_WIDTH); + pixel_len_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2 - vallen * prop) * (MENU_FONT_WIDTH); if (vallen) { lcd_put_wchar(':'); while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); 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); + if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr); } } } - void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) { + void MenuEditItemBase::draw_edit_screen(FSTR_P const ftpl, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1; - const u8g_uint_t labellen = utf8_strlen_P(pstr), vallen = utf8_strlen(value); + const u8g_uint_t labellen = utf8_strlen(ftpl), vallen = utf8_strlen(value); bool extra_row = labellen * prop > LCD_WIDTH - 2 - vallen * prop; #if ENABLED(USE_BIG_EDIT_FONT) @@ -490,7 +490,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, itemString); + if (onpage) lcd_put_u8str(0, baseline, ftpl, itemIndex, itemStringC, itemStringF); // If a value is included, print a colon, then print the value right-justified if (value) { @@ -508,8 +508,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop TERN_(USE_BIG_EDIT_FONT, ui.set_font(FONT_MENU)); } - 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), + inline void draw_boxed_string(const u8g_uint_t x, const u8g_uint_t y, FSTR_P const fstr, const bool inv) { + const u8g_uint_t len = utf8_strlen(fstr), by = (y + 1) * (MENU_FONT_HEIGHT); const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1; const pixel_len_t bw = len * prop * (MENU_FONT_WIDTH), bx = x * prop * (MENU_FONT_WIDTH); @@ -518,19 +518,19 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop u8g.drawBox(bx / prop - 1, by - (MENU_FONT_ASCENT), bw + 2, MENU_FONT_HEIGHT); u8g.setColorIndex(0); } - lcd_put_u8str_P(bx / prop, by, pstr); + lcd_put_u8str(bx / prop, by, fstr); if (inv) u8g.setColorIndex(1); } - void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { - ui.draw_select_screen_prompt(pref, string, suff); + void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const fpre, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { + ui.draw_select_screen_prompt(fpre, string, suff); if (no) draw_boxed_string(1, LCD_HEIGHT - 1, no, !yesno); - if (yes) draw_boxed_string(LCD_WIDTH - (utf8_strlen_P(yes) * (USE_WIDE_GLYPH ? 2 : 1) + 1), LCD_HEIGHT - 1, yes, yesno); + if (yes) draw_boxed_string(LCD_WIDTH - (utf8_strlen(yes) * (USE_WIDE_GLYPH ? 2 : 1) + 1), LCD_HEIGHT - 1, yes, yesno); } #if ENABLED(SDSUPPORT) - void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) { + void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { if (mark_as_selected(row, sel)) { const uint8_t maxlen = LCD_WIDTH - isDir; if (isDir) lcd_put_wchar(LCD_STR_FOLDER[0]); diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp index 4a794f5000..f1bf9d032e 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp @@ -517,14 +517,14 @@ U8G_PB_DEV(u8g_dev_tft_320x240_upscale_from_128x64, WIDTH, HEIGHT, PAGE_HEIGHT, drawCross(x, y, TFT_MARLINBG_COLOR); } - const char *str = nullptr; + FSTR_P str = nullptr; if (calibration_stage < CALIBRATION_SUCCESS) { // handle current state switch (calibration_stage) { - case CALIBRATION_TOP_LEFT: str = GET_TEXT(MSG_TOP_LEFT); break; - case CALIBRATION_BOTTOM_LEFT: str = GET_TEXT(MSG_BOTTOM_LEFT); break; - case CALIBRATION_TOP_RIGHT: str = GET_TEXT(MSG_TOP_RIGHT); break; - case CALIBRATION_BOTTOM_RIGHT: str = GET_TEXT(MSG_BOTTOM_RIGHT); break; + case CALIBRATION_TOP_LEFT: str = GET_TEXT_F(MSG_TOP_LEFT); break; + case CALIBRATION_BOTTOM_LEFT: str = GET_TEXT_F(MSG_BOTTOM_LEFT); break; + case CALIBRATION_TOP_RIGHT: str = GET_TEXT_F(MSG_TOP_RIGHT); break; + case CALIBRATION_BOTTOM_RIGHT: str = GET_TEXT_F(MSG_BOTTOM_RIGHT); break; default: break; } @@ -534,7 +534,7 @@ U8G_PB_DEV(u8g_dev_tft_320x240_upscale_from_128x64, WIDTH, HEIGHT, PAGE_HEIGHT, } else { // end calibration - str = calibration_stage == CALIBRATION_SUCCESS ? GET_TEXT(MSG_CALIBRATION_COMPLETED) : GET_TEXT(MSG_CALIBRATION_FAILED); + str = calibration_stage == CALIBRATION_SUCCESS ? GET_TEXT_F(MSG_CALIBRATION_COMPLETED) : GET_TEXT_F(MSG_CALIBRATION_FAILED); defer_status_screen(false); touch_calibration.calibration_end(); TERN_(HAS_TOUCH_BUTTONS, redrawTouchButtons = true); diff --git a/Marlin/src/lcd/dogm/u8g_fontutf8.cpp b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp index 89bdb09e1b..8ba0e7d50a 100644 --- a/Marlin/src/lcd/dogm/u8g_fontutf8.cpp +++ b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp @@ -104,7 +104,7 @@ static void fontgroup_drawwchar(font_group_t *group, const font_t *fnt_default, * Get the screen pixel width of a ROM UTF-8 string */ static void fontgroup_drawstring(font_group_t *group, const font_t *fnt_default, const char *utf8_msg, read_byte_cb_t cb_read_byte, void * userdata, fontgroup_cb_draw_t cb_draw_ram) { - uint8_t *p = (uint8_t*)utf8_msg; + const uint8_t *p = (uint8_t*)utf8_msg; for (;;) { wchar_t val = 0; p = get_utf8_value_cb(p, cb_read_byte, &val); diff --git a/Marlin/src/lcd/dogm/u8g_fontutf8.h b/Marlin/src/lcd/dogm/u8g_fontutf8.h index 9760ef106b..5933f027cc 100644 --- a/Marlin/src/lcd/dogm/u8g_fontutf8.h +++ b/Marlin/src/lcd/dogm/u8g_fontutf8.h @@ -26,10 +26,10 @@ typedef struct _uxg_fontinfo_t { int uxg_SetUtf8Fonts(const uxg_fontinfo_t * fntinfo, int number); // fntinfo is type of PROGMEM -unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t ch, pixel_len_t max_length); +unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t ch, const pixel_len_t max_length); -unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, pixel_len_t max_length); -unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P utf8_msg, pixel_len_t max_length); +unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, const pixel_len_t max_length); +unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P utf8_msg, const pixel_len_t max_length); int uxg_GetUtf8StrPixelWidth(u8g_t *pu8g, const char *utf8_msg); int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, PGM_P utf8_msg); diff --git a/Marlin/src/lcd/e3v2/README.md b/Marlin/src/lcd/e3v2/README.md index 10b05455fd..91f25e2433 100644 --- a/Marlin/src/lcd/e3v2/README.md +++ b/Marlin/src/lcd/e3v2/README.md @@ -1,6 +1,6 @@ # 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). +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.1.x/config/examples/Creality/Ender-3%20V2). ## Easy Install diff --git a/Marlin/src/lcd/e3v2/common/dwin_api.h b/Marlin/src/lcd/e3v2/common/dwin_api.h index 37b1525ba3..81724c6edf 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_api.h +++ b/Marlin/src/lcd/e3v2/common/dwin_api.h @@ -74,7 +74,7 @@ inline void DWIN_Text(size_t &i, const char * const string, uint16_t rlimit=0xFF inline void DWIN_Text(size_t &i, FSTR_P string, uint16_t rlimit=0xFFFF) { if (!string) return; - const size_t len = _MIN(sizeof(DWIN_SendBuf) - i, _MIN(rlimit, strlen_P((PGM_P)string))); // cast to PGM_P (const char*) measure with strlen_P. + const size_t len = _MIN(sizeof(DWIN_SendBuf) - i, _MIN(rlimit, strlen_P(FTOP(string)))); if (len == 0) return; memcpy_P(&DWIN_SendBuf[i+1], string, len); i += len; diff --git a/Marlin/src/lcd/e3v2/jyersui/README.md b/Marlin/src/lcd/e3v2/jyersui/README.md index 10b05455fd..91f25e2433 100644 --- a/Marlin/src/lcd/e3v2/jyersui/README.md +++ b/Marlin/src/lcd/e3v2/jyersui/README.md @@ -1,6 +1,6 @@ # 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). +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.1.x/config/examples/Creality/Ender-3%20V2). ## Easy Install diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index e8d6abab0c..19155fd5e5 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -121,6 +121,26 @@ #define MIN_BED_TEMP 0 #endif +/** + * Custom menu items with jyersLCD + */ +#if ENABLED(CUSTOM_MENU_CONFIG) + #ifdef CONFIG_MENU_ITEM_5_DESC + #define CUSTOM_MENU_COUNT 5 + #elif defined(CONFIG_MENU_ITEM_4_DESC) + #define CUSTOM_MENU_COUNT 4 + #elif defined(CONFIG_MENU_ITEM_3_DESC) + #define CUSTOM_MENU_COUNT 3 + #elif defined(CONFIG_MENU_ITEM_2_DESC) + #define CUSTOM_MENU_COUNT 2 + #elif defined(CONFIG_MENU_ITEM_1_DESC) + #define CUSTOM_MENU_COUNT 1 + #endif + #if CUSTOM_MENU_COUNT + #define HAS_CUSTOM_MENU 1 + #endif +#endif + constexpr uint16_t TROWS = 6, MROWS = TROWS - 1, TITLE_HEIGHT = 30, MLINE = 53, @@ -1078,7 +1098,8 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #define PREPARE_PREHEAT (PREPARE_ZOFFSET + ENABLED(HAS_PREHEAT)) #define PREPARE_COOLDOWN (PREPARE_PREHEAT + EITHER(HAS_HOTEND, HAS_HEATED_BED)) #define PREPARE_CHANGEFIL (PREPARE_COOLDOWN + ENABLED(ADVANCED_PAUSE_FEATURE)) - #define PREPARE_TOTAL PREPARE_CHANGEFIL + #define PREPARE_CUSTOM_MENU (PREPARE_CHANGEFIL + ENABLED(HAS_CUSTOM_MENU)) + #define PREPARE_TOTAL PREPARE_CUSTOM_MENU switch (item) { case PREPARE_BACK: @@ -1153,6 +1174,18 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; #endif + #if HAS_CUSTOM_MENU + case PREPARE_CUSTOM_MENU: + #ifndef CUSTOM_MENU_CONFIG_TITLE + #define CUSTOM_MENU_CONFIG_TITLE "Custom Commands" + #endif + if (draw) + Draw_Menu_Item(row, ICON_Version, F(CUSTOM_MENU_CONFIG_TITLE)); + else + Draw_Menu(MenuCustom); + break; + #endif + #if ENABLED(ADVANCED_PAUSE_FEATURE) case PREPARE_CHANGEFIL: if (draw) { @@ -1750,6 +1783,126 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; #endif // FILAMENT_LOAD_UNLOAD_GCODES + #if HAS_CUSTOM_MENU + + case MenuCustom: + + #define CUSTOM_MENU_BACK 0 + #define CUSTOM_MENU_1 1 + #define CUSTOM_MENU_2 2 + #define CUSTOM_MENU_3 3 + #define CUSTOM_MENU_4 4 + #define CUSTOM_MENU_5 5 + #define CUSTOM_MENU_TOTAL CUSTOM_MENU_COUNT + + switch (item) { + case CUSTOM_MENU_BACK: + if (draw) + Draw_Menu_Item(row, ICON_Back, F("Back")); + else + Draw_Menu(Prepare, PREPARE_CUSTOM_MENU); + break; + + #if CUSTOM_MENU_COUNT >= 1 + case CUSTOM_MENU_1: + if (draw) + Draw_Menu_Item(row, ICON_Info, F(CONFIG_MENU_ITEM_1_DESC)); + else { + Popup_Handler(Custom); + //queue.inject(F(CONFIG_MENU_ITEM_1_GCODE)); // Old code + gcode.process_subcommands_now(F(CONFIG_MENU_ITEM_1_GCODE)); + planner.synchronize(); + Redraw_Menu(); + #if ENABLED(CUSTOM_MENU_CONFIG_SCRIPT_AUDIBLE_FEEDBACK) + AudioFeedback(); + #endif + #ifdef CUSTOM_MENU_CONFIG_SCRIPT_RETURN + queue.inject(F(CUSTOM_MENU_CONFIG_SCRIPT_DONE)); + #endif + } + break; + #endif + + #if CUSTOM_MENU_COUNT >= 2 + case CUSTOM_MENU_2: + if (draw) + Draw_Menu_Item(row, ICON_Info, F(CONFIG_MENU_ITEM_2_DESC)); + else { + Popup_Handler(Custom); + gcode.process_subcommands_now(F(CONFIG_MENU_ITEM_2_GCODE)); + planner.synchronize(); + Redraw_Menu(); + #if ENABLED(CUSTOM_MENU_CONFIG_SCRIPT_AUDIBLE_FEEDBACK) + AudioFeedback(); + #endif + #ifdef CUSTOM_MENU_CONFIG_SCRIPT_RETURN + queue.inject(F(CUSTOM_MENU_CONFIG_SCRIPT_DONE)); + #endif + } + break; + #endif + + #if CUSTOM_MENU_COUNT >= 3 + case CUSTOM_MENU_3: + if (draw) + Draw_Menu_Item(row, ICON_Info, F(CONFIG_MENU_ITEM_3_DESC)); + else { + Popup_Handler(Custom); + gcode.process_subcommands_now(F(CONFIG_MENU_ITEM_3_GCODE)); + planner.synchronize(); + Redraw_Menu(); + #if ENABLED(CUSTOM_MENU_CONFIG_SCRIPT_AUDIBLE_FEEDBACK) + AudioFeedback(); + #endif + #ifdef CUSTOM_MENU_CONFIG_SCRIPT_RETURN + queue.inject(F(CUSTOM_MENU_CONFIG_SCRIPT_DONE)); + #endif + } + break; + #endif + + #if CUSTOM_MENU_COUNT >= 4 + case CUSTOM_MENU_4: + if (draw) + Draw_Menu_Item(row, ICON_Info, F(CONFIG_MENU_ITEM_4_DESC)); + else { + Popup_Handler(Custom); + gcode.process_subcommands_now(F(CONFIG_MENU_ITEM_4_GCODE)); + planner.synchronize(); + Redraw_Menu(); + #if ENABLED(CUSTOM_MENU_CONFIG_SCRIPT_AUDIBLE_FEEDBACK) + AudioFeedback(); + #endif + #ifdef CUSTOM_MENU_CONFIG_SCRIPT_RETURN + queue.inject(F(CUSTOM_MENU_CONFIG_SCRIPT_DONE)); + #endif + } + break; + #endif + + #if CUSTOM_MENU_COUNT >= 5 + case CUSTOM_MENU_5: + if (draw) + Draw_Menu_Item(row, ICON_Info, F(CONFIG_MENU_ITEM_5_DESC)); + else { + Popup_Handler(Custom); + gcode.process_subcommands_now(F(CONFIG_MENU_ITEM_5_GCODE)); + planner.synchronize(); + Redraw_Menu(); + #if ENABLED(CUSTOM_MENU_CONFIG_SCRIPT_AUDIBLE_FEEDBACK) + AudioFeedback(); + #endif + #ifdef CUSTOM_MENU_CONFIG_SCRIPT_RETURN + queue.inject(F(CUSTOM_MENU_CONFIG_SCRIPT_DONE)); + #endif + } + break; + #endif // Custom Menu + } + break; + + #endif // HAS_CUSTOM_MENU + case Control: #define CONTROL_BACK 0 @@ -2944,7 +3097,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_VIEW: if (draw) - Draw_Menu_Item(row, ICON_Mesh, GET_TEXT(MSG_MESH_VIEW), nullptr, true); + Draw_Menu_Item(row, ICON_Mesh, GET_TEXT_F(MSG_MESH_VIEW), nullptr, true); else { #if ENABLED(AUTO_BED_LEVELING_UBL) if (bedlevel.storage_slot < 0) { @@ -3017,7 +3170,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_VIEW_MESH: if (draw) - Draw_Menu_Item(row, ICON_PrintSize, GET_TEXT(MSG_MESH_VIEW), nullptr, true); + Draw_Menu_Item(row, ICON_PrintSize, GET_TEXT_F(MSG_MESH_VIEW), nullptr, true); else Draw_Menu(MeshViewer); break; @@ -3688,6 +3841,14 @@ FSTR_P CrealityDWINClass::Get_Menu_Title(uint8_t menu) { #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) case ChangeFilament: return F("Change Filament"); #endif + #if HAS_CUSTOM_MENU + case MenuCustom: + #ifdef CUSTOM_MENU_CONFIG_TITLE + return F(CUSTOM_MENU_CONFIG_TITLE); + #else + return F("Custom Commands"); + #endif + #endif case Control: return F("Control"); case TempMenu: return F("Temperature"); #if HAS_HOTEND || HAS_HEATED_BED @@ -3753,6 +3914,9 @@ uint8_t CrealityDWINClass::Get_Menu_Size(uint8_t menu) { #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) case ChangeFilament: return CHANGEFIL_TOTAL; #endif + #if HAS_CUSTOM_MENU + case MenuCustom: return CUSTOM_MENU_TOTAL; + #endif case Control: return CONTROL_TOTAL; case TempMenu: return TEMP_TOTAL; #if HAS_HOTEND || HAS_HEATED_BED @@ -3831,6 +3995,7 @@ void CrealityDWINClass::Popup_Handler(PopupID popupid, bool option/*=false*/) { case Runout: Draw_Popup(F("Filament Runout"), F(""), F(""), Wait, ICON_BLTouch); break; case PIDWait: Draw_Popup(F("PID Autotune"), F("in process"), F("Please wait until done."), Wait, ICON_BLTouch); break; case Resuming: Draw_Popup(F("Resuming Print"), F("Please wait until done."), F(""), Wait, ICON_BLTouch); break; + case Custom: Draw_Popup(F("Running Custom GCode"), F("Please wait until done."), F(""), Wait, ICON_BLTouch); break; default: break; } } @@ -4115,14 +4280,14 @@ void CrealityDWINClass::Print_Screen_Control() { card.startOrResumeFilePrinting(); TERN_(POWER_LOSS_RECOVERY, recovery.prepare()); #else - char cmnd[20]; + char cmd[20]; #if HAS_HEATED_BED - cmnd[sprintf_P(cmnd, PSTR("M140 S%i"), pausebed)] = '\0'; - gcode.process_subcommands_now(cmnd); + sprintf_P(cmd, PSTR("M140 S%i"), pausebed); + gcode.process_subcommands_now(cmd); #endif #if HAS_EXTRUDERS - cmnd[sprintf_P(cmnd, PSTR("M109 S%i"), pausetemp)] = '\0'; - gcode.process_subcommands_now(cmnd); + sprintf_P(cmd, PSTR("M109 S%i"), pausetemp); + gcode.process_subcommands_now(cmd); #endif TERN_(HAS_FAN, thermalManager.fan_speed[0] = pausefan); planner.synchronize(); diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.h b/Marlin/src/lcd/e3v2/jyersui/dwin.h index d238d8e24f..8985647cd1 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.h +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.h @@ -43,7 +43,7 @@ enum processID : uint8_t { enum PopupID : uint8_t { Pause, Stop, Resume, SaveLevel, ETemp, ConfFilChange, PurgeMore, MeshSlot, Level, Home, MoveWait, Heating, FilLoad, FilChange, TempWarn, Runout, PIDWait, Resuming, ManualProbing, - FilInsert, HeaterTime, UserInput, LevelError, InvalidMesh, UI, Complete + FilInsert, HeaterTime, UserInput, LevelError, InvalidMesh, UI, Complete, Custom }; enum menuID : uint8_t { @@ -55,6 +55,7 @@ enum menuID : uint8_t { ZOffset, Preheat, ChangeFilament, + MenuCustom, Control, TempMenu, PID, diff --git a/Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp b/Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp index e2d4d62c77..30e86270c7 100644 --- a/Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp @@ -27,35 +27,35 @@ #include "dwin_string.h" //#include "../../fontutils.h" -uint8_t DWIN_String::data[]; +char DWIN_String::data[]; uint16_t DWIN_String::span; -uint8_t DWIN_String::len; +uint8_t DWIN_String::length; void DWIN_String::set() { //*data = 0x00; memset(data, 0x00, sizeof(data)); span = 0; - len = 0; + length = 0; } -uint8_t read_byte(uint8_t *byte) { return *byte; } +uint8_t read_byte(const uint8_t *byte) { return *byte; } /** * Add a string, applying substitutions for the following characters: * - * $ displays the clipped C-string given by the itemString argument + * $ displays the clipped string given by fstr or cstr * = displays '0'....'10' for indexes 0 - 10 * ~ displays '1'....'11' for indexes 0 - 10 * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) * @ displays an axis name such as XYZUVW, or E for an extruder */ -void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *itemString/*=nullptr*/) { +void DWIN_String::add(const char *tpl, const int8_t index, const char *cstr/*=nullptr*/, FSTR_P const fstr/*=nullptr*/) { wchar_t wchar; - while (*string) { - string = get_utf8_value_cb(string, read_byte, &wchar); + while (*tpl) { + tpl = get_utf8_value_cb(tpl, read_byte, &wchar); if (wchar > 255) wchar |= 0x0080; - uint8_t ch = uint8_t(wchar & 0x00FF); + const uint8_t ch = uint8_t(wchar & 0x00FF); if (ch == '=' || ch == '~' || ch == '*') { if (index >= 0) { @@ -65,10 +65,12 @@ void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *itemString/* add_character('0' + inum); } else - add(index == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED)); + add(index == -2 ? GET_TEXT_F(MSG_CHAMBER) : GET_TEXT_F(MSG_BED)); } - else if (ch == '$' && itemString) - add(itemString); + else if (ch == '$' && fstr) + add(fstr); + else if (ch == '$' && cstr) + add(cstr); else if (ch == '@') add_character(AXIS_CHAR(index)); else @@ -77,10 +79,10 @@ void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *itemString/* eol(); } -void DWIN_String::add(uint8_t *string, uint8_t max_len) { +void DWIN_String::add(const char *cstr, uint8_t max_len/*=MAX_STRING_LENGTH*/) { wchar_t wchar; - while (*string && max_len) { - string = get_utf8_value_cb(string, read_byte, &wchar); + while (*cstr && max_len) { + cstr = get_utf8_value_cb(cstr, read_byte, &wchar); /* if (wchar > 255) wchar |= 0x0080; uint8_t ch = uint8_t(wchar & 0x00FF); @@ -92,7 +94,7 @@ void DWIN_String::add(uint8_t *string, uint8_t max_len) { eol(); } -void DWIN_String::add(wchar_t character) { +void DWIN_String::add(const wchar_t character) { int ret; size_t idx = 0; dwin_charmap_t pinval; @@ -127,18 +129,18 @@ void DWIN_String::add(wchar_t character) { if (str[1]) add_character(str[1]); } -void DWIN_String::add_character(const uint8_t character) { - if (len < MAX_STRING_LENGTH) { - data[len] = character; - len++; +void DWIN_String::add_character(const char character) { + if (length < MAX_STRING_LENGTH) { + data[length] = character; + length++; //span += glyph(character)->DWidth; } } -void DWIN_String::rtrim(const uint8_t character) { - while (len) { - if (data[len - 1] == 0x20 || data[len - 1] == character) { - len--; +void DWIN_String::rtrim(const char character) { + while (length) { + if (data[length - 1] == 0x20 || data[length - 1] == character) { + length--; //span -= glyph(data[length])->DWidth; eol(); } @@ -147,18 +149,18 @@ void DWIN_String::rtrim(const uint8_t character) { } } -void DWIN_String::ltrim(const uint8_t character) { +void DWIN_String::ltrim(const char character) { uint16_t i, j; - for (i = 0; (i < len) && (data[i] == 0x20 || data[i] == character); i++) { + for (i = 0; (i < length) && (data[i] == 0x20 || data[i] == character); i++) { //span -= glyph(data[i])->DWidth; } if (i == 0) return; - for (j = 0; i < len; data[j++] = data[i++]); - len = j; + for (j = 0; i < length; data[j++] = data[i++]); + length = j; eol(); } -void DWIN_String::trim(const uint8_t character) { +void DWIN_String::trim(const char character) { rtrim(character); ltrim(character); } diff --git a/Marlin/src/lcd/e3v2/marlinui/dwin_string.h b/Marlin/src/lcd/e3v2/marlinui/dwin_string.h index 64676dddfd..c29777ae7b 100644 --- a/Marlin/src/lcd/e3v2/marlinui/dwin_string.h +++ b/Marlin/src/lcd/e3v2/marlinui/dwin_string.h @@ -21,6 +21,8 @@ */ #pragma once +// TODO: Make AVR-compatible with separate ROM / RAM string methods + #include "../../fontutils.h" #include "../../marlinui.h" @@ -41,14 +43,14 @@ class DWIN_String { //static glyph_t *glyphs[256]; //static font_t *font_header; - static uint8_t data[MAX_STRING_LENGTH + 1]; + static char data[MAX_STRING_LENGTH + 1]; static uint16_t span; // in pixels - static uint8_t len; // in characters - static void add_character(const uint8_t character); - static void eol() { data[len] = 0x00; } + static void add_character(const char character); + static void eol() { data[length] = 0x00; } public: + static uint8_t length; // in characters //static void set_font(const uint8_t *font); //static void add_glyphs(const uint8_t *font); @@ -57,29 +59,71 @@ class DWIN_String { //static glyph_t *glyph(uint8_t character) { return glyphs[character] ?: glyphs[0x3F]; } /* Use '?' for unknown glyphs */ //static glyph_t *glyph(uint8_t *character) { return glyph(*character); } + /** + * @brief Set the string empty + */ static void set(); - //static void add(uint8_t character) { add_character(character); eol(); } + + //static void add(const char character) { add_character(character); eol(); } + + /** + * @brief Append a UTF-8 character + * + * @param character The UTF-8 character + */ static void add(wchar_t character); - static void add(uint8_t *string, uint8_t max_len=MAX_STRING_LENGTH); - static void add(uint8_t *string, const int8_t index, uint8_t *itemString=nullptr); - static void set(uint8_t *string) { set(); add(string); } static void set(wchar_t character) { set(); add(character); } - static void set(uint8_t *string, int8_t index, const char *itemString=nullptr) { set(); add(string, index, (uint8_t *)itemString); } - static void set(FSTR_P fstring) { set((uint8_t *)fstring); } - static void set(const char *string) { set((uint8_t *)string); } - static void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); } - static void add(const char *string) { add((uint8_t *)string); } - static void trim(const uint8_t character=0x20); - static void rtrim(const uint8_t character=0x20); - static void ltrim(const uint8_t character=0x20); + /** + * @brief Append / Set C-string + * + * @param cstr The string + * @param max_len Character limit + */ + static void add(const char *cstr, uint8_t max_len=MAX_STRING_LENGTH); + static void set(const char *cstr) { set(); add(cstr); } - static void truncate(uint8_t maxlen) { if (len > maxlen) { len = maxlen; eol(); } } + /** + * @brief Append / Set F-string + * + * @param fstr The string + * @param max_len Character limit + */ + static void add(FSTR_P const fstr, uint8_t max_len=MAX_STRING_LENGTH) { add(FTOP(fstr), max_len); } + static void set(FSTR_P const fstr) { set(FTOP(fstr)); } - static uint8_t length() { return len; } + /** + * @brief Append / Set C-string with optional substitution + * + * @param tpl A string with optional substitution + * @param index An index + * @param cstr An SRAM C-string to use for $ substitution + * @param fstr A ROM F-string to use for $ substitution + */ + static void add(const char *tpl, const int8_t index, const char *cstr=nullptr, FSTR_P const fstr=nullptr); + static void set(const char *tpl, const int8_t index, const char *cstr=nullptr, FSTR_P const fstr=nullptr) { set(); add(tpl, index, cstr, fstr); } + + /** + * @brief Append / Set F-string with optional substitution + * + * @param ftpl A ROM F-string with optional substitution + * @param index An index + * @param cstr An SRAM C-string to use for $ substitution + * @param fstr A ROM F-string to use for $ substitution + */ + static void add(FSTR_P const ftpl, const int8_t index, const char *cstr=nullptr, FSTR_P const fstr=nullptr) { add(FTOP(ftpl), index, cstr, fstr); } + static void set(FSTR_P const ftpl, const int8_t index, const char *cstr=nullptr, FSTR_P const fstr=nullptr) { set(); add(ftpl, index, cstr, fstr); } + + // Common string ops + static void trim(const char character=' '); + static void rtrim(const char character=' '); + static void ltrim(const char character=' '); + static void truncate(const uint8_t maxlen) { if (length > maxlen) { length = maxlen; eol(); } } + + // Accessors + static char *string() { return data; } static uint16_t width() { return span; } - static uint8_t *string() { return data; } - static uint16_t center(uint16_t width) { return span > width ? 0 : (width - span) / 2; } + static uint16_t center(const uint16_t width) { return span > width ? 0 : (width - span) / 2; } }; int dwin_charmap_compare(dwin_charmap_t *v1, dwin_charmap_t *v2); diff --git a/Marlin/src/lcd/e3v2/marlinui/lcdprint_dwin.cpp b/Marlin/src/lcd/e3v2/marlinui/lcdprint_dwin.cpp index 44be749d41..278f17fac9 100644 --- a/Marlin/src/lcd/e3v2/marlinui/lcdprint_dwin.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/lcdprint_dwin.cpp @@ -56,20 +56,20 @@ void lcd_put_int(const int i) { } int lcd_put_dwin_string() { - DWIN_Draw_String(dwin_font.solid, dwin_font.index, dwin_font.fg, dwin_font.bg, cursor.x, cursor.y, (char*)dwin_string.string()); - lcd_advance_cursor(dwin_string.length()); - return dwin_string.length(); + DWIN_Draw_String(dwin_font.solid, dwin_font.index, dwin_font.fg, dwin_font.bg, cursor.x, cursor.y, dwin_string.string()); + lcd_advance_cursor(dwin_string.length); + return dwin_string.length; } // return < 0 on error // return the advanced cols -int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { +int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length) { dwin_string.set(c); dwin_string.truncate(max_length); // Draw the char(s) at the cursor and advance the cursor - DWIN_Draw_String(dwin_font.solid, dwin_font.index, dwin_font.fg, dwin_font.bg, cursor.x, cursor.y, (char*)dwin_string.string()); - lcd_advance_cursor(dwin_string.length()); - return dwin_string.length(); + DWIN_Draw_String(dwin_font.solid, dwin_font.index, dwin_font.fg, dwin_font.bg, cursor.x, cursor.y, dwin_string.string()); + lcd_advance_cursor(dwin_string.length); + return dwin_string.length; } /** @@ -83,35 +83,34 @@ int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { * * Draw a UTF-8 string */ -static int lcd_put_u8str_max_cb(const char * utf8_str, uint8_t (*cb_read_byte)(uint8_t * str), pixel_len_t max_length) { - uint8_t *p = (uint8_t *)utf8_str; +static int lcd_put_u8str_max_cb(const char * utf8_str, read_byte_cb_t cb_read_byte, const pixel_len_t max_length) { + const uint8_t *p = (uint8_t *)utf8_str; dwin_string.set(); - while (dwin_string.length() < max_length) { + while (dwin_string.length < max_length) { wchar_t ch = 0; p = get_utf8_value_cb(p, cb_read_byte, &ch); if (!ch) break; dwin_string.add(ch); } - DWIN_Draw_String(dwin_font.solid, dwin_font.index, dwin_font.fg, dwin_font.bg, cursor.x, cursor.y, (char*)dwin_string.string()); - lcd_advance_cursor(dwin_string.length()); - return dwin_string.length(); + DWIN_Draw_String(dwin_font.solid, dwin_font.index, dwin_font.fg, dwin_font.bg, cursor.x, cursor.y, dwin_string.string()); + lcd_advance_cursor(dwin_string.length); + return dwin_string.length; } -int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) { +int lcd_put_u8str_max(const char * utf8_str, const pixel_len_t max_length) { return lcd_put_u8str_max_cb(utf8_str, read_byte_ram, max_length); } -int lcd_put_u8str_max_P(PGM_P utf8_pstr, pixel_len_t max_length) { +int lcd_put_u8str_max_P(PGM_P utf8_pstr, const pixel_len_t max_length) { return lcd_put_u8str_max_cb(utf8_pstr, read_byte_rom, max_length); } -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*/) { - dwin_string.set(); - dwin_string.add((uint8_t*)pstr, ind, (uint8_t*)inStr); +lcd_uint_t lcd_put_u8str_P(PGM_P const ptpl, const int8_t ind, const char * const cstr/*=nullptr*/, FSTR_P const fstr/*=nullptr*/, const lcd_uint_t maxlen/*=LCD_WIDTH*/) { + dwin_string.set(ptpl, ind, cstr, fstr); dwin_string.truncate(maxlen); - DWIN_Draw_String(dwin_font.solid, dwin_font.index, dwin_font.fg, dwin_font.bg, cursor.x, cursor.y, (char*)dwin_string.string()); - lcd_advance_cursor(dwin_string.length()); - return dwin_string.length(); + DWIN_Draw_String(dwin_font.solid, dwin_font.index, dwin_font.fg, dwin_font.bg, cursor.x, cursor.y, dwin_string.string()); + lcd_advance_cursor(dwin_string.length); + return dwin_string.length; } #if ENABLED(DEBUG_LCDPRINT) diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index 9cc634c306..f01a2beddf 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -110,7 +110,7 @@ void MarlinUI::clear_lcd() { #define VERSION_Y 84 #endif - DWIN_Draw_String(false, font10x20, Color_Yellow, Color_Bg_Black, INFO_CENTER - (dwin_string.length() * 10) / 2, VERSION_Y, S(dwin_string.string())); + DWIN_Draw_String(false, font10x20, Color_Yellow, Color_Bg_Black, INFO_CENTER - (dwin_string.length * 10) / 2, VERSION_Y, S(dwin_string.string())); TERN_(SHOW_CUSTOM_BOOTSCREEN, safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT)); clear_lcd(); @@ -127,7 +127,7 @@ void MarlinUI::clear_lcd() { DWIN_ICON_Show(BOOT_ICON, ICON_MarlinURL, INFO_CENTER - 100 / 2, 152); DWIN_ICON_Show(BOOT_ICON, ICON_Copyright, INFO_CENTER - 126 / 2, 200); #endif - DWIN_Draw_String(false, font10x20, Color_Yellow, Color_Bg_Black, INFO_CENTER - (dwin_string.length() * 10) / 2, VERSION_Y, S(dwin_string.string())); + DWIN_Draw_String(false, font10x20, Color_Yellow, Color_Bg_Black, INFO_CENTER - (dwin_string.length * 10) / 2, VERSION_Y, S(dwin_string.string())); DWIN_UpdateLCD(); } @@ -284,7 +284,7 @@ void MarlinUI::draw_status_message(const bool blink) { else dwin_string.add(PSTR(" ")); - lcd_moveto(LCD_WIDTH - dwin_string.length(), row); + lcd_moveto(LCD_WIDTH - dwin_string.length, row); lcd_put_dwin_string(); } @@ -311,7 +311,7 @@ void MarlinUI::draw_status_message(const bool blink) { // Draw a static line of text in the same idiom as a menu item - void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { + void MenuItem_static::draw(const uint8_t row, FSTR_P const ftpl, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { // Call mark_as_selected to draw a bigger selection box // and draw the text without a background if (mark_as_selected(row, (bool)(style & SS_INVERT), true)) { @@ -320,15 +320,15 @@ void MarlinUI::draw_status_message(const bool blink) { dwin_font.fg = Color_White; dwin_string.set(); - const int8_t plen = pstr ? utf8_strlen_P(pstr) : 0, + const int8_t plen = ftpl ? utf8_strlen(ftpl) : 0, vlen = vstr ? utf8_strlen(vstr) : 0; if (style & SS_CENTER) { int8_t pad = (LCD_WIDTH - 1 - plen - vlen) / 2; while (--pad) dwin_string.add(' '); } - if (plen) dwin_string.add((uint8_t*)pstr, itemIndex, (uint8_t*)itemString); - if (vlen) dwin_string.add((uint8_t*)vstr); + if (plen) dwin_string.add(ftpl, itemIndex, itemStringC, itemStringF); + if (vlen) dwin_string.add(vstr); if (style & SS_CENTER) { int8_t pad = (LCD_WIDTH - 1 - plen - vlen) / 2; while (--pad) dwin_string.add(' '); @@ -340,15 +340,15 @@ void MarlinUI::draw_status_message(const bool blink) { } // 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) { + void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char, const char post_char) { if (mark_as_selected(row, sel)) { ui.set_font(DWIN_FONT_MENU); dwin_font.solid = false; dwin_font.fg = Color_White; - dwin_string.set(pstr, itemIndex, itemString); + dwin_string.set(ftpl, itemIndex, itemStringC, itemStringF); - pixel_len_t n = LCD_WIDTH - 1 - dwin_string.length(); + pixel_len_t n = LCD_WIDTH - 1 - dwin_string.length; while (--n > 1) dwin_string.add(' '); dwin_string.add(post_char); @@ -361,15 +361,15 @@ void MarlinUI::draw_status_message(const bool blink) { // // 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, FSTR_P const ftpl, const char * const inStr, const bool pgm) { if (mark_as_selected(row, sel)) { ui.set_font(DWIN_FONT_MENU); dwin_font.solid = false; dwin_font.fg = Color_White; - const uint8_t vallen = (pgm ? utf8_strlen_P(data) : utf8_strlen(S(data))); + const uint8_t vallen = (pgm ? utf8_strlen_P(inStr) : utf8_strlen(S(inStr))); - dwin_string.set(pstr, itemIndex, itemString); + dwin_string.set(ftpl, itemIndex, itemStringC, itemStringF); if (vallen) dwin_string.add(':'); lcd_moveto(1, row); @@ -377,7 +377,7 @@ void MarlinUI::draw_status_message(const bool blink) { if (vallen) { dwin_font.fg = Color_Yellow; - dwin_string.set(data); + dwin_string.set(inStr); lcd_moveto(LCD_WIDTH - vallen - 1, row); lcd_put_dwin_string(); } @@ -387,13 +387,12 @@ void MarlinUI::draw_status_message(const bool blink) { // // Draw an edit screen with label and current value // - void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) { + void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char* const value/*=nullptr*/) { ui.encoder_direction_normal(); - const dwin_coord_t labellen = utf8_strlen_P(pstr), vallen = utf8_strlen(value); + const dwin_coord_t labellen = utf8_strlen(fstr), vallen = utf8_strlen(value); - dwin_string.set(); - dwin_string.add((uint8_t*)pstr, itemIndex); + dwin_string.set(FTOP(fstr), itemIndex); if (vallen) dwin_string.add(':'); // If a value is included, add a colon // Assume the label is alpha-numeric (with a descender) @@ -406,8 +405,7 @@ void MarlinUI::draw_status_message(const bool blink) { // If a value is included, print the value in larger text below the label if (vallen) { - dwin_string.set(); - dwin_string.add(value); + dwin_string.set(value); const dwin_coord_t by = (row * MENU_LINE_HEIGHT) + MENU_FONT_HEIGHT + EXTRA_ROW_HEIGHT / 2; DWIN_Draw_String(true, font16x32, Color_Yellow, Color_Bg_Black, (LCD_PIXEL_WIDTH - vallen * 16) / 2, by, S(dwin_string.string())); @@ -430,19 +428,19 @@ void MarlinUI::draw_status_message(const bool blink) { } } - inline void draw_boxed_string(const bool yesopt, PGM_P const pstr, const bool inv) { - const uint8_t len = utf8_strlen_P(pstr), + inline void draw_boxed_string(const bool yesopt, FSTR_P const fstr, const bool inv) { + const uint8_t len = utf8_strlen(fstr), mar = TERN(DWIN_MARLINUI_PORTRAIT, 1, 4), col = yesopt ? LCD_WIDTH - mar - len : mar, row = (LCD_HEIGHT >= 8 ? LCD_HEIGHT / 2 + 3 : LCD_HEIGHT - 1); lcd_moveto(col, row); DWIN_Draw_Box(1, inv ? Select_Color : Color_Bg_Black, cursor.x - dwin_font.width, cursor.y + 1, dwin_font.width * (len + 2), dwin_font.height + 2); - lcd_put_u8str_P(col, row, pstr); + lcd_put_u8str(col, row, fstr); } void MenuItem_confirm::draw_select_screen( - PGM_P const yes, PGM_P const no, const bool yesno, - PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/ + FSTR_P const yes, FSTR_P const no, const bool yesno, + FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/ ) { ui.set_font(DWIN_FONT_MENU); dwin_font.solid = false; @@ -454,7 +452,7 @@ void MarlinUI::draw_status_message(const bool blink) { #if ENABLED(SDSUPPORT) - void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) { + void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { if (mark_as_selected(row, sel)) { dwin_string.set(); @@ -464,8 +462,8 @@ void MarlinUI::draw_status_message(const bool blink) { maxlen -= 2; } - dwin_string.add((uint8_t*)ui.scrolled_filename(theCard, maxlen, row, sel), maxlen); - uint8_t n = maxlen - dwin_string.length(); + dwin_string.add(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen); + uint8_t n = maxlen - dwin_string.length; while (n > 0) { dwin_string.add(' '); --n; } lcd_moveto(1, row); lcd_put_dwin_string(); @@ -548,7 +546,7 @@ void MarlinUI::draw_status_message(const bool blink) { dwin_string.add(i8tostr3rj(y_plot)); dwin_string.add(")"); lcd_moveto( - TERN(DWIN_MARLINUI_LANDSCAPE, ((x_offset + x_map_pixels) / MENU_FONT_WIDTH) + 2, LCD_WIDTH - dwin_string.length()), + TERN(DWIN_MARLINUI_LANDSCAPE, ((x_offset + x_map_pixels) / MENU_FONT_WIDTH) + 2, LCD_WIDTH - dwin_string.length), TERN(DWIN_MARLINUI_LANDSCAPE, LCD_HEIGHT - 2, ((y_offset + y_map_pixels) / MENU_LINE_HEIGHT) + 1) ); lcd_put_dwin_string(); @@ -560,7 +558,7 @@ void MarlinUI::draw_status_message(const bool blink) { else dwin_string.add(PSTR(" -----")); lcd_moveto( - TERN(DWIN_MARLINUI_LANDSCAPE, ((x_offset + x_map_pixels) / MENU_FONT_WIDTH) + 2, LCD_WIDTH - dwin_string.length()), + TERN(DWIN_MARLINUI_LANDSCAPE, ((x_offset + x_map_pixels) / MENU_FONT_WIDTH) + 2, LCD_WIDTH - dwin_string.length), TERN(DWIN_MARLINUI_LANDSCAPE, LCD_HEIGHT - 1, ((y_offset + y_map_pixels) / MENU_LINE_HEIGHT) + 2) ); lcd_put_dwin_string(); diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp index ba6814a57a..edd8bb06f3 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp @@ -72,17 +72,16 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const uint8_t vallen = utf8_strlen(value); if (!ui.did_first_redraw) { - dwin_string.set(); - dwin_string.add('X' + axis); + dwin_string.set('X' + axis); DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x + (vallen * 14 - 14) / 2, y + 2, S(dwin_string.string())); } dwin_string.set(); if (blink) dwin_string.add(value); - else if (!TEST(axis_homed, axis)) + else if (!TEST(axes_homed, axis)) while (const char c = *value++) dwin_string.add(c <= '.' ? c : '?'); - else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !TEST(axis_trusted, axis)) + else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !TEST(axes_trusted, axis)) dwin_string.add(TERN1(DWIN_MARLINUI_PORTRAIT, axis == Z_AXIS) ? PSTR(" ") : PSTR(" ")); else dwin_string.add(value); @@ -96,8 +95,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const #else // !DWIN_MARLINUI_PORTRAIT if (!ui.did_first_redraw || ui.old_is_printing != print_job_timer.isRunning()) { - dwin_string.set(); - dwin_string.add('X' + axis); + dwin_string.set('X' + axis); DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x, y, S(dwin_string.string())); } @@ -105,11 +103,11 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const if (blink) dwin_string.add(value); else { - if (!TEST(axis_homed, axis)) + if (!TEST(axes_homed, axis)) while (const char c = *value++) dwin_string.add(c <= '.' ? c : '?'); else { #if NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) - if (!TEST(axis_trusted, axis)) + if (!TEST(axes_trusted, axis)) dwin_string.add(TERN1(DWIN_MARLINUI_PORTRAIT, axis == Z_AXIS) ? PSTR(" ") : PSTR(" ")); else #endif @@ -391,7 +389,7 @@ void MarlinUI::draw_status_screen() { time.toDigital(buffer); dwin_string.add(prefix); dwin_string.add(buffer); - DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, (LCD_PIXEL_WIDTH - ((dwin_string.length() + 1) * 14)), 290, S(dwin_string.string())); + DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, (LCD_PIXEL_WIDTH - ((dwin_string.length + 1) * 14)), 290, S(dwin_string.string())); #else @@ -454,7 +452,7 @@ void MarlinUI::draw_status_screen() { dwin_string.add(PSTR("%")); DWIN_Draw_String( false, font16x32, Percent_Color, Color_Bg_Black, - pb_left + (pb_width - dwin_string.length() * 16) / 2, + pb_left + (pb_width - dwin_string.length * 16) / 2, pb_top + (pb_height - 32) / 2, S(dwin_string.string()) ); diff --git a/Marlin/src/lcd/e3v2/proui/base64.hpp b/Marlin/src/lcd/e3v2/proui/base64.hpp new file mode 100644 index 0000000000..d82d0b27e8 --- /dev/null +++ b/Marlin/src/lcd/e3v2/proui/base64.hpp @@ -0,0 +1,208 @@ +/** + * Base64 encoder/decoder for arduino repo + * Uses common web conventions - '+' for 62, '/' for 63, '=' for padding. + * Note that invalid base64 characters are interpreted as padding. + * Author: Densaugeo + * Maintainer: Densaugeo + * Version: 1.2.1.1 + * Changed unsigned int to uint16_t for use in the professional Ender 3V2/S1 firmware + * Url: https://www.arduino.cc/reference/en/libraries/base64/ + */ + +#ifndef BASE64_H_INCLUDED +#define BASE64_H_INCLUDED + +/* binary_to_base64: + * Description: + * Converts a single byte from a binary value to the corresponding base64 character + * Parameters: + * v - Byte to convert + * Returns: + * ascii code of base64 character. If byte is >= 64, then there is not corresponding base64 character + * and 255 is returned + */ +unsigned char binary_to_base64(unsigned char v); + +/* base64_to_binary: + * Description: + * Converts a single byte from a base64 character to the corresponding binary value + * Parameters: + * c - Base64 character (as ascii code) + * Returns: + * 6-bit binary value + */ +unsigned char base64_to_binary(unsigned char c); + +/* encode_base64_length: + * Description: + * Calculates length of base64 string needed for a given number of binary bytes + * Parameters: + * input_length - Amount of binary data in bytes + * Returns: + * Number of base64 characters needed to encode input_length bytes of binary data + */ +uint16_t encode_base64_length(uint16_t input_length); + +/* decode_base64_length: + * Description: + * Calculates number of bytes of binary data in a base64 string + * Variant that does not use input_length no longer used within library, retained for API compatibility + * Parameters: + * input - Base64-encoded null-terminated string + * input_length (optional) - Number of bytes to read from input pointer + * Returns: + * Number of bytes of binary data in input + */ +uint16_t decode_base64_length(unsigned char input[]); +uint16_t decode_base64_length(unsigned char input[], uint16_t input_length); + +/* encode_base64: + * Description: + * Converts an array of bytes to a base64 null-terminated string + * Parameters: + * input - Pointer to input data + * input_length - Number of bytes to read from input pointer + * output - Pointer to output string. Null terminator will be added automatically + * Returns: + * Length of encoded string in bytes (not including null terminator) + */ +uint16_t encode_base64(unsigned char input[], uint16_t input_length, unsigned char output[]); + +/* decode_base64: + * Description: + * Converts a base64 null-terminated string to an array of bytes + * Parameters: + * input - Pointer to input string + * input_length (optional) - Number of bytes to read from input pointer + * output - Pointer to output array + * Returns: + * Number of bytes in the decoded binary + */ +uint16_t decode_base64(unsigned char input[], unsigned char output[]); +uint16_t decode_base64(unsigned char input[], uint16_t input_length, unsigned char output[]); + +unsigned char binary_to_base64(unsigned char v) { + // Capital letters - 'A' is ascii 65 and base64 0 + if (v < 26) return v + 'A'; + + // Lowercase letters - 'a' is ascii 97 and base64 26 + if (v < 52) return v + 71; + + // Digits - '0' is ascii 48 and base64 52 + if (v < 62) return v - 4; + + // '+' is ascii 43 and base64 62 + if (v == 62) return '+'; + + // '/' is ascii 47 and base64 63 + if (v == 63) return '/'; + + return 64; +} + +unsigned char base64_to_binary(unsigned char c) { + // Capital letters - 'A' is ascii 65 and base64 0 + if ('A' <= c && c <= 'Z') return c - 'A'; + + // Lowercase letters - 'a' is ascii 97 and base64 26 + if ('a' <= c && c <= 'z') return c - 71; + + // Digits - '0' is ascii 48 and base64 52 + if ('0' <= c && c <= '9') return c + 4; + + // '+' is ascii 43 and base64 62 + if (c == '+') return 62; + + // '/' is ascii 47 and base64 63 + if (c == '/') return 63; + + return 255; +} + +uint16_t encode_base64_length(uint16_t input_length) { + return (input_length + 2)/3*4; +} + +uint16_t decode_base64_length(unsigned char input[]) { + return decode_base64_length(input, -1); +} + +uint16_t decode_base64_length(unsigned char input[], uint16_t input_length) { + unsigned char *start = input; + + while (base64_to_binary(input[0]) < 64 && (unsigned char)(input - start) < input_length) { + ++input; + } + + input_length = input - start; + return input_length/4*3 + (input_length % 4 ? input_length % 4 - 1 : 0); +} + +uint16_t encode_base64(unsigned char input[], uint16_t input_length, unsigned char output[]) { + uint16_t full_sets = input_length/3; + + // While there are still full sets of 24 bits... + for (uint16_t i = 0; i < full_sets; ++i) { + output[0] = binary_to_base64( input[0] >> 2); + output[1] = binary_to_base64((input[0] & 0x03) << 4 | input[1] >> 4); + output[2] = binary_to_base64((input[1] & 0x0F) << 2 | input[2] >> 6); + output[3] = binary_to_base64( input[2] & 0x3F); + + input += 3; + output += 4; + } + + switch(input_length % 3) { + case 0: + output[0] = '\0'; + break; + case 1: + output[0] = binary_to_base64( input[0] >> 2); + output[1] = binary_to_base64((input[0] & 0x03) << 4); + output[2] = '='; + output[3] = '='; + output[4] = '\0'; + break; + case 2: + output[0] = binary_to_base64( input[0] >> 2); + output[1] = binary_to_base64((input[0] & 0x03) << 4 | input[1] >> 4); + output[2] = binary_to_base64((input[1] & 0x0F) << 2); + output[3] = '='; + output[4] = '\0'; + break; + } + + return encode_base64_length(input_length); +} + +uint16_t decode_base64(unsigned char input[], unsigned char output[]) { + return decode_base64(input, -1, output); +} + +uint16_t decode_base64(unsigned char input[], uint16_t input_length, unsigned char output[]) { + uint16_t output_length = decode_base64_length(input, input_length); + + // While there are still full sets of 24 bits... + for (uint16_t i = 2; i < output_length; i += 3) { + output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4; + output[1] = base64_to_binary(input[1]) << 4 | base64_to_binary(input[2]) >> 2; + output[2] = base64_to_binary(input[2]) << 6 | base64_to_binary(input[3]); + + input += 4; + output += 3; + } + + switch(output_length % 3) { + case 1: + output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4; + break; + case 2: + output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4; + output[1] = base64_to_binary(input[1]) << 4 | base64_to_binary(input[2]) >> 2; + break; + } + + return output_length; +} + +#endif // ifndef diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 122136c1a0..07b134471b 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -31,6 +31,37 @@ #if ENABLED(DWIN_LCD_PROUI) +#if DISABLED(LIMITED_MAX_FR_EDITING) + #warning "LIMITED_MAX_FR_EDITING is recommended with ProUI." +#endif +#if DISABLED(LIMITED_MAX_ACCEL_EDITING) + #warning "LIMITED_MAX_ACCEL_EDITING is recommended with ProUI." +#endif +#if ENABLED(CLASSIC_JERK) && DISABLED(LIMITED_JERK_EDITING) + #warning "LIMITED_JERK_EDITING is recommended with ProUI." +#endif +#if DISABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) + #warning "INDIVIDUAL_AXIS_HOMING_SUBMENU is recommended with ProUI." +#endif +#if DISABLED(LCD_SET_PROGRESS_MANUALLY) + #warning "LCD_SET_PROGRESS_MANUALLY is recommended with ProUI." +#endif +#if DISABLED(STATUS_MESSAGE_SCROLLING) + #warning "STATUS_MESSAGE_SCROLLING is recommended with ProUI." +#endif +#if DISABLED(BAUD_RATE_GCODE) + #warning "BAUD_RATE_GCODE is recommended with ProUI." +#endif +#if DISABLED(SOUND_MENU_ITEM) + #warning "SOUND_MENU_ITEM is recommended with ProUI." +#endif +#if DISABLED(PRINTCOUNTER) + #warning "PRINTCOUNTER is recommended with ProUI." +#endif +#if HAS_MESH && DISABLED(MESH_EDIT_MENU) + #warning "MESH_EDIT_MENU is recommended with ProUI." +#endif + #include "dwin.h" #include "menus.h" #include "dwin_popup.h" @@ -98,6 +129,14 @@ #include "endstop_diag.h" #endif +#if HAS_PIDPLOT + #include "plot.h" +#endif + +#if HAS_GCODE_PREVIEW + #include "gcode_preview.h" +#endif + #if HAS_MESH #include "meshviewer.h" #endif @@ -162,7 +201,12 @@ #define DWIN_SCROLL_UPDATE_INTERVAL SEC_TO_MS(2) #define DWIN_REMAIN_TIME_UPDATE_INTERVAL SEC_TO_MS(20) -#define BABY_Z_VAR TERN(HAS_BED_PROBE, probe.offset.z, HMI_data.ManualZOffset) +#if HAS_MESH + #define BABY_Z_VAR TERN(HAS_BED_PROBE, probe.offset.z, HMI_data.ManualZOffset) +#else + float z_offset = 0; + #define BABY_Z_VAR z_offset +#endif // Structs HMI_value_t HMI_value; @@ -200,11 +244,28 @@ uint8_t index_file = MROWS; bool hash_changed = true; // Flag to know if message status was changed -constexpr float max_feedrate_edit_values[] = MAX_FEEDRATE_EDIT_VALUES; -constexpr float max_acceleration_edit_values[] = MAX_ACCEL_EDIT_VALUES; - +constexpr float max_feedrate_edit_values[] = + #ifdef MAX_FEEDRATE_EDIT_VALUES + MAX_FEEDRATE_EDIT_VALUES + #else + { 1000, 1000, 10, 50 } + #endif +; +constexpr float max_acceleration_edit_values[] = + #ifdef MAX_ACCEL_EDIT_VALUES + MAX_ACCEL_EDIT_VALUES + #else + { 1000, 1000, 200, 2000 } + #endif +; #if HAS_CLASSIC_JERK - constexpr float max_jerk_edit_values[] = MAX_JERK_EDIT_VALUES; + constexpr float max_jerk_edit_values[] = + #ifdef MAX_JERK_EDIT_VALUES + MAX_JERK_EDIT_VALUES + #else + { DEFAULT_XJERK * 2, DEFAULT_YJERK * 2, DEFAULT_ZJERK * 2, DEFAULT_EJERK * 2 } + #endif + ; #endif static uint8_t _percent_done = 0; @@ -652,13 +713,19 @@ void Draw_PrintDone() { Title.ShowCaption(GET_TEXT_F(MSG_PRINT_DONE)); DWINUI::ClearMainArea(); DWIN_Print_Header(nullptr); - Draw_Print_ProgressBar(); - Draw_Print_Labels(); - DWINUI::Draw_Icon(ICON_PrintTime, 15, 173); - DWINUI::Draw_Icon(ICON_RemainTime, 150, 171); - Draw_Print_ProgressElapsed(); - Draw_Print_ProgressRemain(); - DWINUI::Draw_Button(BTN_Continue, 86, 273); + if (sdprint && TERN0(HAS_GCODE_PREVIEW, Preview_Valid())) { + DWIN_ICON_Show(0, 0, 1, 21, 100, 0x00); + DWINUI::Draw_Button(BTN_Continue, 86, 300); + } + else { + Draw_Print_ProgressBar(); + Draw_Print_Labels(); + DWINUI::Draw_Icon(ICON_PrintTime, 15, 173); + DWINUI::Draw_Icon(ICON_RemainTime, 150, 171); + Draw_Print_ProgressElapsed(); + Draw_Print_ProgressRemain(); + DWINUI::Draw_Button(BTN_Continue, 86, 273); + } } void Goto_PrintDone() { @@ -815,6 +882,8 @@ void update_variable() { else DWINUI::Draw_Icon(ICON_Zoffset, 187, 416); } + #else + DWINUI::Draw_Icon(ICON_Zoffset, 187, 416); #endif _draw_xyz_position(false); @@ -1354,6 +1423,9 @@ void EachMomentUpdate() { #if HAS_ESDIAG if (checkkey == ESDiagProcess) ESDiag.Update(); #endif + #if HAS_PIDPLOT + if (checkkey == PidProcess) Plot.Update((HMI_value.pidresult == PID_EXTR_START) ? thermalManager.wholeDegHotend(0) : thermalManager.wholeDegBed()); + #endif } #if HAS_STATUS_MESSAGE_TIMEOUT @@ -1580,15 +1652,49 @@ void DWIN_LevelingDone() { #endif // PID process + +#if HAS_PIDPLOT + void DWIN_Draw_PIDPopup() { + frame_rect_t gfrm = {40, 180, DWIN_WIDTH - 80, 120}; + DWINUI::ClearMainArea(); + Draw_Popup_Bkgd(); + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_PID_AUTOTUNE)); + DWINUI::Draw_String(HMI_data.PopupTxt_Color, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius")); + switch (HMI_value.pidresult) { + case PID_EXTR_START: + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for Nozzle is running.")); + Plot.Draw(gfrm, thermalManager.hotend_maxtemp[0], HMI_data.HotendPidT); + DWINUI::Draw_Int(HMI_data.PopupTxt_Color, 3, gfrm.x + 90, gfrm.y - DWINUI::fontHeight() - 4, HMI_data.HotendPidT); + break; + case PID_BED_START: + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for BED is running.")); + Plot.Draw(gfrm, BED_MAXTEMP, HMI_data.BedPidT); + DWINUI::Draw_Int(HMI_data.PopupTxt_Color, 3, gfrm.x + 90, gfrm.y - DWINUI::fontHeight() - 4, HMI_data.BedPidT); + break; + default: + break; + } + } +#endif + void DWIN_PidTuning(pidresult_t result) { + HMI_value.pidresult = result; switch (result) { case PID_BED_START: - HMI_SaveProcessID(NothingToDo); - DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for BED is running.")); + HMI_SaveProcessID(PidProcess); + #if HAS_PIDPLOT + DWIN_Draw_PIDPopup(); + #else + DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for BED is running.")); + #endif break; case PID_EXTR_START: - HMI_SaveProcessID(NothingToDo); - DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for Nozzle is running.")); + HMI_SaveProcessID(PidProcess); + #if HAS_PIDPLOT + DWIN_Draw_PIDPopup(); + #else + DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for Nozzle is running.")); + #endif break; case PID_BAD_EXTRUDER_NUM: checkkey = last_checkkey; @@ -1905,10 +2011,30 @@ void HMI_LockScreen() { } -void Goto_ConfirmToPrint() { - card.openAndPrintFile(card.filename); - DWIN_Print_Started(true); -} +#if HAS_GCODE_PREVIEW + + void onClick_ConfirmToPrint() { + if (HMI_flag.select_flag) { // Confirm + card.openAndPrintFile(card.filename); + return DWIN_Print_Started(true); + } + else { // Cancel + DWIN_ResetStatusLine(); + checkkey = SelectFile; + return Draw_Print_File_Menu(); + } + } + + void Goto_ConfirmToPrint() { + Goto_Popup(Preview_DrawFromSD, onClick_ConfirmToPrint); + } + +#else + void Goto_ConfirmToPrint() { + card.openAndPrintFile(card.filename); + DWIN_Print_Started(true); + } +#endif #if HAS_ESDIAG void Draw_EndStopDiag() { @@ -2292,48 +2418,45 @@ void ApplyFlow() { planner.refresh_e_factor(0); } void SetFlow() { SetPIntOnClick(MIN_PRINT_FLOW, MAX_PRINT_FLOW, ApplyFlow); } // Bed Tramming -TERN(HAS_BED_PROBE, float, void) Tram(uint8_t point) { - char cmd[100] = ""; - #if HAS_BED_PROBE + +void TramXY(const uint8_t point, const float &margin, float &x, float &y) { + switch (point) { + case 0: + LCD_MESSAGE(MSG_LEVBED_FL); + x = y = margin; + break; + case 1: + LCD_MESSAGE(MSG_LEVBED_FR); + x = X_BED_SIZE - margin; y = margin; + break; + case 2: + LCD_MESSAGE(MSG_LEVBED_BR); + x = X_BED_SIZE - margin; y = Y_BED_SIZE - margin; + break; + case 3: + LCD_MESSAGE(MSG_LEVBED_BL); + x = margin; y = Y_BED_SIZE - margin; + break; + case 4: + LCD_MESSAGE(MSG_LEVBED_C); + x = X_CENTER; y = Y_CENTER; + break; + } +} + +#if HAS_BED_PROBE + + float Tram(const uint8_t point) { + char cmd[100] = ""; static bool inLev = false; float xpos = 0, ypos = 0, zval = 0, margin = 0; char str_1[6] = "", str_2[6] = "", str_3[6] = ""; if (inLev) return NAN; margin = HMI_data.FullManualTramming ? 30 : PROBING_MARGIN; - #else - int16_t xpos = 0, ypos = 0; - int16_t margin = 30; - #endif - switch (point) { - case 0: - LCD_MESSAGE(MSG_LEVBED_FL); - xpos = ypos = margin; - break; - case 1: - LCD_MESSAGE(MSG_LEVBED_FR); - xpos = X_BED_SIZE - margin; ypos = margin; - break; - case 2: - LCD_MESSAGE(MSG_LEVBED_BR); - xpos = X_BED_SIZE - margin; ypos = Y_BED_SIZE - margin; - break; - case 3: - LCD_MESSAGE(MSG_LEVBED_BL); - xpos = margin; ypos = Y_BED_SIZE - margin; - break; - case 4: - LCD_MESSAGE(MSG_LEVBED_C); - xpos = X_BED_SIZE / 2; ypos = Y_BED_SIZE / 2; - break; - } - - planner.synchronize(); - - #if HAS_BED_PROBE + TramXY(point, margin, xpos, ypos); if (HMI_data.FullManualTramming) { - planner.synchronize(); sprintf_P(cmd, PSTR("M420S0\nG28O\nG90\nG0Z5F300\nG0X%sY%sF5000\nG0Z0F300"), dtostrf(xpos, 1, 1, str_1), dtostrf(ypos, 1, 1, str_2) @@ -2341,6 +2464,20 @@ TERN(HAS_BED_PROBE, float, void) Tram(uint8_t point) { queue.inject(cmd); } else { + // AUTO_BED_LEVELING_BILINEAR does not define MESH_INSET + #ifndef MESH_MIN_X + #define MESH_MIN_X (_MAX(X_MIN_BED + PROBING_MARGIN, X_MIN_POS)) + #endif + #ifndef MESH_MIN_Y + #define MESH_MIN_Y (_MAX(Y_MIN_BED + PROBING_MARGIN, Y_MIN_POS)) + #endif + #ifndef MESH_MAX_X + #define MESH_MAX_X (_MIN(X_MAX_BED - (PROBING_MARGIN), X_MAX_POS)) + #endif + #ifndef MESH_MAX_Y + #define MESH_MAX_Y (_MIN(Y_MAX_BED - (PROBING_MARGIN), Y_MAX_POS)) + #endif + LIMIT(xpos, MESH_MIN_X, MESH_MAX_X); LIMIT(ypos, MESH_MIN_Y, MESH_MAX_Y); probe.stow(); @@ -2360,14 +2497,20 @@ TERN(HAS_BED_PROBE, float, void) Tram(uint8_t point) { inLev = false; } return zval; + } - #else // !HAS_BED_PROBE +#else - sprintf_P(cmd, PSTR("M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300"), xpos, ypos); + void Tram(const uint8_t point) { + float xpos = 0, ypos = 0, margin = 30; + TramXY(point, margin, xpos, ypos); + + char cmd[100] = "", str_1[6] = "", str_2[6] = ""; + sprintf_P(cmd, PSTR("M420S0\nG28O\nG90\nG0Z5F300\nG0X%sY%sF5000\nG0Z0F300"), dtostrf(xpos, 1, 1, str_1), dtostrf(ypos, 1, 1, str_2)); queue.inject(cmd); + } - #endif -} +#endif void TramFL() { Tram(0); } void TramFR() { Tram(1); } @@ -3437,14 +3580,14 @@ void Draw_MaxSpeed_Menu() { if (!MaxSpeedMenu) MaxSpeedMenu = new MenuClass(); if (CurrentMenu != MaxSpeedMenu) { CurrentMenu = MaxSpeedMenu; - SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_MAXSPEED)); + SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_MAX_SPEED)); MenuItemsPrepare(5); BACK_ITEM(Draw_Motion_Menu); - EDIT_ITEM_F(ICON_MaxSpeedX, MSG_MAXSPEED_X, onDrawMaxSpeedX, SetMaxSpeedX, &planner.settings.max_feedrate_mm_s[X_AXIS]); - EDIT_ITEM_F(ICON_MaxSpeedY, MSG_MAXSPEED_Y, onDrawMaxSpeedY, SetMaxSpeedY, &planner.settings.max_feedrate_mm_s[Y_AXIS]); - EDIT_ITEM_F(ICON_MaxSpeedZ, MSG_MAXSPEED_Z, onDrawMaxSpeedZ, SetMaxSpeedZ, &planner.settings.max_feedrate_mm_s[Z_AXIS]); + EDIT_ITEM_F(ICON_MaxSpeedX, MSG_VMAX_A, onDrawMaxSpeedX, SetMaxSpeedX, &planner.settings.max_feedrate_mm_s[X_AXIS]); + EDIT_ITEM_F(ICON_MaxSpeedY, MSG_VMAX_B, onDrawMaxSpeedY, SetMaxSpeedY, &planner.settings.max_feedrate_mm_s[Y_AXIS]); + EDIT_ITEM_F(ICON_MaxSpeedZ, MSG_VMAX_C, onDrawMaxSpeedZ, SetMaxSpeedZ, &planner.settings.max_feedrate_mm_s[Z_AXIS]); #if HAS_HOTEND - EDIT_ITEM_F(ICON_MaxSpeedE, MSG_MAXSPEED_E, onDrawMaxSpeedE, SetMaxSpeedE, &planner.settings.max_feedrate_mm_s[E_AXIS]); + EDIT_ITEM_F(ICON_MaxSpeedE, MSG_VMAX_E, onDrawMaxSpeedE, SetMaxSpeedE, &planner.settings.max_feedrate_mm_s[E_AXIS]); #endif } CurrentMenu->draw(); @@ -3606,18 +3749,18 @@ void Draw_Steps_Menu() { void SetBedLevT() { SetPIntOnClick(MIN_BEDTEMP, MAX_BEDTEMP); } #endif - uint8_t mesh_x = 0; - uint8_t mesh_y = 0; - #define Z_OFFSET_MIN -3 - #define Z_OFFSET_MAX 3 - - void LiveEditMesh() { ((MenuItemPtrClass*)EditZValueItem)->value = &bedlevel.z_values[HMI_value.Select ? mesh_x : MenuData.Value][HMI_value.Select ? MenuData.Value : mesh_y]; EditZValueItem->redraw(); } - void ApplyEditMeshX() { mesh_x = MenuData.Value; } - void SetEditMeshX() { HMI_value.Select = 0; SetIntOnClick(0, GRID_MAX_POINTS_X - 1, mesh_x, ApplyEditMeshX, LiveEditMesh); } - void ApplyEditMeshY() { mesh_y = MenuData.Value; } - void SetEditMeshY() { HMI_value.Select = 1; SetIntOnClick(0, GRID_MAX_POINTS_Y - 1, mesh_y, ApplyEditMeshY, LiveEditMesh); } - void SetEditZValue() { SetPFloatOnClick(Z_OFFSET_MIN, Z_OFFSET_MAX, 3); } + #if ENABLED(MESH_EDIT_MENU) + uint8_t mesh_x = 0, mesh_y = 0; + #define Z_OFFSET_MIN -3 + #define Z_OFFSET_MAX 3 + void LiveEditMesh() { ((MenuItemPtrClass*)EditZValueItem)->value = &bedlevel.z_values[HMI_value.Select ? mesh_x : MenuData.Value][HMI_value.Select ? MenuData.Value : mesh_y]; EditZValueItem->redraw(); } + void ApplyEditMeshX() { mesh_x = MenuData.Value; } + void SetEditMeshX() { HMI_value.Select = 0; SetIntOnClick(0, GRID_MAX_POINTS_X - 1, mesh_x, ApplyEditMeshX, LiveEditMesh); } + void ApplyEditMeshY() { mesh_y = MenuData.Value; } + void SetEditMeshY() { HMI_value.Select = 1; SetIntOnClick(0, GRID_MAX_POINTS_Y - 1, mesh_y, ApplyEditMeshY, LiveEditMesh); } + void SetEditZValue() { SetPFloatOnClick(Z_OFFSET_MIN, Z_OFFSET_MAX, 3); } + #endif #endif #if ENABLED(AUTO_BED_LEVELING_UBL) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index f4e550295e..4f992b3a78 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -238,9 +238,7 @@ void Draw_Tramming_Menu(); #if HAS_BED_PROBE void Draw_ProbeSet_Menu(); #endif -#if HAS_FILAMENT_SENSOR - void Draw_FilSet_Menu(); -#endif +void Draw_FilSet_Menu(); #if ENABLED(NOZZLE_PARK_FEATURE) void Draw_ParkPos_Menu(); #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index bfeb06d763..1517acd238 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -35,41 +35,12 @@ #include #define HAS_ESDIAG 1 +#define HAS_PIDPLOT 1 +#define HAS_GCODE_PREVIEW 1 #if defined(__STM32F1__) || defined(STM32F1) #define DASH_REDRAW 1 #endif -#if DISABLED(LIMITED_MAX_FR_EDITING) - #error "LIMITED_MAX_FR_EDITING is required with ProUI." -#endif -#if DISABLED(LIMITED_MAX_ACCEL_EDITING) - #error "LIMITED_MAX_ACCEL_EDITING is required with ProUI." -#endif -#if ENABLED(CLASSIC_JERK) && DISABLED(LIMITED_JERK_EDITING) - #error "LIMITED_JERK_EDITING is required with ProUI." -#endif -#if DISABLED(FILAMENT_RUNOUT_SENSOR) - #error "FILAMENT_RUNOUT_SENSOR is required with ProUI." -#endif -#if DISABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) - #error "INDIVIDUAL_AXIS_HOMING_SUBMENU is required with ProUI." -#endif -#if DISABLED(LCD_SET_PROGRESS_MANUALLY) - #error "LCD_SET_PROGRESS_MANUALLY is required with ProUI." -#endif -#if DISABLED(STATUS_MESSAGE_SCROLLING) - #error "STATUS_MESSAGE_SCROLLING is required with ProUI." -#endif -#if DISABLED(BAUD_RATE_GCODE) - #error "BAUD_RATE_GCODE is required with ProUI." -#endif -#if DISABLED(SOUND_MENU_ITEM) - #error "SOUND_MENU_ITEM is required with ProUI." -#endif -#if DISABLED(PRINTCOUNTER) - #error "PRINTCOUNTER is required with ProUI." -#endif - #include "../common/dwin_color.h" #if ENABLED(LED_CONTROL_MENU) #include "../../../feature/leds/leds.h" diff --git a/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp index f2cefe0cb7..6cdafc8a93 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp @@ -147,7 +147,7 @@ void DWIN_SRAMToPic(uint8_t picID) { //--------------------------Test area ------------------------- -//void DWIN_ReadSRAM(uint16_t addr, uint8_t length, const char * const data) { +//void DWIN_ReadSRAM(uint16_t addr, const uint8_t length, const char * const data) { // size_t i = 0; // DWIN_Byte(i, 0x32); // DWIN_Byte(i, 0x5A); // 0x5A Read from SRAM - 0xA5 Read from Flash diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp new file mode 100644 index 0000000000..951f469e1c --- /dev/null +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp @@ -0,0 +1,253 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 g-code thumbnail preview + * Author: Miguel A. Risco-Castillo + * version: 2.1 + * Date: 2021/06/19 + * + * This program 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 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * For commercial applications additional licenses can be requested + */ + +#include "dwin_defines.h" + +#if HAS_GCODE_PREVIEW + +#include "../../../core/types.h" +#include "../../marlinui.h" +#include "../../../sd/cardreader.h" +#include "dwin_lcd.h" +#include "dwinui.h" +#include "dwin.h" +#include "dwin_popup.h" +#include "base64.hpp" +#include "gcode_preview.h" + +typedef struct { + char name[13] = ""; //8.3 + null + uint32_t thumbstart = 0; + int thumbsize = 0; + int thumbheight = 0; + int thumbwidth = 0; + uint8_t *thumbdata = nullptr; + float time = 0; + float filament = 0; + float layer = 0; + float width = 0; + float height = 0; + float length = 0; + void setname(const char * const fn); + void clear(); +} fileprop_t; +fileprop_t fileprop; + +void fileprop_t::setname(const char * const fn) { + const uint8_t len = _MIN(sizeof(name) - 1, strlen(fn)); + memcpy(&name[0], fn, len); + name[len] = '\0'; +} + +void fileprop_t::clear() { + fileprop.name[0] = '\0'; + fileprop.thumbstart = 0; + fileprop.thumbsize = 0; + fileprop.thumbheight = 0; + fileprop.thumbwidth = 0; + fileprop.thumbdata = nullptr; + fileprop.time = 0; + fileprop.filament = 0; + fileprop.layer = 0; + fileprop.height = 0; + fileprop.width = 0; + fileprop.length = 0; +} + +void Get_Value(char *buf, const char * const key, float &value) { + char num[10] = ""; + char * posptr = 0; + uint8_t i = 0; + if (!!value) return; + posptr = strstr(buf, key); + if (posptr != nullptr) { + while (i < sizeof(num)) { + char c = posptr[0]; + if (!ISEOL(c) && (c != 0)) { + if ((c > 47 && c < 58) || (c == '.')) num[i++] = c; + posptr++; + } + else { + num[i] = '\0'; + value = atof(num); + return; + } + } + } +} + +bool Has_Preview() { + const char * tbstart = "; thumbnail begin 230x180"; + char * posptr = 0; + uint8_t nbyte = 1; + uint32_t indx = 0; + char buf[256]; + float tmp = 0; + + fileprop.clear(); + fileprop.setname(card.filename); + + card.openFileRead(fileprop.name); + + while ((nbyte > 0) && (indx < 4 * sizeof(buf)) && !fileprop.thumbstart) { + nbyte = card.read(buf, sizeof(buf) - 1); + if (nbyte > 0) { + buf[nbyte] = '\0'; + Get_Value(buf, ";TIME:", fileprop.time); + Get_Value(buf, ";Filament used:", fileprop.filament); + Get_Value(buf, ";Layer height:", fileprop.layer); + Get_Value(buf, ";MINX:", tmp); + Get_Value(buf, ";MAXX:", fileprop.width); + fileprop.width -= tmp; + tmp = 0; + Get_Value(buf, ";MINY:", tmp); + Get_Value(buf, ";MAXY:", fileprop.length); + fileprop.length -= tmp; + tmp = 0; + Get_Value(buf, ";MINZ:", tmp); + Get_Value(buf, ";MAXZ:", fileprop.height); + fileprop.height -= tmp; + posptr = strstr(buf, tbstart); + if (posptr != NULL) { + fileprop.thumbstart = indx + (posptr - &buf[0]); + } + else { + indx += _MAX(10, nbyte - (signed)strlen(tbstart)); + card.setIndex(indx); + } + } + } + + if (!fileprop.thumbstart) { + card.closefile(); + LCD_MESSAGE_F("Thumbnail not found"); + return 0; + } + + // Get the size of the thumbnail + card.setIndex(fileprop.thumbstart + strlen(tbstart)); + for (uint8_t i = 0; i < 16; i++) { + char c = card.get(); + if (!ISEOL(c)) { + buf[i] = c; + } + else { + buf[i] = 0; + break; + } + } + fileprop.thumbsize = atoi(buf); + + // Exit if there isn't a thumbnail + if (!fileprop.thumbsize) { + card.closefile(); + LCD_MESSAGE_F("Invalid Thumbnail Size"); + return 0; + } + + uint16_t readed = 0; + uint8_t buf64[fileprop.thumbsize]; + + fileprop.thumbdata = new uint8_t[3 + 3 * (fileprop.thumbsize / 4)]; // Reserve space for the JPEG thumbnail + + while (readed < fileprop.thumbsize) { + uint8_t c = card.get(); + if (!ISEOL(c) && (c != ';') && (c != ' ')) { + buf64[readed] = c; + readed++; + } + } + card.closefile(); + buf64[readed] = 0; + + fileprop.thumbsize = decode_base64(buf64, fileprop.thumbdata); card.closefile(); + DWINUI::WriteToSRAM(0x00, fileprop.thumbsize, fileprop.thumbdata); + delete[] fileprop.thumbdata; + return true; +} + +void Preview_DrawFromSD() { + if (Has_Preview()) { + char buf[46]; + char str_1[6] = ""; + char str_2[6] = ""; + char str_3[6] = ""; + DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, 0, DWIN_WIDTH, STATUS_Y - 1); + if (fileprop.time) { + sprintf_P(buf, PSTR("Estimated time: %i:%02i"), (uint16_t)fileprop.time / 3600, ((uint16_t)fileprop.time % 3600) / 60); + DWINUI::Draw_String(20, 10, buf); + } + if (fileprop.filament) { + sprintf_P(buf, PSTR("Filament used: %s m"), dtostrf(fileprop.filament, 1, 2, str_1)); + DWINUI::Draw_String(20, 30, buf); + } + if (fileprop.layer) { + sprintf_P(buf, PSTR("Layer height: %s mm"), dtostrf(fileprop.layer, 1, 2, str_1)); + DWINUI::Draw_String(20, 50, buf); + } + if (fileprop.width) { + sprintf_P(buf, PSTR("Volume: %sx%sx%s mm"), dtostrf(fileprop.width, 1, 1, str_1), dtostrf(fileprop.length, 1, 1, str_2), dtostrf(fileprop.height, 1, 1, str_3)); + DWINUI::Draw_String(20, 70, buf); + } + DWINUI::Draw_Button(BTN_Print, 26, 290); + DWINUI::Draw_Button(BTN_Cancel, 146, 290); + DWIN_ICON_Show(0, 0, 1, 21, 90, 0x00); + Draw_Select_Highlight(true, 290); + DWIN_UpdateLCD(); + } + else { + HMI_flag.select_flag = 1; + wait_for_user = false; + } +} + +bool Preview_Valid() { + return !!fileprop.thumbstart; +} + +void Preview_Reset() { + fileprop.thumbsize = 0; +} + +#endif // HAS_GCODE_PREVIEW diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.h b/Marlin/src/lcd/e3v2/proui/gcode_preview.h new file mode 100644 index 0000000000..4417084a24 --- /dev/null +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.h @@ -0,0 +1,27 @@ +/** + * DWIN g-code thumbnail preview + * Author: Miguel A. Risco-Castillo + * version: 2.1 + * Date: 2021/06/19 + * + * This program 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 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * For commercial applications additional licenses can be requested + */ + +#pragma once + +void Preview_DrawFromSD(); +bool Preview_Valid(); +void Preview_Reset(); diff --git a/Marlin/src/lcd/e3v2/proui/plot.cpp b/Marlin/src/lcd/e3v2/proui/plot.cpp new file mode 100644 index 0000000000..ebc685fa24 --- /dev/null +++ b/Marlin/src/lcd/e3v2/proui/plot.cpp @@ -0,0 +1,94 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 Single var plot + * Author: Miguel A. Risco-Castillo + * Version: 2.0 + * Date: 2022/01/31 + * + * This program 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 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * For commercial applications additional licenses can be requested + */ + +#include "../../../inc/MarlinConfigPre.h" + +#ifdef DWIN_LCD_PROUI + +#include "plot.h" + +#include "../../../core/types.h" +#include "../../marlinui.h" +#include "dwin_lcd.h" +#include "dwinui.h" +#include "dwin_popup.h" +#include "dwin.h" + +#define Plot_Bg_Color RGB( 1, 12, 8) + +PlotClass Plot; + +uint16_t grphpoints, r, x2, y2 = 0; +frame_rect_t grphframe = {0}; +float scale = 0; + +void PlotClass::Draw(const frame_rect_t frame, const float max, const float ref) { + grphframe = frame; + grphpoints = 0; + scale = frame.h / max; + x2 = frame.x + frame.w - 1; + y2 = frame.y + frame.h - 1; + r = round((y2) - ref * scale); + DWINUI::Draw_Box(1, Plot_Bg_Color, frame); + for (uint8_t i = 1; i < 4; i++) if (i*50 < frame.w) DWIN_Draw_VLine(Line_Color, i*50 + frame.x, frame.y, frame.h); + DWINUI::Draw_Box(0, Color_White, DWINUI::ExtendFrame(frame, 1)); + DWIN_Draw_HLine(Color_Red, frame.x, r, frame.w); +} + +void PlotClass::Update(const float value) { + if (!scale) return; + uint16_t y = round((y2) - value * scale); + if (grphpoints < grphframe.w) { + DWIN_Draw_Point(Color_Yellow, 1, 1, grphpoints + grphframe.x, y); + } + else { + DWIN_Frame_AreaMove(1, 0, 1, Plot_Bg_Color, grphframe.x, grphframe.y, x2, y2); + if ((grphpoints % 50) == 0) DWIN_Draw_VLine(Line_Color, x2 - 1, grphframe.y + 1, grphframe.h - 2); + DWIN_Draw_Point(Color_Red, 1, 1, x2 - 1, r); + DWIN_Draw_Point(Color_Yellow, 1, 1, x2 - 1, y); + } + grphpoints++; +} + +#endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/plot.h b/Marlin/src/lcd/e3v2/proui/plot.h new file mode 100644 index 0000000000..8522c530bd --- /dev/null +++ b/Marlin/src/lcd/e3v2/proui/plot.h @@ -0,0 +1,54 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General 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 Single var plot + * Author: Miguel A. Risco-Castillo + * Version: 1.0 + * Date: 2022/01/30 + * + * This program 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 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * For commercial applications additional licenses can be requested + */ +#pragma once + +#include "dwinui.h" + +class PlotClass { +public: + void Draw(frame_rect_t frame, float max, float ref = 0); + void Update(float value); +}; + +extern PlotClass Plot; diff --git a/Marlin/src/lcd/e3v2/proui/ubl_tools.cpp b/Marlin/src/lcd/e3v2/proui/ubl_tools.cpp index 96a7f52bec..87909d2dd2 100644 --- a/Marlin/src/lcd/e3v2/proui/ubl_tools.cpp +++ b/Marlin/src/lcd/e3v2/proui/ubl_tools.cpp @@ -1,10 +1,9 @@ /** - * UBL Tools and Mesh Viewer for Pro UI - * Version: 1.0.0 - * Date: 2022/04/13 + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * - * Original Author: Henri-J-Norden - * Original Source: https://github.com/Jyers/Marlin/pull/126 + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,11 +20,20 @@ * */ +/** + * UBL Tools and Mesh Viewer for Pro UI + * Version: 1.0.0 + * Date: 2022/04/13 + * + * Original Author: Henri-J-Norden + * Original Source: https://github.com/Jyers/Marlin/pull/126 + */ + #include "../../../inc/MarlinConfigPre.h" + +#if BOTH(DWIN_LCD_PROUI, AUTO_BED_LEVELING_UBL) + #include "ubl_tools.h" - -#if ENABLED(DWIN_LCD_PROUI) - #include "../../marlinui.h" #include "../../../core/types.h" #include "dwin.h" @@ -249,4 +257,4 @@ bool UBLMeshToolsClass::validate() { } #endif -#endif // DWIN_LCD_PROUI +#endif // DWIN_LCD_PROUI && AUTO_BED_LEVELING_UBL diff --git a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp index 7561c89d79..285729cc15 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp @@ -708,7 +708,7 @@ void ChironTFT::PanelAction(uint8_t req) { // Old TFT A22 X -1F1500 A22 X +1F1500 // New TFT A22 X-1.0 F1500 A22 X1.0 F1500 - // lets just wrap this in a gcode relative nonprint move and let the controller deal with it + // Send a G-code-relative non-print move and let the controller deal with it // G91 G0 G90 if (!isPrinting()) { // Ignore request if printing diff --git a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp index c382af3fe2..0da8bb36a7 100644 --- a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp +++ b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp @@ -86,7 +86,7 @@ void AnycubicTFTClass::OnSetup() { delay_ms(10); // Init the state of the key pins running on the TFT - #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) + #if BOTH(SDSUPPORT, HAS_SD_DETECT) SET_INPUT_PULLUP(SD_DETECT_PIN); #endif #if ENABLED(FILAMENT_RUNOUT_SENSOR) @@ -916,7 +916,7 @@ void AnycubicTFTClass::GetCommandFromTFT() { } void AnycubicTFTClass::DoSDCardStateCheck() { - #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) + #if BOTH(SDSUPPORT, HAS_SD_DETECT) bool isInserted = isMediaInserted(); if (isInserted) SENDLINE_DBG_PGM("J00", "TFT Serial Debug: SD card state changed... isInserted"); diff --git a/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp b/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp index 6fa188bf5f..0eb95bb041 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp @@ -243,7 +243,7 @@ void DGUSDisplay::WritePGM(const char str[], uint8_t len) { } void DGUSDisplay::loop() { - // protect against recursion… ProcessRx() may indirectly call idle() when injecting gcode commands. + // Protect against recursion. ProcessRx() may indirectly call idle() when injecting G-code commands. if (!no_reentrance) { no_reentrance = true; ProcessRx(); diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp index 35c2de0549..739265e496 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp @@ -193,7 +193,6 @@ void DGUSScreenHandlerMKS::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) { 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 - auto cs = getCurrentScreen(); if (runout_mks.runout_status != RUNOUT_WAITING_STATUS && runout_mks.runout_status != UNRUNOUT_STATUS) { if (cs == MKSLCD_SCREEN_PRINT || cs == MKSLCD_SCREEN_PAUSE) @@ -213,7 +212,6 @@ void DGUSScreenHandlerMKS::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) { } break; case 1: // Pause - GotoScreen(MKSLCD_SCREEN_PAUSE); if (!ExtUI::isPrintingFromMediaPaused()) { nozzle_park_mks.print_pause_start_flag = 1; @@ -222,6 +220,7 @@ void DGUSScreenHandlerMKS::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) { //ExtUI::mks_pausePrint(); } break; + case 2: // Abort HandleUserConfirmationPopUp(VP_SD_AbortPrintConfirmed, nullptr, PSTR("Abort printing"), filelist.filename(), PSTR("?"), true, true, false, true); break; diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp index cf95bb1d76..88fe30a027 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp @@ -47,9 +47,7 @@ void DGUSRxHandler::ScreenChange(DGUS_VP &vp, void *data_ptr) { if (vp.addr == DGUS_Addr::SCREENCHANGE_SD) { #if ENABLED(SDSUPPORT) - #if !PIN_EXISTS(SD_DETECT) - card.mount(); - #endif + IF_DISABLED(HAS_SD_DETECT, card.mount()); if (!ExtUI::isMediaInserted()) { dgus_screen_handler.SetStatusMessage(GET_TEXT_F(MSG_NO_MEDIA)); @@ -466,7 +464,7 @@ void DGUSRxHandler::MoveToPoint(DGUS_VP &vp, void *data_ptr) { } const uint8_t point = ((uint8_t*)data_ptr)[1]; - constexpr float lfrb[4] = LEVEL_CORNERS_INSET_LFRB; + constexpr float lfrb[4] = BED_TRAMMING_INSET_LFRB; float x, y; switch (point) { @@ -493,12 +491,12 @@ void DGUSRxHandler::MoveToPoint(DGUS_VP &vp, void *data_ptr) { break; } - if (ExtUI::getAxisPosition_mm(ExtUI::Z) < Z_MIN_POS + LEVEL_CORNERS_Z_HOP) { - ExtUI::setAxisPosition_mm(Z_MIN_POS + LEVEL_CORNERS_Z_HOP, ExtUI::Z); + if (ExtUI::getAxisPosition_mm(ExtUI::Z) < Z_MIN_POS + BED_TRAMMING_Z_HOP) { + ExtUI::setAxisPosition_mm(Z_MIN_POS + BED_TRAMMING_Z_HOP, ExtUI::Z); } ExtUI::setAxisPosition_mm(x, ExtUI::X); ExtUI::setAxisPosition_mm(y, ExtUI::Y); - ExtUI::setAxisPosition_mm(Z_MIN_POS + LEVEL_CORNERS_HEIGHT, ExtUI::Z); + ExtUI::setAxisPosition_mm(Z_MIN_POS + BED_TRAMMING_HEIGHT, ExtUI::Z); } void DGUSRxHandler::Probe(DGUS_VP &vp, void *data_ptr) { diff --git a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h index 9b275fb2f5..846fd15942 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h @@ -71,15 +71,15 @@ static_assert((DGUS_LEVEL_GRID_SIZE == GRID_MAX_POINTS_X * GRID_MAX_POINTS_Y), " #define DGUS_DEFAULT_FILAMENT_LEN 10 #endif -#ifndef LEVEL_CORNERS_Z_HOP - #define LEVEL_CORNERS_Z_HOP 4.0 +#ifndef BED_TRAMMING_Z_HOP + #define BED_TRAMMING_Z_HOP 4.0 #endif -#ifndef LEVEL_CORNERS_HEIGHT - #define LEVEL_CORNERS_HEIGHT 0.0 +#ifndef BED_TRAMMING_HEIGHT + #define BED_TRAMMING_HEIGHT 0.0 #endif -static_assert(LEVEL_CORNERS_Z_HOP >= 0, "LEVEL_CORNERS_Z_HOP must be >= 0. Please update your configuration."); +static_assert(BED_TRAMMING_Z_HOP >= 0, "BED_TRAMMING_Z_HOP must be >= 0. Please update your configuration."); #ifndef DGUS_LEVEL_CENTER_X #define DGUS_LEVEL_CENTER_X ((X_BED_SIZE) / 2) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp index dbee1e034b..a23ad6e37e 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp @@ -178,9 +178,9 @@ bool UIFlashStorage::is_present = false; if (!is_known) { SERIAL_ECHO_MSG("Unable to locate supported SPI Flash Memory."); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(" Manufacturer ID, got: ", manufacturer_id); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(" Device Type , got: ", device_type); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(" Capacity , got: ", capacity); + SERIAL_ECHO_MSG(" Manufacturer ID, got: ", manufacturer_id); + SERIAL_ECHO_MSG(" Device Type , got: ", device_type); + SERIAL_ECHO_MSG(" Capacity , got: ", capacity); } return is_known; @@ -247,7 +247,7 @@ bool UIFlashStorage::is_present = false; case 0xFFFFFFFFul: return read_offset; case delimiter: read_offset = offset; break; default: - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Invalid delimiter in Flash: ", delim); + SERIAL_ECHO_MSG("Invalid delimiter in Flash: ", delim); return -1; } } @@ -325,8 +325,7 @@ bool UIFlashStorage::is_present = false; } SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Writing UI settings to SPI Flash (offset ", write_addr); - SERIAL_ECHOPGM(")..."); + SERIAL_ECHOPGM("Writing UI settings to SPI Flash (offset ", write_addr, ")..."); const uint32_t delim = delimiter; write_addr = write(write_addr, &delim, sizeof(delim)); @@ -509,7 +508,7 @@ bool UIFlashStorage::is_present = false; bytes_remaining = get_media_file_size(slot); if (bytes_remaining != 0xFFFFFFFFUL) { - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Boot media file size:", bytes_remaining); + SERIAL_ECHO_MSG("Boot media file size:", bytes_remaining); addr = get_media_file_start(slot); return true; } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp index 6d42fd41e4..e3b95c4cd4 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp @@ -54,7 +54,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(8) .button(BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_MAX_SPEED)) .tag(9) .button(BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION)) .tag(10) .button(BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(TERN(HAS_JUNCTION_DEVIATION, MSG_JUNCTION_DEVIATION, MSG_JERK))) .enabled(ENABLED(BACKLASH_GCODE)) @@ -64,7 +64,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { .tag(13) .button(BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE)) .tag(14) .button(BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_DEFAULTS)) .colors(action_btn) - .tag(1). button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_DONE)); + .tag(1) .button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_DONE)); } } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/advanced_settings_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/advanced_settings_menu.cpp index 888f2c2cdd..00cdf76331 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/advanced_settings_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/advanced_settings_menu.cpp @@ -59,7 +59,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { .tag(3) .button(TMC_CURRENT_POS, GET_TEXT_F(MSG_TMC_CURRENT)) .enabled(ENABLED(LIN_ADVANCE)) .tag(4) .button(LIN_ADVANCE_POS, GET_TEXT_F(MSG_LINEAR_ADVANCE)) - .tag(5) .button(VELOCITY_POS, GET_TEXT_F(MSG_VELOCITY)) + .tag(5) .button(VELOCITY_POS, GET_TEXT_F(MSG_MAX_SPEED)) .tag(6) .button(ACCELERATION_POS, GET_TEXT_F(MSG_ACCELERATION)) .tag(7) .button(JERK_POS, GET_TEXT_F(TERN(HAS_JUNCTION_DEVIATION, MSG_JUNCTION_DEVIATION, MSG_JERK))) .tag(8) .button(ENDSTOPS_POS, GET_TEXT_F(MSG_LCD_ENDSTOPS)) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp index 8e788421ad..a796c8edcf 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp @@ -1024,9 +1024,7 @@ template bool CLCD::CommandFifo::write(T data, uint16_t len) { uint16_t Command_Space = mem_read_32(REG::CMDB_SPACE) & 0x0FFF; if (Command_Space < (len + padding)) { #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Waiting for ", len + padding); - SERIAL_ECHOLNPGM(" bytes in command queue, now free: ", Command_Space); + SERIAL_ECHO_MSG("Waiting for ", len + padding, " bytes in command queue, now free: ", Command_Space); #endif do { Command_Space = mem_read_32(REG::CMDB_SPACE) & 0x0FFF; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp index 1ee73c140e..f947a352b1 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp @@ -131,9 +131,7 @@ bool DLCache::store(uint32_t min_bytes /* = 0*/) { if (dl_size > dl_slot_size) { // Not enough memory to cache the display list. #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPGM ("Not enough space in GRAM to cache display list, free space: ", dl_slot_size); - SERIAL_ECHOLNPGM(" Required: ", dl_size); + SERIAL_ECHO_MSG("Not enough space in GRAM to cache display list, free space: ", dl_slot_size, " Required: ", dl_size); #endif dl_slot_used = 0; save_slot(); @@ -141,9 +139,7 @@ bool DLCache::store(uint32_t min_bytes /* = 0*/) { } else { #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPGM ("Saving DL to RAMG cache, bytes: ", dl_slot_used); - SERIAL_ECHOLNPGM(" Free space: ", dl_slot_size); + SERIAL_ECHO_MSG("Saving DL to RAMG cache, bytes: ", dl_slot_used, " Free space: ", dl_slot_size); #endif dl_slot_used = dl_size; save_slot(); @@ -160,9 +156,9 @@ void DLCache::save_slot(uint8_t indx, uint32_t addr, uint16_t size, uint16_t use } void DLCache::load_slot(uint8_t indx, uint32_t &addr, uint16_t &size, uint16_t &used) { - addr = CLCD::mem_read_32(DL_CACHE_START + indx * 12 + 0); - size = CLCD::mem_read_32(DL_CACHE_START + indx * 12 + 4); - used = CLCD::mem_read_32(DL_CACHE_START + indx * 12 + 8); + addr = CLCD::mem_read_32(DL_CACHE_START + indx * 12 + 0); + size = CLCD::mem_read_32(DL_CACHE_START + indx * 12 + 4); + used = CLCD::mem_read_32(DL_CACHE_START + indx * 12 + 8); } void DLCache::append() { @@ -171,9 +167,7 @@ void DLCache::append() { #if ENABLED(TOUCH_UI_DEBUG) cmd.execute(); wait_until_idle(); - SERIAL_ECHO_START(); - SERIAL_ECHOPGM ("Appending to DL from RAMG cache, bytes: ", dl_slot_used); - SERIAL_ECHOLNPGM(" REG_CMD_DL: ", CLCD::mem_read_32(REG::CMD_DL)); + SERIAL_ECHO_MSG("Appending to DL from RAMG cache, bytes: ", dl_slot_used, " REG_CMD_DL: ", CLCD::mem_read_32(REG::CMD_DL)); #endif } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/advanced_settings_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/advanced_settings_menu.cpp index 8e0a01e1c8..8753b44e70 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/advanced_settings_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/advanced_settings_menu.cpp @@ -105,7 +105,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { .tag(15).button(DISPLAY_POS, GET_TEXT_F(MSG_DISPLAY_MENU)) .tag(9) .button(INTERFACE_POS, GET_TEXT_F(MSG_INTERFACE)) .tag(10).button(RESTORE_DEFAULTS_POS, GET_TEXT_F(MSG_RESTORE_DEFAULTS)) - .tag(5) .button(VELOCITY_POS, GET_TEXT_F(MSG_VELOCITY)) + .tag(5) .button(VELOCITY_POS, GET_TEXT_F(MSG_MAX_SPEED)) .tag(6) .button(ACCELERATION_POS, GET_TEXT_F(MSG_ACCELERATION)) .tag(7) .button(JERK_POS, GET_TEXT_F(TERN(HAS_JUNCTION_DEVIATION, MSG_JUNCTION_DEVIATION, MSG_JERK))) .enabled(ENABLED(BACKLASH_GCODE)) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/max_velocity_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/max_velocity_screen.cpp index 0111276211..e7fc23ab48 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/max_velocity_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/max_velocity_screen.cpp @@ -34,7 +34,7 @@ void MaxVelocityScreen::onRedraw(draw_mode_t what) { widgets_t w(what); w.precision(0); w.units(GET_TEXT_F(MSG_UNITS_MM_S)); - w.heading( GET_TEXT_F(MSG_VELOCITY)); + w.heading( GET_TEXT_F(MSG_MAX_SPEED)); w.color(x_axis) .adjuster( 2, GET_TEXT_F(MSG_VMAX_X), getAxisMaxFeedrate_mm_s(X) ); w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_VMAX_Y), getAxisMaxFeedrate_mm_s(Y) ); w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_VMAX_Z), getAxisMaxFeedrate_mm_s(Z) ); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/tune_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/tune_menu.cpp index d059f6ff3f..0370c44174 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/tune_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/tune_menu.cpp @@ -52,8 +52,6 @@ void TuneMenu::onRedraw(draw_mode_t what) { #define ADVANCED_SETTINGS_POS BTN_POS(1,9), BTN_SIZE(1,1) #define BACK_POS BTN_POS(2,9), BTN_SIZE(1,1) #else - #define GRID_COLS 2 - #define GRID_ROWS 5 #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) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language.h index cbc05c5aa3..8c123db6a1 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language.h @@ -20,4 +20,6 @@ ****************************************************************************/ #pragma once +#define LSTR PROGMEM Language_Str + #include "language_en.h" diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h index 83e762430c..5dbde8a5c3 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h @@ -36,142 +36,142 @@ #endif namespace Language_en { - PROGMEM Language_Str MSG_BUTTON_OKAY = u8"Okay"; - PROGMEM Language_Str MSG_BUTTON_MENU = u8"Menu"; - PROGMEM Language_Str MSG_BUTTON_MEDIA = u8"Media"; - PROGMEM Language_Str MSG_BUTTON_OPEN = u8"Open"; - PROGMEM Language_Str MSG_CLEAN_NOZZLE = u8"Clean Nozzle"; - PROGMEM Language_Str MSG_VMAX_X = u8"Vmax X"; - PROGMEM Language_Str MSG_VMAX_Y = u8"Vmax Y"; - PROGMEM Language_Str MSG_VMAX_Z = u8"Vmax Z"; - PROGMEM Language_Str MSG_ACCEL_PRINTING = u8"Printing"; - PROGMEM Language_Str MSG_ACCEL_TRAVEL = u8"Travel"; - PROGMEM Language_Str MSG_ACCEL_RETRACT = u8"Retraction"; - PROGMEM Language_Str MSG_AMAX_X = u8"Amax X"; - PROGMEM Language_Str MSG_AMAX_Y = u8"Amax Y"; - PROGMEM Language_Str MSG_AMAX_Z = u8"Amax Z"; - PROGMEM Language_Str MSG_AXIS_X = u8"X"; - PROGMEM Language_Str MSG_AXIS_X2 = u8"X2"; - PROGMEM Language_Str MSG_AXIS_Y = u8"Y"; - PROGMEM Language_Str MSG_AXIS_Y2 = u8"Y2"; - PROGMEM Language_Str MSG_AXIS_Z = u8"Z"; - PROGMEM Language_Str MSG_AXIS_Z2 = u8"Z2"; - PROGMEM Language_Str MSG_AXIS_E = u8"E"; - PROGMEM Language_Str MSG_AXIS_E1 = u8"E1"; - PROGMEM Language_Str MSG_AXIS_E2 = u8"E2"; - PROGMEM Language_Str MSG_AXIS_E3 = u8"E3"; - PROGMEM Language_Str MSG_AXIS_E4 = u8"E4"; - PROGMEM Language_Str MSG_AXIS_ALL = u8"All"; - PROGMEM Language_Str MSG_HOME = u8"Home"; - PROGMEM Language_Str MSG_PRINT_STARTING = u8"Print starting"; - PROGMEM Language_Str MSG_PRINT_FINISHED = u8"Print finished"; - PROGMEM Language_Str MSG_PRINT_ERROR = u8"Print error"; - PROGMEM Language_Str MSG_ABOUT_TOUCH_PANEL_1 = u8"Color Touch Panel"; - PROGMEM Language_Str MSG_ABOUT_TOUCH_PANEL_2 = WEBSITE_URL; - PROGMEM Language_Str MSG_LICENSE = u8"This program is free software: you can redistribute it and/or modify it under the terms of " + LSTR MSG_BUTTON_OKAY = u8"Okay"; + LSTR MSG_BUTTON_MENU = u8"Menu"; + LSTR MSG_BUTTON_MEDIA = u8"Media"; + LSTR MSG_BUTTON_OPEN = u8"Open"; + LSTR MSG_CLEAN_NOZZLE = u8"Clean Nozzle"; + LSTR MSG_VMAX_X = u8"Max X Speed"; + LSTR MSG_VMAX_Y = u8"Max Y Speed"; + LSTR MSG_VMAX_Z = u8"Max Z Speed"; + LSTR MSG_ACCEL_PRINTING = u8"Printing"; + LSTR MSG_ACCEL_TRAVEL = u8"Travel"; + LSTR MSG_ACCEL_RETRACT = u8"Retraction"; + LSTR MSG_AMAX_X = u8"Max X Accel."; + LSTR MSG_AMAX_Y = u8"Max Y Accel."; + LSTR MSG_AMAX_Z = u8"Max Z Accel."; + LSTR MSG_AXIS_X = u8"X"; + LSTR MSG_AXIS_X2 = u8"X2"; + LSTR MSG_AXIS_Y = u8"Y"; + LSTR MSG_AXIS_Y2 = u8"Y2"; + LSTR MSG_AXIS_Z = u8"Z"; + LSTR MSG_AXIS_Z2 = u8"Z2"; + LSTR MSG_AXIS_E = u8"E"; + LSTR MSG_AXIS_E1 = u8"E1"; + LSTR MSG_AXIS_E2 = u8"E2"; + LSTR MSG_AXIS_E3 = u8"E3"; + LSTR MSG_AXIS_E4 = u8"E4"; + LSTR MSG_AXIS_ALL = u8"All"; + LSTR MSG_HOME = u8"Home"; + LSTR MSG_PRINT_STARTING = u8"Print starting"; + LSTR MSG_PRINT_FINISHED = u8"Print finished"; + LSTR MSG_PRINT_ERROR = u8"Print error"; + LSTR MSG_ABOUT_TOUCH_PANEL_1 = u8"Color Touch Panel"; + LSTR MSG_ABOUT_TOUCH_PANEL_2 = WEBSITE_URL; + LSTR 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. To view a copy of the GNU General " "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"; - PROGMEM Language_Str MSG_INTERFACE = u8"Interface"; - PROGMEM Language_Str MSG_MEASURE_AUTOMATICALLY = u8"Measure automatically"; - PROGMEM Language_Str MSG_H_OFFSET = u8"H Offset"; - PROGMEM Language_Str MSG_V_OFFSET = u8"V Offset"; - PROGMEM Language_Str MSG_TOUCH_SCREEN = u8"Touch Screen"; - PROGMEM Language_Str MSG_CALIBRATE = u8"Calibrate"; - PROGMEM Language_Str MSG_UNITS_MILLIAMP = u8"mA"; - PROGMEM Language_Str MSG_UNITS_MM = u8"mm"; - PROGMEM Language_Str MSG_UNITS_MM_S = u8"mm/s"; - PROGMEM Language_Str MSG_UNITS_MM_S2 = u8"mm/s" SUPERSCRIPT_TWO; - PROGMEM Language_Str MSG_UNITS_STEP_MM = u8"st/mm"; - PROGMEM Language_Str MSG_UNITS_PERCENT = u8"%"; - PROGMEM Language_Str MSG_UNITS_C = DEGREE_SIGN u8"C"; - PROGMEM Language_Str MSG_IDLE = u8"idle"; - PROGMEM Language_Str MSG_SET_MAXIMUM = u8"Set Maximum"; - PROGMEM Language_Str MSG_PRINT_SPEED = u8"Print Speed"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE = u8"Linear Advance"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE_K = u8"K"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE_K1 = u8"K E1"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE_K2 = u8"K E2"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE_K3 = u8"K E3"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE_K4 = u8"K E4"; - PROGMEM Language_Str MSG_NUDGE_NOZZLE = u8"Nudge Nozzle"; - PROGMEM Language_Str MSG_ADJUST_BOTH_NOZZLES = u8"Adjust Both Nozzles"; - PROGMEM Language_Str MSG_SHOW_OFFSETS = u8"Show Offsets"; - PROGMEM Language_Str MSG_INCREMENT = u8"Increment"; - PROGMEM Language_Str MSG_ERASE_FLASH_WARNING = u8"Are you sure? SPI flash will be erased."; - PROGMEM Language_Str MSG_ERASING = u8"Erasing..."; - PROGMEM Language_Str MSG_ERASED = u8"SPI flash erased"; - PROGMEM Language_Str MSG_CALIBRATION_WARNING = u8"For best results, unload the filament and clean the hotend prior to starting calibration. Continue?"; - PROGMEM Language_Str MSG_START_PRINT_CONFIRMATION = u8"Start printing %s?"; - PROGMEM Language_Str MSG_ABORT_WARNING = u8"Are you sure you want to cancel the print?"; - PROGMEM Language_Str MSG_EXTRUDER_SELECTION = u8"Extruder Selection"; - PROGMEM Language_Str MSG_CURRENT_TEMPERATURE = u8"Current Temp"; - PROGMEM Language_Str MSG_REMOVAL_TEMPERATURE = u8"Removal Temp"; - PROGMEM Language_Str MSG_CAUTION = u8"Caution:"; - PROGMEM Language_Str MSG_HOT = u8"Hot!"; - PROGMEM Language_Str MSG_UNLOAD_FILAMENT = u8"Unload/Retract"; - PROGMEM Language_Str MSG_LOAD_FILAMENT = u8"Load/Extrude"; - PROGMEM Language_Str MSG_MOMENTARY = u8"Momentary"; - PROGMEM Language_Str MSG_CONTINUOUS = u8"Continuous"; - PROGMEM Language_Str MSG_PRINT_MENU = u8"Print Menu"; - PROGMEM Language_Str MSG_FINE_MOTION = u8"Fine motion"; - PROGMEM Language_Str MSG_ENABLE_MEDIA = u8"Enable Media"; - PROGMEM Language_Str MSG_INSERT_MEDIA = u8"Insert Media..."; - PROGMEM Language_Str MSG_LCD_BRIGHTNESS = u8"LCD brightness"; - PROGMEM Language_Str MSG_SOUND_VOLUME = u8"Sound volume"; - PROGMEM Language_Str MSG_SCREEN_LOCK = u8"Screen lock"; - PROGMEM Language_Str MSG_BOOT_SCREEN = u8"Boot screen"; - PROGMEM Language_Str MSG_SOUNDS = u8"Sounds"; - PROGMEM Language_Str MSG_CLICK_SOUNDS = u8"Click sounds"; - PROGMEM Language_Str MSG_EEPROM_RESTORED = u8"Settings restored from backup"; - PROGMEM Language_Str MSG_EEPROM_RESET = u8"Settings restored to default"; - PROGMEM Language_Str MSG_EEPROM_SAVED = u8"Settings saved!"; - PROGMEM Language_Str MSG_EEPROM_SAVE_PROMPT = u8"Settings applied. Save these settings for next power-on?"; - PROGMEM Language_Str MSG_EEPROM_RESET_WARNING = u8"Are you sure? Customizations will be lost."; + LSTR MSG_RUNOUT_1 = u8"Runout 1"; + LSTR MSG_RUNOUT_2 = u8"Runout 2"; + LSTR MSG_DISPLAY_MENU = u8"Display"; + LSTR MSG_INTERFACE = u8"Interface"; + LSTR MSG_MEASURE_AUTOMATICALLY = u8"Measure automatically"; + LSTR MSG_H_OFFSET = u8"H Offset"; + LSTR MSG_V_OFFSET = u8"V Offset"; + LSTR MSG_TOUCH_SCREEN = u8"Touch Screen"; + LSTR MSG_CALIBRATE = u8"Calibrate"; + LSTR MSG_UNITS_MILLIAMP = u8"mA"; + LSTR MSG_UNITS_MM = u8"mm"; + LSTR MSG_UNITS_MM_S = u8"mm/s"; + LSTR MSG_UNITS_MM_S2 = u8"mm/s" SUPERSCRIPT_TWO; + LSTR MSG_UNITS_STEP_MM = u8"st/mm"; + LSTR MSG_UNITS_PERCENT = u8"%"; + LSTR MSG_UNITS_C = DEGREE_SIGN u8"C"; + LSTR MSG_IDLE = u8"idle"; + LSTR MSG_SET_MAXIMUM = u8"Set Maximum"; + LSTR MSG_PRINT_SPEED = u8"Print Speed"; + LSTR MSG_LINEAR_ADVANCE = u8"Linear Advance"; + LSTR MSG_LINEAR_ADVANCE_K = u8"K"; + LSTR MSG_LINEAR_ADVANCE_K1 = u8"K E1"; + LSTR MSG_LINEAR_ADVANCE_K2 = u8"K E2"; + LSTR MSG_LINEAR_ADVANCE_K3 = u8"K E3"; + LSTR MSG_LINEAR_ADVANCE_K4 = u8"K E4"; + LSTR MSG_NUDGE_NOZZLE = u8"Nudge Nozzle"; + LSTR MSG_ADJUST_BOTH_NOZZLES = u8"Adjust Both Nozzles"; + LSTR MSG_SHOW_OFFSETS = u8"Show Offsets"; + LSTR MSG_INCREMENT = u8"Increment"; + LSTR MSG_ERASE_FLASH_WARNING = u8"Are you sure? SPI flash will be erased."; + LSTR MSG_ERASING = u8"Erasing..."; + LSTR MSG_ERASED = u8"SPI flash erased"; + LSTR MSG_CALIBRATION_WARNING = u8"For best results, unload the filament and clean the hotend prior to starting calibration. Continue?"; + LSTR MSG_START_PRINT_CONFIRMATION = u8"Start printing %s?"; + LSTR MSG_ABORT_WARNING = u8"Are you sure you want to cancel the print?"; + LSTR MSG_EXTRUDER_SELECTION = u8"Extruder Selection"; + LSTR MSG_CURRENT_TEMPERATURE = u8"Current Temp"; + LSTR MSG_REMOVAL_TEMPERATURE = u8"Removal Temp"; + LSTR MSG_CAUTION = u8"Caution:"; + LSTR MSG_HOT = u8"Hot!"; + LSTR MSG_UNLOAD_FILAMENT = u8"Unload/Retract"; + LSTR MSG_LOAD_FILAMENT = u8"Load/Extrude"; + LSTR MSG_MOMENTARY = u8"Momentary"; + LSTR MSG_CONTINUOUS = u8"Continuous"; + LSTR MSG_PRINT_MENU = u8"Print Menu"; + LSTR MSG_FINE_MOTION = u8"Fine motion"; + LSTR MSG_ENABLE_MEDIA = u8"Enable Media"; + LSTR MSG_INSERT_MEDIA = u8"Insert Media..."; + LSTR MSG_LCD_BRIGHTNESS = u8"LCD brightness"; + LSTR MSG_SOUND_VOLUME = u8"Sound volume"; + LSTR MSG_SCREEN_LOCK = u8"Screen lock"; + LSTR MSG_BOOT_SCREEN = u8"Boot screen"; + LSTR MSG_SOUNDS = u8"Sounds"; + LSTR MSG_CLICK_SOUNDS = u8"Click sounds"; + LSTR MSG_EEPROM_RESTORED = u8"Settings restored from backup"; + LSTR MSG_EEPROM_RESET = u8"Settings restored to default"; + LSTR MSG_EEPROM_SAVED = u8"Settings saved!"; + LSTR MSG_EEPROM_SAVE_PROMPT = u8"Settings applied. Save these settings for next power-on?"; + LSTR MSG_EEPROM_RESET_WARNING = u8"Are you sure? Customizations will be lost."; - PROGMEM Language_Str MSG_PASSCODE_REJECTED = u8"Wrong passcode!"; - PROGMEM Language_Str MSG_PASSCODE_ACCEPTED = u8"Passcode accepted!"; - PROGMEM Language_Str MSG_PASSCODE_SELECT = u8"Select Passcode:"; - PROGMEM Language_Str MSG_PASSCODE_REQUEST = u8"Enter Passcode:"; + LSTR MSG_PASSCODE_REJECTED = u8"Wrong passcode!"; + LSTR MSG_PASSCODE_ACCEPTED = u8"Passcode accepted!"; + LSTR MSG_PASSCODE_SELECT = u8"Select Passcode:"; + LSTR MSG_PASSCODE_REQUEST = u8"Enter Passcode:"; - PROGMEM Language_Str MSG_TOUCH_CALIBRATION_START = u8"Release to begin screen calibration"; - PROGMEM Language_Str MSG_TOUCH_CALIBRATION_PROMPT = u8"Touch the dots to calibrate"; - PROGMEM Language_Str MSG_BED_MAPPING_DONE = u8"Bed mapping finished"; - PROGMEM Language_Str MSG_BED_MAPPING_INCOMPLETE = u8"Not all points probed"; - PROGMEM Language_Str MSG_LEVELING = u8"Leveling"; - PROGMEM Language_Str MSG_AXIS_LEVELING = u8"Axis Leveling"; - PROGMEM Language_Str MSG_PROBE_BED = u8"Probe Mesh"; - PROGMEM Language_Str MSG_PRINT_TEST = u8"Print Test (PLA)"; - PROGMEM Language_Str MSG_MOVE_Z_TO_TOP = u8"Raise Z to Top"; + LSTR MSG_TOUCH_CALIBRATION_START = u8"Release to begin screen calibration"; + LSTR MSG_TOUCH_CALIBRATION_PROMPT = u8"Touch the dots to calibrate"; + LSTR MSG_BED_MAPPING_DONE = u8"Bed mapping finished"; + LSTR MSG_BED_MAPPING_INCOMPLETE = u8"Not all points probed"; + LSTR MSG_LEVELING = u8"Leveling"; + LSTR MSG_AXIS_LEVELING = u8"Axis Leveling"; + LSTR MSG_PROBE_BED = u8"Probe Mesh"; + LSTR MSG_PRINT_TEST = u8"Print Test (PLA)"; + LSTR MSG_MOVE_Z_TO_TOP = u8"Raise Z to Top"; #if ENABLED(TOUCH_UI_LULZBOT_BIO) - PROGMEM Language_Str MSG_MOVE_TO_HOME = u8"Move to Home"; - PROGMEM Language_Str MSG_RAISE_PLUNGER = u8"Raise Plunger"; - PROGMEM Language_Str MSG_RELEASE_XY_AXIS = u8"Release X and Y Axis"; - PROGMEM Language_Str MSG_BED_TEMPERATURE = u8"Bed Temperature"; - PROGMEM Language_Str MSG_HOME_XYZ_WARNING = u8"About to move to home position. Ensure the top and the bed of the printer are clear.\n\nContinue?"; - PROGMEM Language_Str MSG_HOME_E_WARNING = u8"About to re-home plunger and auto-level. Remove syringe prior to proceeding.\n\nContinue?"; + LSTR MSG_MOVE_TO_HOME = u8"Move to Home"; + LSTR MSG_RAISE_PLUNGER = u8"Raise Plunger"; + LSTR MSG_RELEASE_XY_AXIS = u8"Release X and Y Axis"; + LSTR MSG_BED_TEMPERATURE = u8"Bed Temperature"; + LSTR MSG_HOME_XYZ_WARNING = u8"About to move to home position. Ensure the top and the bed of the printer are clear.\n\nContinue?"; + LSTR MSG_HOME_E_WARNING = u8"About to re-home plunger and auto-level. Remove syringe prior to proceeding.\n\nContinue?"; #endif #ifdef TOUCH_UI_COCOA_PRESS - PROGMEM Language_Str MSG_BODY = u8"Body"; - PROGMEM Language_Str MSG_SELECT_CHOCOLATE_TYPE = u8"Select Chocolate Type"; - PROGMEM Language_Str MSG_EXTERNAL = u8"External"; - PROGMEM Language_Str MSG_CHOCOLATE = u8"Chocolate"; - PROGMEM Language_Str MSG_UNLOAD_CARTRIDGE = u8"Unload Cartridge"; - PROGMEM Language_Str MSG_LOAD_UNLOAD = u8"Load/Unload"; - PROGMEM Language_Str MSG_FULL_LOAD = u8"Full Load"; - PROGMEM Language_Str MSG_FULL_UNLOAD = u8"Full Unload"; - PROGMEM Language_Str MSG_PREHEAT_CHOCOLATE = u8"Preheat Chocolate"; - PROGMEM Language_Str MSG_PREHEAT_FINISHED = u8"Preheat finished"; - PROGMEM Language_Str MSG_PREHEAT = u8"Preheat"; - PROGMEM Language_Str MSG_BUTTON_PAUSE = u8"Pause"; - PROGMEM Language_Str MSG_BUTTON_RESUME = u8"Resume"; - PROGMEM Language_Str MSG_ELAPSED_PRINT = u8"Elapsed Print"; - PROGMEM Language_Str MSG_XYZ_MOVE = u8"XYZ Move"; - PROGMEM Language_Str MSG_E_MOVE = u8"Extrusion Move"; + LSTR MSG_BODY = u8"Body"; + LSTR MSG_SELECT_CHOCOLATE_TYPE = u8"Select Chocolate Type"; + LSTR MSG_EXTERNAL = u8"External"; + LSTR MSG_CHOCOLATE = u8"Chocolate"; + LSTR MSG_UNLOAD_CARTRIDGE = u8"Unload Cartridge"; + LSTR MSG_LOAD_UNLOAD = u8"Load/Unload"; + LSTR MSG_FULL_LOAD = u8"Full Load"; + LSTR MSG_FULL_UNLOAD = u8"Full Unload"; + LSTR MSG_PREHEAT_CHOCOLATE = u8"Preheat Chocolate"; + LSTR MSG_PREHEAT_FINISHED = u8"Preheat finished"; + LSTR MSG_PREHEAT = u8"Preheat"; + LSTR MSG_BUTTON_PAUSE = u8"Pause"; + LSTR MSG_BUTTON_RESUME = u8"Resume"; + LSTR MSG_ELAPSED_PRINT = u8"Elapsed Print"; + LSTR MSG_XYZ_MOVE = u8"XYZ Move"; + LSTR MSG_E_MOVE = u8"Extrusion Move"; #endif }; // namespace Language_en diff --git a/Marlin/src/lcd/extui/malyan/malyan.cpp b/Marlin/src/lcd/extui/malyan/malyan.cpp index df7f305df2..06c9886f01 100644 --- a/Marlin/src/lcd/extui/malyan/malyan.cpp +++ b/Marlin/src/lcd/extui/malyan/malyan.cpp @@ -24,7 +24,7 @@ * lcd/extui/malyan/malyan.cpp * * LCD implementation for Malyan's LCD, a separate ESP8266 MCU running - * on Serial1 for the M200 board. This module outputs a pseudo-gcode + * on Serial1 for the M200 board. This module outputs a pseudo-G-code * wrapped in curly braces which the LCD implementation translates into * actual G-code commands. * diff --git a/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp index 5d6a991910..0199bc1f55 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp @@ -369,7 +369,7 @@ uint32_t lv_open_gcode_file(char *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 + // Ignore the beginning message of G-code file if (ps4) { pre_sread_cnt = (uintptr_t)ps4 - (uintptr_t)((uint32_t *)(&public_buf[0])); card.setIndex(pre_sread_cnt); @@ -490,7 +490,7 @@ void cutFileName(char *path, int len, int bytePerLine, char *outStr) { //&& (strIndex2 != 0) && (strIndex1 < strIndex2) ) ? strIndex1 + 1 : tmpFile; - if (strIndex2 == 0 || (strIndex1 > strIndex2)) { // not gcode file + if (strIndex2 == 0 || (strIndex1 > strIndex2)) { // not G-code file #if _LFN_UNICODE if (wcslen(beginIndex) > len) wcsncpy(outStr, beginIndex, len); @@ -503,7 +503,7 @@ void cutFileName(char *path, int len, int bytePerLine, char *outStr) { strcpy(outStr, beginIndex); #endif } - else { // gcode file + else { // G-code file if (strIndex2 - beginIndex > (len - 2)) { #if _LFN_UNICODE wcsncpy(outStr, (const WCHAR *)beginIndex, len - 3); diff --git a/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp index d3f192e44f..6a8333fd66 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp @@ -159,7 +159,7 @@ void gCfgItems_init() { gCfgItems.spi_flash_flag = FLASH_INF_VALID_FLAG; W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems, VAR_INF_ADDR, sizeof(gCfgItems)); - // init gcode command + // Init G-code command W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&custom_gcode_command[0], AUTO_LEVELING_COMMAND_ADDR, 100); W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&custom_gcode_command[1], OTHERS_COMMAND_ADDR_1, 100); W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&custom_gcode_command[2], OTHERS_COMMAND_ADDR_2, 100); @@ -238,7 +238,7 @@ void update_spi_flash() { uint8_t command_buf[512]; W25QXX.init(SPI_QUARTER_SPEED); - // read back the gcode command before erase spi flash + // read back the G-code command before erase spi flash W25QXX.SPI_FLASH_BufferRead((uint8_t *)&command_buf, GCODE_COMMAND_ADDR, sizeof(command_buf)); W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems, VAR_INF_ADDR, sizeof(gCfgItems)); @@ -249,7 +249,7 @@ void update_gcode_command(int addr, uint8_t *s) { uint8_t command_buf[512]; W25QXX.init(SPI_QUARTER_SPEED); - // read back the gcode command before erase spi flash + // read back the G-code command before erase spi flash W25QXX.SPI_FLASH_BufferRead((uint8_t *)&command_buf, GCODE_COMMAND_ADDR, sizeof(command_buf)); W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems, VAR_INF_ADDR, sizeof(gCfgItems)); diff --git a/Marlin/src/lcd/extui/mks_ui/pic_manager.h b/Marlin/src/lcd/extui/mks_ui/pic_manager.h index 320cb20b0b..cdcc5b76b8 100644 --- a/Marlin/src/lcd/extui/mks_ui/pic_manager.h +++ b/Marlin/src/lcd/extui/mks_ui/pic_manager.h @@ -122,7 +122,7 @@ #define VAR_INF_ADDR 0x000000 #define FLASH_INF_VALID_FLAG 0x20201118 -// Store some gcode commands, such as auto leveling commands +// Store some G-code commands, such as auto-leveling commands #define GCODE_COMMAND_ADDR VAR_INF_ADDR + 3 * 1024 #define AUTO_LEVELING_COMMAND_ADDR GCODE_COMMAND_ADDR #define OTHERS_COMMAND_ADDR_1 AUTO_LEVELING_COMMAND_ADDR + 100 diff --git a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp index 3785210315..3861235811 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp @@ -137,8 +137,7 @@ void tft_lvgl_init() { uint16_t usb_flash_loop = 1000; #if ENABLED(MULTI_VOLUME) && !HAS_SD_HOST_DRIVE SET_INPUT_PULLUP(SD_DETECT_PIN); - if (READ(SD_DETECT_PIN) == LOW) card.changeMedia(&card.media_driver_sdcard); - else card.changeMedia(&card.media_driver_usbFlash); + card.changeMedia(IS_SD_INSERTED() ? &card.media_driver_sdcard : &card.media_driver_usbFlash); #endif do { card.media_driver_usbFlash.idle(); diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index bba03fc6d4..143f240c2d 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -936,12 +936,10 @@ namespace ExtUI { if (x_target != current_position.x || y_target != current_position.y) { // If moving across bed, raise nozzle to safe height over bed feedrate_mm_s = Z_PROBE_FEEDRATE_FAST; - destination = current_position; - destination.z = Z_CLEARANCE_BETWEEN_PROBES; + destination.set(current_position.x, current_position.y, Z_CLEARANCE_BETWEEN_PROBES); prepare_line_to_destination(); feedrate_mm_s = XY_PROBE_FEEDRATE; - destination.x = x_target; - destination.y = y_target; + destination.set(x_target, y_target); prepare_line_to_destination(); } feedrate_mm_s = Z_PROBE_FEEDRATE_FAST; diff --git a/Marlin/src/lcd/fontutils.cpp b/Marlin/src/lcd/fontutils.cpp index 50b671ea33..a97e63ac4d 100644 --- a/Marlin/src/lcd/fontutils.cpp +++ b/Marlin/src/lcd/fontutils.cpp @@ -40,13 +40,8 @@ #include "fontutils.h" -uint8_t read_byte_ram(uint8_t * str) { - return *str; -} - -uint8_t read_byte_rom(uint8_t * str) { - return pgm_read_byte(str); -} +uint8_t read_byte_ram(const uint8_t *str) { return *str; } +uint8_t read_byte_rom(const uint8_t *str) { return pgm_read_byte(str); } /** * @brief Using binary search to find the position by data_pin @@ -104,9 +99,9 @@ static inline bool utf8_is_start_byte_of_char(const uint8_t b) { /* This function gets the character at the pstart position, interpreting UTF8 multibyte sequences and returns the pointer to the next character */ -uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval) { +const uint8_t* get_utf8_value_cb(const uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval) { uint32_t val = 0; - uint8_t *p = pstart; + const uint8_t *p = pstart; #define NEXT_6_BITS() do{ val <<= 6; p++; valcur = cb_read_byte(p); val |= (valcur & 0x3F); }while(0) diff --git a/Marlin/src/lcd/fontutils.h b/Marlin/src/lcd/fontutils.h index 21aee1e939..e01962d7ad 100644 --- a/Marlin/src/lcd/fontutils.h +++ b/Marlin/src/lcd/fontutils.h @@ -38,10 +38,10 @@ #include "../core/macros.h" // read a byte from ROM or RAM -typedef uint8_t (*read_byte_cb_t)(uint8_t * str); +typedef uint8_t (*read_byte_cb_t)(const uint8_t * str); -uint8_t read_byte_ram(uint8_t * str); -uint8_t read_byte_rom(uint8_t * str); +uint8_t read_byte_ram(const uint8_t *str); +uint8_t read_byte_rom(const uint8_t *str); // there's overflow of the wchar_t due to the 2-byte size in Arduino // sizeof(wchar_t)=2; sizeof(size_t)=2; sizeof(uint32_t)=4; @@ -58,7 +58,11 @@ typedef int (* pf_bsearch_cb_comp_t)(void *userdata, size_t idx, void * data_pin int pf_bsearch_r(void *userdata, size_t num_data, pf_bsearch_cb_comp_t cb_comp, void *data_pinpoint, size_t *ret_idx); /* Get the character, decoding multibyte UTF8 characters and returning a pointer to the start of the next UTF8 character */ -uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval); +const uint8_t* get_utf8_value_cb(const uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval); + +inline const char* get_utf8_value_cb(const char *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval) { + return (const char *)get_utf8_value_cb((const uint8_t *)pstart, cb_read_byte, pval); +} /* Returns length of string in CHARACTERS, NOT BYTES */ uint8_t utf8_strlen(const char *pstart); diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index c5a7e1877e..98f3d4ed97 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -85,7 +85,7 @@ namespace Language_an { LSTR MSG_MOVE_Z = _UxGT("Mover Z"); LSTR MSG_MOVE_E = _UxGT("Extrusor"); LSTR MSG_MOVE_EN = _UxGT("Extrusor *"); - LSTR MSG_MOVE_N_MM = _UxGT("Mover %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Mover $mm"); LSTR MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Mover 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Mover 10mm"); @@ -109,10 +109,8 @@ namespace Language_an { LSTR MSG_AMAX_A = _UxGT("Acel. max ") STR_A; LSTR MSG_AMAX_B = _UxGT("Acel. max ") STR_B; LSTR MSG_AMAX_C = _UxGT("Acel. max ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Acel. max ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Acel. max ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Acel. max ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Acel. max ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Acel. max @"); + LSTR MSG_AMAX_E = _UxGT("Acel. max E"); LSTR MSG_AMAX_EN = _UxGT("Acel. max *"); LSTR MSG_A_RETRACT = _UxGT("Acel. retrac."); LSTR MSG_A_TRAVEL = _UxGT("Acel. Viaje"); @@ -120,9 +118,7 @@ namespace Language_an { LSTR MSG_A_STEPS = STR_A _UxGT(" trangos/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" trangos/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" trangos/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" trangos/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" trangos/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" trangos/mm"); + LSTR MSG_N_STEPS = _UxGT("@ trangos/mm"); LSTR MSG_E_STEPS = _UxGT("E trangos/mm"); LSTR MSG_EN_STEPS = _UxGT("* trangos/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatura"); @@ -168,6 +164,7 @@ namespace Language_an { LSTR MSG_BABYSTEP_X = _UxGT("Micropaso X"); LSTR MSG_BABYSTEP_Y = _UxGT("Micropaso Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Micropaso Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Micropaso @"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Cancelado - Endstop"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Error: en calentar"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Error: temperatura"); diff --git a/Marlin/src/lcd/language/language_bg.h b/Marlin/src/lcd/language/language_bg.h index 95ca4ce1bf..2596d62564 100644 --- a/Marlin/src/lcd/language/language_bg.h +++ b/Marlin/src/lcd/language/language_bg.h @@ -74,7 +74,7 @@ namespace Language_bg { LSTR MSG_MOVE_Z = _UxGT("Движение по Z"); LSTR MSG_MOVE_E = _UxGT("Екструдер"); LSTR MSG_MOVE_EN = _UxGT("Екструдер *"); - LSTR MSG_MOVE_N_MM = _UxGT("Премести с %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Премести с $mm"); LSTR MSG_MOVE_01MM = _UxGT("Премести с 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Премести с 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Премести с 10mm"); @@ -101,9 +101,7 @@ namespace Language_bg { LSTR MSG_A_STEPS = STR_A _UxGT(" стъпки/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" стъпки/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" стъпки/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" стъпки/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" стъпки/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" стъпки/mm"); + LSTR MSG_N_STEPS = _UxGT("@ стъпки/mm"); LSTR MSG_E_STEPS = _UxGT("E стъпки/mm"); LSTR MSG_EN_STEPS = _UxGT("* стъпки/mm"); LSTR MSG_TEMPERATURE = _UxGT("Температура"); @@ -148,6 +146,7 @@ namespace Language_bg { LSTR MSG_BABYSTEP_X = _UxGT("Министъпка X"); LSTR MSG_BABYSTEP_Y = _UxGT("Министъпка Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Министъпка Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Министъпка @"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Стоп Кр.Изключватели"); LSTR MSG_DELTA_CALIBRATE = _UxGT("Делта Калибровка"); LSTR MSG_DELTA_CALIBRATE_X = _UxGT("Калибровка X"); diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index 582c27b1ae..fd46bcc28f 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -85,7 +85,7 @@ namespace Language_ca { LSTR MSG_MOVE_Z = _UxGT("Mou Z"); LSTR MSG_MOVE_E = _UxGT("Extrusor"); LSTR MSG_MOVE_EN = _UxGT("Extrusor *"); - LSTR MSG_MOVE_N_MM = _UxGT("Mou %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Mou $mm"); LSTR MSG_MOVE_01MM = _UxGT("Mou 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Mou 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Mou 10mm"); @@ -107,11 +107,9 @@ namespace Language_ca { LSTR MSG_A_STEPS = STR_A _UxGT(" passos/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" passos/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" passos/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" passos/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" passos/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" passos/mm"); - LSTR MSG_E_STEPS = _UxGT("Epassos/mm"); - LSTR MSG_EN_STEPS = _UxGT("*passos/mm"); + LSTR MSG_E_STEPS = _UxGT("@ passos/mm"); + LSTR MSG_N_STEPS = _UxGT("E passos/mm"); + LSTR MSG_EN_STEPS = _UxGT("* passos/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatura"); LSTR MSG_MOTION = _UxGT("Moviment"); LSTR MSG_FILAMENT = _UxGT("Filament"); @@ -156,6 +154,7 @@ namespace Language_ca { LSTR MSG_BABYSTEP_X = _UxGT("Micropas X"); LSTR MSG_BABYSTEP_Y = _UxGT("Micropas Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Micropas Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Micropas @"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Cancel. Endstop"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Error al escalfar"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: TEMP REDUNDANT"); diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index 76469c5fe5..d78b43f9a9 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -235,7 +235,7 @@ namespace Language_cz { LSTR MSG_MOVE_E = _UxGT("Extrudér"); LSTR MSG_MOVE_EN = _UxGT("Extrudér *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Hotend je studený"); - LSTR MSG_MOVE_N_MM = _UxGT("Posunout o %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Posunout o $mm"); LSTR MSG_MOVE_01MM = _UxGT("Posunout o 0,1mm"); LSTR MSG_MOVE_1MM = _UxGT("Posunout o 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Posunout o 10mm"); @@ -269,19 +269,15 @@ namespace Language_cz { LSTR MSG_VA_JERK = _UxGT("Max ") STR_A _UxGT(" Jerk"); LSTR MSG_VB_JERK = _UxGT("Max ") STR_B _UxGT(" Jerk"); LSTR MSG_VC_JERK = _UxGT("Max ") STR_C _UxGT(" Jerk"); - LSTR MSG_VI_JERK = _UxGT("Max ") STR_I _UxGT(" Jerk"); - LSTR MSG_VJ_JERK = _UxGT("Max ") STR_J _UxGT(" Jerk"); - LSTR MSG_VK_JERK = _UxGT("Max ") STR_K _UxGT(" Jerk"); + LSTR MSG_VN_JERK = _UxGT("Max @ Jerk"); LSTR MSG_VE_JERK = _UxGT("Max E Jerk"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Odchylka spoje"); - LSTR MSG_VELOCITY = _UxGT("Rychlost"); + LSTR MSG_MAX_SPEED = _UxGT("Max Rychlost"); LSTR MSG_VMAX_A = _UxGT("Max ") STR_A _UxGT(" Rychlost"); LSTR MSG_VMAX_B = _UxGT("Max ") STR_B _UxGT(" Rychlost"); LSTR MSG_VMAX_C = _UxGT("Max ") STR_C _UxGT(" Rychlost"); - LSTR MSG_VMAX_I = _UxGT("Max ") STR_I _UxGT(" Rychlost"); - LSTR MSG_VMAX_J = _UxGT("Max ") STR_J _UxGT(" Rychlost"); - LSTR MSG_VMAX_K = _UxGT("Max ") STR_K _UxGT(" Rychlost"); - LSTR MSG_VMAX_E = _UxGT("Max ") STR_E _UxGT(" Rychlost"); + LSTR MSG_VMAX_N = _UxGT("Max @ Rychlost"); + LSTR MSG_VMAX_E = _UxGT("Max E Rychlost"); LSTR MSG_VMAX_EN = _UxGT("Max * Rychlost"); LSTR MSG_VMIN = _UxGT("Vmin"); LSTR MSG_VTRAV_MIN = _UxGT("VTrav Min"); @@ -289,10 +285,8 @@ namespace Language_cz { LSTR MSG_AMAX_A = _UxGT("Max ") STR_A _UxGT(" Akcel"); LSTR MSG_AMAX_B = _UxGT("Max ") STR_B _UxGT(" Akcel"); LSTR MSG_AMAX_C = _UxGT("Max ") STR_C _UxGT(" Akcel"); - LSTR MSG_AMAX_I = _UxGT("Max ") STR_I _UxGT(" Akcel"); - LSTR MSG_AMAX_J = _UxGT("Max ") STR_J _UxGT(" Akcel"); - LSTR MSG_AMAX_K = _UxGT("Max ") STR_K _UxGT(" Akcel"); - LSTR MSG_AMAX_E = _UxGT("Max ") STR_E _UxGT(" Akcel"); + LSTR MSG_AMAX_N = _UxGT("Max @ Akcel"); + LSTR MSG_AMAX_E = _UxGT("Max E Akcel"); LSTR MSG_AMAX_EN = _UxGT("Max * Akcel"); LSTR MSG_A_RETRACT = _UxGT("A-retrakt"); LSTR MSG_A_TRAVEL = _UxGT("A-přejezd"); @@ -300,9 +294,7 @@ namespace Language_cz { LSTR MSG_A_STEPS = STR_A _UxGT(" kroků/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" kroků/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" kroků/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" kroků/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" kroků/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" kroků/mm"); + LSTR MSG_N_STEPS = _UxGT("@ kroků/mm"); LSTR MSG_E_STEPS = _UxGT("E kroků/mm"); LSTR MSG_EN_STEPS = _UxGT("* kroků/mm"); LSTR MSG_TEMPERATURE = _UxGT("Teplota"); @@ -407,6 +399,7 @@ namespace Language_cz { LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Babystep Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Celkem"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop abort"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Chyba zahřívání"); @@ -482,13 +475,7 @@ namespace Language_cz { LSTR MSG_INFO_MAX_TEMP = _UxGT("Teplota max"); LSTR MSG_INFO_PSU = _UxGT("Nap. zdroj"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Buzení motorů"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Motor %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Motor %"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("DAC uložit EEPROM"); LSTR MSG_ERROR_TMC = _UxGT("TMC CHYBA SPOJENÍ"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("VÝMĚNA FILAMENTU"); diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index 01281db268..05474744d0 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -74,7 +74,7 @@ namespace Language_da { LSTR MSG_MOVE_X = _UxGT("Flyt X"); LSTR MSG_MOVE_Y = _UxGT("Flyt Y"); LSTR MSG_MOVE_Z = _UxGT("Flyt Z"); - LSTR MSG_MOVE_N_MM = _UxGT("Flyt %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Flyt $mm"); LSTR MSG_MOVE_01MM = _UxGT("Flyt 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Flyt 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Flyt 10mm"); @@ -172,13 +172,7 @@ namespace Language_da { LSTR MSG_INFO_PSU = _UxGT("Strømfors."); LSTR MSG_DRIVE_STRENGTH = _UxGT("Driv Styrke"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Driv %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Driv %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Driv %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Driv %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Driv %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Driv %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Driv %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Driv %"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Skriv"); diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 111608dd46..2b22319361 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -84,12 +84,6 @@ namespace Language_de { LSTR MSG_HOME_OFFSET_X = _UxGT("Homeversatz X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Homeversatz Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Homeversatz Z"); - LSTR MSG_HOME_OFFSET_I = _UxGT("Homeversatz ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Homeversatz ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Homeversatz ") STR_K; - LSTR MSG_HOME_OFFSET_U = _UxGT("Homeversatz ") STR_U; - LSTR MSG_HOME_OFFSET_V = _UxGT("Homeversatz ") STR_V; - LSTR MSG_HOME_OFFSET_W = _UxGT("Homeversatz ") STR_W; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Homeversatz aktiv"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Tramming Assistent"); LSTR MSG_SELECT_ORIGIN = _UxGT("Wählen Sie Ursprung"); @@ -273,13 +267,11 @@ namespace Language_de { LSTR MSG_MOVE_X = _UxGT("Bewege X"); LSTR MSG_MOVE_Y = _UxGT("Bewege Y"); LSTR MSG_MOVE_Z = _UxGT("Bewege Z"); - LSTR MSG_MOVE_I = _UxGT("Bewege ") STR_I; - LSTR MSG_MOVE_J = _UxGT("Bewege ") STR_J; - LSTR MSG_MOVE_K = _UxGT("Bewege ") STR_K; + LSTR MSG_MOVE_N = _UxGT("Bewege @"); LSTR MSG_MOVE_E = _UxGT("Bewege Extruder"); LSTR MSG_MOVE_EN = _UxGT("Bewege Extruder *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Hotend zu kalt"); - LSTR MSG_MOVE_N_MM = _UxGT(" %s mm"); + LSTR MSG_MOVE_N_MM = _UxGT(" $ mm"); LSTR MSG_MOVE_01MM = _UxGT(" 0,1 mm"); LSTR MSG_MOVE_1MM = _UxGT(" 1,0 mm"); LSTR MSG_MOVE_10MM = _UxGT(" 10,0 mm"); @@ -289,12 +281,6 @@ namespace Language_de { LSTR MSG_MOVE_01IN = _UxGT("0.100 in"); LSTR MSG_MOVE_1IN = _UxGT("1.000 in"); LSTR MSG_SPEED = _UxGT("Geschw."); - LSTR MSG_MAXSPEED = _UxGT("Max Geschw. (mm/s)"); - LSTR MSG_MAXSPEED_X = _UxGT("Max ") STR_A _UxGT(" Geschw."); - LSTR MSG_MAXSPEED_Y = _UxGT("Max ") STR_B _UxGT(" Geschw."); - LSTR MSG_MAXSPEED_Z = _UxGT("Max ") STR_C _UxGT(" Geschw."); - LSTR MSG_MAXSPEED_E = _UxGT("Max ") STR_E _UxGT(" Geschw."); - LSTR MSG_MAXSPEED_A = _UxGT("Max @ Geschw."); LSTR MSG_BED_Z = _UxGT("Bett Z"); LSTR MSG_NOZZLE = _UxGT("Düse"); LSTR MSG_NOZZLE_N = _UxGT("Düse ~"); @@ -347,19 +333,15 @@ namespace Language_de { LSTR MSG_VA_JERK = _UxGT("Max ") STR_A _UxGT(" Jerk"); LSTR MSG_VB_JERK = _UxGT("Max ") STR_B _UxGT(" Jerk"); LSTR MSG_VC_JERK = _UxGT("Max ") STR_C _UxGT(" Jerk"); - LSTR MSG_VI_JERK = _UxGT("Max ") STR_I _UxGT(" Jerk"); - LSTR MSG_VJ_JERK = _UxGT("Max ") STR_J _UxGT(" Jerk"); - LSTR MSG_VK_JERK = _UxGT("Max ") STR_K _UxGT(" Jerk"); + LSTR MSG_VN_JERK = _UxGT("Max @ Jerk"); LSTR MSG_VE_JERK = _UxGT("Max E Jerk"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Junction Dev"); - LSTR MSG_VELOCITY = _UxGT("Geschwindigkeit"); + LSTR MSG_MAX_SPEED = _UxGT("Max Geschw. (mm/s)"); LSTR MSG_VMAX_A = _UxGT("V max ") STR_A; LSTR MSG_VMAX_B = _UxGT("V max ") STR_B; LSTR MSG_VMAX_C = _UxGT("V max ") STR_C; - LSTR MSG_VMAX_I = _UxGT("V max ") STR_I; - LSTR MSG_VMAX_J = _UxGT("V max ") STR_J; - LSTR MSG_VMAX_K = _UxGT("V max ") STR_K; - LSTR MSG_VMAX_E = _UxGT("V max ") STR_E; + LSTR MSG_VMAX_N = _UxGT("V max @"); + LSTR MSG_VMAX_E = _UxGT("V max E"); LSTR MSG_VMAX_EN = _UxGT("V max *"); LSTR MSG_VMIN = _UxGT("V min "); LSTR MSG_VTRAV_MIN = _UxGT("V min Leerfahrt"); @@ -367,10 +349,8 @@ namespace Language_de { LSTR MSG_AMAX_A = _UxGT("A max ") STR_A; LSTR MSG_AMAX_B = _UxGT("A max ") STR_B; LSTR MSG_AMAX_C = _UxGT("A max ") STR_C; - LSTR MSG_AMAX_I = _UxGT("A max ") STR_I; - LSTR MSG_AMAX_J = _UxGT("A max ") STR_J; - LSTR MSG_AMAX_K = _UxGT("A max ") STR_K; - LSTR MSG_AMAX_E = _UxGT("A max ") STR_E; + LSTR MSG_AMAX_N = _UxGT("A max @"); + LSTR MSG_AMAX_E = _UxGT("A max E"); LSTR MSG_AMAX_EN = _UxGT("A max *"); LSTR MSG_A_RETRACT = _UxGT("A Einzug"); LSTR MSG_A_TRAVEL = _UxGT("A Leerfahrt"); @@ -380,10 +360,8 @@ namespace Language_de { LSTR MSG_A_STEPS = STR_A _UxGT(" Steps/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" Steps/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" Steps/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" Steps/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" Steps/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" Steps/mm"); - LSTR MSG_E_STEPS = STR_E _UxGT(" Steps/mm"); + LSTR MSG_N_STEPS = _UxGT("@ Steps/mm"); + LSTR MSG_E_STEPS = _UxGT("E Steps/mm"); LSTR MSG_EN_STEPS = _UxGT("* Steps/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatur"); LSTR MSG_MOTION = _UxGT("Bewegung"); @@ -533,9 +511,7 @@ namespace Language_de { LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Babystep Z"); - LSTR MSG_BABYSTEP_I = _UxGT("Babystep ") STR_I; - LSTR MSG_BABYSTEP_J = _UxGT("Babystep ") STR_J; - LSTR MSG_BABYSTEP_K = _UxGT("Babystep ") STR_K; + LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Abbr. mit Endstopp"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("HEIZEN ERFOLGLOS"); @@ -629,13 +605,7 @@ namespace Language_de { LSTR MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); LSTR MSG_INFO_PSU = _UxGT("Netzteil"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Motorleistung"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Treiber %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Treiber %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Treiber %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Treiber %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Treiber %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Treiber %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Treiber %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Treiber %"); LSTR MSG_ERROR_TMC = _UxGT("TMC Verbindungsfehler"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Werte speichern"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("FILAMENT WECHSEL"); diff --git a/Marlin/src/lcd/language/language_el.h b/Marlin/src/lcd/language/language_el.h index 3705681756..47d6a5b2da 100644 --- a/Marlin/src/lcd/language/language_el.h +++ b/Marlin/src/lcd/language/language_el.h @@ -119,17 +119,13 @@ namespace Language_el { LSTR MSG_VA_JERK = _UxGT("Vαντίδραση ") STR_A; LSTR MSG_VB_JERK = _UxGT("Vαντίδραση ") STR_B; LSTR MSG_VC_JERK = _UxGT("Vαντίδραση ") STR_C; - LSTR MSG_VI_JERK = _UxGT("Vαντίδραση ") STR_I; - LSTR MSG_VJ_JERK = _UxGT("Vαντίδραση ") STR_J; - LSTR MSG_VK_JERK = _UxGT("Vαντίδραση ") STR_K; + LSTR MSG_VN_JERK = _UxGT("Vαντίδραση @"); LSTR MSG_VE_JERK = _UxGT("Vαντίδραση E"); LSTR MSG_VMAX_A = _UxGT("V Μέγιστο") STR_A; LSTR MSG_VMAX_B = _UxGT("V Μέγιστο") STR_B; LSTR MSG_VMAX_C = _UxGT("V Μέγιστο") STR_C; - LSTR MSG_VMAX_I = _UxGT("V Μέγιστο") STR_I; - LSTR MSG_VMAX_J = _UxGT("V Μέγιστο") STR_J; - LSTR MSG_VMAX_K = _UxGT("V Μέγιστο") STR_K; - LSTR MSG_VMAX_E = _UxGT("V Μέγιστο") STR_E; + LSTR MSG_VMAX_N = _UxGT("V Μέγιστο@"); + LSTR MSG_VMAX_E = _UxGT("V ΜέγιστοE"); LSTR MSG_VMAX_EN = _UxGT("V Μέγιστο *"); LSTR MSG_VMIN = _UxGT("V Ελάχιστο"); LSTR MSG_VTRAV_MIN = _UxGT("Vελάχ. μετατόπιση"); @@ -137,10 +133,8 @@ namespace Language_el { LSTR MSG_AMAX_A = _UxGT("Aμεγ ") STR_A; LSTR MSG_AMAX_B = _UxGT("Aμεγ ") STR_B; LSTR MSG_AMAX_C = _UxGT("Aμεγ ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Aμεγ ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Aμεγ ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Aμεγ ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Aμεγ ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Aμεγ @"); + LSTR MSG_AMAX_E = _UxGT("Aμεγ E"); LSTR MSG_AMAX_EN = _UxGT("Aμεγ *"); LSTR MSG_A_RETRACT = _UxGT("Α-ανάσυρση"); LSTR MSG_A_TRAVEL = _UxGT("Α-μετατόπιση"); @@ -148,9 +142,7 @@ namespace Language_el { LSTR MSG_A_STEPS = _UxGT("Bήματα ") STR_A _UxGT(" ανά μμ"); LSTR MSG_B_STEPS = _UxGT("Bήματα ") STR_B _UxGT(" ανά μμ"); LSTR MSG_C_STEPS = _UxGT("Bήματα ") STR_C _UxGT(" ανά μμ"); - LSTR MSG_I_STEPS = _UxGT("Bήματα ") STR_I _UxGT(" ανά μμ"); - LSTR MSG_J_STEPS = _UxGT("Bήματα ") STR_J _UxGT(" ανά μμ"); - LSTR MSG_K_STEPS = _UxGT("Bήματα ") STR_K _UxGT(" ανά μμ"); + LSTR MSG_N_STEPS = _UxGT("Bήματα @ ανά μμ"); LSTR MSG_E_STEPS = _UxGT("Bήματα Ε ανά μμ"); LSTR MSG_EN_STEPS = _UxGT("Bήματα * ανά μμ"); LSTR MSG_TEMPERATURE = _UxGT("Θερμοκρασία"); diff --git a/Marlin/src/lcd/language/language_el_gr.h b/Marlin/src/lcd/language/language_el_gr.h index b13893fb4c..bd2e7d595d 100644 --- a/Marlin/src/lcd/language/language_el_gr.h +++ b/Marlin/src/lcd/language/language_el_gr.h @@ -109,17 +109,13 @@ namespace Language_el_gr { LSTR MSG_VA_JERK = _UxGT("Vαντίδραση ") STR_A; LSTR MSG_VB_JERK = _UxGT("Vαντίδραση ") STR_B; LSTR MSG_VC_JERK = _UxGT("Vαντίδραση ") STR_C; - LSTR MSG_VI_JERK = _UxGT("Vαντίδραση ") STR_I; - LSTR MSG_VJ_JERK = _UxGT("Vαντίδραση ") STR_J; - LSTR MSG_VK_JERK = _UxGT("Vαντίδραση ") STR_K; + LSTR MSG_VN_JERK = _UxGT("Vαντίδραση @"); LSTR MSG_VE_JERK = _UxGT("Vαντίδραση E"); LSTR MSG_VMAX_A = _UxGT("Vμεγ ") STR_A; LSTR MSG_VMAX_B = _UxGT("Vμεγ ") STR_B; LSTR MSG_VMAX_C = _UxGT("Vμεγ ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Vμεγ ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Vμεγ ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Vμεγ ") STR_K; - LSTR MSG_VMAX_E = _UxGT("Vμεγ ") STR_E; + LSTR MSG_VMAX_N = _UxGT("Vμεγ @"); + LSTR MSG_VMAX_E = _UxGT("Vμεγ E"); LSTR MSG_VMAX_EN = _UxGT("Vμεγ *"); LSTR MSG_VMIN = _UxGT("Vελαχ"); LSTR MSG_VTRAV_MIN = _UxGT("Vελάχ. μετατόπιση"); @@ -127,10 +123,8 @@ namespace Language_el_gr { LSTR MSG_AMAX_A = _UxGT("Aμεγ ") STR_A; LSTR MSG_AMAX_B = _UxGT("Aμεγ ") STR_B; LSTR MSG_AMAX_C = _UxGT("Aμεγ ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Aμεγ ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Aμεγ ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Aμεγ ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Aμεγ ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Aμεγ @"); + LSTR MSG_AMAX_E = _UxGT("Aμεγ E"); LSTR MSG_AMAX_EN = _UxGT("Aμεγ *"); LSTR MSG_A_RETRACT = _UxGT("Α-ανάσυρση"); LSTR MSG_A_TRAVEL = _UxGT("Α-μετατόπιση"); @@ -138,9 +132,7 @@ namespace Language_el_gr { LSTR MSG_A_STEPS = _UxGT("Bήματα ") STR_A _UxGT(" ανά μμ"); LSTR MSG_B_STEPS = _UxGT("Bήματα ") STR_B _UxGT(" ανά μμ"); LSTR MSG_C_STEPS = _UxGT("Bήματα ") STR_C _UxGT(" ανά μμ"); - LSTR MSG_I_STEPS = _UxGT("Bήματα ") STR_I _UxGT(" ανά μμ"); - LSTR MSG_J_STEPS = _UxGT("Bήματα ") STR_J _UxGT(" ανά μμ"); - LSTR MSG_K_STEPS = _UxGT("Bήματα ") STR_K _UxGT(" ανά μμ"); + LSTR MSG_N_STEPS = _UxGT("Bήματα @ ανά μμ"); LSTR MSG_E_STEPS = _UxGT("Bήματα Ε ανά μμ"); LSTR MSG_EN_STEPS = _UxGT("Bήματα * ανά μμ"); LSTR MSG_TEMPERATURE = _UxGT("Θερμοκρασία"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 93ef1b5a71..81f30b61d8 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -27,10 +27,9 @@ * LCD Menu Messages * See also https://marlinfw.org/docs/development/lcd_language.html * - * Substitutions are applied for the following characters when used - * in menu items that call lcd_put_u8str_ind_P with an index: + * Substitutions are applied for the following characters when used in menu items titles: * - * $ displays an inserted C-string + * $ displays an inserted string * = displays '0'....'10' for indexes 0 - 10 * ~ displays '1'....'11' for indexes 0 - 10 * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) @@ -106,12 +105,6 @@ namespace Language_en { LSTR MSG_HOME_OFFSET_X = _UxGT("Home Offset X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Home Offset Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Home Offset Z"); - LSTR MSG_HOME_OFFSET_I = _UxGT("Home Offset ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Home Offset ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Home Offset ") STR_K; - LSTR MSG_HOME_OFFSET_U = _UxGT("Home Offset ") STR_U; - LSTR MSG_HOME_OFFSET_V = _UxGT("Home Offset ") STR_V; - LSTR MSG_HOME_OFFSET_W = _UxGT("Home Offset ") STR_W; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets Applied"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Tramming Wizard"); LSTR MSG_SELECT_ORIGIN = _UxGT("Select Origin"); @@ -314,16 +307,11 @@ namespace Language_en { LSTR MSG_MOVE_X = _UxGT("Move X"); // Used by draw_edit_screen LSTR MSG_MOVE_Y = _UxGT("Move Y"); LSTR MSG_MOVE_Z = _UxGT("Move Z"); - LSTR MSG_MOVE_I = _UxGT("Move ") STR_I; - LSTR MSG_MOVE_J = _UxGT("Move ") STR_J; - LSTR MSG_MOVE_K = _UxGT("Move ") STR_K; - LSTR MSG_MOVE_U = _UxGT("Move ") STR_U; - LSTR MSG_MOVE_V = _UxGT("Move ") STR_V; - LSTR MSG_MOVE_W = _UxGT("Move ") STR_W; + LSTR MSG_MOVE_N = _UxGT("Move @"); LSTR MSG_MOVE_E = _UxGT("Move Extruder"); LSTR MSG_MOVE_EN = _UxGT("Move E*"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Hotend too cold"); - LSTR MSG_MOVE_N_MM = _UxGT("Move %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Move $mm"); LSTR MSG_MOVE_01MM = _UxGT("Move 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Move 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Move 10mm"); @@ -333,12 +321,6 @@ namespace Language_en { LSTR MSG_MOVE_01IN = _UxGT("Move 0.1in"); LSTR MSG_MOVE_1IN = _UxGT("Move 1.0in"); LSTR MSG_SPEED = _UxGT("Speed"); - LSTR MSG_MAXSPEED = _UxGT("Max Speed (mm/s)"); - LSTR MSG_MAXSPEED_X = _UxGT("Max ") STR_A _UxGT(" Speed"); - LSTR MSG_MAXSPEED_Y = _UxGT("Max ") STR_B _UxGT(" Speed"); - LSTR MSG_MAXSPEED_Z = _UxGT("Max ") STR_C _UxGT(" Speed"); - LSTR MSG_MAXSPEED_E = _UxGT("Max ") STR_E _UxGT(" Speed"); - LSTR MSG_MAXSPEED_A = _UxGT("Max @ Speed"); LSTR MSG_BED_Z = _UxGT("Bed Z"); LSTR MSG_NOZZLE = _UxGT("Nozzle"); LSTR MSG_NOZZLE_N = _UxGT("Nozzle ~"); @@ -395,39 +377,24 @@ namespace Language_en { LSTR MSG_VA_JERK = _UxGT("Max ") STR_A _UxGT(" Jerk"); LSTR MSG_VB_JERK = _UxGT("Max ") STR_B _UxGT(" Jerk"); LSTR MSG_VC_JERK = _UxGT("Max ") STR_C _UxGT(" Jerk"); - LSTR MSG_VI_JERK = _UxGT("Max ") STR_I _UxGT(" Jerk"); - LSTR MSG_VJ_JERK = _UxGT("Max ") STR_J _UxGT(" Jerk"); - LSTR MSG_VK_JERK = _UxGT("Max ") STR_K _UxGT(" Jerk"); - LSTR MSG_VU_JERK = _UxGT("Max ") STR_U _UxGT(" Jerk"); - LSTR MSG_VV_JERK = _UxGT("Max ") STR_V _UxGT(" Jerk"); - LSTR MSG_VW_JERK = _UxGT("Max ") STR_W _UxGT(" Jerk"); + LSTR MSG_VN_JERK = _UxGT("Max @ Jerk"); LSTR MSG_VE_JERK = _UxGT("Max E Jerk"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Junction Dev"); - LSTR MSG_VELOCITY = _UxGT("Velocity"); - LSTR MSG_VMAX_A = _UxGT("Max ") STR_A _UxGT(" Vel"); - LSTR MSG_VMAX_B = _UxGT("Max ") STR_B _UxGT(" Vel"); - LSTR MSG_VMAX_C = _UxGT("Max ") STR_C _UxGT(" Vel"); - LSTR MSG_VMAX_I = _UxGT("Max ") STR_I _UxGT(" Vel"); - LSTR MSG_VMAX_J = _UxGT("Max ") STR_J _UxGT(" Vel"); - LSTR MSG_VMAX_K = _UxGT("Max ") STR_K _UxGT(" Vel"); - LSTR MSG_VMAX_U = _UxGT("Max ") STR_U _UxGT(" Vel"); - LSTR MSG_VMAX_V = _UxGT("Max ") STR_V _UxGT(" Vel"); - LSTR MSG_VMAX_W = _UxGT("Max ") STR_W _UxGT(" Vel"); - LSTR MSG_VMAX_E = _UxGT("Max ") STR_E _UxGT(" Vel"); - LSTR MSG_VMAX_EN = _UxGT("Max * Vel"); + LSTR MSG_MAX_SPEED = _UxGT("Max Speed (mm/s)"); + LSTR MSG_VMAX_A = _UxGT("Max ") STR_A _UxGT(" Speed"); + LSTR MSG_VMAX_B = _UxGT("Max ") STR_B _UxGT(" Speed"); + LSTR MSG_VMAX_C = _UxGT("Max ") STR_C _UxGT(" Speed"); + LSTR MSG_VMAX_N = _UxGT("Max @ Speed"); + LSTR MSG_VMAX_E = _UxGT("Max E Speed"); + LSTR MSG_VMAX_EN = _UxGT("Max * Speed"); LSTR MSG_VMIN = _UxGT("Min Velocity"); - LSTR MSG_VTRAV_MIN = _UxGT("Min Travel Vel"); + LSTR MSG_VTRAV_MIN = _UxGT("Min Travel Speed"); LSTR MSG_ACCELERATION = _UxGT("Acceleration"); LSTR MSG_AMAX_A = _UxGT("Max ") STR_A _UxGT(" Accel"); LSTR MSG_AMAX_B = _UxGT("Max ") STR_B _UxGT(" Accel"); LSTR MSG_AMAX_C = _UxGT("Max ") STR_C _UxGT(" Accel"); - LSTR MSG_AMAX_I = _UxGT("Max ") STR_I _UxGT(" Accel"); - LSTR MSG_AMAX_J = _UxGT("Max ") STR_J _UxGT(" Accel"); - LSTR MSG_AMAX_K = _UxGT("Max ") STR_K _UxGT(" Accel"); - LSTR MSG_AMAX_U = _UxGT("Max ") STR_U _UxGT(" Accel"); - LSTR MSG_AMAX_V = _UxGT("Max ") STR_V _UxGT(" Accel"); - LSTR MSG_AMAX_W = _UxGT("Max ") STR_W _UxGT(" Accel"); - LSTR MSG_AMAX_E = _UxGT("Max ") STR_E _UxGT(" Accel"); + LSTR MSG_AMAX_N = _UxGT("Max @ Accel"); + LSTR MSG_AMAX_E = _UxGT("Max E Accel"); LSTR MSG_AMAX_EN = _UxGT("Max * Accel"); LSTR MSG_A_RETRACT = _UxGT("Retract Accel"); LSTR MSG_A_TRAVEL = _UxGT("Travel Accel"); @@ -437,12 +404,7 @@ namespace Language_en { LSTR MSG_A_STEPS = STR_A _UxGT(" Steps/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" Steps/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" Steps/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" Steps/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" Steps/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" Steps/mm"); - LSTR MSG_U_STEPS = STR_U _UxGT(" Steps/mm"); - LSTR MSG_V_STEPS = STR_V _UxGT(" Steps/mm"); - LSTR MSG_W_STEPS = STR_W _UxGT(" Steps/mm"); + LSTR MSG_N_STEPS = _UxGT("@ steps/mm"); LSTR MSG_E_STEPS = _UxGT("E steps/mm"); LSTR MSG_EN_STEPS = _UxGT("* Steps/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperature"); @@ -605,12 +567,7 @@ namespace Language_en { LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Babystep Z"); - LSTR MSG_BABYSTEP_I = _UxGT("Babystep ") STR_I; - LSTR MSG_BABYSTEP_J = _UxGT("Babystep ") STR_J; - LSTR MSG_BABYSTEP_K = _UxGT("Babystep ") STR_K; - LSTR MSG_BABYSTEP_U = _UxGT("Babystep ") STR_U; - LSTR MSG_BABYSTEP_V = _UxGT("Babystep ") STR_V; - LSTR MSG_BABYSTEP_W = _UxGT("Babystep ") STR_W; + LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop Abort"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Heating Failed"); @@ -707,16 +664,7 @@ namespace Language_en { LSTR MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); LSTR MSG_INFO_PSU = _UxGT("PSU"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Drive Strength"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_U = STR_U _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_V = STR_V _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_W = STR_W _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Driver %"); LSTR MSG_ERROR_TMC = _UxGT("TMC CONNECTION ERROR"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Write"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("FILAMENT CHANGE"); @@ -889,15 +837,7 @@ namespace Language_en { LSTR MSG_PID_C_E = _UxGT("PID-C *"); LSTR MSG_PID_F = _UxGT("PID-F"); LSTR MSG_PID_F_E = _UxGT("PID-F *"); - LSTR MSG_BACKLASH_A = STR_A; - LSTR MSG_BACKLASH_B = STR_B; - LSTR MSG_BACKLASH_C = STR_C; - LSTR MSG_BACKLASH_I = STR_I; - LSTR MSG_BACKLASH_J = STR_J; - LSTR MSG_BACKLASH_K = STR_K; - LSTR MSG_BACKLASH_U = STR_U; - LSTR MSG_BACKLASH_V = STR_V; - LSTR MSG_BACKLASH_W = STR_W; + LSTR MSG_BACKLASH_N = _UxGT("@"); } #if FAN_COUNT == 1 diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index 4eb7c9f7e1..cc331efd45 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -229,7 +229,7 @@ namespace Language_es { LSTR MSG_MOVE_E = _UxGT("Extrusor"); LSTR MSG_MOVE_EN = _UxGT("Extrusor *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Hotend muy frio"); - LSTR MSG_MOVE_N_MM = _UxGT("Mover %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Mover $mm"); LSTR MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Mover 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Mover 10mm"); @@ -270,30 +270,24 @@ namespace Language_es { LSTR MSG_VA_JERK = _UxGT("Max ") STR_A _UxGT(" Jerk"); LSTR MSG_VB_JERK = _UxGT("Max ") STR_B _UxGT(" Jerk"); LSTR MSG_VC_JERK = _UxGT("Max ") STR_C _UxGT(" Jerk"); - LSTR MSG_VI_JERK = _UxGT("Max ") STR_I _UxGT(" Jerk"); - LSTR MSG_VJ_JERK = _UxGT("Max ") STR_J _UxGT(" Jerk"); - LSTR MSG_VK_JERK = _UxGT("Max ") STR_K _UxGT(" Jerk"); + LSTR MSG_VN_JERK = _UxGT("Max @ Jerk"); LSTR MSG_VE_JERK = _UxGT("Max E Jerk"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Desvi. Unión"); - LSTR MSG_VELOCITY = _UxGT("Velocidad"); - LSTR MSG_VMAX_A = _UxGT("Max ") STR_A _UxGT(" Vel"); - LSTR MSG_VMAX_B = _UxGT("Max ") STR_B _UxGT(" Vel"); - LSTR MSG_VMAX_C = _UxGT("Max ") STR_C _UxGT(" Vel"); - LSTR MSG_VMAX_I = _UxGT("Max ") STR_I _UxGT(" Vel"); - LSTR MSG_VMAX_J = _UxGT("Max ") STR_J _UxGT(" Vel"); - LSTR MSG_VMAX_K = _UxGT("Max ") STR_K _UxGT(" Vel"); - LSTR MSG_VMAX_E = _UxGT("Max ") STR_E _UxGT(" Vel"); - LSTR MSG_VMAX_EN = _UxGT("Max * Vel"); + LSTR MSG_MAX_SPEED = _UxGT("Max Velocidad"); + LSTR MSG_VMAX_A = _UxGT("Max ") STR_A _UxGT(" Speed"); + LSTR MSG_VMAX_B = _UxGT("Max ") STR_B _UxGT(" Speed"); + LSTR MSG_VMAX_C = _UxGT("Max ") STR_C _UxGT(" Speed"); + LSTR MSG_VMAX_N = _UxGT("Max @ Speed"); + LSTR MSG_VMAX_E = _UxGT("Max E Speed"); + LSTR MSG_VMAX_EN = _UxGT("Max * Speed"); LSTR MSG_VMIN = _UxGT("Vmin"); LSTR MSG_VTRAV_MIN = _UxGT("Vel. viaje min"); LSTR MSG_ACCELERATION = _UxGT("Acceleración"); LSTR MSG_AMAX_A = _UxGT("Acel. max") STR_A; LSTR MSG_AMAX_B = _UxGT("Acel. max") STR_B; LSTR MSG_AMAX_C = _UxGT("Acel. max") STR_C; - LSTR MSG_AMAX_I = _UxGT("Acel. max") STR_I; - LSTR MSG_AMAX_J = _UxGT("Acel. max") STR_J; - LSTR MSG_AMAX_K = _UxGT("Acel. max") STR_K; - LSTR MSG_AMAX_E = _UxGT("Acel. max") STR_E; + LSTR MSG_AMAX_N = _UxGT("Acel. max@"); + LSTR MSG_AMAX_E = _UxGT("Acel. maxE"); LSTR MSG_AMAX_EN = _UxGT("Acel. max *"); LSTR MSG_A_RETRACT = _UxGT("Acel. retrac."); LSTR MSG_A_TRAVEL = _UxGT("Acel. Viaje"); @@ -301,9 +295,7 @@ namespace Language_es { LSTR MSG_A_STEPS = STR_A _UxGT(" pasos/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" pasos/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" pasos/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" pasos/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" pasos/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" pasos/mm"); + LSTR MSG_N_STEPS = _UxGT("@ pasos/mm"); LSTR MSG_E_STEPS = _UxGT("E pasos/mm"); LSTR MSG_EN_STEPS = _UxGT("* pasos/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatura"); @@ -413,6 +405,7 @@ namespace Language_es { LSTR MSG_BABYSTEP_X = _UxGT("Micropaso X"); LSTR MSG_BABYSTEP_Y = _UxGT("Micropaso Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Micropaso Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Micropaso @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Cancelado - Endstop"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Calent. fallido"); @@ -480,13 +473,7 @@ namespace Language_es { LSTR MSG_INFO_MAX_TEMP = _UxGT("Temp. Máxima"); LSTR MSG_INFO_PSU = _UxGT("F. Aliment."); LSTR MSG_DRIVE_STRENGTH = _UxGT("Fuerza de empuje"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Driver %"); LSTR MSG_ERROR_TMC = _UxGT("ERROR CONEX. TMC"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Escribe DAC EEPROM"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("CAMBIAR FILAMENTO"); diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index 2d84518f0b..09a0fbeb6a 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -138,7 +138,7 @@ namespace Language_eu { LSTR MSG_MOVE_Z = _UxGT("Mugitu Z"); LSTR MSG_MOVE_E = _UxGT("Estrusorea"); LSTR MSG_MOVE_EN = _UxGT("Estrusorea *"); - LSTR MSG_MOVE_N_MM = _UxGT("Mugitu %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Mugitu $mm"); LSTR MSG_MOVE_01MM = _UxGT("Mugitu 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Mugitu 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Mugitu 10mm"); @@ -166,9 +166,7 @@ namespace Language_eu { LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT("-astindua"); LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT("-astindua"); LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT("-astindua"); - LSTR MSG_VI_JERK = _UxGT("V") STR_I _UxGT("-astindua"); - LSTR MSG_VJ_JERK = _UxGT("V") STR_J _UxGT("-astindua"); - LSTR MSG_VK_JERK = _UxGT("V") STR_K _UxGT("-astindua"); + LSTR MSG_VN_JERK = _UxGT("V@-astindua"); LSTR MSG_VE_JERK = _UxGT("Ve-astindua"); LSTR MSG_VTRAV_MIN = _UxGT("VBidaia min"); LSTR MSG_A_RETRACT = _UxGT("A-retrakt"); @@ -177,9 +175,7 @@ namespace Language_eu { LSTR MSG_A_STEPS = STR_A _UxGT(" pausoak/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" pausoak/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" pausoak/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" pausoak/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" pausoak/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" pausoak/mm"); + LSTR MSG_N_STEPS = _UxGT("@ pausoak/mm"); LSTR MSG_E_STEPS = _UxGT("E pausoak/mm"); LSTR MSG_EN_STEPS = _UxGT("* pausoak/mm"); LSTR MSG_TEMPERATURE = _UxGT("Tenperatura"); @@ -243,6 +239,7 @@ namespace Language_eu { LSTR MSG_BABYSTEP_X = _UxGT("Mikro-urratsa X"); LSTR MSG_BABYSTEP_Y = _UxGT("Mikro-urratsa Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Mikro-urratsa Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Mikro-urratsa @"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop deusezta."); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Err: Beroketa"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: Tenperatura"); @@ -296,13 +293,7 @@ namespace Language_eu { LSTR MSG_INFO_MAX_TEMP = _UxGT("Tenp. Maximoa"); LSTR MSG_INFO_PSU = _UxGT("Elikadura-iturria"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Driver-aren potentzia"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Driver %"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Idatzi DAC EEPROM"); LSTR MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("HARIZPIA ALDATU"); LSTR MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("HARIZPIA KARGATU"); diff --git a/Marlin/src/lcd/language/language_fi.h b/Marlin/src/lcd/language/language_fi.h index 066179c950..8fd53a79e3 100644 --- a/Marlin/src/lcd/language/language_fi.h +++ b/Marlin/src/lcd/language/language_fi.h @@ -71,7 +71,7 @@ namespace Language_fi { LSTR MSG_MOVE_Z = _UxGT("Liikuta Z"); LSTR MSG_MOVE_E = _UxGT("Extruder"); LSTR MSG_MOVE_EN = _UxGT("Extruder *"); - LSTR MSG_MOVE_N_MM = _UxGT("Liikuta %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Liikuta $mm"); LSTR MSG_MOVE_01MM = _UxGT("Liikuta 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Liikuta 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Liikuta 10mm"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index f3ea9b5e3b..6081234607 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -72,9 +72,6 @@ namespace Language_fr { LSTR MSG_HOME_OFFSET_X = _UxGT("Décal. origine X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Décal. origine Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Décal. origine Z"); - LSTR MSG_HOME_OFFSET_I = _UxGT("Décal. origine ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Décal. origine ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Décal. origine ") STR_K; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Décalages appliqués"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Assistant Molettes"); LSTR MSG_SELECT_ORIGIN = _UxGT("Molette du lit"); // Not a selection of the origin @@ -233,13 +230,11 @@ namespace Language_fr { LSTR MSG_MOVE_X = _UxGT("Déplacer X"); LSTR MSG_MOVE_Y = _UxGT("Déplacer Y"); LSTR MSG_MOVE_Z = _UxGT("Déplacer Z"); - LSTR MSG_MOVE_I = _UxGT("Déplacer ") STR_I; - LSTR MSG_MOVE_J = _UxGT("Déplacer ") STR_J; - LSTR MSG_MOVE_K = _UxGT("Déplacer ") STR_K; + LSTR MSG_MOVE_N = _UxGT("Déplacer @"); LSTR MSG_MOVE_E = _UxGT("Extruder"); LSTR MSG_MOVE_EN = _UxGT("Extruder *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Buse trop froide"); - LSTR MSG_MOVE_N_MM = _UxGT("Déplacer %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Déplacer $mm"); LSTR MSG_MOVE_01MM = _UxGT("Déplacer 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Déplacer 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Déplacer 10mm"); @@ -282,18 +277,14 @@ namespace Language_fr { LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT(" jerk"); LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT(" jerk"); LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT(" jerk"); - LSTR MSG_VI_JERK = _UxGT("V") STR_I _UxGT(" jerk"); - LSTR MSG_VJ_JERK = _UxGT("V") STR_J _UxGT(" jerk"); - LSTR MSG_VK_JERK = _UxGT("V") STR_K _UxGT(" jerk"); + LSTR MSG_VN_JERK = _UxGT("V@ jerk"); LSTR MSG_VE_JERK = _UxGT("Ve jerk"); - LSTR MSG_VELOCITY = _UxGT("Vélocité"); + LSTR MSG_MAX_SPEED = _UxGT("Max Vélocité"); LSTR MSG_VMAX_A = _UxGT("Vit. Max ") STR_A; LSTR MSG_VMAX_B = _UxGT("Vit. Max ") STR_B; LSTR MSG_VMAX_C = _UxGT("Vit. Max ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Vit. Max ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Vit. Max ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Vit. Max ") STR_K; - LSTR MSG_VMAX_E = _UxGT("Vit. Max ") STR_E; + LSTR MSG_VMAX_N = _UxGT("Vit. Max @"); + LSTR MSG_VMAX_E = _UxGT("Vit. Max E"); LSTR MSG_VMAX_EN = _UxGT("Vit. Max *"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Déviat. jonct."); LSTR MSG_VMIN = _UxGT("Vit. Min"); @@ -302,10 +293,8 @@ namespace Language_fr { LSTR MSG_AMAX_A = _UxGT("Max Accél. ") STR_A; LSTR MSG_AMAX_B = _UxGT("Max Accél. ") STR_B; LSTR MSG_AMAX_C = _UxGT("Max Accél. ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Max Accél. ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Max Accél. ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Max Accél. ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Max Accél. ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Max Accél. @"); + LSTR MSG_AMAX_E = _UxGT("Max Accél. E"); LSTR MSG_AMAX_EN = _UxGT("Max Accél. *"); LSTR MSG_A_RETRACT = _UxGT("Acc.rétraction"); LSTR MSG_A_TRAVEL = _UxGT("Acc.course"); @@ -315,9 +304,7 @@ namespace Language_fr { LSTR MSG_A_STEPS = STR_A _UxGT(" pas/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" pas/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" pas/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" pas/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" pas/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" pas/mm"); + LSTR MSG_N_STEPS = _UxGT("@ pas/mm"); LSTR MSG_E_STEPS = _UxGT("E pas/mm"); LSTR MSG_EN_STEPS = _UxGT("* pas/mm"); LSTR MSG_TEMPERATURE = _UxGT("Température"); @@ -443,9 +430,7 @@ namespace Language_fr { LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Babystep Z"); - LSTR MSG_BABYSTEP_I = _UxGT("Babystep ") STR_I; - LSTR MSG_BABYSTEP_J = _UxGT("Babystep ") STR_J; - LSTR MSG_BABYSTEP_K = _UxGT("Babystep ") STR_K; + LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Butée abandon"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Err de chauffe"); @@ -521,13 +506,7 @@ namespace Language_fr { LSTR MSG_INFO_MAX_TEMP = _UxGT("Temp Max"); LSTR MSG_INFO_PSU = _UxGT("Alim."); LSTR MSG_DRIVE_STRENGTH = _UxGT("Puiss. moteur "); - LSTR MSG_DAC_PERCENT_A = _UxGT("Driver ") STR_A _UxGT(" %"); - LSTR MSG_DAC_PERCENT_B = _UxGT("Driver ") STR_B _UxGT(" %"); - LSTR MSG_DAC_PERCENT_C = _UxGT("Driver ") STR_C _UxGT(" %"); - LSTR MSG_DAC_PERCENT_I = _UxGT("Driver ") STR_I _UxGT(" %"); - LSTR MSG_DAC_PERCENT_J = _UxGT("Driver ") STR_J _UxGT(" %"); - LSTR MSG_DAC_PERCENT_K = _UxGT("Driver ") STR_K _UxGT(" %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("Driver E %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("Driver @ %"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM sauv."); LSTR MSG_ERROR_TMC = _UxGT("ERREUR CONNEXION TMC"); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index 55dc03ac9d..dabd35efcf 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -226,7 +226,7 @@ namespace Language_gl { LSTR MSG_MOVE_E = _UxGT("Extrusor"); LSTR MSG_MOVE_EN = _UxGT("Extrusor *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Bico moi frío"); - LSTR MSG_MOVE_N_MM = _UxGT("Mover %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Mover $mm"); LSTR MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Mover 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Mover 10mm"); @@ -271,30 +271,23 @@ namespace Language_gl { LSTR MSG_VA_JERK = _UxGT("Max ") STR_A _UxGT(" Jerk"); LSTR MSG_VB_JERK = _UxGT("Max ") STR_B _UxGT(" Jerk"); LSTR MSG_VC_JERK = _UxGT("Max ") STR_C _UxGT(" Jerk"); - LSTR MSG_VI_JERK = _UxGT("Max ") STR_I _UxGT(" Jerk"); - LSTR MSG_VJ_JERK = _UxGT("Max ") STR_J _UxGT(" Jerk"); - LSTR MSG_VK_JERK = _UxGT("Max ") STR_K _UxGT(" Jerk"); + LSTR MSG_VN_JERK = _UxGT("Max @ Jerk"); LSTR MSG_VE_JERK = _UxGT("Max E Jerk"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Desvío Unión"); - LSTR MSG_VELOCITY = _UxGT("Velocidade"); - LSTR MSG_VMAX_A = _UxGT("Max ") STR_A _UxGT(" Vel"); - LSTR MSG_VMAX_B = _UxGT("Max ") STR_B _UxGT(" Vel"); - LSTR MSG_VMAX_C = _UxGT("Max ") STR_C _UxGT(" Vel"); - LSTR MSG_VMAX_I = _UxGT("Max ") STR_I _UxGT(" Vel"); - LSTR MSG_VMAX_J = _UxGT("Max ") STR_J _UxGT(" Vel"); - LSTR MSG_VMAX_K = _UxGT("Max ") STR_K _UxGT(" Vel"); - LSTR MSG_VMAX_E = _UxGT("Max ") STR_E _UxGT(" Vel"); - LSTR MSG_VMAX_EN = _UxGT("Max * Vel"); + LSTR MSG_MAX_SPEED = _UxGT("Max Velocidade"); + LSTR MSG_VMAX_A = _UxGT("Max ") STR_A _UxGT(" Speed"); + LSTR MSG_VMAX_B = _UxGT("Max ") STR_B _UxGT(" Speed"); + LSTR MSG_VMAX_C = _UxGT("Max ") STR_C _UxGT(" Speed"); + LSTR MSG_VMAX_N = _UxGT("Max @ Speed"); + LSTR MSG_VMAX_E = _UxGT("Max E Speed"); + LSTR MSG_VMAX_EN = _UxGT("Max * Speed"); LSTR MSG_VMIN = _UxGT("Vmin"); LSTR MSG_VTRAV_MIN = _UxGT("V-viaxe min"); LSTR MSG_ACCELERATION = _UxGT("Aceleración"); LSTR MSG_AMAX_A = _UxGT("Max ") STR_A _UxGT(" Accel"); LSTR MSG_AMAX_B = _UxGT("Max ") STR_B _UxGT(" Accel"); LSTR MSG_AMAX_C = _UxGT("Max ") STR_C _UxGT(" Accel"); - LSTR MSG_AMAX_I = _UxGT("Max ") STR_I _UxGT(" Accel"); - LSTR MSG_AMAX_J = _UxGT("Max ") STR_J _UxGT(" Accel"); - LSTR MSG_AMAX_K = _UxGT("Max ") STR_K _UxGT(" Accel"); - LSTR MSG_AMAX_E = _UxGT("Max ") STR_E _UxGT(" Accel"); + LSTR MSG_AMAX_E = _UxGT("Max E Accel"); LSTR MSG_AMAX_EN = _UxGT("Max * Accel"); LSTR MSG_A_RETRACT = _UxGT("A-retrac."); LSTR MSG_A_TRAVEL = _UxGT("A-viaxe"); @@ -304,9 +297,7 @@ namespace Language_gl { LSTR MSG_A_STEPS = STR_A _UxGT(" pasos/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" pasos/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" pasos/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" pasos/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" pasos/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" pasos/mm"); + LSTR MSG_N_STEPS = _UxGT("@ pasos/mm"); LSTR MSG_E_STEPS = _UxGT("E pasos/mm"); LSTR MSG_EN_STEPS = _UxGT("* pasos/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatura"); @@ -429,6 +420,7 @@ namespace Language_gl { LSTR MSG_BABYSTEP_X = _UxGT("Micropaso X"); LSTR MSG_BABYSTEP_Y = _UxGT("Micropaso Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Micropaso Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Micropaso @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Erro FinCarro"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Fallo Quentando"); @@ -496,13 +488,7 @@ namespace Language_gl { LSTR MSG_INFO_MAX_TEMP = _UxGT("Temp Máx"); LSTR MSG_INFO_PSU = _UxGT("Fonte Alimentación"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Forza do Motor"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Driver %"); LSTR MSG_ERROR_TMC = _UxGT("ERRO CONEX. TMC"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Escribe DAC EEPROM"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("CAMBIAR FILAMENTO"); diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index 40705bbc91..10f11f616f 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -78,7 +78,7 @@ namespace Language_hr { LSTR MSG_LEVEL_BED = _UxGT("Niveliraj bed"); LSTR MSG_MOVE_X = _UxGT("Miči X"); LSTR MSG_MOVE_Y = _UxGT("Miči Y"); - LSTR MSG_MOVE_N_MM = _UxGT("Miči %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Miči $mm"); LSTR MSG_MOVE_01MM = _UxGT("Miči 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Miči 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Miči 10mm"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index 6321ed1367..81db96df17 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -79,9 +79,6 @@ namespace Language_hu { LSTR MSG_HOME_OFFSET_X = _UxGT("X Kezdö eltol."); LSTR MSG_HOME_OFFSET_Y = _UxGT("Y Kezdö eltol."); LSTR MSG_HOME_OFFSET_Z = _UxGT("Z Kezdö eltol."); - LSTR MSG_HOME_OFFSET_I = _UxGT("Kezdö eltol. ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Kezdö eltol. ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Kezdö eltol. ") STR_K; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Eltolás beállítva."); LSTR MSG_TRAMMING_WIZARD = _UxGT("Elektromos varázsló"); LSTR MSG_SELECT_ORIGIN = _UxGT("Eredeti választása"); @@ -259,13 +256,11 @@ namespace Language_hu { LSTR MSG_MOVE_X = _UxGT("X mozgás"); LSTR MSG_MOVE_Y = _UxGT("Y mozgás"); LSTR MSG_MOVE_Z = _UxGT("Z mozgás"); - LSTR MSG_MOVE_I = _UxGT("Mozgás ") STR_I; - LSTR MSG_MOVE_J = _UxGT("Mozgás ") STR_J; - LSTR MSG_MOVE_K = _UxGT("Mozgás ") STR_K; + LSTR MSG_MOVE_N = _UxGT("@ mozgás"); LSTR MSG_MOVE_E = _UxGT("Adagoló"); LSTR MSG_MOVE_EN = _UxGT("Adagoló *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("A fej túl hideg"); - LSTR MSG_MOVE_N_MM = _UxGT("Mozgás %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Mozgás $mm"); LSTR MSG_MOVE_01MM = _UxGT("Mozgás 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Mozgás 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Mozgás 10mm"); @@ -319,19 +314,15 @@ namespace Language_hu { LSTR MSG_VA_JERK = _UxGT("Seb.") STR_A _UxGT("-Rántás"); LSTR MSG_VB_JERK = _UxGT("Seb.") STR_B _UxGT("-Rántás"); LSTR MSG_VC_JERK = _UxGT("Seb.") STR_C _UxGT("-Rántás"); - LSTR MSG_VI_JERK = _UxGT("Seb.") STR_I _UxGT("-Rántás"); - LSTR MSG_VJ_JERK = _UxGT("Seb.") STR_J _UxGT("-Rántás"); - LSTR MSG_VK_JERK = _UxGT("Seb.") STR_K _UxGT("-Rántás"); + LSTR MSG_VN_JERK = _UxGT("Seb.@-Rántás"); LSTR MSG_VE_JERK = _UxGT("E ránt. seb."); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Csomopont eltérés"); - LSTR MSG_VELOCITY = _UxGT("Sebesség"); + LSTR MSG_MAX_SPEED = _UxGT("Max Sebesség (mm/s)"); LSTR MSG_VMAX_A = _UxGT("Max Seb. ") STR_A; LSTR MSG_VMAX_B = _UxGT("Max Seb. ") STR_B; LSTR MSG_VMAX_C = _UxGT("Max Seb. ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Max Seb. ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Max Seb. ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Max Seb. ") STR_K; - LSTR MSG_VMAX_E = _UxGT("Max Seb. ") STR_E; + LSTR MSG_VMAX_N = _UxGT("Max Seb. @"); + LSTR MSG_VMAX_E = _UxGT("Max Seb. E"); LSTR MSG_VMAX_EN = _UxGT("Max sebesség *"); LSTR MSG_VMIN = _UxGT("Min sebesség"); LSTR MSG_VTRAV_MIN = _UxGT("Min utazó.seb."); @@ -339,10 +330,8 @@ namespace Language_hu { LSTR MSG_AMAX_A = _UxGT("Max gyors. ") STR_A; LSTR MSG_AMAX_B = _UxGT("Max gyors. ") STR_B; LSTR MSG_AMAX_C = _UxGT("Max gyors. ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Max gyors. ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Max gyors. ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Max gyors. ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Max gyors. ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Max gyors. @"); + LSTR MSG_AMAX_E = _UxGT("Max gyors. E"); LSTR MSG_AMAX_EN = _UxGT("Max gyorsulás *"); LSTR MSG_A_RETRACT = _UxGT("Visszahúzás"); LSTR MSG_A_TRAVEL = _UxGT("Utazás"); @@ -352,9 +341,7 @@ namespace Language_hu { LSTR MSG_A_STEPS = STR_A _UxGT(" Lépés/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" Lépés/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" Lépés/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" Lépés/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" Lépés/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" Lépés/mm"); + LSTR MSG_N_STEPS = _UxGT("@ lépés/mm"); LSTR MSG_E_STEPS = _UxGT("E lépés/mm"); LSTR MSG_EN_STEPS = _UxGT("*Lépés/mm"); LSTR MSG_TEMPERATURE = _UxGT("Höfok"); @@ -488,9 +475,7 @@ namespace Language_hu { LSTR MSG_BABYSTEP_X = _UxGT("Mikrolépés X"); LSTR MSG_BABYSTEP_Y = _UxGT("Mikrolépés Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Mikrolépés Z"); - LSTR MSG_BABYSTEP_I = _UxGT("Mikrolépés ") STR_I; - LSTR MSG_BABYSTEP_J = _UxGT("Mikrolépés ") STR_J; - LSTR MSG_BABYSTEP_K = _UxGT("Mikrolépés ") STR_K; + LSTR MSG_BABYSTEP_N = _UxGT("Mikrolépés @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Teljes"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Végállás megszakítva!"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Fütés hiba!"); @@ -568,13 +553,7 @@ namespace Language_hu { LSTR MSG_INFO_MAX_TEMP = _UxGT("Max höfok"); LSTR MSG_INFO_PSU = _UxGT("PSU"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Meghajtási erö"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Meghajtó %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Meghajtó %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Meghajtó %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Meghajtó %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Meghajtó %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Meghajtó %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E meghajtó %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ meghajtó %"); LSTR MSG_ERROR_TMC = _UxGT("TMC CSATLAKOZÁSI HIBA"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM írása"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("NYOMTATÓSZÁL CSERE"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 82c595aa8c..b043ac26e1 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -27,10 +27,9 @@ * LCD Menu Messages * See also https://marlinfw.org/docs/development/lcd_language.html * - * Substitutions are applied for the following characters when used - * in menu items that call lcd_put_u8str_ind_P with an index: + * Substitutions are applied for the following characters when used in menu items titles: * - * $ displays an inserted C-string + * $ displays an inserted string * = displays '0'....'10' for indexes 0 - 10 * ~ displays '1'....'11' for indexes 0 - 10 * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) @@ -95,12 +94,6 @@ namespace Language_it { LSTR MSG_HOME_OFFSET_X = _UxGT("Offset home X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Offset home Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Offset home Z"); - LSTR MSG_HOME_OFFSET_I = _UxGT("Offset home ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Offset home ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Offset home ") STR_K; - LSTR MSG_HOME_OFFSET_U = _UxGT("Offset home ") STR_U; - LSTR MSG_HOME_OFFSET_V = _UxGT("Offset home ") STR_V; - LSTR MSG_HOME_OFFSET_W = _UxGT("Offset home ") STR_W; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offset applicato"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Wizard Tramming"); LSTR MSG_SELECT_ORIGIN = _UxGT("Selez. origine"); @@ -284,16 +277,11 @@ namespace Language_it { LSTR MSG_MOVE_X = _UxGT("Muovi X"); LSTR MSG_MOVE_Y = _UxGT("Muovi Y"); LSTR MSG_MOVE_Z = _UxGT("Muovi Z"); - LSTR MSG_MOVE_I = _UxGT("Muovi ") STR_I; - LSTR MSG_MOVE_J = _UxGT("Muovi ") STR_J; - LSTR MSG_MOVE_K = _UxGT("Muovi ") STR_K; - LSTR MSG_MOVE_U = _UxGT("Muovi ") STR_U; - LSTR MSG_MOVE_V = _UxGT("Muovi ") STR_V; - LSTR MSG_MOVE_W = _UxGT("Muovi ") STR_W; + LSTR MSG_MOVE_N = _UxGT("Muovi @"); LSTR MSG_MOVE_E = _UxGT("Estrusore"); LSTR MSG_MOVE_EN = _UxGT("Estrusore *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Ugello freddo"); - LSTR MSG_MOVE_N_MM = _UxGT("Muovi di %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Muovi di $mm"); LSTR MSG_MOVE_01MM = _UxGT("Muovi di 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Muovi di 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Muovi di 10mm"); @@ -302,13 +290,6 @@ namespace Language_it { LSTR MSG_MOVE_001IN = _UxGT("Muovi di 0.01\""); LSTR MSG_MOVE_01IN = _UxGT("Muovi di 0.1\""); LSTR MSG_MOVE_1IN = _UxGT("Muovi di 1\""); - LSTR MSG_SPEED = _UxGT("Velocità"); - LSTR MSG_MAXSPEED = _UxGT("Vel.massima (mm/s)"); - LSTR MSG_MAXSPEED_X = _UxGT("Vel.massima ") STR_A; - LSTR MSG_MAXSPEED_Y = _UxGT("Vel.massima ") STR_B; - LSTR MSG_MAXSPEED_Z = _UxGT("Vel.massima ") STR_C; - LSTR MSG_MAXSPEED_E = _UxGT("Vel.massima ") STR_E; - LSTR MSG_MAXSPEED_A = _UxGT("Vel.massima @"); LSTR MSG_BED_Z = _UxGT("Piatto Z"); LSTR MSG_NOZZLE = _UxGT("Ugello"); LSTR MSG_NOZZLE_N = _UxGT("Ugello ~"); @@ -361,25 +342,15 @@ namespace Language_it { LSTR MSG_VA_JERK = _UxGT("Max Jerk ") STR_A; LSTR MSG_VB_JERK = _UxGT("Max Jerk ") STR_B; LSTR MSG_VC_JERK = _UxGT("Max Jerk ") STR_C; - LSTR MSG_VI_JERK = _UxGT("Max Jerk ") STR_I; - LSTR MSG_VJ_JERK = _UxGT("Max Jerk ") STR_J; - LSTR MSG_VK_JERK = _UxGT("Max Jerk ") STR_K; - LSTR MSG_VU_JERK = _UxGT("Max Jerk ") STR_U; - LSTR MSG_VV_JERK = _UxGT("Max Jerk ") STR_V; - LSTR MSG_VW_JERK = _UxGT("Max Jerk ") STR_W; + LSTR MSG_VN_JERK = _UxGT("Max Jerk @"); LSTR MSG_VE_JERK = _UxGT("Max Jerk E"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Deviaz. giunzioni"); - LSTR MSG_VELOCITY = _UxGT("Velocità"); + LSTR MSG_MAX_SPEED = _UxGT("Vel.massima (mm/s)"); LSTR MSG_VMAX_A = _UxGT("Vel.Massima ") STR_A; LSTR MSG_VMAX_B = _UxGT("Vel.Massima ") STR_B; LSTR MSG_VMAX_C = _UxGT("Vel.Massima ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Vel.Massima ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Vel.Massima ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Vel.Massima ") STR_K; - LSTR MSG_VMAX_U = _UxGT("Vel.Massima ") STR_U; - LSTR MSG_VMAX_V = _UxGT("Vel.Massima ") STR_V; - LSTR MSG_VMAX_W = _UxGT("Vel.Massima ") STR_W; - LSTR MSG_VMAX_E = _UxGT("Vel.Massima ") STR_E; + LSTR MSG_VMAX_N = _UxGT("Vel.Massima @"); + LSTR MSG_VMAX_E = _UxGT("Vel.Massima E"); LSTR MSG_VMAX_EN = _UxGT("Vel.Massima *"); LSTR MSG_VMIN = _UxGT("Vel.Minima"); LSTR MSG_VTRAV_MIN = _UxGT("Vel.Min spostam."); @@ -387,13 +358,8 @@ namespace Language_it { LSTR MSG_AMAX_A = _UxGT("Acc.Massima ") STR_A; LSTR MSG_AMAX_B = _UxGT("Acc.Massima ") STR_B; LSTR MSG_AMAX_C = _UxGT("Acc.Massima ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Acc.Massima ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Acc.Massima ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Acc.Massima ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Acc.Massima ") STR_E; - LSTR MSG_AMAX_U = _UxGT("Acc.Massima ") STR_U; - LSTR MSG_AMAX_V = _UxGT("Acc.Massima ") STR_V; - LSTR MSG_AMAX_W = _UxGT("Acc.Massima ") STR_W; + LSTR MSG_AMAX_N = _UxGT("Acc.Massima @"); + LSTR MSG_AMAX_E = _UxGT("Acc.Massima E"); LSTR MSG_AMAX_EN = _UxGT("Acc.Massima *"); LSTR MSG_A_RETRACT = _UxGT("A-Ritrazione"); LSTR MSG_A_TRAVEL = _UxGT("A-Spostamento"); @@ -403,12 +369,7 @@ namespace Language_it { LSTR MSG_A_STEPS = STR_A _UxGT(" passi/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" passi/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" passi/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" passi/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" passi/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" passi/mm"); - LSTR MSG_U_STEPS = STR_U _UxGT(" passi/mm"); - LSTR MSG_V_STEPS = STR_V _UxGT(" passi/mm"); - LSTR MSG_W_STEPS = STR_W _UxGT(" passi/mm"); + LSTR MSG_N_STEPS = _UxGT("@ passi/mm"); LSTR MSG_E_STEPS = _UxGT("E passi/mm"); LSTR MSG_EN_STEPS = _UxGT("* passi/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatura"); @@ -560,12 +521,7 @@ namespace Language_it { LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Babystep Z"); - LSTR MSG_BABYSTEP_I = _UxGT("Babystep ") STR_I; - LSTR MSG_BABYSTEP_J = _UxGT("Babystep ") STR_J; - LSTR MSG_BABYSTEP_K = _UxGT("Babystep ") STR_K; - LSTR MSG_BABYSTEP_U = _UxGT("Babystep ") STR_U; - LSTR MSG_BABYSTEP_V = _UxGT("Babystep ") STR_V; - LSTR MSG_BABYSTEP_W = _UxGT("Babystep ") STR_W; + LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Totali"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Interrompi se FC"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Risc.Fallito"); // Max 12 characters @@ -658,16 +614,7 @@ namespace Language_it { LSTR MSG_INFO_MAX_TEMP = _UxGT("Temp max"); LSTR MSG_INFO_PSU = _UxGT("Alimentatore"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Potenza Drive"); - LSTR MSG_DAC_PERCENT_A = _UxGT("Driver ") STR_A _UxGT(" %"); - LSTR MSG_DAC_PERCENT_B = _UxGT("Driver ") STR_B _UxGT(" %"); - LSTR MSG_DAC_PERCENT_C = _UxGT("Driver ") STR_C _UxGT(" %"); - LSTR MSG_DAC_PERCENT_I = _UxGT("Driver ") STR_I _UxGT(" %"); - LSTR MSG_DAC_PERCENT_J = _UxGT("Driver ") STR_J _UxGT(" %"); - LSTR MSG_DAC_PERCENT_K = _UxGT("Driver ") STR_K _UxGT(" %"); - LSTR MSG_DAC_PERCENT_U = _UxGT("Driver ") STR_U _UxGT(" %"); - LSTR MSG_DAC_PERCENT_V = _UxGT("Driver ") STR_V _UxGT(" %"); - LSTR MSG_DAC_PERCENT_W = _UxGT("Driver ") STR_W _UxGT(" %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("Driver E %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("Driver @ %"); LSTR MSG_ERROR_TMC = _UxGT("ERR.CONNESSIONE TMC"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Scrivi DAC EEPROM"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("CAMBIO FILAMENTO"); diff --git a/Marlin/src/lcd/language/language_jp_kana.h b/Marlin/src/lcd/language/language_jp_kana.h index 01d1c0b987..0a53ee50d2 100644 --- a/Marlin/src/lcd/language/language_jp_kana.h +++ b/Marlin/src/lcd/language/language_jp_kana.h @@ -93,7 +93,7 @@ namespace Language_jp_kana { LSTR MSG_MOVE_Y = _UxGT("Yジク イドウ"); // "Move Y" LSTR MSG_MOVE_Z = _UxGT("Zジク イドウ"); // "Move Z" LSTR MSG_MOVE_E = _UxGT("エクストルーダー"); // "Extruder" - LSTR MSG_MOVE_N_MM = _UxGT("%smm イドウ"); // "Move 0.025mm" + LSTR MSG_MOVE_N_MM = _UxGT("$mm イドウ"); // "Move 0.025mm" LSTR MSG_MOVE_01MM = _UxGT("0.1mm イドウ"); // "Move 0.1mm" LSTR MSG_MOVE_1MM = _UxGT(" 1mm イドウ"); // "Move 1mm" LSTR MSG_MOVE_10MM = _UxGT(" 10mm イドウ"); // "Move 10mm" @@ -118,20 +118,16 @@ namespace Language_jp_kana { LSTR MSG_VA_JERK = _UxGT("ジク ヤクドウ mm/s") STR_A; // "Va-jerk" LSTR MSG_VB_JERK = _UxGT("ジク ヤクドウ mm/s") STR_B; // "Vb-jerk" LSTR MSG_VC_JERK = _UxGT("ジク ヤクドウ mm/s") STR_C; // "Vc-jerk" - LSTR MSG_VI_JERK = _UxGT("ジク ヤクドウ mm/s") STR_I; // "Va-jerk" - LSTR MSG_VJ_JERK = _UxGT("ジク ヤクドウ mm/s") STR_J; // "Vb-jerk" - LSTR MSG_VK_JERK = _UxGT("ジク ヤクドウ mm/s") STR_K; // "Vc-jerk" + LSTR MSG_VN_JERK = _UxGT("ジク ヤクドウ mm/s@"); // "V@-jerk" LSTR MSG_A_STEPS = STR_A _UxGT("ステップ/mm"); LSTR MSG_B_STEPS = STR_B _UxGT("ステップ/mm"); LSTR MSG_C_STEPS = STR_C _UxGT("ステップ/mm"); + LSTR MSG_N_STEPS = _UxGT("@ステップ/mm"); LSTR MSG_VE_JERK = _UxGT("エクストルーダー ヤクド"); // "Ve-jerk" LSTR MSG_VMAX_A = _UxGT("サイダイオクリソクド ") STR_A; // "Vmax A" LSTR MSG_VMAX_B = _UxGT("サイダイオクリソクド ") STR_B; // "Vmax B" LSTR MSG_VMAX_C = _UxGT("サイダイオクリソクド ") STR_C; // "Vmax C" - LSTR MSG_VMAX_I = _UxGT("サイダイオクリソクド ") STR_I; // "Vmax I" - LSTR MSG_VMAX_J = _UxGT("サイダイオクリソクド ") STR_J; // "Vmax J" - LSTR MSG_VMAX_K = _UxGT("サイダイオクリソクド ") STR_K; // "Vmax K" - LSTR MSG_VMAX_E = _UxGT("サイダイオクリソクド ") STR_E; // "Vmax E" + LSTR MSG_VMAX_E = _UxGT("サイダイオクリソクド E"); // "Vmax E" LSTR MSG_VMAX_EN = _UxGT("サイダイオクリソクド *"); // "Vmax E1" LSTR MSG_VMIN = _UxGT("サイショウオクリソクド"); // "Vmin" LSTR MSG_VTRAV_MIN = _UxGT("サイショウイドウソクド"); // "VTrav min" @@ -215,13 +211,7 @@ namespace Language_jp_kana { LSTR MSG_INFO_MAX_TEMP = _UxGT("セッテイサイコウオン"); // "Max Temp" LSTR MSG_INFO_PSU = _UxGT("デンゲンシュベツ"); // "Power Supply" LSTR MSG_DRIVE_STRENGTH = _UxGT("モータークドウリョク"); // "Drive Strength" - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" DACシュツリョク %"); // "X Driver %" - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" DACシュツリョク %"); // "Y Driver %" - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" DACシュツリョク %"); // "Z Driver %" - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" DACシュツリョク %"); // "I Driver %" - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" DACシュツリョク %"); // "J Driver %" - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" DACシュツリョク %"); // "K Driver %" - LSTR MSG_DAC_PERCENT_E = _UxGT("E DACシュツリョク %"); // "E Driver %" + LSTR MSG_DAC_PERCENT_N = _UxGT("@ DACシュツリョク %"); // "@ Driver %" LSTR MSG_DAC_EEPROM_WRITE = _UxGT("EEPROMヘホゾン"); // "Store memory" LSTR MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("イチジテイシ"); LSTR MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("プリントサイカイ"); // "Resume print" @@ -249,7 +239,7 @@ namespace Language_jp_kana { LSTR MSG_YES = _UxGT("ハイ"); LSTR MSG_NO = _UxGT("イイエ"); LSTR MSG_BACK = _UxGT("モドリ"); - LSTR MSG_VELOCITY = _UxGT("ソクド"); + LSTR MSG_MAX_SPEED = _UxGT("ソクド"); LSTR MSG_STEPS_PER_MM = _UxGT("ステップ/mm"); LSTR MSG_CUSTOM_COMMANDS = _UxGT("ユーザーコマンド"); LSTR MSG_PRINT_PAUSED = _UxGT("プリントガイチジテイシサレマシタ"); diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index 29a8a1fdc8..6b308ba48b 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -86,7 +86,7 @@ namespace Language_nl { LSTR MSG_MOVE_Z = _UxGT("Verplaats Z"); LSTR MSG_MOVE_E = _UxGT("Extruder"); LSTR MSG_MOVE_EN = _UxGT("Extruder *"); - LSTR MSG_MOVE_N_MM = _UxGT("Verplaats %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Verplaats $mm"); LSTR MSG_MOVE_01MM = _UxGT("Verplaats 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Verplaats 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Verplaats 10mm"); @@ -157,6 +157,7 @@ namespace Language_nl { LSTR MSG_BABYSTEP_X = _UxGT("Babystap X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystap Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Babystap Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Babystap @"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop afbr."); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Voorverw. fout"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Redun. temp fout"); diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 8bd7d2d301..630f94ab12 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -27,10 +27,9 @@ * LCD Menu Messages * See also https://marlinfw.org/docs/development/lcd_language.html * - * Substitutions are applied for the following characters when used - * in menu items that call lcd_put_u8str_ind_P with an index: + * Substitutions are applied for the following characters when used in menu items titles: * - * $ displays an inserted C-string + * $ displays an inserted string * = displays '0'....'10' for indexes 0 - 10 * ~ displays '1'....'11' for indexes 0 - 10 * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) @@ -239,7 +238,7 @@ namespace Language_pl { LSTR MSG_MOVE_E = _UxGT("Ekstruzja (os E)"); LSTR MSG_MOVE_EN = _UxGT("Ekstruzja (os E) *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Dysza za zimna"); - LSTR MSG_MOVE_N_MM = _UxGT("Przesuń co %s mm"); + LSTR MSG_MOVE_N_MM = _UxGT("Przesuń co $ mm"); LSTR MSG_MOVE_01MM = _UxGT("Przesuń co .1 mm"); LSTR MSG_MOVE_1MM = _UxGT("Przesuń co 1 mm"); LSTR MSG_MOVE_10MM = _UxGT("Przesuń co 10 mm"); @@ -276,11 +275,9 @@ namespace Language_pl { LSTR MSG_VA_JERK = _UxGT("Zryw V") STR_A; LSTR MSG_VB_JERK = _UxGT("Zryw V") STR_B; LSTR MSG_VC_JERK = _UxGT("Zryw V") STR_C; - LSTR MSG_VI_JERK = _UxGT("Zryw V") STR_I; - LSTR MSG_VJ_JERK = _UxGT("Zryw V") STR_J; - LSTR MSG_VK_JERK = _UxGT("Zryw V") STR_K; + LSTR MSG_VN_JERK = _UxGT("Zryw V@"); LSTR MSG_VE_JERK = _UxGT("Zryw Ve"); - LSTR MSG_VELOCITY = _UxGT("Prędkość (V)"); + LSTR MSG_MAX_SPEED = _UxGT("Prędkość (V)"); LSTR MSG_VTRAV_MIN = _UxGT("Vskok min"); LSTR MSG_ACCELERATION = _UxGT("Przyspieszenie (A)"); @@ -292,9 +289,7 @@ namespace Language_pl { LSTR MSG_A_STEPS = STR_A _UxGT(" kroki/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" kroki/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" kroki/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" kroki/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" kroki/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" kroki/mm"); + LSTR MSG_N_STEPS = _UxGT("@ kroki/mm"); LSTR MSG_E_STEPS = _UxGT("E kroki/mm"); LSTR MSG_EN_STEPS = _UxGT("* kroki/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatura"); @@ -445,13 +440,7 @@ namespace Language_pl { LSTR MSG_INFO_PSU = _UxGT("Zasilacz"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Siła silnika"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Siła %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Siła %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Siła %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Siła %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Siła %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Siła %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Siła %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Siła %"); LSTR MSG_ERROR_TMC = _UxGT("TMC BŁĄD POŁĄCZENIA"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Zapisz DAC EEPROM"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("ZMIEŃ FILAMENT"); diff --git a/Marlin/src/lcd/language/language_pt.h b/Marlin/src/lcd/language/language_pt.h index 2366142f06..69df8bdf54 100644 --- a/Marlin/src/lcd/language/language_pt.h +++ b/Marlin/src/lcd/language/language_pt.h @@ -80,7 +80,7 @@ namespace Language_pt { LSTR MSG_MOVE_Z = _UxGT("Mover Z"); LSTR MSG_MOVE_E = _UxGT("Mover Extrusor"); LSTR MSG_MOVE_EN = _UxGT("Mover Extrusor *"); - LSTR MSG_MOVE_N_MM = _UxGT("Mover %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Mover $mm"); LSTR MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Mover 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Mover 10mm"); @@ -104,9 +104,7 @@ namespace Language_pt { LSTR MSG_A_STEPS = STR_A _UxGT(" passo/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" passo/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" passo/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" passo/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" passo/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" passo/mm"); + LSTR MSG_N_STEPS = _UxGT("@ passo/mm"); LSTR MSG_E_STEPS = _UxGT("E passo/mm"); LSTR MSG_EN_STEPS = _UxGT("* passo/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatura"); diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index 5e3e33b376..5b73d6df6d 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -212,7 +212,7 @@ namespace Language_pt_br { LSTR MSG_MOVE_E = _UxGT("Mover Extrusor"); LSTR MSG_MOVE_EN = _UxGT("Mover Extrusor *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Extrus. mto fria"); - LSTR MSG_MOVE_N_MM = _UxGT("Mover %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Mover $mm"); LSTR MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Mover 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Mover 10mm"); @@ -242,12 +242,10 @@ namespace Language_pt_br { LSTR MSG_VA_JERK = _UxGT("arrancada V") STR_A; LSTR MSG_VB_JERK = _UxGT("arrancada V") STR_B; LSTR MSG_VC_JERK = _UxGT("arrancada V") STR_C; - LSTR MSG_VI_JERK = _UxGT("arrancada V") STR_I; - LSTR MSG_VJ_JERK = _UxGT("arrancada V") STR_J; - LSTR MSG_VK_JERK = _UxGT("arrancada V") STR_K; + LSTR MSG_VN_JERK = _UxGT("arrancada V@"); LSTR MSG_VE_JERK = _UxGT("arrancada VE"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Desv. Junção"); - LSTR MSG_VELOCITY = _UxGT("Velocidade"); + LSTR MSG_MAX_SPEED = _UxGT("Velocidade"); LSTR MSG_VTRAV_MIN = _UxGT("VDeslocamento min"); LSTR MSG_ACCELERATION = _UxGT("Aceleração"); LSTR MSG_A_RETRACT = _UxGT("Retrair A"); @@ -256,9 +254,7 @@ namespace Language_pt_br { LSTR MSG_A_STEPS = _UxGT("Passo ") STR_A _UxGT("/mm"); LSTR MSG_B_STEPS = _UxGT("Passo ") STR_B _UxGT("/mm"); LSTR MSG_C_STEPS = _UxGT("Passo ") STR_C _UxGT("/mm"); - LSTR MSG_I_STEPS = _UxGT("Passo ") STR_I _UxGT("/mm"); - LSTR MSG_J_STEPS = _UxGT("Passo ") STR_J _UxGT("/mm"); - LSTR MSG_K_STEPS = _UxGT("Passo ") STR_K _UxGT("/mm"); + LSTR MSG_N_STEPS = _UxGT("Passo @/mm"); LSTR MSG_E_STEPS = _UxGT("E/mm"); LSTR MSG_EN_STEPS = _UxGT("*/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatura"); @@ -352,6 +348,7 @@ namespace Language_pt_br { LSTR MSG_BABYSTEP_X = _UxGT("Passinho X"); LSTR MSG_BABYSTEP_Y = _UxGT("Passinho Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Passinho Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Passinho @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Abortar Fim de Curso"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Aquecimento falhou"); diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index 79421752af..79160624e7 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -225,7 +225,7 @@ namespace Language_ro { LSTR MSG_MOVE_E = _UxGT("Extruder"); LSTR MSG_MOVE_EN = _UxGT("Extruder *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Capat Prea Rece"); - LSTR MSG_MOVE_N_MM = _UxGT("Move %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Move $mm"); LSTR MSG_MOVE_01MM = _UxGT("Move 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Move 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Move 10mm"); @@ -270,30 +270,24 @@ namespace Language_ro { LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT("-Jerk"); LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT("-Jerk"); LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT("-Jerk"); - LSTR MSG_VI_JERK = _UxGT("V") STR_I _UxGT("-Jerk"); - LSTR MSG_VJ_JERK = _UxGT("V") STR_J _UxGT("-Jerk"); - LSTR MSG_VK_JERK = _UxGT("V") STR_K _UxGT("-Jerk"); + LSTR MSG_VN_JERK = _UxGT("V@-Jerk"); LSTR MSG_VE_JERK = _UxGT("Ve-Jerk"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Junction Dev"); - LSTR MSG_VELOCITY = _UxGT("Velocity"); - LSTR MSG_VMAX_A = _UxGT("Vmax ") STR_A; - LSTR MSG_VMAX_B = _UxGT("Vmax ") STR_B; - LSTR MSG_VMAX_C = _UxGT("Vmax ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Vmax ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Vmax ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Vmax ") STR_K; - LSTR MSG_VMAX_E = _UxGT("Vmax ") STR_E; - LSTR MSG_VMAX_EN = _UxGT("Vmax *"); + LSTR MSG_MAX_SPEED = _UxGT("Max Speed"); + LSTR MSG_VMAX_A = _UxGT("Max Speed ") STR_A; + LSTR MSG_VMAX_B = _UxGT("Max Speed ") STR_B; + LSTR MSG_VMAX_C = _UxGT("Max Speed ") STR_C; + LSTR MSG_VMAX_N = _UxGT("Max Speed @"); + LSTR MSG_VMAX_E = _UxGT("Max Speed E"); + LSTR MSG_VMAX_EN = _UxGT("Max Speed *"); LSTR MSG_VMIN = _UxGT("Vmin"); LSTR MSG_VTRAV_MIN = _UxGT("VTrav Min"); LSTR MSG_ACCELERATION = _UxGT("Acceleration"); LSTR MSG_AMAX_A = _UxGT("Amax ") STR_A; LSTR MSG_AMAX_B = _UxGT("Amax ") STR_B; LSTR MSG_AMAX_C = _UxGT("Amax ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Amax ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Amax ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Amax ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Amax ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Amax @"); + LSTR MSG_AMAX_E = _UxGT("Amax E"); LSTR MSG_AMAX_EN = _UxGT("Amax *"); LSTR MSG_A_RETRACT = _UxGT("A-Retract"); LSTR MSG_A_TRAVEL = _UxGT("A-Travel"); @@ -303,11 +297,9 @@ namespace Language_ro { LSTR MSG_A_STEPS = STR_A _UxGT(" steps/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" steps/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" steps/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" steps/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" steps/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" steps/mm"); - LSTR MSG_E_STEPS = _UxGT("Esteps/mm"); - LSTR MSG_EN_STEPS = _UxGT("*steps/mm"); + LSTR MSG_N_STEPS = _UxGT("@ steps/mm"); + LSTR MSG_E_STEPS = _UxGT("E steps/mm"); + LSTR MSG_EN_STEPS = _UxGT("* steps/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperature"); LSTR MSG_MOTION = _UxGT("Motion"); LSTR MSG_FILAMENT = _UxGT("Filament"); @@ -435,6 +427,7 @@ namespace Language_ro { LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Babystep Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop Abort"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Heating Failed"); @@ -503,13 +496,7 @@ namespace Language_ro { LSTR MSG_INFO_MAX_TEMP = _UxGT("Temperatura Maxima"); LSTR MSG_INFO_PSU = _UxGT("PSU"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Drive Strength"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Driver %"); LSTR MSG_ERROR_TMC = _UxGT("TMC CONNECTION ERROR"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Write"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("FILAMENT CHANGE"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 4b8d4703e4..5f05f1d2be 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -84,17 +84,11 @@ namespace Language_ru { LSTR MSG_HOME_OFFSET_X = _UxGT("Смещение дома X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Смещение дома Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Смещение дома Z"); - LSTR MSG_HOME_OFFSET_I = _UxGT("Смещение дома ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Смещение дома ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Смещение дома ") STR_K; #else LSTR MSG_SET_HOME_OFFSETS = _UxGT("Установ.смещ.дома"); LSTR MSG_HOME_OFFSET_X = _UxGT("Смещ. дома X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Смещ. дома Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Смещ. дома Z"); - LSTR MSG_HOME_OFFSET_I = _UxGT("Смещ. дома ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Смещ. дома ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Смещ. дома ") STR_K; #endif LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Смещения применены"); LSTR MSG_SELECT_ORIGIN = _UxGT("Выберите ноль"); @@ -338,9 +332,7 @@ namespace Language_ru { LSTR MSG_MOVE_X = _UxGT("Движение по X"); LSTR MSG_MOVE_Y = _UxGT("Движение по Y"); LSTR MSG_MOVE_Z = _UxGT("Движение по Z"); - LSTR MSG_MOVE_I = _UxGT("Движение по ") STR_I; - LSTR MSG_MOVE_J = _UxGT("Движение по ") STR_J; - LSTR MSG_MOVE_K = _UxGT("Движение по ") STR_K; + LSTR MSG_MOVE_N = _UxGT("Движение по @"); LSTR MSG_MOVE_E = _UxGT("Экструдер"); LSTR MSG_MOVE_EN = _UxGT("Экструдер *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Сопло не нагрето"); @@ -401,23 +393,19 @@ namespace Language_ru { LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT("-рывок"); LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT("-рывок"); LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT("-рывок"); - LSTR MSG_VI_JERK = _UxGT("V") STR_I _UxGT("-рывок"); - LSTR MSG_VJ_JERK = _UxGT("V") STR_J _UxGT("-рывок"); - LSTR MSG_VK_JERK = _UxGT("V") STR_K _UxGT("-рывок"); + LSTR MSG_VN_JERK = _UxGT("V@-рывок"); LSTR MSG_VE_JERK = _UxGT("Ve-рывок"); #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_JUNCTION_DEVIATION = _UxGT("Отклонение узла"); #else LSTR MSG_JUNCTION_DEVIATION = _UxGT("Отклон. узла"); #endif - LSTR MSG_VELOCITY = _UxGT("Скорость, мм/с"); + LSTR MSG_MAX_SPEED = _UxGT("Скорость, мм/с"); LSTR MSG_VMAX_A = _UxGT("Скор.макс ") STR_A; LSTR MSG_VMAX_B = _UxGT("Скор.макс ") STR_B; LSTR MSG_VMAX_C = _UxGT("Скор.макс ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Скор.макс ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Скор.макс ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Скор.макс ") STR_K; - LSTR MSG_VMAX_E = _UxGT("Скор.макс ") STR_E; + LSTR MSG_VMAX_N = _UxGT("Скор.макс @"); + LSTR MSG_VMAX_E = _UxGT("Скор.макс E"); LSTR MSG_VMAX_EN = _UxGT("Скор.макс *"); LSTR MSG_VMIN = _UxGT("Скор.мин"); LSTR MSG_VTRAV_MIN = _UxGT("Перемещение мин"); @@ -425,10 +413,8 @@ namespace Language_ru { LSTR MSG_AMAX_A = _UxGT("Ускор.макс ") STR_A; LSTR MSG_AMAX_B = _UxGT("Ускор.макс ") STR_B; LSTR MSG_AMAX_C = _UxGT("Ускор.макс ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Ускор.макс ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Ускор.макс ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Ускор.макс ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Ускор.макс ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Ускор.макс @"); + LSTR MSG_AMAX_E = _UxGT("Ускор.макс E"); LSTR MSG_AMAX_EN = _UxGT("Ускор.макс *"); LSTR MSG_A_RETRACT = _UxGT("Ускор.втягив."); LSTR MSG_A_TRAVEL = _UxGT("Ускор.путеш."); @@ -438,9 +424,7 @@ namespace Language_ru { LSTR MSG_A_STEPS = STR_A _UxGT(" шаг/мм"); LSTR MSG_B_STEPS = STR_B _UxGT(" шаг/мм"); LSTR MSG_C_STEPS = STR_C _UxGT(" шаг/мм"); - LSTR MSG_I_STEPS = STR_I _UxGT(" шаг/мм"); - LSTR MSG_J_STEPS = STR_J _UxGT(" шаг/мм"); - LSTR MSG_K_STEPS = STR_K _UxGT(" шаг/мм"); + LSTR MSG_N_STEPS = _UxGT("@ шаг/мм"); LSTR MSG_E_STEPS = _UxGT("E шаг/мм"); LSTR MSG_EN_STEPS = _UxGT("* шаг/мм"); LSTR MSG_TEMPERATURE = _UxGT("Температура"); @@ -611,9 +595,7 @@ namespace Language_ru { LSTR MSG_BABYSTEP_X = _UxGT("Микрошаг X"); LSTR MSG_BABYSTEP_Y = _UxGT("Микрошаг Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Микрошаг Z"); - LSTR MSG_BABYSTEP_I = _UxGT("Микрошаг ") STR_I; - LSTR MSG_BABYSTEP_J = _UxGT("Микрошаг ") STR_J; - LSTR MSG_BABYSTEP_K = _UxGT("Микрошаг ") STR_K; + LSTR MSG_BABYSTEP_N = _UxGT("Микрошаг @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Сумарно"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Сработал концевик"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Разогрев не удался"); @@ -710,13 +692,7 @@ namespace Language_ru { LSTR MSG_INFO_MAX_TEMP = _UxGT("Макс. ") LCD_STR_THERMOMETER; LSTR MSG_INFO_PSU = _UxGT("БП"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Сила привода"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Привод, %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Привод, %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Привод, %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Привод, %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Привод, %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Привод, %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Привод, %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Привод, %"); LSTR MSG_ERROR_TMC = _UxGT("СБОЙ СВЯЗИ С TMC"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Запись DAC в EEPROM"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("ЗАМЕНА ФИЛАМЕНТА"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 7ba505ede5..124080de0b 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -31,10 +31,9 @@ * Translated by Michal Holeš, Farma MaM * https://www.facebook.com/farmamam * - * Substitutions are applied for the following characters when used - * in menu items that call lcd_put_u8str_ind_P with an index: + * Substitutions are applied for the following characters when used in menu items titles: * - * $ displays an inserted C-string + * $ displays an inserted string * = displays '0'....'10' for indexes 0 - 10 * ~ displays '1'....'11' for indexes 0 - 10 * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) @@ -98,9 +97,6 @@ namespace Language_sk { LSTR MSG_HOME_OFFSET_X = _UxGT("X Ofset"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Y Ofset"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Z Ofset"); - LSTR MSG_HOME_OFFSET_I = STR_I _UxGT(" Ofset"); - LSTR MSG_HOME_OFFSET_J = STR_J _UxGT(" Ofset"); - LSTR MSG_HOME_OFFSET_K = STR_K _UxGT(" Ofset"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Ofsety nastavené"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Spriev. vyrovn."); LSTR MSG_SELECT_ORIGIN = _UxGT("Vyberte začiatok"); @@ -281,13 +277,11 @@ namespace Language_sk { LSTR MSG_MOVE_X = _UxGT("Posunúť X"); LSTR MSG_MOVE_Y = _UxGT("Posunúť Y"); LSTR MSG_MOVE_Z = _UxGT("Posunúť Z"); - LSTR MSG_MOVE_I = _UxGT("Posunúť ") STR_I; - LSTR MSG_MOVE_J = _UxGT("Posunúť ") STR_J; - LSTR MSG_MOVE_K = _UxGT("Posunúť ") STR_K; + LSTR MSG_MOVE_N = _UxGT("Posunúť @"); LSTR MSG_MOVE_E = _UxGT("Extrudér"); LSTR MSG_MOVE_EN = _UxGT("Extrudér *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Hotend je studený"); - LSTR MSG_MOVE_N_MM = _UxGT("Posunúť o %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Posunúť o $mm"); LSTR MSG_MOVE_01MM = _UxGT("Posunúť o 0,1mm"); LSTR MSG_MOVE_1MM = _UxGT("Posunúť o 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Posunúť o 10mm"); @@ -297,12 +291,6 @@ namespace Language_sk { LSTR MSG_MOVE_01IN = _UxGT("Posunúť o 0,1in"); LSTR MSG_MOVE_1IN = _UxGT("Posunúť o 1,0in"); LSTR MSG_SPEED = _UxGT("Rýchlosť"); - LSTR MSG_MAXSPEED = _UxGT("Max rýchl. (mm/s)"); - LSTR MSG_MAXSPEED_X = _UxGT("Max rýchl. ") STR_A; - LSTR MSG_MAXSPEED_Y = _UxGT("Max rýchl. ") STR_B; - LSTR MSG_MAXSPEED_Z = _UxGT("Max rýchl. ") STR_C; - LSTR MSG_MAXSPEED_E = _UxGT("Max rýchl. ") STR_E; - LSTR MSG_MAXSPEED_A = _UxGT("Max rýchl. @"); LSTR MSG_BED_Z = _UxGT("Výška podl."); LSTR MSG_NOZZLE = _UxGT("Tryska"); LSTR MSG_NOZZLE_N = _UxGT("Tryska ~"); @@ -347,30 +335,24 @@ namespace Language_sk { LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT("-skok"); LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT("-skok"); LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT("-skok"); - LSTR MSG_VI_JERK = _UxGT("V") STR_I _UxGT("-skok"); - LSTR MSG_VJ_JERK = _UxGT("V") STR_J _UxGT("-skok"); - LSTR MSG_VK_JERK = _UxGT("V") STR_K _UxGT("-skok"); + LSTR MSG_VN_JERK = _UxGT("V@-skok"); LSTR MSG_VE_JERK = _UxGT("Ve-skok"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Junction Dev"); - LSTR MSG_VELOCITY = _UxGT("Rýchlosť"); - LSTR MSG_VMAX_A = _UxGT("Vmax ") STR_A; - LSTR MSG_VMAX_B = _UxGT("Vmax ") STR_B; - LSTR MSG_VMAX_C = _UxGT("Vmax ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Vmax ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Vmax ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Vmax ") STR_K; - LSTR MSG_VMAX_E = _UxGT("Vmax ") STR_E; - LSTR MSG_VMAX_EN = _UxGT("Vmax *"); + LSTR MSG_MAX_SPEED = _UxGT("Max rýchl. (mm/s)"); + LSTR MSG_VMAX_A = _UxGT("Max rýchl. ") STR_A; + LSTR MSG_VMAX_B = _UxGT("Max rýchl. ") STR_B; + LSTR MSG_VMAX_C = _UxGT("Max rýchl. ") STR_C; + LSTR MSG_VMAX_N = _UxGT("Max rýchl. @"); + LSTR MSG_VMAX_E = _UxGT("Max rýchl. E"); + LSTR MSG_VMAX_EN = _UxGT("Max rýchl. *"); LSTR MSG_VMIN = _UxGT("Vmin"); LSTR MSG_VTRAV_MIN = _UxGT("VPrej Min"); LSTR MSG_ACCELERATION = _UxGT("Akcelerácia"); LSTR MSG_AMAX_A = _UxGT("Amax ") STR_A; LSTR MSG_AMAX_B = _UxGT("Amax ") STR_B; LSTR MSG_AMAX_C = _UxGT("Amax ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Amax ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Amax ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Amax ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Amax ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Amax @"); + LSTR MSG_AMAX_E = _UxGT("Amax E"); LSTR MSG_AMAX_EN = _UxGT("Amax *"); LSTR MSG_A_RETRACT = _UxGT("A-retrakt"); LSTR MSG_A_TRAVEL = _UxGT("A-prejazd"); @@ -380,11 +362,9 @@ namespace Language_sk { LSTR MSG_A_STEPS = STR_A _UxGT(" krokov/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" krokov/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" krokov/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" krokov/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" krokov/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" krokov/mm"); - LSTR MSG_E_STEPS = _UxGT("Ekrokov/mm"); - LSTR MSG_EN_STEPS = _UxGT("*krokov/mm"); + LSTR MSG_N_STEPS = _UxGT("@ krokov/mm"); + LSTR MSG_E_STEPS = _UxGT("E krokov/mm"); + LSTR MSG_EN_STEPS = _UxGT("* krokov/mm"); LSTR MSG_TEMPERATURE = _UxGT("Teplota"); LSTR MSG_MOTION = _UxGT("Pohyb"); LSTR MSG_FILAMENT = _UxGT("Filament"); @@ -527,9 +507,7 @@ namespace Language_sk { LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Babystep Z"); - LSTR MSG_BABYSTEP_I = _UxGT("Babystep ") STR_I; - LSTR MSG_BABYSTEP_J = _UxGT("Babystep ") STR_J; - LSTR MSG_BABYSTEP_K = _UxGT("Babystep ") STR_K; + LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Celkom"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Zastavenie Endstop"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Chyba ohrevu"); @@ -624,13 +602,7 @@ namespace Language_sk { LSTR MSG_INFO_MAX_TEMP = _UxGT("Teplota max"); LSTR MSG_INFO_PSU = _UxGT("Nap. zdroj"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Budenie motorov"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Motor %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Motor %"); LSTR MSG_ERROR_TMC = _UxGT("CHYBA KOMUNIKÁ. TMC"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Uložiť do EEPROM"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("VÝMENA FILAMENTU"); diff --git a/Marlin/src/lcd/language/language_sv.h b/Marlin/src/lcd/language/language_sv.h index db2196fa46..6e6d3e11ec 100644 --- a/Marlin/src/lcd/language/language_sv.h +++ b/Marlin/src/lcd/language/language_sv.h @@ -252,7 +252,7 @@ namespace Language_sv { LSTR MSG_MOVE_E = _UxGT("Extruder"); LSTR MSG_MOVE_EN = _UxGT("Extruder *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Hetände för kall"); - LSTR MSG_MOVE_N_MM = _UxGT("Flytta %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Flytta $mm"); LSTR MSG_MOVE_01MM = _UxGT("Flytta 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Flytta 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Flytta 10mm"); @@ -300,19 +300,15 @@ namespace Language_sv { LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT("-Ryck"); LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT("-Ryck"); LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT("-Ryck"); - LSTR MSG_VI_JERK = _UxGT("V") STR_I _UxGT("-Ryck"); - LSTR MSG_VJ_JERK = _UxGT("V") STR_J _UxGT("-Ryck"); - LSTR MSG_VK_JERK = _UxGT("V") STR_K _UxGT("-Ryck"); + LSTR MSG_VN_JERK = _UxGT("V@-Ryck"); LSTR MSG_VE_JERK = _UxGT("Ve-Ryck"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Knutpunkt Avv"); - LSTR MSG_VELOCITY = _UxGT("Hastighet"); + LSTR MSG_MAX_SPEED = _UxGT("Hastighet"); LSTR MSG_VMAX_A = _UxGT("Vmax ") STR_A; LSTR MSG_VMAX_B = _UxGT("Vmax ") STR_B; LSTR MSG_VMAX_C = _UxGT("Vmax ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Vmax ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Vmax ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Vmax ") STR_K; - LSTR MSG_VMAX_E = _UxGT("Vmax ") STR_E; + LSTR MSG_VMAX_N = _UxGT("Vmax @"); + LSTR MSG_VMAX_E = _UxGT("Vmax E"); LSTR MSG_VMAX_EN = _UxGT("Vmax *"); LSTR MSG_VMIN = _UxGT("Vmin"); LSTR MSG_VTRAV_MIN = _UxGT("VTrav Min"); @@ -320,10 +316,8 @@ namespace Language_sv { LSTR MSG_AMAX_A = _UxGT("Amax ") STR_A; LSTR MSG_AMAX_B = _UxGT("Amax ") STR_B; LSTR MSG_AMAX_C = _UxGT("Amax ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Amax ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Amax ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Amax ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Amax ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Amax @"); + LSTR MSG_AMAX_E = _UxGT("Amax E"); LSTR MSG_AMAX_EN = _UxGT("Amax *"); LSTR MSG_A_RETRACT = _UxGT("A-Dra tillbaka"); LSTR MSG_A_TRAVEL = _UxGT("A-Färdas"); @@ -333,9 +327,7 @@ namespace Language_sv { LSTR MSG_A_STEPS = STR_A _UxGT(" Steg/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" Steg/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" Steg/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" Steg/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" Steg/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" Steg/mm"); + LSTR MSG_N_STEPS = _UxGT("@ Steg/mm"); LSTR MSG_E_STEPS = _UxGT("E Steg/mm"); LSTR MSG_EN_STEPS = _UxGT("* Steg/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatur"); @@ -469,6 +461,7 @@ namespace Language_sv { LSTR MSG_BABYSTEP_X = _UxGT("Småsteg X"); LSTR MSG_BABYSTEP_Y = _UxGT("Småsteg Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Småsteg Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Småsteg @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Slutstopp Avbrott"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Värma Misslyckad"); @@ -540,13 +533,7 @@ namespace Language_sv { LSTR MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); LSTR MSG_INFO_PSU = _UxGT("PSU"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Driv Styrka"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Driver %"); LSTR MSG_ERROR_TMC = _UxGT("TMC KOPPLNINGSFEL"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Skriv"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("TRÅDBYTE"); diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index 0acdd958c3..b981127ed1 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -228,7 +228,7 @@ namespace Language_tr { LSTR MSG_MOVE_E = _UxGT("Ekstruder"); LSTR MSG_MOVE_EN = _UxGT("Ekstruder *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Nozul Çok Soğuk"); - LSTR MSG_MOVE_N_MM = _UxGT("%smm"); + LSTR MSG_MOVE_N_MM = _UxGT("$mm"); LSTR MSG_MOVE_01MM = _UxGT("0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("1mm"); LSTR MSG_MOVE_10MM = _UxGT("10mm"); @@ -263,19 +263,15 @@ namespace Language_tr { LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT("-Sarsım"); LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT("-Sarsım"); LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT("-Sarsım"); - LSTR MSG_VI_JERK = _UxGT("V") STR_I _UxGT("-Sarsım"); - LSTR MSG_VJ_JERK = _UxGT("V") STR_J _UxGT("-Sarsım"); - LSTR MSG_VK_JERK = _UxGT("V") STR_K _UxGT("-Sarsım"); + LSTR MSG_VN_JERK = _UxGT("V@-Sarsım"); LSTR MSG_VE_JERK = _UxGT("Ve-Sarsım"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Jonksiyon Sapması"); - LSTR MSG_VELOCITY = _UxGT("Hız Vektörü"); + LSTR MSG_MAX_SPEED = _UxGT("Hız Vektörü"); LSTR MSG_VMAX_A = _UxGT("HızVektör.max ") STR_A; LSTR MSG_VMAX_B = _UxGT("HızVektör.max ") STR_B; LSTR MSG_VMAX_C = _UxGT("HızVektör.max ") STR_C; - LSTR MSG_VMAX_I = _UxGT("HızVektör.max ") STR_I; - LSTR MSG_VMAX_J = _UxGT("HızVektör.max ") STR_J; - LSTR MSG_VMAX_K = _UxGT("HızVektör.max ") STR_K; - LSTR MSG_VMAX_E = _UxGT("HızVektör.max ") STR_E; + LSTR MSG_VMAX_N = _UxGT("HızVektör.max @"); + LSTR MSG_VMAX_E = _UxGT("HızVektör.max E"); LSTR MSG_VMAX_EN = _UxGT("HızVektör.max *"); LSTR MSG_VMIN = _UxGT("HızVektör.min"); LSTR MSG_VTRAV_MIN = _UxGT("HV.gezinme min"); @@ -283,10 +279,8 @@ namespace Language_tr { LSTR MSG_AMAX_A = _UxGT("Max. ivme ") STR_A; LSTR MSG_AMAX_B = _UxGT("Max. ivme ") STR_B; LSTR MSG_AMAX_C = _UxGT("Max. ivme ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Max. ivme ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Max. ivme ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Max. ivme ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Max. ivme ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Max. ivme @"); + LSTR MSG_AMAX_E = _UxGT("Max. ivme E"); LSTR MSG_AMAX_EN = _UxGT("Max. ivme *"); LSTR MSG_A_RETRACT = _UxGT("Ivme-geri çekme"); LSTR MSG_A_TRAVEL = _UxGT("Ivme-gezinme"); @@ -294,9 +288,7 @@ namespace Language_tr { LSTR MSG_A_STEPS = STR_A _UxGT(" adım/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" adım/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" adım/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" adım/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" adım/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" adım/mm"); + LSTR MSG_N_STEPS = _UxGT("@ adım/mm"); LSTR MSG_E_STEPS = _UxGT("E adım/mm"); LSTR MSG_EN_STEPS = _UxGT("* adım/mm"); LSTR MSG_TEMPERATURE = _UxGT("Sıcaklık"); @@ -406,6 +398,7 @@ namespace Language_tr { LSTR MSG_BABYSTEP_X = _UxGT("Miniadım X"); LSTR MSG_BABYSTEP_Y = _UxGT("Miniadım Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Miniadım Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Miniadım @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Toplam"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop iptal"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Isınma başarısız"); @@ -473,13 +466,7 @@ namespace Language_tr { LSTR MSG_INFO_MAX_TEMP = _UxGT("Max Sıc."); LSTR MSG_INFO_PSU = _UxGT("Güç Kaynağı"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Sürücü Gücü"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Sürücü %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Sürücü %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Sürücü %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Sürücü %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Sürücü %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Sürücü %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Sürücü %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Sürücü %"); LSTR MSG_ERROR_TMC = _UxGT("TMC BAĞLANTI HATASI"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Yaz"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("FILAMAN DEGISTIR"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index bfb74b9f6e..3c47ccada9 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -86,17 +86,11 @@ namespace Language_uk { LSTR MSG_HOME_OFFSET_X = _UxGT("Зміщення дому X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Зміщення дому Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Зміщення дому Z"); - LSTR MSG_HOME_OFFSET_I = _UxGT("Зміщення дому ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Зміщення дому ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Зміщення дому ") STR_K; #else LSTR MSG_SET_HOME_OFFSETS = _UxGT("Встан. зміщ. дому"); LSTR MSG_HOME_OFFSET_X = _UxGT("Зміщ. дому X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Зміщ. дому Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Зміщ. дому Z"); - LSTR MSG_HOME_OFFSET_I = _UxGT("Зміщ. дому ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Зміщ. дому ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Зміщ. дому ") STR_K; #endif LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Зміщення прийняті"); LSTR MSG_SELECT_ORIGIN = _UxGT("Оберіть нуль"); @@ -339,9 +333,7 @@ namespace Language_uk { LSTR MSG_MOVE_X = _UxGT("Рух по X"); LSTR MSG_MOVE_Y = _UxGT("Рух по Y"); LSTR MSG_MOVE_Z = _UxGT("Рух по Z"); - LSTR MSG_MOVE_I = _UxGT("Рух по ") STR_I; - LSTR MSG_MOVE_J = _UxGT("Рух по ") STR_J; - LSTR MSG_MOVE_K = _UxGT("Рух по ") STR_K; + LSTR MSG_MOVE_N = _UxGT("Рух по @"); LSTR MSG_MOVE_E = _UxGT("Екструдер"); LSTR MSG_MOVE_EN = _UxGT("Екструдер *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Сопло дуже холодне"); @@ -406,23 +398,19 @@ namespace Language_uk { LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT("-ривок"); LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT("-ривок"); LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT("-ривок"); - LSTR MSG_VI_JERK = _UxGT("V") STR_I _UxGT("-ривок"); - LSTR MSG_VJ_JERK = _UxGT("V") STR_J _UxGT("-ривок"); - LSTR MSG_VK_JERK = _UxGT("V") STR_K _UxGT("-ривок"); + LSTR MSG_VN_JERK = _UxGT("V@-ривок"); LSTR MSG_VE_JERK = _UxGT("Ve-ривок"); #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_JUNCTION_DEVIATION = _UxGT("Відхилення вузла"); #else LSTR MSG_JUNCTION_DEVIATION = _UxGT("Відхил.вузла"); #endif - LSTR MSG_VELOCITY = _UxGT("Швидкість, мм/с"); + LSTR MSG_MAX_SPEED = _UxGT("Швидкість, мм/с"); LSTR MSG_VMAX_A = _UxGT("Швидк.макс ") STR_A; LSTR MSG_VMAX_B = _UxGT("Швидк.макс ") STR_B; LSTR MSG_VMAX_C = _UxGT("Швидк.макс ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Швидк.макс ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Швидк.макс ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Швидк.макс ") STR_K; - LSTR MSG_VMAX_E = _UxGT("Швидк.макс ") STR_E; + LSTR MSG_VMAX_N = _UxGT("Швидк.макс @"); + LSTR MSG_VMAX_E = _UxGT("Швидк.макс E"); LSTR MSG_VMAX_EN = _UxGT("Швидк.макс *"); LSTR MSG_VMIN = _UxGT("Швидк. мін"); #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 @@ -434,10 +422,8 @@ namespace Language_uk { LSTR MSG_AMAX_A = _UxGT("Приск.макс ") STR_A; LSTR MSG_AMAX_B = _UxGT("Приск.макс ") STR_B; LSTR MSG_AMAX_C = _UxGT("Приск.макс ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Приск.макс ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Приск.макс ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Приск.макс ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Приск.макс ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Приск.макс @"); + LSTR MSG_AMAX_E = _UxGT("Приск.макс E"); LSTR MSG_AMAX_EN = _UxGT("Приск.макс *"); LSTR MSG_A_RETRACT = _UxGT("Приск.втягув."); LSTR MSG_A_TRAVEL = _UxGT("Приск.переміщ."); @@ -447,9 +433,7 @@ namespace Language_uk { LSTR MSG_A_STEPS = STR_A _UxGT(" кроків/мм"); LSTR MSG_B_STEPS = STR_B _UxGT(" кроків/мм"); LSTR MSG_C_STEPS = STR_C _UxGT(" кроків/мм"); - LSTR MSG_I_STEPS = STR_I _UxGT(" кроків/мм"); - LSTR MSG_J_STEPS = STR_J _UxGT(" кроків/мм"); - LSTR MSG_K_STEPS = STR_K _UxGT(" кроків/мм"); + LSTR MSG_N_STEPS = _UxGT("@ кроків/мм"); LSTR MSG_E_STEPS = _UxGT("E кроків/мм"); LSTR MSG_EN_STEPS = _UxGT("* кроків/мм"); LSTR MSG_TEMPERATURE = _UxGT("Температура"); @@ -624,9 +608,7 @@ namespace Language_uk { LSTR MSG_BABYSTEP_X = _UxGT("Мікрокрок X"); LSTR MSG_BABYSTEP_Y = _UxGT("Мікрокрок Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Мікрокрок Z"); - LSTR MSG_BABYSTEP_I = _UxGT("Мікрокрок ") STR_I; - LSTR MSG_BABYSTEP_J = _UxGT("Мікрокрок ") STR_J; - LSTR MSG_BABYSTEP_K = _UxGT("Мікрокрок ") STR_K; + LSTR MSG_BABYSTEP_N = _UxGT("Мікрокрок @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Сумарно"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Кінцевик спрацював"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Збій нагріву"); @@ -749,13 +731,7 @@ namespace Language_uk { LSTR MSG_INFO_MAX_TEMP = _UxGT("Макс. ") LCD_STR_THERMOMETER; LSTR MSG_INFO_PSU = _UxGT("Блок жив-ня"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Сила мотору"); - LSTR MSG_DAC_PERCENT_A = _UxGT("Драйвер ") STR_A _UxGT(", %"); - LSTR MSG_DAC_PERCENT_B = _UxGT("Драйвер ") STR_B _UxGT(", %"); - LSTR MSG_DAC_PERCENT_C = _UxGT("Драйвер ") STR_C _UxGT(", %"); - LSTR MSG_DAC_PERCENT_I = _UxGT("Драйвер ") STR_I _UxGT(", %"); - LSTR MSG_DAC_PERCENT_J = _UxGT("Драйвер ") STR_J _UxGT(", %"); - LSTR MSG_DAC_PERCENT_K = _UxGT("Драйвер ") STR_K _UxGT(", %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("Драйвер E, %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("Драйвер @, %"); LSTR MSG_ERROR_TMC = _UxGT("ЗБІЙ ЗВ'ЯЗКУ З TMC"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Запис ЦАП у EEPROM"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("ЗАМІНА ПРУТКА"); diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index da9e1fc030..f963e3e346 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -230,19 +230,15 @@ namespace Language_vi { LSTR MSG_VA_JERK = _UxGT("Giật-V") STR_A; LSTR MSG_VB_JERK = _UxGT("Giật-V") STR_B; LSTR MSG_VC_JERK = _UxGT("Giật-V") STR_C; - LSTR MSG_VI_JERK = _UxGT("Giật-V") STR_I; - LSTR MSG_VJ_JERK = _UxGT("Giật-V") STR_J; - LSTR MSG_VK_JERK = _UxGT("Giật-V") STR_K; + LSTR MSG_VN_JERK = _UxGT("Giật-V@"); LSTR MSG_VE_JERK = _UxGT("Giật-Ve"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Độ Lệch Chỗ Giao"); // Junction Dev - LSTR MSG_VELOCITY = _UxGT("Vận tốc"); // velocity + LSTR MSG_MAX_SPEED = _UxGT("Vận tốc"); // velocity LSTR MSG_VMAX_A = _UxGT("Vđa") STR_A; // Vmax LSTR MSG_VMAX_B = _UxGT("Vđa") STR_B; LSTR MSG_VMAX_C = _UxGT("Vđa") STR_C; - LSTR MSG_VMAX_I = _UxGT("Vđa") STR_I; - LSTR MSG_VMAX_J = _UxGT("Vđa") STR_J; - LSTR MSG_VMAX_K = _UxGT("Vđa") STR_K; - LSTR MSG_VMAX_E = _UxGT("Vđa") STR_E; + LSTR MSG_VMAX_N = _UxGT("Vđa@"); + LSTR MSG_VMAX_E = _UxGT("VđaE"); LSTR MSG_VMAX_EN = _UxGT("Vđa *"); LSTR MSG_VMIN = _UxGT("Vthiểu"); // Vmin LSTR MSG_VTRAV_MIN = _UxGT("Vchuyển thiểu"); // VTrav min @@ -250,10 +246,8 @@ namespace Language_vi { LSTR MSG_AMAX_A = _UxGT("Tăng tốc ca") STR_A; // Amax LSTR MSG_AMAX_B = _UxGT("Tăng tốc ca") STR_B; LSTR MSG_AMAX_C = _UxGT("Tăng tốc ca") STR_C; - LSTR MSG_AMAX_I = _UxGT("Tăng tốc ca") STR_I; // Amax - LSTR MSG_AMAX_J = _UxGT("Tăng tốc ca") STR_J; - LSTR MSG_AMAX_K = _UxGT("Tăng tốc ca") STR_K; - LSTR MSG_AMAX_E = _UxGT("Tăng tốc ca") STR_E; + LSTR MSG_AMAX_N = _UxGT("Tăng tốc ca@"); + LSTR MSG_AMAX_E = _UxGT("Tăng tốc caE"); LSTR MSG_AMAX_EN = _UxGT("Tăng tốc ca *"); LSTR MSG_A_RETRACT = _UxGT("TT-Rút"); // A-retract LSTR MSG_A_TRAVEL = _UxGT("TT-Chuyển"); // A-travel @@ -261,9 +255,7 @@ namespace Language_vi { LSTR MSG_A_STEPS = _UxGT("Bước") STR_A _UxGT("/mm"); // Steps/mm LSTR MSG_B_STEPS = _UxGT("Bước") STR_B _UxGT("/mm"); LSTR MSG_C_STEPS = _UxGT("Bước") STR_C _UxGT("/mm"); - LSTR MSG_I_STEPS = _UxGT("Bước") STR_I _UxGT("/mm"); // Steps/mm - LSTR MSG_J_STEPS = _UxGT("Bước") STR_J _UxGT("/mm"); - LSTR MSG_K_STEPS = _UxGT("Bước") STR_K _UxGT("/mm"); + LSTR MSG_N_STEPS = _UxGT("Bước@/mm"); LSTR MSG_E_STEPS = _UxGT("BướcE/mm"); LSTR MSG_EN_STEPS = _UxGT("Bước */mm"); LSTR MSG_TEMPERATURE = _UxGT("Nhiệt độ"); // Temperature @@ -339,6 +331,7 @@ namespace Language_vi { LSTR MSG_BABYSTEP_X = _UxGT("Nhít X"); // Babystep X LSTR MSG_BABYSTEP_Y = _UxGT("Nhít Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Nhít Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Nhít @"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Hủy bỏ công tắc"); // Endstop abort LSTR MSG_HEATING_FAILED_LCD = _UxGT("Sưởi đầu phun không thành công"); // Heating failed LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Điều sai: nhiệt độ dư"); // Err: REDUNDANT TEMP @@ -399,13 +392,7 @@ namespace Language_vi { LSTR MSG_INFO_MAX_TEMP = _UxGT("Nhiệt độ tối đa"); // Max temp LSTR MSG_INFO_PSU = _UxGT("Bộ nguồn"); // PSU LSTR MSG_DRIVE_STRENGTH = _UxGT("Sức mạnh ổ đĩa"); // Drive Strength - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" % trình điều khiển"); // X Driver % - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" % trình điều khiển"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" % trình điều khiển"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" % trình điều khiển"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" % trình điều khiển"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" % trình điều khiển"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E % trình điều khiển"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ % trình điều khiển"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Ghi DAC EEPROM"); // DAC EEPROM Write LSTR MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("In tạm dừng"); // PRINT PAUSED LSTR MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("Nạp dây nhựa"); diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index f2d348b396..a4816ff899 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -225,7 +225,7 @@ namespace Language_zh_CN { LSTR MSG_MOVE_E = _UxGT("挤出机"); // "Extruder" LSTR MSG_MOVE_EN = _UxGT("挤出机 *"); // "Extruder" LSTR MSG_HOTEND_TOO_COLD = _UxGT("热端太冷"); - LSTR MSG_MOVE_N_MM = _UxGT("移动 %s mm"); // "Move 0.025mm" + LSTR MSG_MOVE_N_MM = _UxGT("移动 $ mm"); // "Move 0.025mm" LSTR MSG_MOVE_01MM = _UxGT("移动 0.1 mm"); // "Move 0.1mm" LSTR MSG_MOVE_1MM = _UxGT("移动 1 mm"); // "Move 1mm" LSTR MSG_MOVE_10MM = _UxGT("移动 10 mm"); // "Move 10mm" @@ -270,19 +270,15 @@ namespace Language_zh_CN { LSTR MSG_VA_JERK = _UxGT("轴抖动速率") STR_A; // "Va-jerk" LSTR MSG_VB_JERK = _UxGT("轴抖动速率") STR_B; // "Vb-jerk" LSTR MSG_VC_JERK = _UxGT("轴抖动速率") STR_C; // "Vc-jerk" - LSTR MSG_VI_JERK = _UxGT("轴抖动速率") STR_I; // "Vi-jerk" - LSTR MSG_VJ_JERK = _UxGT("轴抖动速率") STR_J; // "Vj-jerk" - LSTR MSG_VK_JERK = _UxGT("轴抖动速率") STR_K; // "Vk-jerk" + LSTR MSG_VN_JERK = _UxGT("轴抖动速率@"); // "V@-jerk" LSTR MSG_VE_JERK = _UxGT("挤出机抖动速率"); // "Ve-jerk" LSTR MSG_JUNCTION_DEVIATION = _UxGT("接点差"); - LSTR MSG_VELOCITY = _UxGT("速度"); // "Velocity" + LSTR MSG_MAX_SPEED = _UxGT("速度"); // "Velocity" LSTR MSG_VMAX_A = _UxGT("最大进料速率") STR_A; // "Vmax " max_feedrate_mm_s LSTR MSG_VMAX_B = _UxGT("最大进料速率") STR_B; LSTR MSG_VMAX_C = _UxGT("最大进料速率") STR_C; - LSTR MSG_VMAX_I = _UxGT("最大进料速率") STR_I; - LSTR MSG_VMAX_J = _UxGT("最大进料速率") STR_J; - LSTR MSG_VMAX_K = _UxGT("最大进料速率") STR_K; - LSTR MSG_VMAX_E = _UxGT("最大进料速率") STR_E; + LSTR MSG_VMAX_N = _UxGT("最大进料速率@"); + LSTR MSG_VMAX_E = _UxGT("最大进料速率E"); LSTR MSG_VMAX_EN = _UxGT("最大进料速率 *"); LSTR MSG_VMIN = _UxGT("最小进料速率"); // "Vmin" min_feedrate_mm_s LSTR MSG_VTRAV_MIN = _UxGT("最小移动速率"); // "VTrav min" min_travel_feedrate_mm_s, (target) speed of the move @@ -290,10 +286,8 @@ namespace Language_zh_CN { LSTR MSG_AMAX_A = _UxGT("最大打印加速度") STR_A; // "Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves LSTR MSG_AMAX_B = _UxGT("最大打印加速度") STR_B; LSTR MSG_AMAX_C = _UxGT("最大打印加速度") STR_C; - LSTR MSG_AMAX_I = _UxGT("最大打印加速度") STR_I; - LSTR MSG_AMAX_J = _UxGT("最大打印加速度") STR_J; - LSTR MSG_AMAX_K = _UxGT("最大打印加速度") STR_K; - LSTR MSG_AMAX_E = _UxGT("最大打印加速度") STR_E; + LSTR MSG_AMAX_N = _UxGT("最大打印加速度@"); + LSTR MSG_AMAX_E = _UxGT("最大打印加速度E"); LSTR MSG_AMAX_EN = _UxGT("最大打印加速度 *"); LSTR MSG_A_RETRACT = _UxGT("收进加速度"); // "A-retract" retract_acceleration, E acceleration in mm/s^2 for retracts LSTR MSG_A_TRAVEL = _UxGT("非打印移动加速度"); // "A-travel" travel_acceleration, X, Y, Z acceleration in mm/s^2 for travel (non printing) moves @@ -303,9 +297,7 @@ namespace Language_zh_CN { LSTR MSG_A_STEPS = STR_A _UxGT(" 步数/mm"); // "Asteps/mm" LSTR MSG_B_STEPS = STR_B _UxGT(" 步数/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" 步数/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" 步数/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" 步数/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" 步数/mm"); + LSTR MSG_N_STEPS = _UxGT("@ 步数/mm"); LSTR MSG_E_STEPS = _UxGT("E 步数/mm"); // "Esteps/mm" LSTR MSG_EN_STEPS = _UxGT("* 步数/mm"); LSTR MSG_TEMPERATURE = _UxGT("温度"); // "Temperature" @@ -507,13 +499,7 @@ namespace Language_zh_CN { LSTR MSG_INFO_MAX_TEMP = _UxGT("最高温度"); // "Max Temp" LSTR MSG_INFO_PSU = _UxGT("电源供应"); // "Power Supply" LSTR MSG_DRIVE_STRENGTH = _UxGT("驱动力度"); // "Drive Strength" - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" 驱动 %"); // "X Driver %" - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" 驱动 %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" 驱动 %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" 驱动 %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" 驱动 %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" 驱动 %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E 驱动 %"); // "E Driver %" + LSTR MSG_DAC_PERCENT_N = _UxGT("@ 驱动 %"); // "E Driver %" LSTR MSG_ERROR_TMC = _UxGT("TMC 连接错误"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("保存驱动设置"); // "DAC EEPROM Write" LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("更换料"); diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 3c0acd5fa8..5f7c85c838 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -221,7 +221,7 @@ namespace Language_zh_TW { LSTR MSG_MOVE_E = _UxGT("擠出機"); // "Extruder" LSTR MSG_MOVE_EN = _UxGT("擠出機 *"); // "Extruder *" LSTR MSG_HOTEND_TOO_COLD = _UxGT("噴嘴溫度不夠"); // "Hotend too cold" - LSTR MSG_MOVE_N_MM = _UxGT("移動 %s mm"); // "Move 0.025mm" + LSTR MSG_MOVE_N_MM = _UxGT("移動 $ mm"); // "Move 0.025mm" LSTR MSG_MOVE_01MM = _UxGT("移動 0.1 mm"); // "Move 0.1mm" LSTR MSG_MOVE_1MM = _UxGT("移動 1 mm"); // "Move 1mm" LSTR MSG_MOVE_10MM = _UxGT("移動 10 mm"); // "Move 10mm" @@ -254,19 +254,15 @@ namespace Language_zh_TW { LSTR MSG_VA_JERK = _UxGT("軸抖動速率") STR_A; // "Va-jerk" LSTR MSG_VB_JERK = _UxGT("軸抖動速率") STR_B; LSTR MSG_VC_JERK = _UxGT("軸抖動速率") STR_C; - LSTR MSG_VI_JERK = _UxGT("軸抖動速率") STR_I; - LSTR MSG_VJ_JERK = _UxGT("軸抖動速率") STR_J; - LSTR MSG_VK_JERK = _UxGT("軸抖動速率") STR_K; + LSTR MSG_VN_JERK = _UxGT("軸抖動速率@"); LSTR MSG_VE_JERK = _UxGT("擠出機抖動速率"); - LSTR MSG_VELOCITY = _UxGT("速度"); // "Velocity" + LSTR MSG_MAX_SPEED = _UxGT("速度"); // "Velocity" LSTR MSG_VMAX_A = _UxGT("最大進料速率") STR_A; // "Vmax " max_feedrate_mm_s LSTR MSG_VMAX_B = _UxGT("最大進料速率") STR_B; LSTR MSG_VMAX_C = _UxGT("最大進料速率") STR_C; - LSTR MSG_VMAX_I = _UxGT("最大進料速率") STR_I; - LSTR MSG_VMAX_J = _UxGT("最大進料速率") STR_J; - LSTR MSG_VMAX_K = _UxGT("最大進料速率") STR_K; - LSTR MSG_VMAX_E = _UxGT("最大進料速率") STR_E; + LSTR MSG_VMAX_N = _UxGT("最大進料速率@"); + LSTR MSG_VMAX_E = _UxGT("最大進料速率E"); LSTR MSG_VMAX_EN = _UxGT("最大進料速率 *"); // "Vmax " max_feedrate_mm_s LSTR MSG_VMIN = _UxGT("最小進料速率"); // "Vmin" min_feedrate_mm_s LSTR MSG_VTRAV_MIN = _UxGT("最小移動速率"); // "VTrav min" min_travel_feedrate_mm_s, (target) speed of the move @@ -274,10 +270,8 @@ namespace Language_zh_TW { LSTR MSG_AMAX_A = _UxGT("最大列印加速度") STR_A; // "Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves LSTR MSG_AMAX_B = _UxGT("最大列印加速度") STR_B; LSTR MSG_AMAX_C = _UxGT("最大列印加速度") STR_C; - LSTR MSG_AMAX_I = _UxGT("最大列印加速度") STR_I; - LSTR MSG_AMAX_J = _UxGT("最大列印加速度") STR_J; - LSTR MSG_AMAX_K = _UxGT("最大列印加速度") STR_K; - LSTR MSG_AMAX_E = _UxGT("最大列印加速度") STR_E; + LSTR MSG_AMAX_N = _UxGT("最大列印加速度@"); + LSTR MSG_AMAX_E = _UxGT("最大列印加速度E"); LSTR MSG_AMAX_EN = _UxGT("最大列印加速度 *"); // "Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves LSTR MSG_A_RETRACT = _UxGT("回縮加速度"); // "A-retract" retract_acceleration, E acceleration in mm/s^2 for retracts LSTR MSG_A_TRAVEL = _UxGT("非列印移動加速度"); // "A-travel" travel_acceleration, X, Y, Z acceleration in mm/s^2 for travel (non printing) moves @@ -285,9 +279,7 @@ namespace Language_zh_TW { LSTR MSG_A_STEPS = STR_A _UxGT(" 軸步數/mm"); // "Asteps/mm" axis_steps_per_mm, axis steps-per-unit G92 LSTR MSG_B_STEPS = STR_B _UxGT(" 軸步數/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" 軸步數/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" 軸步數/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" 軸步數/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" 軸步數/mm"); + LSTR MSG_N_STEPS = _UxGT("@ 軸步數/mm"); LSTR MSG_E_STEPS = _UxGT("擠出機步數/mm"); // "Esteps/mm" LSTR MSG_EN_STEPS = _UxGT("擠出機~步數/mm"); LSTR MSG_TEMPERATURE = _UxGT("溫度"); // "Temperature" @@ -454,13 +446,7 @@ namespace Language_zh_TW { LSTR MSG_INFO_MAX_TEMP = _UxGT("最高溫度"); // "Max Temp" LSTR MSG_INFO_PSU = _UxGT("電源供應"); // "Power Supply" LSTR MSG_DRIVE_STRENGTH = _UxGT("驅動力度"); // "Drive Strength" - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" 驅動 %"); // X Driver % - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" 驅動 %"); // Y Driver % - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" 驅動 %"); // Z Driver % - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" 驅動 %"); // I Driver % - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" 驅動 %"); // J Driver % - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" 驅動 %"); // K Driver % - LSTR MSG_DAC_PERCENT_E = _UxGT("E 驅動 %"); //E Driver % + LSTR MSG_DAC_PERCENT_N = _UxGT("@ 驅動 %"); //E Driver % LSTR MSG_ERROR_TMC = _UxGT("TMC連接錯誤"); // "TMC CONNECTION ERROR" LSTR MSG_DAC_EEPROM_WRITE = _UxGT("保存驅動設置"); // "DAC EEPROM Write" LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("更換絲料"); // "FILAMENT CHANGE" diff --git a/Marlin/src/lcd/lcdprint.cpp b/Marlin/src/lcd/lcdprint.cpp index 52d30fdfa3..deec2b1778 100644 --- a/Marlin/src/lcd/lcdprint.cpp +++ b/Marlin/src/lcd/lcdprint.cpp @@ -32,19 +32,19 @@ #include "lcdprint.h" /** - * lcd_put_u8str_ind_P + * lcd_put_u8str_P * - * Print a string with an index substituted within it: + * Print a string with optional substitutions: * - * $ displays the clipped C-string given by the inStr argument + * $ displays the clipped string given by fstr or cstr * = displays '0'....'10' for indexes 0 - 10 * ~ displays '1'....'11' for indexes 0 - 10 * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) * @ displays an axis name such as XYZUVW, or E for an extruder */ -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*/) { +lcd_uint_t lcd_put_u8str_P(PGM_P const ptpl, const int8_t ind, const char *cstr/*=nullptr*/, FSTR_P const fstr/*=nullptr*/, const lcd_uint_t maxlen/*=LCD_WIDTH*/) { const uint8_t prop = USE_WIDE_GLYPH ? 2 : 1; - uint8_t *p = (uint8_t*)pstr; + const uint8_t *p = (uint8_t*)ptpl; int8_t n = maxlen; while (n > 0) { wchar_t ch; @@ -71,8 +71,11 @@ lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const int8_t ind, PGM_P const i break; } } - else if (ch == '$' && inStr) { - n -= lcd_put_u8str_max_P(inStr, n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH); + else if (ch == '$' && fstr) { + n -= lcd_put_u8str_max_P(FTOP(fstr), n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH); + } + else if (ch == '$' && cstr) { + n -= lcd_put_u8str_max(cstr, n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH); } else if (ch == '@') { lcd_put_wchar(AXIS_CHAR(ind)); @@ -90,7 +93,7 @@ lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const int8_t ind, PGM_P const i int calculateWidth(PGM_P const pstr) { if (!USE_WIDE_GLYPH) return utf8_strlen_P(pstr) * MENU_FONT_WIDTH; const uint8_t prop = 2; - uint8_t *p = (uint8_t*)pstr; + const uint8_t *p = (uint8_t*)pstr; int n = 0; do { diff --git a/Marlin/src/lcd/lcdprint.h b/Marlin/src/lcd/lcdprint.h index d716d035ca..2eb47c534b 100644 --- a/Marlin/src/lcd/lcdprint.h +++ b/Marlin/src/lcd/lcdprint.h @@ -130,83 +130,167 @@ int lcd_glyph_height(); -int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length); +/** + * @brief Draw a UTF-8 character + * + * @param utf8_str : the UTF-8 character + * @param max_length : the output width limit (in pixels on GLCD) + * + * @return the output width (in pixels on GLCD) + */ +int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length); /** - * @brief Draw a UTF-8 string + * @brief Draw a SRAM UTF-8 string * * @param utf8_str : the UTF-8 string - * @param max_length : the pixel length of the string allowed (or number of slots in HD44780) + * @param max_length : the output width limit (in pixels on GLCD) * - * @return the pixel width - * - * Draw a UTF-8 string + * @return the output width (in pixels on GLCD) */ -int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length); +int lcd_put_u8str_max(const char *utf8_str, const pixel_len_t max_length); /** - * Set the print baseline position + * Change the print cursor position */ void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row); /** * @brief Draw a ROM UTF-8 string * - * @param utf8_pstr : the ROM UTF-8 string - * @param max_length : the pixel length of the string allowed (or number of slots in HD44780) + * @param pstr : the ROM UTF-8 string + * @param max_length : the output width limit (in pixels on GLCD) * - * @return the pixel width - * - * Draw a ROM UTF-8 string + * @return the output width (in pixels on GLCD) */ -int lcd_put_u8str_max_P(PGM_P utf8_pstr, pixel_len_t max_length); -inline int lcd_put_u8str_max_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P utf8_pstr, pixel_len_t max_length) { +int lcd_put_u8str_max_P(PGM_P pstr, const pixel_len_t max_length); +inline int lcd_put_u8str_max_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P pstr, const pixel_len_t max_length) { lcd_moveto(col, row); - return lcd_put_u8str_max_P(utf8_pstr, max_length); + return lcd_put_u8str_max_P(pstr, max_length); } -inline int lcd_put_u8str_max(const lcd_uint_t col, const lcd_uint_t row, FSTR_P const utf8_fstr, pixel_len_t max_length) { - return lcd_put_u8str_max_P(col, row, FTOP(utf8_fstr), max_length); +inline int lcd_put_u8str_max(const lcd_uint_t col, const lcd_uint_t row, FSTR_P const fstr, const pixel_len_t max_length) { + return lcd_put_u8str_max_P(col, row, FTOP(fstr), max_length); } +/** + * @brief Draw an integer, left-justified + * + * @param i : the integer + */ void lcd_put_int(const int i); inline void lcd_put_int(const lcd_uint_t col, const lcd_uint_t row, const int i) { lcd_moveto(col, row); lcd_put_int(i); } +/** + * @brief Draw a ROM UTF-8 string + * + * @param i : the integer + */ inline int lcd_put_u8str_P(PGM_P const pstr) { return lcd_put_u8str_max_P(pstr, PIXEL_LEN_NOLIMIT); } inline int lcd_put_u8str_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P const pstr) { lcd_moveto(col, row); return lcd_put_u8str_P(pstr); } +/** + * @brief Draw a ROM UTF-8 F-string + * + * @param fstr The F-string pointer + * @return the output width (in pixels on GLCD) + */ inline int lcd_put_u8str(FSTR_P const fstr) { return lcd_put_u8str_P(FTOP(fstr)); } inline int lcd_put_u8str(const lcd_uint_t col, const lcd_uint_t row, FSTR_P const fstr) { return lcd_put_u8str_P(col, row, FTOP(fstr)); } -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) { +/** + * @brief Draw a string with optional substitution + * @details Print a string with optional substitutions: + * $ displays the clipped string given by fstr or cstr + * = displays '0'....'10' for indexes 0 - 10 + * ~ displays '1'....'11' for indexes 0 - 10 + * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) + * @ displays an axis name such as XYZUVW, or E for an extruder + * + * @param ptpl A ROM string (template) + * @param ind An index value to use for = ~ * substitution + * @param cstr An SRAM C-string to use for $ substitution + * @param fstr A ROM F-string to use for $ substitution + * @param maxlen The maximum size of the string (in pixels on GLCD) + * @return the output width (in pixels on GLCD) + */ +lcd_uint_t lcd_put_u8str_P(PGM_P const ptpl, const int8_t ind, const char *cstr=nullptr, FSTR_P const fstr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH); +inline lcd_uint_t lcd_put_u8str_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P const ptpl, const int8_t ind, const char *cstr=nullptr, FSTR_P const fstr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH) { lcd_moveto(col, row); - return lcd_put_u8str_ind_P(pstr, ind, inStr, maxlen); + return lcd_put_u8str_P(ptpl, ind, cstr, fstr, maxlen); } -inline lcd_uint_t lcd_put_u8str_ind(FSTR_P const fstr, const int8_t ind, FSTR_P const inFstr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH) { - return lcd_put_u8str_ind_P(FTOP(fstr), ind, FTOP(inFstr), maxlen); +/** + * @brief Draw a ROM UTF-8 F-string with optional substitution + * @details (See above) + * + * @param ftpl A ROM F-string (template) + * @param ind An index value to use for = ~ * substitution + * @param cstr An SRAM C-string to use for $ substitution + * @param fstr A ROM F-string to use for $ substitution + * @param maxlen The maximum size of the string (in pixels on GLCD) + * @return the output width (in pixels on GLCD) + */ +inline lcd_uint_t lcd_put_u8str(FSTR_P const ftpl, const int8_t ind, const char *cstr=nullptr, FSTR_P const fstr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH) { + return lcd_put_u8str_P(FTOP(ftpl), ind, cstr, fstr, maxlen); } -inline lcd_uint_t lcd_put_u8str_ind(const lcd_uint_t col, const lcd_uint_t row, FSTR_P const fstr, const int8_t ind, FSTR_P const inFstr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH) { - return lcd_put_u8str_ind_P(col, row, FTOP(fstr), ind, FTOP(inFstr), maxlen); +/** + * @param col + * @param row + */ +inline lcd_uint_t lcd_put_u8str(const lcd_uint_t col, const lcd_uint_t row, FSTR_P const ftpl, const int8_t ind, const char *cstr=nullptr, FSTR_P const fstr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH) { + return lcd_put_u8str_P(col, row, FTOP(ftpl), ind, cstr, fstr, maxlen); } +/** + * @brief Draw a SRAM string with no width limit + * + * @param str The UTF-8 string + * @return the output width (in pixels on GLCD) + */ inline int lcd_put_u8str(const char * const str) { return lcd_put_u8str_max(str, PIXEL_LEN_NOLIMIT); } +/** + * @param col + * @param row + */ inline int lcd_put_u8str(const lcd_uint_t col, const lcd_uint_t row, const char * const str) { lcd_moveto(col, row); return lcd_put_u8str(str); } +/** + * @brief Draw a UTF-8 character with no width limit + * + * @param c The wchar to draw + * @return the output width (in pixels on GLCD) + */ inline int lcd_put_wchar(const wchar_t c) { return lcd_put_wchar_max(c, PIXEL_LEN_NOLIMIT); } +/** + * @param col + * @param row + */ inline int lcd_put_wchar(const lcd_uint_t col, const lcd_uint_t row, const wchar_t c) { lcd_moveto(col, row); return lcd_put_wchar(c); } +/** + * @brief Calculate the width of a ROM UTF-8 string (in pixels on GLCD) + * + * @param pstr The ROM-based UTF-8 string + * @return the string width (in pixels on GLCD) + */ int calculateWidth(PGM_P const pstr); +/** + * @brief Calculate the width of a ROM UTF-8 string (in pixels on GLCD) + * + * @param pstr The ROM-based UTF-8 string + * @return the string width (in pixels on GLCD) + */ +inline int calculateWidth(FSTR_P const fstr) { return calculateWidth(FTOP(fstr)); } diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 675e22b110..3976c48dc7 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -140,12 +140,12 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; preheat_t MarlinUI::material_preset[PREHEAT_COUNT]; // Initialized by settings.load() - PGM_P MarlinUI::get_preheat_label(const uint8_t m) { + FSTR_P MarlinUI::get_preheat_label(const uint8_t m) { #define _PDEF(N) static PGMSTR(preheat_##N##_label, PREHEAT_##N##_LABEL); #define _PLBL(N) preheat_##N##_label, REPEAT_1(PREHEAT_COUNT, _PDEF); static PGM_P const preheat_labels[PREHEAT_COUNT] PROGMEM = { REPEAT_1(PREHEAT_COUNT, _PLBL) }; - return (PGM_P)pgm_read_ptr(&preheat_labels[m]); + return FPSTR((PGM_P)pgm_read_ptr(&preheat_labels[m])); } void MarlinUI::apply_preheat(const uint8_t m, const uint8_t pmask, const uint8_t e/*=active_extruder*/) { @@ -416,10 +416,11 @@ void MarlinUI::init() { SETCURSOR(0, row); // Simulate carriage return }; - uint8_t *p = (uint8_t*)string; + const uint8_t *p = (uint8_t*)string; wchar_t ch; if (wordwrap) { - uint8_t *wrd = nullptr, c = 0; + const uint8_t *wrd = nullptr; + uint8_t c = 0; // find the end of the part for (;;) { if (!wrd) wrd = p; // Get word start /before/ advancing @@ -454,20 +455,20 @@ void MarlinUI::init() { } } - void MarlinUI::draw_select_screen_prompt(PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { - const uint8_t plen = utf8_strlen_P(pref), slen = suff ? utf8_strlen_P(suff) : 0; + void MarlinUI::draw_select_screen_prompt(FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { + const uint8_t plen = utf8_strlen(pref), slen = suff ? utf8_strlen(suff) : 0; uint8_t col = 0, row = 0; if (!string && plen + slen <= LCD_WIDTH) { col = (LCD_WIDTH - plen - slen) / 2; row = LCD_HEIGHT > 3 ? 1 : 0; } if (LCD_HEIGHT >= 8) row = LCD_HEIGHT / 2 - 2; - wrap_string_P(col, row, pref, true); + wrap_string_P(col, row, FTOP(pref), true); if (string) { if (col) { col = 0; row++; } // Move to the start of the next line wrap_string(col, row, string); } - if (suff) wrap_string_P(col, row, suff); + if (suff) wrap_string_P(col, row, FTOP(suff)); } #endif // !HAS_GRAPHICAL_TFT @@ -484,17 +485,17 @@ void MarlinUI::init() { #if HAS_MARLINUI_MENU && !HAS_ADC_BUTTONS - void lcd_move_x(); - void lcd_move_y(); - void lcd_move_z(); - void _reprapworld_keypad_move(const AxisEnum axis, const int16_t dir) { ui.manual_move.menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; ui.encoderPosition = dir; switch (axis) { - case X_AXIS: lcd_move_x(); break; - case Y_AXIS: lcd_move_y(); break; - case Z_AXIS: lcd_move_z(); + case X_AXIS: { void lcd_move_x(); lcd_move_x(); } break; + #if HAS_Y_AXIS + case Y_AXIS: { void lcd_move_y(); lcd_move_y(); } break; + #endif + #if HAS_Z_AXIS + case Z_AXIS: { void lcd_move_z(); lcd_move_z(); } break; + #endif default: break; } } @@ -1651,7 +1652,7 @@ void MarlinUI::init() { void MarlinUI::pause_print() { #if HAS_MARLINUI_MENU - synchronize(GET_TEXT(MSG_PAUSING)); + synchronize(GET_TEXT_F(MSG_PAUSING)); defer_status_screen(); #endif @@ -1755,7 +1756,7 @@ void MarlinUI::init() { if (old_status < 2) { #if ENABLED(EXTENSIBLE_UI) ExtUI::onMediaRemoved(); - #elif PIN_EXISTS(SD_DETECT) + #elif HAS_SD_DETECT LCD_MESSAGE(MSG_MEDIA_REMOVED); #if HAS_MARLINUI_MENU if (!defer_return_to_status) return_to_status(); @@ -1855,12 +1856,12 @@ void MarlinUI::init() { #if DISABLED(EEPROM_AUTO_INIT) - static inline PGM_P eeprom_err(const uint8_t msgid) { + static inline FSTR_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); + case 0: return GET_TEXT_F(MSG_ERR_EEPROM_CRC); + case 1: return GET_TEXT_F(MSG_ERR_EEPROM_INDEX); + case 2: return GET_TEXT_F(MSG_ERR_EEPROM_VERSION); } } @@ -1868,17 +1869,17 @@ void MarlinUI::init() { #if HAS_MARLINUI_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); + FSTR_P const restore_msg = GET_TEXT_F(MSG_INIT_EEPROM); + char msg[utf8_strlen(restore_msg) + 1]; + strcpy_P(msg, FTOP(restore_msg)); MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_RESET), GET_TEXT(MSG_BUTTON_IGNORE), + GET_TEXT_F(MSG_BUTTON_RESET), GET_TEXT_F(MSG_BUTTON_IGNORE), init_eeprom, return_to_status, - eeprom_err(editable.uint8), msg, PSTR("?") + eeprom_err(editable.uint8), msg, F("?") ); }); #else - set_status(FPSTR(eeprom_err(msgid))); + set_status(eeprom_err(msgid)); #endif } diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index c27ced6fdd..66e5e0c261 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -520,7 +520,7 @@ public: #if HAS_PREHEAT enum PreheatTarget : uint8_t { PT_HOTEND, PT_BED, PT_FAN, PT_CHAMBER, PT_ALL = 0xFF }; static preheat_t material_preset[PREHEAT_COUNT]; - static PGM_P get_preheat_label(const uint8_t m); + static FSTR_P get_preheat_label(const uint8_t m); static void apply_preheat(const uint8_t m, const uint8_t pmask, const uint8_t e=active_extruder); static void preheat_set_fan(const uint8_t m) { TERN_(HAS_FAN, apply_preheat(m, _BV(PT_FAN))); } static void preheat_hotend(const uint8_t m, const uint8_t e=active_extruder) { TERN_(HAS_HOTEND, apply_preheat(m, _BV(PT_HOTEND))); } @@ -559,7 +559,7 @@ public: static void set_selection(const bool sel) { selection = sel; } static bool update_selection(); - static void synchronize(PGM_P const msg=nullptr); + static void synchronize(FSTR_P const msg=nullptr); static screenFunc_t currentScreen; static bool screen_changed; @@ -605,7 +605,7 @@ public: static float ubl_mesh_value(); #endif - static void draw_select_screen_prompt(PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr); + static void draw_select_screen_prompt(FSTR_P const pref, const char * const string=nullptr, FSTR_P const suff=nullptr); #else diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 2f075238e4..a1e2beaf72 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -47,7 +47,7 @@ ///////////// Global Variables ///////////// //////////////////////////////////////////// -#if HAS_LEVELING && ANY(LEVEL_BED_CORNERS, PROBE_OFFSET_WIZARD, X_AXIS_TWIST_COMPENSATION) +#if HAS_LEVELING && ANY(LCD_BED_TRAMMING, PROBE_OFFSET_WIZARD, X_AXIS_TWIST_COMPENSATION) bool leveling_was_active; // = false #endif #if ANY(PROBE_MANUALLY, MESH_BED_LEVELING, X_AXIS_TWIST_COMPENSATION) @@ -68,12 +68,13 @@ typedef struct { menuPosition screen_history[6]; uint8_t screen_history_depth = 0; -int8_t MenuItemBase::itemIndex; // Index number for draw and action -PGM_P MenuItemBase::itemString; // A PSTR for substitution -chimera_t editable; // Value Editing +int8_t MenuItemBase::itemIndex; // Index number for draw and action +FSTR_P MenuItemBase::itemStringF; // A string for substitution +const char *MenuItemBase::itemStringC; +chimera_t editable; // Value Editing // Menu Edit Items -PGM_P MenuEditItemBase::editLabel; +FSTR_P MenuEditItemBase::editLabel; void* MenuEditItemBase::editValue; int32_t MenuEditItemBase::minEditValue, MenuEditItemBase::maxEditValue; @@ -134,7 +135,7 @@ void MenuEditItemBase::edit_screen(strfunc_t strfunc, loadfunc_t loadfunc) { // Going to an edit screen sets up some persistent values first void MenuEditItemBase::goto_edit_screen( - PGM_P const el, // Edit label + FSTR_P const el, // Edit label void * const ev, // Edit value pointer const int32_t minv, // Encoder minimum const int32_t maxv, // Encoder maximum @@ -232,8 +233,8 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co // Display a "synchronize" screen with a custom message until // all moves are finished. Go back to calling screen when done. // -void MarlinUI::synchronize(PGM_P const msg/*=nullptr*/) { - static PGM_P sync_message = msg ?: GET_TEXT(MSG_MOVING); +void MarlinUI::synchronize(FSTR_P const fmsg/*=nullptr*/) { + static FSTR_P sync_message = fmsg ?: GET_TEXT_F(MSG_MOVING); push_current_screen(); goto_screen([]{ if (should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, sync_message); @@ -319,12 +320,12 @@ void scroll_screen(const uint8_t limit, const bool is_menu) { } if (ui.should_draw()) { if (do_probe) { - MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_ZPROBE_ZOFFSET), BABYSTEP_TO_STR(probe.offset.z)); + MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_ZPROBE_ZOFFSET), BABYSTEP_TO_STR(probe.offset.z)); TERN_(BABYSTEP_ZPROBE_GFX_OVERLAY, ui.zoffset_overlay(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)); + MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_HOTEND_OFFSET_Z), ftostr54sign(hotend_offset[active_extruder].z)); #endif } } @@ -335,7 +336,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) { void _lcd_draw_homing() { if (ui.should_draw()) { constexpr uint8_t line = (LCD_HEIGHT - 1) / 2; - MenuItem_static::draw(line, GET_TEXT(MSG_LEVEL_BED_HOMING)); + MenuItem_static::draw(line, GET_TEXT_F(MSG_LEVEL_BED_HOMING)); } } @@ -357,9 +358,9 @@ bool MarlinUI::update_selection() { } void MenuItem_confirm::select_screen( - PGM_P const yes, PGM_P const no, + FSTR_P const yes, FSTR_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, - PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/ + FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/ ) { ui.defer_status_screen(); const bool ui_selection = !yes ? false : !no || ui.update_selection(), diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index 288dd5be2f..3e88f68690 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -53,73 +53,75 @@ class MenuItemBase { // 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; + // Optional pointers for use in display or by the action + static FSTR_P itemStringF; + static const char* itemStringC; - // Store the index of the item ahead of use by indexed items - FORCE_INLINE static void init(const int8_t ind=0, PGM_P const pstr=nullptr) { itemIndex = ind; itemString = pstr; } + // Store an index and string for later substitution + FORCE_INLINE static void init(const int8_t ind=0, FSTR_P const fstr=nullptr) { itemIndex = ind; itemStringF = fstr; itemStringC = nullptr; } + FORCE_INLINE static void init(const int8_t ind, const char * const cstr) { itemIndex = ind; itemStringC = cstr; itemStringF = nullptr; } // Implementation-specific: // Draw an item either selected (pre_char) or not (space) with post_char - // Menus may set up itemIndex, itemString and pass them to string-building or string-emitting functions - static void _draw(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char); + // Menus may set up itemIndex, itemStringC/F and pass them to string-building or string-emitting functions + static void _draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char); // Draw an item either selected ('>') or not (space) with post_char - FORCE_INLINE static void _draw(const bool sel, const uint8_t row, PGM_P const pstr, const char post_char) { - _draw(sel, row, pstr, '>', post_char); + FORCE_INLINE static void _draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char post_char) { + _draw(sel, row, fstr, '>', post_char); } }; // STATIC_ITEM(LABEL,...) class MenuItem_static : public MenuItemBase { public: - static void draw(const uint8_t row, PGM_P const pstr, const uint8_t style=SS_DEFAULT, const char * const vstr=nullptr); + static void draw(const uint8_t row, FSTR_P const fstr, const uint8_t style=SS_DEFAULT, const char * const vstr=nullptr); }; // BACK_ITEM(LABEL) class MenuItem_back : public MenuItemBase { public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr) { - _draw(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr) { + _draw(sel, row, fstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]); } // Back Item action goes back one step in history - FORCE_INLINE static void action(PGM_P const=nullptr) { ui.go_back(); } + FORCE_INLINE static void action(FSTR_P const=nullptr) { ui.go_back(); } }; // CONFIRM_ITEM(LABEL,Y,N,FY,FN,...), // YESNO_ITEM(LABEL,FY,FN,...) class MenuItem_confirm : public MenuItemBase { public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { - _draw(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const ftpl, ...) { + _draw(sel, row, ftpl, '>', LCD_STR_ARROW_RIGHT[0]); } // Implemented for HD44780 and DOGM // Draw the prompt, buttons, and state static void draw_select_screen( - PGM_P const yes, // Right option label - PGM_P const no, // Left option label + FSTR_P const yes, // Right option label + FSTR_P const no, // Left option label const bool yesno, // Is "yes" selected? - PGM_P const pref, // Prompt prefix + FSTR_P const pref, // Prompt prefix const char * const string, // Prompt runtime string - PGM_P const suff // Prompt suffix + FSTR_P const suff // Prompt suffix ); static void select_screen( - PGM_P const yes, PGM_P const no, + FSTR_P const yes, FSTR_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, - PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr + FSTR_P const pref, const char * const string=nullptr, FSTR_P const suff=nullptr ); static void select_screen( - PGM_P const yes, PGM_P const no, + FSTR_P const yes, FSTR_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, - PGM_P const pref, FSTR_P const string, PGM_P const suff=nullptr + FSTR_P const pref, FSTR_P const string, FSTR_P const suff=nullptr ) { char str[strlen_P(FTOP(string)) + 1]; strcpy_P(str, FTOP(string)); select_screen(yes, no, yesFunc, noFunc, pref, str, suff); } // Shortcut for prompt with "NO"/ "YES" labels - FORCE_INLINE static void confirm_screen(selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr) { - select_screen(GET_TEXT(MSG_YES), GET_TEXT(MSG_NO), yesFunc, noFunc, pref, string, suff); + FORCE_INLINE static void confirm_screen(selectFunc_t yesFunc, selectFunc_t noFunc, FSTR_P const pref, const char * const string=nullptr, FSTR_P const suff=nullptr) { + select_screen(GET_TEXT_F(MSG_YES), GET_TEXT_F(MSG_NO), yesFunc, noFunc, pref, string, suff); } }; @@ -148,7 +150,7 @@ class MenuEditItemBase : public MenuItemBase { // The action() method acts like the instantiator. The entire lifespan // of a menu item is within its declaration, so all these values decompose // into behavior and unused items get optimized out. - static PGM_P editLabel; + static FSTR_P editLabel; static void *editValue; static int32_t minEditValue, maxEditValue; // Encoder value range static screenFunc_t callbackFunc; @@ -157,7 +159,7 @@ class MenuEditItemBase : public MenuItemBase { typedef const char* (*strfunc_t)(const int32_t); typedef void (*loadfunc_t)(void *, const int32_t); static void goto_edit_screen( - PGM_P const el, // Edit label + FSTR_P const el, // Edit label void * const ev, // Edit value pointer const int32_t minv, // Encoder minimum const int32_t maxv, // Encoder maximum @@ -170,11 +172,15 @@ class MenuEditItemBase : public MenuItemBase { public: // Implementation-specific: // 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 inStr, const bool pgm=false); + static void draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char * const inStr, const bool pgm=false); + + static void draw(const bool sel, const uint8_t row, FSTR_P const ftpl, FSTR_P const fstr) { + draw(sel, row, ftpl, FTOP(fstr), true); + } // Implementation-specific: // This low-level method is good to draw from anywhere - static void draw_edit_screen(PGM_P const pstr, const char * const value); + static void draw_edit_screen(FSTR_P const fstr, const char * const value); // This method is for the current menu item static void draw_edit_screen(const char * const value) { draw_edit_screen(editLabel, value); } @@ -185,7 +191,7 @@ class MenuEditItemBase : public MenuItemBase { class MenuItem_sdbase { public: // Implemented for HD44780 and DOGM - static void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard, const bool isDir); + static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, CardReader &theCard, const bool isDir); }; #endif @@ -207,7 +213,7 @@ void menu_move(); void lcd_move_z(); void _lcd_draw_homing(); -#define HAS_LINE_TO_Z ANY(DELTA, PROBE_MANUALLY, MESH_BED_LEVELING, LEVEL_BED_CORNERS) +#define HAS_LINE_TO_Z ANY(DELTA, PROBE_MANUALLY, MESH_BED_LEVELING, LCD_BED_TRAMMING) #if HAS_LINE_TO_Z void line_to_z(const_float_t z); @@ -254,7 +260,7 @@ inline void clear_menu_history() { screen_history_depth = 0; } #define STICKY_SCREEN(S) []{ ui.defer_status_screen(); ui.goto_screen(S); } -#if HAS_LEVELING && ANY(LEVEL_BED_CORNERS, PROBE_OFFSET_WIZARD, X_AXIS_TWIST_COMPENSATION) +#if HAS_LEVELING && ANY(LCD_BED_TRAMMING, PROBE_OFFSET_WIZARD, X_AXIS_TWIST_COMPENSATION) extern bool leveling_was_active; #endif diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index b786931a42..a6ebb10407 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -68,8 +68,10 @@ void menu_backlash(); LOOP_LOGICAL_AXES(i) driverPercent[i] = stepper_dac.get_current_percent((AxisEnum)i); START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); - #define EDIT_DAC_PERCENT(A) EDIT_ITEM(uint8, MSG_DAC_PERCENT_##A, &driverPercent[_AXIS(A)], 0, 100, []{ stepper_dac.set_current_percents(driverPercent); }) - LOGICAL_AXIS_CODE(EDIT_DAC_PERCENT(E), EDIT_DAC_PERCENT(A), EDIT_DAC_PERCENT(B), EDIT_DAC_PERCENT(C), EDIT_DAC_PERCENT(I), EDIT_DAC_PERCENT(J), EDIT_DAC_PERCENT(K), EDIT_DAC_PERCENT(U), EDIT_DAC_PERCENT(V), EDIT_DAC_PERCENT(W)); + + LOOP_LOGICAL_AXES(a) + EDIT_ITEM_N(uint8, a, MSG_DAC_PERCENT_N, &driverPercent[a], 0, 100, []{ stepper_dac.set_current_percents(driverPercent); }); + ACTION_ITEM(MSG_DAC_EEPROM_WRITE, stepper_dac.commit_eeprom); END_MENU(); } @@ -83,7 +85,7 @@ void menu_backlash(); void menu_pwm() { START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); - #define EDIT_CURRENT_PWM(LABEL,I) EDIT_ITEM_P(long5, PSTR(LABEL), &stepper.motor_current_setting[I], 100, 2000, stepper.refresh_motor_power) + #define EDIT_CURRENT_PWM(LABEL,I) EDIT_ITEM_F(long5, F(LABEL), &stepper.motor_current_setting[I], 100, 2000, stepper.refresh_motor_power) #if ANY_PIN(MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y) EDIT_CURRENT_PWM(STR_A STR_B, 0); #endif @@ -415,7 +417,7 @@ void menu_backlash(); #elif ENABLED(LIMITED_MAX_FR_EDITING) DEFAULT_MAX_FEEDRATE #else - LOGICAL_AXIS_ARRAY(9999, 9999, 9999, 9999, 9999, 9999, 9999, 9999, 9999, 9999) + LOGICAL_AXIS_ARRAY_1(9999) #endif ; #if ENABLED(LIMITED_MAX_FR_EDITING) && !defined(MAX_FEEDRATE_EDIT_VALUES) @@ -427,11 +429,11 @@ void menu_backlash(); START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); - #define EDIT_VMAX(N) EDIT_ITEM_FAST(float5, MSG_VMAX_##N, &planner.settings.max_feedrate_mm_s[_AXIS(N)], 1, max_fr_edit_scaled[_AXIS(N)]) - NUM_AXIS_CODE(EDIT_VMAX(A), EDIT_VMAX(B), EDIT_VMAX(C), EDIT_VMAX(I), EDIT_VMAX(J), EDIT_VMAX(K), EDIT_VMAX(U), EDIT_VMAX(V), EDIT_VMAX(W)); + LOOP_NUM_AXES(a) + EDIT_ITEM_FAST_N(float5, a, MSG_VMAX_N, &planner.settings.max_feedrate_mm_s[a], 1, max_fr_edit_scaled[a]); #if E_STEPPERS - EDIT_ITEM_FAST(float5, MSG_VMAX_E, &planner.settings.max_feedrate_mm_s[E_AXIS_N(active_extruder)], 1, max_fr_edit_scaled.e); + EDIT_ITEM_FAST_N(float5, E_AXIS, MSG_VMAX_N, &planner.settings.max_feedrate_mm_s[E_AXIS_N(active_extruder)], 1, max_fr_edit_scaled.e); #endif #if ENABLED(DISTINCT_E_FACTORS) LOOP_L_N(n, E_STEPPERS) @@ -458,7 +460,7 @@ void menu_backlash(); #elif ENABLED(LIMITED_MAX_ACCEL_EDITING) DEFAULT_MAX_ACCELERATION #else - LOGICAL_AXIS_ARRAY(99000, 99000, 99000, 99000, 99000, 99000, 99000, 99000, 99000, 99000) + LOGICAL_AXIS_ARRAY_1(99000) #endif ; #if ENABLED(LIMITED_MAX_ACCEL_EDITING) && !defined(MAX_ACCEL_EDIT_VALUES) @@ -515,40 +517,28 @@ void menu_backlash(); 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 + EDIT_ITEM(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.001f, TERN(LIN_ADVANCE, 0.3f, 0.5f) + OPTARG(LIN_ADVANCE, planner.recalculate_max_e_jerk) + ); #endif constexpr xyze_float_t max_jerk_edit = #ifdef MAX_JERK_EDIT_VALUES MAX_JERK_EDIT_VALUES #elif ENABLED(LIMITED_JERK_EDITING) - { LOGICAL_AXIS_LIST((DEFAULT_EJERK) * 2, - (DEFAULT_XJERK) * 2, (DEFAULT_YJERK) * 2, (DEFAULT_ZJERK) * 2, - (DEFAULT_IJERK) * 2, (DEFAULT_JJERK) * 2, (DEFAULT_KJERK) * 2, - (DEFAULT_UJERK) * 2, (DEFAULT_VJERK) * 2, (DEFAULT_WJERK) * 2) } + #define _JERK2(N) DEFAULT_##N##JERK * 2 + { MAPLIST(_JERK2, LOGICAL_AXIS_NAMES) } #else - { LOGICAL_AXIS_LIST(990, 990, 990, 990, 990, 990, 990, 990, 990, 990) } + LOGICAL_AXIS_ARRAY_1(990) #endif ; - #define EDIT_JERK(N) EDIT_ITEM_FAST(float3, MSG_V##N##_JERK, &planner.max_jerk[_AXIS(N)], 1, max_jerk_edit[_AXIS(N)]) - #if ENABLED(DELTA) - #define EDIT_JERK_C() EDIT_JERK(C) - #else - #define EDIT_JERK_C() EDIT_ITEM_FAST(float52sign, MSG_VC_JERK, &planner.max_jerk.c, 0.1f, max_jerk_edit.c) - #endif - NUM_AXIS_CODE( - EDIT_JERK(A), EDIT_JERK(B), EDIT_JERK_C(), - EDIT_JERK(I), EDIT_JERK(J), EDIT_JERK(K), - EDIT_JERK(U), EDIT_JERK(V), EDIT_JERK(W) - ); - #if HAS_EXTRUDERS - EDIT_ITEM_FAST(float52sign, MSG_VE_JERK, &planner.max_jerk.e, 0.1f, max_jerk_edit.e); - #endif + LOOP_LOGICAL_AXES(a) { + if (a == C_AXIS || TERN0(HAS_EXTRUDERS, a == E_AXIS)) + EDIT_ITEM_FAST_N(float52sign, a, MSG_VN_JERK, &planner.max_jerk[a], 0.1f, max_jerk_edit[a]); + else + EDIT_ITEM_FAST_N(float3, a, MSG_VN_JERK, &planner.max_jerk[a], 1.0f, max_jerk_edit[a]); + } END_MENU(); } @@ -585,12 +575,8 @@ void menu_advanced_steps_per_mm() { START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); - #define EDIT_QSTEPS(Q) EDIT_ITEM_FAST(float61, MSG_##Q##_STEPS, &planner.settings.axis_steps_per_mm[_AXIS(Q)], 5, 9999, []{ planner.refresh_positioning(); }) - NUM_AXIS_CODE( - EDIT_QSTEPS(A), EDIT_QSTEPS(B), EDIT_QSTEPS(C), - EDIT_QSTEPS(I), EDIT_QSTEPS(J), EDIT_QSTEPS(K), - EDIT_QSTEPS(U), EDIT_QSTEPS(V), EDIT_QSTEPS(W) - ); + LOOP_NUM_AXES(a) + EDIT_ITEM_FAST_N(float61, a, MSG_N_STEPS, &planner.settings.axis_steps_per_mm[a], 5, 9999, []{ planner.refresh_positioning(); }); #if ENABLED(DISTINCT_E_FACTORS) LOOP_L_N(n, E_STEPPERS) @@ -602,7 +588,7 @@ void menu_advanced_steps_per_mm() { planner.mm_per_step[E_AXIS_N(e)] = 1.0f / planner.settings.axis_steps_per_mm[E_AXIS_N(e)]; }); #elif E_STEPPERS - EDIT_ITEM_FAST(float61, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); }); + EDIT_ITEM_FAST_N(float61, E_AXIS, MSG_N_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); }); #endif END_MENU(); @@ -628,7 +614,7 @@ void menu_advanced_settings() { #endif // M203 / M205 - Feedrate items - SUBMENU(MSG_VELOCITY, menu_advanced_velocity); + SUBMENU(MSG_MAX_SPEED, menu_advanced_velocity); // M201 - Acceleration items SUBMENU(MSG_ACCELERATION, menu_advanced_acceleration); @@ -709,7 +695,7 @@ void menu_advanced_settings() { CONFIRM_ITEM(MSG_INIT_EEPROM, MSG_BUTTON_INIT, MSG_BUTTON_CANCEL, ui.init_eeprom, nullptr, - GET_TEXT(MSG_INIT_EEPROM), (const char *)nullptr, PSTR("?") + GET_TEXT_F(MSG_INIT_EEPROM), (const char *)nullptr, F("?") ); #endif diff --git a/Marlin/src/lcd/menu/menu_backlash.cpp b/Marlin/src/lcd/menu/menu_backlash.cpp index 07f3c9d704..e71606fc12 100644 --- a/Marlin/src/lcd/menu/menu_backlash.cpp +++ b/Marlin/src/lcd/menu/menu_backlash.cpp @@ -47,7 +47,7 @@ void menu_backlash() { #define EDIT_BACKLASH_DISTANCE(N) do { \ editable.decimal = backlash.get_distance_mm(_AXIS(N)); \ - EDIT_ITEM_FAST(float43, MSG_BACKLASH_##N, &editable.decimal, 0.0f, 9.9f, []{ backlash.set_distance_mm(_AXIS(N), editable.decimal); }); \ + EDIT_ITEM_FAST_N(float43, _AXIS(N), MSG_BACKLASH_N, &editable.decimal, 0.0f, 9.9f, []{ backlash.set_distance_mm(_AXIS(N), editable.decimal); }); \ } while (0); if (_CAN_CALI(A)) EDIT_BACKLASH_DISTANCE(A); diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index 163a2a751a..3fe0c582cb 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_MARLINUI_MENU, LEVEL_BED_CORNERS) +#if BOTH(HAS_MARLINUI_MENU, LCD_BED_TRAMMING) #include "menu_item.h" #include "../../module/motion.h" @@ -36,21 +36,21 @@ #include "../../feature/bedlevel/bedlevel.h" #endif -#ifndef LEVEL_CORNERS_Z_HOP - #define LEVEL_CORNERS_Z_HOP 4.0 +#ifndef BED_TRAMMING_Z_HOP + #define BED_TRAMMING_Z_HOP 4.0 #endif -#ifndef LEVEL_CORNERS_HEIGHT - #define LEVEL_CORNERS_HEIGHT 0.0 +#ifndef BED_TRAMMING_HEIGHT + #define BED_TRAMMING_HEIGHT 0.0 #endif -#if ENABLED(LEVEL_CORNERS_USE_PROBE) +#if ENABLED(BED_TRAMMING_USE_PROBE) #include "../../module/probe.h" #include "../../module/endstops.h" #if ENABLED(BLTOUCH) #include "../../feature/bltouch.h" #endif - #ifndef LEVEL_CORNERS_PROBE_TOLERANCE - #define LEVEL_CORNERS_PROBE_TOLERANCE 0.2 + #ifndef BED_TRAMMING_PROBE_TOLERANCE + #define BED_TRAMMING_PROBE_TOLERANCE 0.2 #endif float last_z; int good_points; @@ -64,32 +64,32 @@ #endif -static_assert(LEVEL_CORNERS_Z_HOP >= 0, "LEVEL_CORNERS_Z_HOP must be >= 0. Please update your configuration."); +static_assert(BED_TRAMMING_Z_HOP >= 0, "BED_TRAMMING_Z_HOP must be >= 0. Please update your configuration."); -#ifndef LEVEL_CORNERS_LEVELING_ORDER - #define LEVEL_CORNERS_LEVELING_ORDER { LF, RF, LB, RB } // Default - //#define LEVEL_CORNERS_LEVELING_ORDER { LF, LB, RF } // 3 hard-coded points - //#define LEVEL_CORNERS_LEVELING_ORDER { LF, RF } // 3-Point tramming - Rear - //#define LEVEL_CORNERS_LEVELING_ORDER { LF, LB } // 3-Point tramming - Right - //#define LEVEL_CORNERS_LEVELING_ORDER { RF, RB } // 3-Point tramming - Left - //#define LEVEL_CORNERS_LEVELING_ORDER { LB, RB } // 3-Point tramming - Front +#ifndef BED_TRAMMING_LEVELING_ORDER + #define BED_TRAMMING_LEVELING_ORDER { LF, RF, LB, RB } // Default + //#define BED_TRAMMING_LEVELING_ORDER { LF, LB, RF } // 3 hard-coded points + //#define BED_TRAMMING_LEVELING_ORDER { LF, RF } // 3-Point tramming - Rear + //#define BED_TRAMMING_LEVELING_ORDER { LF, LB } // 3-Point tramming - Right + //#define BED_TRAMMING_LEVELING_ORDER { RF, RB } // 3-Point tramming - Left + //#define BED_TRAMMING_LEVELING_ORDER { LB, RB } // 3-Point tramming - Front #endif #define LF 1 #define RF 2 #define RB 3 #define LB 4 -constexpr int lco[] = LEVEL_CORNERS_LEVELING_ORDER; +constexpr int lco[] = BED_TRAMMING_LEVELING_ORDER; constexpr bool level_corners_3_points = COUNT(lco) == 2; -static_assert(level_corners_3_points || COUNT(lco) == 4, "LEVEL_CORNERS_LEVELING_ORDER must have exactly 2 or 4 corners."); +static_assert(level_corners_3_points || COUNT(lco) == 4, "BED_TRAMMING_LEVELING_ORDER must have exactly 2 or 4 corners."); constexpr int lcodiff = ABS(lco[0] - lco[1]); -static_assert(COUNT(lco) == 4 || lcodiff == 1 || lcodiff == 3, "The first two LEVEL_CORNERS_LEVELING_ORDER corners must be on the same edge."); +static_assert(COUNT(lco) == 4 || lcodiff == 1 || lcodiff == 3, "The first two BED_TRAMMING_LEVELING_ORDER corners must be on the same edge."); constexpr int nr_edge_points = level_corners_3_points ? 3 : 4; -constexpr int available_points = nr_edge_points + ENABLED(LEVEL_CENTER_TOO); -constexpr int center_index = TERN(LEVEL_CENTER_TOO, available_points - 1, -1); -constexpr float inset_lfrb[4] = LEVEL_CORNERS_INSET_LFRB; +constexpr int available_points = nr_edge_points + ENABLED(BED_TRAMMING_INCLUDE_CENTER); +constexpr int center_index = TERN(BED_TRAMMING_INCLUDE_CENTER, available_points - 1, -1); +constexpr float inset_lfrb[4] = BED_TRAMMING_INSET_LFRB; constexpr xy_pos_t lf { (X_MIN_BED) + inset_lfrb[0], (Y_MIN_BED) + inset_lfrb[1] }, rb { (X_MAX_BED) - inset_lfrb[2], (Y_MAX_BED) - inset_lfrb[3] }; @@ -120,12 +120,12 @@ static void _lcd_level_bed_corners_get_next_position() { if ((lco[0] == LF && lco[1] == LB) || (lco[0] == LB && lco[1] == LF)) current_position.x = rb.x; // Center Right if ((lco[0] == RF && lco[1] == RB) || (lco[0] == RB && lco[1] == RF)) current_position.x = lf.x; // Left Center if ((lco[0] == LF && lco[1] == RF) || (lco[0] == RF && lco[1] == LF)) current_position.y = rb.y; // Center Back - #if DISABLED(LEVEL_CENTER_TOO) && ENABLED(LEVEL_CORNERS_USE_PROBE) + #if DISABLED(BED_TRAMMING_INCLUDE_CENTER) && ENABLED(BED_TRAMMING_USE_PROBE) bed_corner++; // Must increment the count to ensure it resets the loop if the 3rd point is out of tolerance #endif break; - #if ENABLED(LEVEL_CENTER_TOO) + #if ENABLED(BED_TRAMMING_INCLUDE_CENTER) case 3: current_position.set(X_CENTER, Y_CENTER); break; @@ -134,9 +134,9 @@ static void _lcd_level_bed_corners_get_next_position() { } else { // Four-Corner Bed Tramming with optional center - if (TERN0(LEVEL_CENTER_TOO, bed_corner == center_index)) { + if (TERN0(BED_TRAMMING_INCLUDE_CENTER, bed_corner == center_index)) { current_position.set(X_CENTER, Y_CENTER); - TERN_(LEVEL_CORNERS_USE_PROBE, good_points--); // Decrement to allow one additional probe point + TERN_(BED_TRAMMING_USE_PROBE, good_points--); // Decrement to allow one additional probe point } else { current_position = lf; // Left front @@ -152,10 +152,10 @@ static void _lcd_level_bed_corners_get_next_position() { /** * Level corners, starting in the front-left corner. */ -#if ENABLED(LEVEL_CORNERS_USE_PROBE) +#if ENABLED(BED_TRAMMING_USE_PROBE) #define VALIDATE_POINT(X, Y, STR) static_assert(Probe::build_time::can_reach((X), (Y)), \ - "LEVEL_CORNERS_INSET_LFRB " STR " inset is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.") + "BED_TRAMMING_INSET_LFRB " STR " inset is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.") VALIDATE_POINT(lf.x, Y_CENTER, "left"); VALIDATE_POINT(X_CENTER, lf.y, "front"); VALIDATE_POINT(rb.x, Y_CENTER, "right"); VALIDATE_POINT(X_CENTER, rb.y, "back"); @@ -168,7 +168,7 @@ static void _lcd_level_bed_corners_get_next_position() { TERN_(HAS_MARLINUI_U8GLIB, ui.set_font(FONT_MENU)); // Set up the font for extra info - MenuItem_static::draw(0, GET_TEXT(MSG_PROBING_POINT), SS_INVERT); // "Probing Mesh" heading + MenuItem_static::draw(0, GET_TEXT_F(MSG_PROBING_POINT), SS_INVERT); // "Probing Mesh" heading uint8_t cy = TERN(TFT_COLOR_UI, 3, LCD_HEIGHT - 1), y = LCD_ROW_Y(cy); @@ -197,37 +197,35 @@ static void _lcd_level_bed_corners_get_next_position() { void _lcd_draw_raise() { if (!ui.should_draw()) return; MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_DONE), GET_TEXT(MSG_BUTTON_SKIP) + GET_TEXT_F(MSG_BUTTON_DONE), GET_TEXT_F(MSG_BUTTON_SKIP) , []{ corner_probing_done = true; wait_for_probe = false; } , []{ wait_for_probe = false; } - , GET_TEXT(MSG_BED_TRAMMING_RAISE) - , (const char*)nullptr, NUL_STR + , GET_TEXT_F(MSG_BED_TRAMMING_RAISE) ); } void _lcd_draw_level_prompt() { if (!ui.should_draw()) return; MenuItem_confirm::select_screen( - GET_TEXT(TERN(HAS_LEVELING, MSG_BUTTON_LEVEL, MSG_BUTTON_DONE)), - TERN(HAS_LEVELING, GET_TEXT(MSG_BUTTON_BACK), nullptr) + GET_TEXT_F(TERN(HAS_LEVELING, MSG_BUTTON_LEVEL, MSG_BUTTON_DONE)), + TERN(HAS_LEVELING, GET_TEXT_F(MSG_BUTTON_BACK), nullptr) , []{ queue.inject(TERN(HAS_LEVELING, F("G29N"), FPSTR(G28_STR))); ui.return_to_status(); } , TERN(HAS_LEVELING, ui.goto_previous_screen_no_defer, []{}) - , GET_TEXT(MSG_BED_TRAMMING_IN_RANGE) - , (const char*)nullptr, NUL_STR + , GET_TEXT_F(MSG_BED_TRAMMING_IN_RANGE) ); } bool _lcd_level_bed_corners_probe(bool verify=false) { - if (verify) do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); // do clearance if needed + if (verify) do_blocking_move_to_z(current_position.z + BED_TRAMMING_Z_HOP); // do clearance if needed TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.deploy()); // Deploy in LOW SPEED MODE on every probe action - do_blocking_move_to_z(last_z - LEVEL_CORNERS_PROBE_TOLERANCE, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW)); // Move down to lower tolerance + do_blocking_move_to_z(last_z - BED_TRAMMING_PROBE_TOLERANCE, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW)); // Move down to lower tolerance if (TEST(endstops.trigger_state(), Z_MIN_PROBE)) { // check if probe triggered endstops.hit_on_purpose(); set_current_from_steppers_for_axis(Z_AXIS); sync_plan_position(); TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.stow()); // Stow in LOW SPEED MODE on every trigger // Triggered outside tolerance range? - if (ABS(current_position.z - last_z) > LEVEL_CORNERS_PROBE_TOLERANCE) { + if (ABS(current_position.z - last_z) > BED_TRAMMING_PROBE_TOLERANCE) { last_z = current_position.z; // Above tolerance. Set a new Z for subsequent corners. good_points = 0; // ...and start over } @@ -247,7 +245,7 @@ static void _lcd_level_bed_corners_get_next_position() { probe_triggered = PROBE_TRIGGERED(); if (probe_triggered) { endstops.hit_on_purpose(); - TERN_(LEVEL_CORNERS_AUDIO_FEEDBACK, BUZZ(200, 600)); + TERN_(BED_TRAMMING_AUDIO_FEEDBACK, BUZZ(200, 600)); } idle(); } @@ -257,8 +255,8 @@ static void _lcd_level_bed_corners_get_next_position() { } void _lcd_test_corners() { - bed_corner = TERN(LEVEL_CENTER_TOO, center_index, 0); - last_z = LEVEL_CORNERS_HEIGHT; + bed_corner = TERN(BED_TRAMMING_INCLUDE_CENTER, center_index, 0); + last_z = BED_TRAMMING_HEIGHT; endstops.enable_z_probe(true); good_points = 0; ui.goto_screen(_lcd_draw_probing); @@ -266,7 +264,7 @@ static void _lcd_level_bed_corners_get_next_position() { ui.refresh(LCDVIEW_REDRAW_NOW); _lcd_draw_probing(); // update screen with # of good points - do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP + TERN0(BLTOUCH, bltouch.z_extra_clearance())); // clearance + do_blocking_move_to_z(current_position.z + BED_TRAMMING_Z_HOP + TERN0(BLTOUCH, bltouch.z_extra_clearance())); // clearance _lcd_level_bed_corners_get_next_position(); // Select next corner coordinates current_position -= probe.offset_xy; // Account for probe offsets @@ -275,7 +273,7 @@ static void _lcd_level_bed_corners_get_next_position() { TERN_(BLTOUCH, if (bltouch.high_speed_mode) bltouch.deploy()); // Deploy in HIGH SPEED MODE if (!_lcd_level_bed_corners_probe()) { // Probe down to tolerance if (_lcd_level_bed_corners_raise()) { // Prompt user to raise bed if needed - #if ENABLED(LEVEL_CORNERS_VERIFY_RAISED) // Verify + #if ENABLED(BED_TRAMMING_VERIFY_RAISED) // Verify while (!_lcd_level_bed_corners_probe(true)) { // Loop while corner verified if (!_lcd_level_bed_corners_raise()) { // Prompt user to raise bed if needed if (corner_probing_done) return; // Done was selected @@ -296,7 +294,7 @@ static void _lcd_level_bed_corners_get_next_position() { #if ENABLED(BLTOUCH) if (bltouch.high_speed_mode) { // In HIGH SPEED MODE do clearance and stow at the very end - do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); + do_blocking_move_to_z(current_position.z + BED_TRAMMING_Z_HOP); bltouch.stow(); } #endif @@ -305,25 +303,25 @@ static void _lcd_level_bed_corners_get_next_position() { ui.set_selection(true); } -#else // !LEVEL_CORNERS_USE_PROBE +#else // !BED_TRAMMING_USE_PROBE static void _lcd_goto_next_corner() { - line_to_z(LEVEL_CORNERS_Z_HOP); + line_to_z(BED_TRAMMING_Z_HOP); // Select next corner coordinates _lcd_level_bed_corners_get_next_position(); line_to_current_position(manual_feedrate_mm_s.x); - line_to_z(LEVEL_CORNERS_HEIGHT); + line_to_z(BED_TRAMMING_HEIGHT); if (++bed_corner >= available_points) bed_corner = 0; } -#endif // !LEVEL_CORNERS_USE_PROBE +#endif // !BED_TRAMMING_USE_PROBE static void _lcd_level_bed_corners_homing() { _lcd_draw_homing(); if (!all_axes_homed()) return; - #if ENABLED(LEVEL_CORNERS_USE_PROBE) + #if ENABLED(BED_TRAMMING_USE_PROBE) _lcd_test_corners(); if (corner_probing_done) ui.goto_previous_screen_no_defer(); TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active)); @@ -332,15 +330,15 @@ static 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) + GET_TEXT_F(MSG_BUTTON_NEXT), GET_TEXT_F(MSG_BUTTON_DONE) , _lcd_goto_next_corner , []{ - line_to_z(LEVEL_CORNERS_Z_HOP); // Raise Z off the bed when done + line_to_z(BED_TRAMMING_Z_HOP); // Raise Z off the bed when done 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("?") + , GET_TEXT_F(TERN(BED_TRAMMING_INCLUDE_CENTER, MSG_LEVEL_BED_NEXT_POINT, MSG_NEXT_CORNER)) + , (const char*)nullptr, F("?") ); }); ui.set_selection(true); @@ -364,4 +362,4 @@ void _lcd_level_bed_corners() { ui.goto_screen(_lcd_level_bed_corners_homing); } -#endif // HAS_MARLINUI_MENU && LEVEL_BED_CORNERS +#endif // HAS_MARLINUI_MENU && LCD_BED_TRAMMING diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index 866f709b8e..294666e356 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -71,12 +71,12 @@ #if Z_AFTER_PROBING > 0 && DISABLED(MESH_BED_LEVELING) // Display "Done" screen and wait for moves to complete line_to_z(Z_AFTER_PROBING); - ui.synchronize(GET_TEXT(MSG_LEVEL_BED_DONE)); + ui.synchronize(GET_TEXT_F(MSG_LEVEL_BED_DONE)); #endif ui.goto_previous_screen_no_defer(); ui.completion_feedback(); } - if (ui.should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT(MSG_LEVEL_BED_DONE)); + if (ui.should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT_F(MSG_LEVEL_BED_DONE)); ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); } @@ -127,7 +127,7 @@ // if (ui.should_draw()) { const float v = current_position.z; - MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+')); + MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+')); } } @@ -138,7 +138,7 @@ if (ui.should_draw()) { char msg[10]; sprintf_P(msg, PSTR("%i / %u"), int(manual_probe_index + 1), total_probe_points); - MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_LEVEL_BED_NEXT_POINT), msg); + MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT), msg); } ui.refresh(LCDVIEW_CALL_NO_REDRAW); if (!ui.wait_for_move) ui.goto_screen(_lcd_level_bed_get_z); @@ -165,7 +165,7 @@ // void _lcd_level_bed_homing_done() { if (ui.should_draw()) { - MenuItem_static::draw(1, GET_TEXT(MSG_LEVEL_BED_WAITING)); + MenuItem_static::draw(1, GET_TEXT_F(MSG_LEVEL_BED_WAITING)); // Color UI needs a control to detect a touch #if BOTH(TOUCH_SCREEN, HAS_GRAPHICAL_TFT) touch.add_control(CLICK, 0, 0, TFT_WIDTH, TFT_HEIGHT); @@ -243,7 +243,7 @@ void menu_bed_leveling() { // Auto Home if not using manual probing #if NONE(PROBE_MANUALLY, MESH_BED_LEVELING) - if (!is_homed) GCODES_ITEM(MSG_AUTO_HOME, G28_STR); + if (!is_homed) GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR)); #endif // Level Bed @@ -252,7 +252,7 @@ void menu_bed_leveling() { SUBMENU(MSG_LEVEL_BED, _lcd_level_bed_continue); #else // Automatic leveling can just run the G-code - GCODES_ITEM(MSG_LEVEL_BED, is_homed ? PSTR("G29") : PSTR("G29N")); + GCODES_ITEM(MSG_LEVEL_BED, is_homed ? F("G29") : F("G29N")); #endif #if ENABLED(MESH_EDIT_MENU) @@ -290,7 +290,7 @@ void menu_bed_leveling() { EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); #endif - #if ENABLED(LEVEL_BED_CORNERS) + #if ENABLED(LCD_BED_TRAMMING) SUBMENU(MSG_BED_TRAMMING, _lcd_level_bed_corners); #endif diff --git a/Marlin/src/lcd/menu/menu_cancelobject.cpp b/Marlin/src/lcd/menu/menu_cancelobject.cpp index 8db698d300..b2d36bf8c3 100644 --- a/Marlin/src/lcd/menu/menu_cancelobject.cpp +++ b/Marlin/src/lcd/menu/menu_cancelobject.cpp @@ -48,7 +48,7 @@ static void lcd_cancel_object_confirm() { ui.goto_previous_screen(); }, nullptr, - GET_TEXT(MSG_CANCEL_OBJECT), item_num, PSTR("?") + GET_TEXT_F(MSG_CANCEL_OBJECT), item_num, F("?") ); } diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index d755706b16..8b6af33fd1 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -78,7 +78,7 @@ void menu_advanced_settings(); bar_percent += (int8_t)ui.encoderPosition; LIMIT(bar_percent, 0, 100); ui.encoderPosition = 0; - MenuItem_static::draw(0, GET_TEXT(MSG_PROGRESS_BAR_TEST), SS_DEFAULT|SS_INVERT); + MenuItem_static::draw(0, GET_TEXT_F(MSG_PROGRESS_BAR_TEST), SS_DEFAULT|SS_INVERT); lcd_put_int((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2, bar_percent); lcd_put_wchar('%'); lcd_moveto(0, LCD_HEIGHT - 1); ui.draw_progress_bar(bar_percent); } @@ -137,7 +137,7 @@ void menu_advanced_settings(); #include "../../gcode/queue.h" void menu_toolchange_migration() { - PGM_P const msg_migrate = GET_TEXT(MSG_TOOL_MIGRATION_SWAP); + FSTR_P const msg_migrate = GET_TEXT_F(MSG_TOOL_MIGRATION_SWAP); START_MENU(); BACK_ITEM(MSG_CONFIGURATION); @@ -149,7 +149,7 @@ void menu_advanced_settings(); // Migrate to a chosen extruder EXTRUDER_LOOP() { if (e != active_extruder) { - ACTION_ITEM_N_P(e, msg_migrate, []{ + ACTION_ITEM_N_F(e, msg_migrate, []{ char cmd[12]; sprintf_P(cmd, PSTR("M217 T%i"), int(MenuItemBase::itemIndex)); queue.inject(cmd); @@ -199,16 +199,16 @@ void menu_advanced_settings(); START_MENU(); BACK_ITEM(MSG_CONFIGURATION); - GCODES_ITEM(MSG_IDEX_MODE_AUTOPARK, PSTR("M605S1\nG28X\nG1X0")); + GCODES_ITEM(MSG_IDEX_MODE_AUTOPARK, F("M605S1\nG28X\nG1X0")); GCODES_ITEM(MSG_IDEX_MODE_DUPLICATE, need_g28 - ? PSTR("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0") // If Y or Z is not homed, do a full G28 first - : PSTR("M605S1\nT0\nM605S2\nG28X\nG1X0") + ? F("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0") // If Y or Z is not homed, do a full G28 first + : F("M605S1\nT0\nM605S2\nG28X\nG1X0") ); GCODES_ITEM(MSG_IDEX_MODE_MIRRORED_COPY, need_g28 - ? PSTR("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0\nM605S3") // If Y or Z is not homed, do a full G28 first - : PSTR("M605S1\nT0\nM605S2\nG28 X\nG1X0\nM605S3") + ? F("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0\nM605S3") // If Y or Z is not homed, do a full G28 first + : F("M605S1\nT0\nM605S2\nG28 X\nG1X0\nM605S3") ); - GCODES_ITEM(MSG_IDEX_MODE_FULL_CTRL, PSTR("M605S0\nG28X")); + GCODES_ITEM(MSG_IDEX_MODE_FULL_CTRL, F("M605S0\nG28X")); EDIT_ITEM(float42_52, MSG_IDEX_DUPE_GAP, &duplicate_extruder_x_offset, (X2_MIN_POS) - (X1_MIN_POS), (X_BED_SIZE) - 20); @@ -246,11 +246,11 @@ void menu_advanced_settings(); EDIT_ITEM(bool, MSG_BLTOUCH_SPEED_MODE, &bltouch.high_speed_mode); #endif #if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU) - CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); - CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); + CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, nullptr, GET_TEXT_F(MSG_BLTOUCH_MODE_CHANGE)); + CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, nullptr, GET_TEXT_F(MSG_BLTOUCH_MODE_CHANGE)); ACTION_ITEM(MSG_BLTOUCH_MODE_STORE, bltouch._mode_store); - CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_5V, MSG_BLTOUCH_MODE_STORE_5V, MSG_BUTTON_CANCEL, bltouch.mode_conv_5V, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); - CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_OD, MSG_BLTOUCH_MODE_STORE_OD, MSG_BUTTON_CANCEL, bltouch.mode_conv_OD, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); + CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_5V, MSG_BLTOUCH_MODE_STORE_5V, MSG_BUTTON_CANCEL, bltouch.mode_conv_5V, nullptr, GET_TEXT_F(MSG_BLTOUCH_MODE_CHANGE)); + CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_OD, MSG_BLTOUCH_MODE_STORE_OD, MSG_BUTTON_CANCEL, bltouch.mode_conv_OD, nullptr, GET_TEXT_F(MSG_BLTOUCH_MODE_CHANGE)); ACTION_ITEM(MSG_BLTOUCH_MODE_ECHO, bltouch_report); #endif END_MENU(); @@ -264,10 +264,10 @@ void menu_advanced_settings(); ui.defer_status_screen(); START_MENU(); BACK_ITEM(MSG_CONFIGURATION); - GCODES_ITEM(MSG_TOUCHMI_INIT, PSTR("M851 Z0\nG28\nG1 F200 Z0")); + GCODES_ITEM(MSG_TOUCHMI_INIT, F("M851 Z0\nG28\nG1 F200 Z0")); SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); - GCODES_ITEM(MSG_TOUCHMI_SAVE, PSTR("M500\nG1 F200 Z10")); - GCODES_ITEM(MSG_TOUCHMI_ZTEST, PSTR("G28\nG1 F200 Z0")); + GCODES_ITEM(MSG_TOUCHMI_SAVE, F("M500\nG1 F200 Z10")); + GCODES_ITEM(MSG_TOUCHMI_ZTEST, F("G28\nG1 F200 Z0")); END_MENU(); } @@ -329,7 +329,7 @@ void menu_advanced_settings(); #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_DEFAULT|SS_INVERT); + STATIC_ITEM_F(ui.get_preheat_label(m), SS_DEFAULT|SS_INVERT); BACK_ITEM(MSG_CONFIGURATION); #if HAS_FAN editable.uint8 = uint8_t(ui.material_preset[m].fan_speed); @@ -369,13 +369,13 @@ void menu_advanced_settings(); #define _DONE_SCRIPT "" #endif #define GCODE_LAMBDA_CONF(N) []{ _lcd_custom_menus_configuration_gcode(F(CONFIG_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); } - #define _CUSTOM_ITEM_CONF(N) ACTION_ITEM_P(PSTR(CONFIG_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_CONF(N)); - #define _CUSTOM_ITEM_CONF_CONFIRM(N) \ - SUBMENU_P(PSTR(CONFIG_MENU_ITEM_##N##_DESC), []{ \ - MenuItem_confirm::confirm_screen( \ - GCODE_LAMBDA_CONF(N), nullptr, \ - PSTR(CONFIG_MENU_ITEM_##N##_DESC "?") \ - ); \ + #define _CUSTOM_ITEM_CONF(N) ACTION_ITEM_F(F(CONFIG_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_CONF(N)); + #define _CUSTOM_ITEM_CONF_CONFIRM(N) \ + SUBMENU_F(F(CONFIG_MENU_ITEM_##N##_DESC), []{ \ + MenuItem_confirm::confirm_screen( \ + GCODE_LAMBDA_CONF(N), nullptr, \ + F(CONFIG_MENU_ITEM_##N##_DESC "?") \ + ); \ }) #define CUSTOM_ITEM_CONF(N) do{ \ @@ -483,7 +483,7 @@ void menu_configuration() { #if ENABLED(CUSTOM_MENU_CONFIG) if (TERN1(CUSTOM_MENU_CONFIG_ONLY_IDLE, !busy)) { #ifdef CUSTOM_MENU_CONFIG_TITLE - SUBMENU_P(PSTR(CUSTOM_MENU_CONFIG_TITLE), custom_menus_configuration); + SUBMENU_F(F(CUSTOM_MENU_CONFIG_TITLE), custom_menus_configuration); #else SUBMENU(MSG_CUSTOM_COMMANDS, custom_menus_configuration); #endif @@ -572,7 +572,7 @@ void menu_configuration() { // Preheat configurations #if HAS_PREHEAT && 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); + SUBMENU_N_f(m, ui.get_preheat_label(m), MSG_PREHEAT_M_SETTINGS, _menu_configuration_preheat_settings); #endif #if ENABLED(SOUND_MENU_ITEM) diff --git a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp index f491c5b576..b86f101258 100644 --- a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp +++ b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp @@ -41,6 +41,10 @@ #include "../extui/ui_api.h" #endif +#if HAS_PROBE_XY_OFFSET + #include "../../module/probe.h" +#endif + void _man_probe_pt(const xy_pos_t &xy) { if (!ui.wait_for_move) { ui.wait_for_move = true; @@ -88,7 +92,9 @@ void _man_probe_pt(const xy_pos_t &xy) { } void _goto_tower_a(const_float_t a) { - constexpr float dcr = DELTA_PRINTABLE_RADIUS; + float dcr = DELTA_PRINTABLE_RADIUS - PROBING_MARGIN; + TERN_(HAS_PROBE_XY_OFFSET, dcr -= HYPOT(probe.offset_xy.x, probe.offset_xy.y)); + TERN_(HAS_DELTA_SENSORLESS_PROBING, dcr *= sensorless_radius_factor); xy_pos_t tower_vec = { cos(RADIANS(a)), sin(RADIANS(a)) }; _man_probe_pt(tower_vec * dcr); } @@ -107,12 +113,12 @@ void lcd_delta_settings() { START_MENU(); BACK_ITEM(MSG_DELTA_CALIBRATE); EDIT_ITEM(float52sign, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10, delta_height + 10, _recalc_delta_settings); - #define EDIT_ENDSTOP_ADJ(LABEL,N) EDIT_ITEM_P(float43, PSTR(LABEL), &delta_endstop_adj.N, -5, 0, _recalc_delta_settings) + #define EDIT_ENDSTOP_ADJ(LABEL,N) EDIT_ITEM_F(float43, F(LABEL), &delta_endstop_adj.N, -5, 0, _recalc_delta_settings) EDIT_ENDSTOP_ADJ("Ex", a); EDIT_ENDSTOP_ADJ("Ey", b); EDIT_ENDSTOP_ADJ("Ez", c); EDIT_ITEM(float52sign, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5, delta_radius + 5, _recalc_delta_settings); - #define EDIT_ANGLE_TRIM(LABEL,N) EDIT_ITEM_P(float43, PSTR(LABEL), &delta_tower_angle_trim.N, -5, 5, _recalc_delta_settings) + #define EDIT_ANGLE_TRIM(LABEL,N) EDIT_ITEM_F(float43, F(LABEL), &delta_tower_angle_trim.N, -5, 5, _recalc_delta_settings) EDIT_ANGLE_TRIM("Tx", a); EDIT_ANGLE_TRIM("Ty", b); EDIT_ANGLE_TRIM("Tz", c); @@ -129,7 +135,7 @@ void menu_delta_calibrate() { BACK_ITEM(MSG_MAIN); #if ENABLED(DELTA_AUTO_CALIBRATION) - GCODES_ITEM(MSG_DELTA_AUTO_CALIBRATE, PSTR("G33")); + GCODES_ITEM(MSG_DELTA_AUTO_CALIBRATE, F("G33")); #if ENABLED(EEPROM_SETTINGS) ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings); ACTION_ITEM(MSG_LOAD_EEPROM, ui.load_settings); diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp index 03ac6e512c..5902a2f63f 100644 --- a/Marlin/src/lcd/menu/menu_filament.cpp +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -45,22 +45,22 @@ static PauseMode _change_filament_mode; // = PAUSE_MODE_PAUSE_PRINT static int8_t _change_filament_extruder; // = 0 -inline PGM_P _change_filament_command() { +inline FSTR_P _change_filament_command() { switch (_change_filament_mode) { - case PAUSE_MODE_LOAD_FILAMENT: return PSTR("M701 T%d"); + case PAUSE_MODE_LOAD_FILAMENT: return F("M701 T%d"); case PAUSE_MODE_UNLOAD_FILAMENT: return _change_filament_extruder >= 0 - ? PSTR("M702 T%d") : PSTR("M702 ;%d"); + ? F("M702 T%d") : F("M702 ;%d"); case PAUSE_MODE_CHANGE_FILAMENT: case PAUSE_MODE_PAUSE_PRINT: default: break; } - return PSTR("M600 B0 T%d"); + return F("M600 B0 T%d"); } // Initiate Filament Load/Unload/Change at the specified temperature static void _change_filament_with_temp(const uint16_t celsius) { char cmd[11]; - sprintf_P(cmd, _change_filament_command(), _change_filament_extruder); + sprintf_P(cmd, FTOP(_change_filament_command()), _change_filament_extruder); thermalManager.setTargetHotend(celsius, _change_filament_extruder); queue.inject(cmd); } @@ -77,13 +77,13 @@ static void _change_filament_with_custom() { // Menu to choose the temperature and start Filament Change // -inline PGM_P change_filament_header(const PauseMode mode) { +inline FSTR_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_F(MSG_FILAMENTLOAD); + case PAUSE_MODE_UNLOAD_FILAMENT: return GET_TEXT_F(MSG_FILAMENTUNLOAD); default: break; } - return GET_TEXT(MSG_FILAMENTCHANGE); + return GET_TEXT_F(MSG_FILAMENTCHANGE); } void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) { @@ -91,11 +91,11 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) { _change_filament_extruder = extruder; const int8_t old_index = MenuItemBase::itemIndex; START_MENU(); - if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), SS_DEFAULT|SS_INVERT); + if (LCD_HEIGHT >= 4) STATIC_ITEM_F(change_filament_header(mode), SS_DEFAULT|SS_INVERT); BACK_ITEM(MSG_BACK); #if HAS_PREHEAT LOOP_L_N(m, PREHEAT_COUNT) - ACTION_ITEM_N_S(m, ui.get_preheat_label(m), MSG_PREHEAT_M, _change_filament_with_preset); + ACTION_ITEM_N_f(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.hotend_max_target(extruder), @@ -132,18 +132,18 @@ void menu_change_filament() { // Change filament #if E_STEPPERS == 1 - PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE); + FSTR_P const fmsg = GET_TEXT_F(MSG_FILAMENTCHANGE); if (thermalManager.targetTooColdToExtrude(active_extruder)) - SUBMENU_P(msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); }); + SUBMENU_F(fmsg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); }); else - GCODES_ITEM_P(msg, PSTR("M600 B0")); + GCODES_ITEM_F(fmsg, F("M600 B0")); #else - PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE_E); + FSTR_P const fmsg = GET_TEXT_F(MSG_FILAMENTCHANGE_E); LOOP_L_N(s, E_STEPPERS) { if (thermalManager.targetTooColdToExtrude(s)) - SUBMENU_N_P(s, msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); }); + SUBMENU_N_F(s, fmsg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); }); else { - ACTION_ITEM_N_P(s, msg, []{ + ACTION_ITEM_N_F(s, fmsg, []{ PGM_P const cmdpstr = PSTR("M600 B0 T%i"); char cmd[strlen_P(cmdpstr) + 3 + 1]; sprintf_P(cmd, cmdpstr, int(MenuItemBase::itemIndex)); @@ -157,18 +157,18 @@ void menu_change_filament() { if (!is_busy) { // Load filament #if E_STEPPERS == 1 - PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD); + FSTR_P const msg_load = GET_TEXT_F(MSG_FILAMENTLOAD); if (thermalManager.targetTooColdToExtrude(active_extruder)) - SUBMENU_P(msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 0); }); + SUBMENU_F(msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 0); }); else - GCODES_ITEM_P(msg_load, PSTR("M701")); + GCODES_ITEM_F(msg_load, F("M701")); #else - PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD_E); + FSTR_P const msg_load = GET_TEXT_F(MSG_FILAMENTLOAD_E); LOOP_L_N(s, E_STEPPERS) { if (thermalManager.targetTooColdToExtrude(s)) - SUBMENU_N_P(s, msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, MenuItemBase::itemIndex); }); + SUBMENU_N_F(s, msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, MenuItemBase::itemIndex); }); else { - ACTION_ITEM_N_P(s, msg_load, []{ + ACTION_ITEM_N_F(s, msg_load, []{ char cmd[12]; sprintf_P(cmd, PSTR("M701 T%i"), int(MenuItemBase::itemIndex)); queue.inject(cmd); @@ -179,24 +179,24 @@ void menu_change_filament() { // Unload filament #if E_STEPPERS == 1 - PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD); + FSTR_P const msg_unload = GET_TEXT_F(MSG_FILAMENTUNLOAD); if (thermalManager.targetTooColdToExtrude(active_extruder)) - SUBMENU_P(msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 0); }); + SUBMENU_F(msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 0); }); else - GCODES_ITEM_P(msg_unload, PSTR("M702")); + GCODES_ITEM_F(msg_unload, F("M702")); #else #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) if (too_cold) SUBMENU(MSG_FILAMENTUNLOAD_ALL, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, -1); }); else - GCODES_ITEM(MSG_FILAMENTUNLOAD_ALL, PSTR("M702")); + GCODES_ITEM(MSG_FILAMENTUNLOAD_ALL, F("M702")); #endif - PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD_E); + FSTR_P const msg_unload = GET_TEXT_F(MSG_FILAMENTUNLOAD_E); LOOP_L_N(s, E_STEPPERS) { if (thermalManager.targetTooColdToExtrude(s)) - SUBMENU_N_P(s, msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, MenuItemBase::itemIndex); }); + SUBMENU_N_F(s, msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, MenuItemBase::itemIndex); }); else { - ACTION_ITEM_N_P(s, msg_unload, []{ + ACTION_ITEM_N_F(s, msg_unload, []{ char cmd[12]; sprintf_P(cmd, PSTR("M702 T%i"), int(MenuItemBase::itemIndex)); queue.inject(cmd); @@ -221,21 +221,21 @@ void menu_change_filament() { static uint8_t hotend_status_extruder = 0; -static PGM_P pause_header() { +static FSTR_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_F(MSG_FILAMENT_CHANGE_HEADER); + case PAUSE_MODE_LOAD_FILAMENT: return GET_TEXT_F(MSG_FILAMENT_CHANGE_HEADER_LOAD); + case PAUSE_MODE_UNLOAD_FILAMENT: return GET_TEXT_F(MSG_FILAMENT_CHANGE_HEADER_UNLOAD); default: break; } - return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_PAUSE); + return GET_TEXT_F(MSG_FILAMENT_CHANGE_HEADER_PAUSE); } // Portions from STATIC_ITEM... #define HOTEND_STATUS_ITEM() do { \ if (_menuLineNr == _thisItemNr) { \ if (ui.should_draw()) { \ - IF_DISABLED(HAS_GRAPHICAL_TFT, MenuItem_static::draw(_lcdLineNr, GET_TEXT(MSG_FILAMENT_CHANGE_NOZZLE), SS_INVERT)); \ + IF_DISABLED(HAS_GRAPHICAL_TFT, MenuItem_static::draw(_lcdLineNr, GET_TEXT_F(MSG_FILAMENT_CHANGE_NOZZLE), SS_INVERT)); \ ui.draw_hotend_status(_lcdLineNr, hotend_status_extruder); \ } \ if (_skipStatic && encoderLine <= _thisItemNr) { \ @@ -271,41 +271,41 @@ void menu_pause_option() { // // ADVANCED_PAUSE_FEATURE message screens // -// Warning: msg must have three null bytes to delimit lines! +// Warning: fmsg must have three null bytes to delimit lines! // -void _lcd_pause_message(PGM_P const msg) { - PGM_P const msg1 = msg; +void _lcd_pause_message(FSTR_P const fmsg) { + PGM_P const msg1 = FTOP(fmsg); PGM_P const msg2 = msg1 + strlen_P(msg1) + 1; PGM_P const msg3 = msg2 + strlen_P(msg2) + 1; const bool has2 = msg2[0], has3 = msg3[0], skip1 = !has2 && (LCD_HEIGHT) >= 5; START_SCREEN(); - STATIC_ITEM_P(pause_header(), SS_DEFAULT|SS_INVERT); // 1: Header + STATIC_ITEM_F(pause_header(), SS_DEFAULT|SS_INVERT); // 1: Header if (skip1) SKIP_ITEM(); // Move a single-line message down - STATIC_ITEM_P(msg1); // 2: Message Line 1 - if (has2) STATIC_ITEM_P(msg2); // 3: Message Line 2 - if (has3 && (LCD_HEIGHT) >= 5) STATIC_ITEM_P(msg3); // 4: Message Line 3 (if LCD has 5 lines) + STATIC_ITEM_F(FPSTR(msg1)); // 2: Message Line 1 + if (has2) STATIC_ITEM_F(FPSTR(msg2)); // 3: Message Line 2 + if (has3 && (LCD_HEIGHT) >= 5) STATIC_ITEM_F(FPSTR(msg3)); // 4: Message Line 3 (if LCD has 5 lines) if (skip1 + 1 + has2 + has3 < (LCD_HEIGHT) - 2) SKIP_ITEM(); // Push Hotend Status down, if needed HOTEND_STATUS_ITEM(); // 5: Hotend Status END_SCREEN(); } -void lcd_pause_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)); } -void lcd_pause_heat_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_HEAT)); } -void lcd_pause_insert_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_INSERT)); } -void lcd_pause_load_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_LOAD)); } -void lcd_pause_waiting_message() { _lcd_pause_message(GET_TEXT(MSG_ADVANCED_PAUSE_WAITING)); } -void lcd_pause_resume_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_RESUME)); } +void lcd_pause_parking_message() { _lcd_pause_message(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); } +void lcd_pause_changing_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); } +void lcd_pause_unload_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); } +void lcd_pause_heating_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); } +void lcd_pause_heat_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT)); } +void lcd_pause_insert_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); } +void lcd_pause_load_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); } +void lcd_pause_waiting_message() { _lcd_pause_message(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING)); } +void lcd_pause_resume_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); } void lcd_pause_purge_message() { #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_CONT_PURGE)); + _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_CONT_PURGE)); #else - _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_PURGE)); + _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE)); #endif } diff --git a/Marlin/src/lcd/menu/menu_info.cpp b/Marlin/src/lcd/menu/menu_info.cpp index 3a23cf0048..101861074d 100644 --- a/Marlin/src/lcd/menu/menu_info.cpp +++ b/Marlin/src/lcd/menu/menu_info.cpp @@ -35,7 +35,7 @@ #endif #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) +#define VALUE_ITEM_F(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) @@ -56,35 +56,35 @@ 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_F(F("> "), SS_LEFT, duration_t(stats.printTime).toString(buffer)); // > 99y 364d 23h 59m 59s STATIC_ITEM(MSG_INFO_PRINT_LONGEST, SS_LEFT); // Longest job time: - STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.longestPrint).toString(buffer)); // > 99y 364d 23h 59m 59s + STATIC_ITEM_F(F("> "), 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_F(F("> "), SS_LEFT, buffer); // > 125m #if SERVICE_INTERVAL_1 > 0 || SERVICE_INTERVAL_2 > 0 || SERVICE_INTERVAL_3 > 0 strcpy_P(buffer, GET_TEXT(MSG_SERVICE_IN)); #endif #if SERVICE_INTERVAL_1 > 0 - STATIC_ITEM_P(PSTR(SERVICE_NAME_1 " "), SS_LEFT, buffer); // Service X in: - STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService1).toString(buffer)); // > 7d 12h 11m 10s + STATIC_ITEM_F(F(SERVICE_NAME_1 " "), SS_LEFT, buffer); // Service X in: + STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.nextService1).toString(buffer)); // > 7d 12h 11m 10s #endif #if SERVICE_INTERVAL_2 > 0 - STATIC_ITEM_P(PSTR(SERVICE_NAME_2 " "), SS_LEFT, buffer); - STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService2).toString(buffer)); + STATIC_ITEM_F(F(SERVICE_NAME_2 " "), SS_LEFT, buffer); + STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.nextService2).toString(buffer)); #endif #if SERVICE_INTERVAL_3 > 0 - STATIC_ITEM_P(PSTR(SERVICE_NAME_3 " "), SS_LEFT, buffer); - STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService3).toString(buffer)); + STATIC_ITEM_F(F(SERVICE_NAME_3 " "), SS_LEFT, buffer); + STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.nextService3).toString(buffer)); #endif END_SCREEN(); @@ -103,7 +103,7 @@ void menu_info_thermistors() { #if HAS_EXTRUDERS #define THERMISTOR_ID TEMP_SENSOR_0 #include "../thermistornames.h" - STATIC_ITEM_P(PSTR(STR_E0 ": " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F(STR_E0 ": " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_0_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_0_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -113,7 +113,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_1 #include "../thermistornames.h" - STATIC_ITEM_P(PSTR(STR_E1 ": " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F(STR_E1 ": " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_1_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_1_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -123,7 +123,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_2 #include "../thermistornames.h" - STATIC_ITEM_P(PSTR(STR_E2 ": " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F(STR_E2 ": " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_2_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_2_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -133,7 +133,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_3 #include "../thermistornames.h" - STATIC_ITEM_P(PSTR(STR_E3 ": " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F(STR_E3 ": " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_3_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_3_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -143,7 +143,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_4 #include "../thermistornames.h" - STATIC_ITEM_P(PSTR(STR_E4 ": " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F(STR_E4 ": " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_4_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_4_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -153,7 +153,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_5 #include "../thermistornames.h" - STATIC_ITEM_P(PSTR(STR_E5 ": " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F(STR_E5 ": " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_5_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_5_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -163,7 +163,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_6 #include "../thermistornames.h" - STATIC_ITEM_P(PSTR(STR_E6 ": " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F(STR_E6 ": " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_6_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_6_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -173,7 +173,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_7 #include "../thermistornames.h" - STATIC_ITEM_P(PSTR(STR_E7 ": " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F(STR_E7 ": " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_7_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_7_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -183,7 +183,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_BED #include "../thermistornames.h" - STATIC_ITEM_P(PSTR("BED: " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F("BED: " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(BED_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(BED_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_BED, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -193,7 +193,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_CHAMBER #include "../thermistornames.h" - STATIC_ITEM_P(PSTR("CHAM: " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F("CHAM: " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(CHAMBER_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(CHAMBER_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_CHAMBER, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -203,7 +203,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_COOLER #include "../thermistornames.h" - STATIC_ITEM_P(PSTR("COOL: " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F("COOL: " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(COOLER_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(COOLER_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_COOLER, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -219,9 +219,9 @@ void menu_info_board() { if (ui.use_click()) return ui.go_back(); START_SCREEN(); - STATIC_ITEM_P(PSTR(BOARD_INFO_NAME), SS_DEFAULT|SS_INVERT); // MyPrinterController + STATIC_ITEM_F(F(BOARD_INFO_NAME), SS_DEFAULT|SS_INVERT); // MyPrinterController #ifdef BOARD_WEBSITE_URL - STATIC_ITEM_P(PSTR(BOARD_WEBSITE_URL), SS_LEFT); // www.my3dprinter.com + STATIC_ITEM_F(F(BOARD_WEBSITE_URL), SS_LEFT); // www.my3dprinter.com #endif PSTRING_ITEM(MSG_INFO_BAUDRATE, STRINGIFY(BAUDRATE), SS_CENTER); // Baud: 250000 PSTRING_ITEM(MSG_INFO_PROTOCOL, PROTOCOL_VERSION, SS_CENTER); // Protocol: 1.0 @@ -251,11 +251,11 @@ void menu_info_board() { void menu_info_printer() { if (ui.use_click()) return ui.go_back(); START_SCREEN(); - STATIC_ITEM(MSG_MARLIN, SS_DEFAULT|SS_INVERT); // Marlin - STATIC_ITEM_P(PSTR(SHORT_BUILD_VERSION)); // x.x.x-Branch - STATIC_ITEM_P(PSTR(STRING_DISTRIBUTION_DATE)); // YYYY-MM-DD HH:MM - STATIC_ITEM_P(PSTR(MACHINE_NAME), SS_DEFAULT|SS_INVERT); // My3DPrinter - STATIC_ITEM_P(PSTR(WEBSITE_URL)); // www.my3dprinter.com + STATIC_ITEM(MSG_MARLIN, SS_DEFAULT|SS_INVERT); // Marlin + STATIC_ITEM_F(F(SHORT_BUILD_VERSION)); // x.x.x-Branch + STATIC_ITEM_F(F(STRING_DISTRIBUTION_DATE)); // YYYY-MM-DD HH:MM + STATIC_ITEM_F(F(MACHINE_NAME), SS_DEFAULT|SS_INVERT); // My3DPrinter + STATIC_ITEM_F(F(WEBSITE_URL)); // www.my3dprinter.com PSTRING_ITEM(MSG_INFO_EXTRUDERS, STRINGIFY(EXTRUDERS), SS_CENTER); // Extruders: 2 #if HAS_LEVELING STATIC_ITEM( diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index fcde9f5801..b48eaf9bae 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -36,36 +36,36 @@ void lcd_move_z(); // SUBMENU(LABEL, screen_handler) class MenuItem_submenu : public MenuItemBase { public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { - _draw(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, ...) { + _draw(sel, row, fstr, '>', LCD_STR_ARROW_RIGHT[0]); } - static void action(PGM_P const, const screenFunc_t func) { ui.push_current_screen(); ui.goto_screen(func); } + static void action(FSTR_P const, const screenFunc_t func) { ui.push_current_screen(); ui.goto_screen(func); } }; // Any menu item that invokes an immediate action class MenuItem_button : public MenuItemBase { public: // Button-y Items are selectable lines with no other indicator - static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { - _draw(sel, row, pstr, '>', ' '); + static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, ...) { + _draw(sel, row, fstr, '>', ' '); } }; // ACTION_ITEM(LABEL, FUNC) class MenuItem_function : public MenuItem_button { public: - //static void action(PGM_P const, const uint8_t, const menuAction_t func) { (*func)(); }; - static void action(PGM_P const, const menuAction_t func) { if (func) (*func)(); }; + //static void action(FSTR_P const, const uint8_t, const menuAction_t func) { (*func)(); }; + static void action(FSTR_P const, const menuAction_t func) { if (func) (*func)(); }; }; // GCODES_ITEM(LABEL, GCODES) class MenuItem_gcode : public MenuItem_button { public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { - _draw(sel, row, pstr, '>', ' '); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, ...) { + _draw(sel, row, fstr, '>', ' '); } - static void action(PGM_P const, PGM_P const pgcode) { queue.inject(FPSTR(pgcode)); } - static void action(PGM_P const pstr, const uint8_t, PGM_P const pgcode) { action(pstr, pgcode); } + static void action(FSTR_P const, FSTR_P const fgcode) { queue.inject(fgcode); } + static void action(FSTR_P const fstr, const uint8_t, FSTR_P const fgcode) { action(fstr, fgcode); } }; //////////////////////////////////////////// @@ -82,16 +82,16 @@ class TMenuEditItem : MenuEditItemBase { static const char* to_string(const int32_t value) { return NAME::strfunc(unscale(value)); } static void load(void *ptr, const int32_t value) { *((type_t*)ptr) = unscale(value); } public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, type_t * const data, ...) { - MenuEditItemBase::draw(sel, row, pstr, NAME::strfunc(*(data))); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, type_t * const data, ...) { + MenuEditItemBase::draw(sel, row, fstr, NAME::strfunc(*(data))); } - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, type_t (*pget)(), ...) { - MenuEditItemBase::draw(sel, row, pstr, NAME::strfunc(pget())); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, type_t (*pget)(), ...) { + MenuEditItemBase::draw(sel, row, fstr, NAME::strfunc(pget())); } // Edit screen for this type of item static void edit_screen() { MenuEditItemBase::edit_screen(to_string, load); } static void action( - PGM_P const pstr, // Edit label + FSTR_P const fstr, // Edit label type_t * const ptr, // Value pointer const type_t minValue, // Value range const type_t maxValue, @@ -101,7 +101,7 @@ class TMenuEditItem : MenuEditItemBase { // Make sure minv and maxv fit within int32_t const int32_t minv = _MAX(scale(minValue), INT32_MIN), maxv = _MIN(scale(maxValue), INT32_MAX); - goto_edit_screen(pstr, ptr, minv, maxv - minv, scale(*ptr) - minv, + goto_edit_screen(fstr, ptr, minv, maxv - minv, scale(*ptr) - minv, edit_screen, callback, live); } }; @@ -168,16 +168,16 @@ DEFINE_MENU_EDIT_ITEM_TYPE(long5_25 ,uint32_t ,ftostr5rj , 0.04f ); class MenuItem_bool : public MenuEditItemBase { public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, const bool onoff) { - MenuEditItemBase::draw(sel, row, pstr, onoff ? GET_TEXT(MSG_LCD_ON) : GET_TEXT(MSG_LCD_OFF), true); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, const bool onoff) { + MenuEditItemBase::draw(sel, row, fstr, onoff ? GET_TEXT_F(MSG_LCD_ON) : GET_TEXT_F(MSG_LCD_OFF)); } - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, bool * const data, ...) { - draw(sel, row, pstr, *data); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, bool * const data, ...) { + draw(sel, row, fstr, *data); } - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, PGM_P const, bool (*pget)(), ...) { - draw(sel, row, pstr, pget()); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, FSTR_P const, bool (*pget)(), ...) { + draw(sel, row, fstr, pget()); } - static void action(PGM_P const pstr, bool * const ptr, const screenFunc_t callbackFunc=nullptr) { + static void action(FSTR_P const fstr, bool * const ptr, const screenFunc_t callbackFunc=nullptr) { *ptr ^= true; ui.refresh(); if (callbackFunc) (*callbackFunc)(); } @@ -250,16 +250,16 @@ class MenuItem_bool : public MenuEditItemBase { * * Examples: * BACK_ITEM(MSG_INFO_SCREEN) - * MenuItem_back::action(plabel, ...) - * MenuItem_back::draw(sel, row, plabel, ...) + * MenuItem_back::action(flabel, ...) + * MenuItem_back::draw(sel, row, flabel, ...) * * ACTION_ITEM(MSG_PAUSE_PRINT, lcd_sdcard_pause) - * MenuItem_function::action(plabel, lcd_sdcard_pause) - * MenuItem_function::draw(sel, row, plabel, lcd_sdcard_pause) + * MenuItem_function::action(flabel, lcd_sdcard_pause) + * MenuItem_function::draw(sel, row, flabel, lcd_sdcard_pause) * * EDIT_ITEM(int3, MSG_SPEED, &feedrate_percentage, 10, 999) - * MenuItem_int3::action(plabel, &feedrate_percentage, 10, 999) - * MenuItem_int3::draw(sel, row, plabel, &feedrate_percentage, 10, 999) + * MenuItem_int3::action(flabel, &feedrate_percentage, 10, 999) + * MenuItem_int3::draw(sel, row, flabel, &feedrate_percentage, 10, 999) */ #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -268,52 +268,73 @@ class MenuItem_bool : public MenuEditItemBase { #define _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER) #endif -#define _MENU_INNER_P(TYPE, USE_MULTIPLIER, PLABEL, V...) do { \ - PGM_P const plabel = PLABEL; \ +#define _MENU_INNER_F(TYPE, USE_MULTIPLIER, FLABEL, V...) do { \ + FSTR_P const flabel = FLABEL; \ if (encoderLine == _thisItemNr && ui.use_click()) { \ _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER); \ - MenuItem_##TYPE::action(plabel, ##V); \ + MenuItem_##TYPE::action(flabel, ##V); \ if (ui.screen_changed) return; \ } \ if (ui.should_draw()) \ MenuItem_##TYPE::draw \ - (encoderLine == _thisItemNr, _lcdLineNr, plabel, ##V); \ + (encoderLine == _thisItemNr, _lcdLineNr, flabel, ##V); \ }while(0) -#define _MENU_ITEM_P(TYPE, V...) do { \ +// Item with optional data +#define _MENU_ITEM_F(TYPE, V...) do { \ if (_menuLineNr == _thisItemNr) { \ _skipStatic = false; \ - _MENU_INNER_P(TYPE, ##V); \ + _MENU_INNER_F(TYPE, ##V); \ } \ 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{ \ +// Item with index value, C-string, and optional data +#define _MENU_ITEM_N_S_F(TYPE, N, S, V...) do{ \ if (_menuLineNr == _thisItemNr) { \ _skipStatic = false; \ MenuItemBase::init(N, S); \ - _MENU_INNER_P(TYPE, ##V); \ + _MENU_INNER_F(TYPE, ##V); \ } \ NEXT_ITEM(); \ }while(0) -// Indexed items set a global index value -#define _MENU_ITEM_N_P(TYPE, N, V...) do{ \ +// Item with index value and F-string +#define _MENU_ITEM_N_f_F(TYPE, N, f, V...) do{ \ + if (_menuLineNr == _thisItemNr) { \ + _skipStatic = false; \ + MenuItemBase::init(N, f); \ + _MENU_INNER_F(TYPE, ##V); \ + } \ + NEXT_ITEM(); \ +}while(0) + +// Item with index value +#define _MENU_ITEM_N_F(TYPE, N, V...) do{ \ if (_menuLineNr == _thisItemNr) { \ _skipStatic = false; \ - MenuItemBase::itemIndex = N; \ - _MENU_INNER_P(TYPE, ##V); \ + MenuItemBase::init(N); \ + _MENU_INNER_F(TYPE, ##V); \ } \ NEXT_ITEM(); \ }while(0) // Items with a unique string -#define _MENU_ITEM_S_P(TYPE, S, V...) do{ \ +#define _MENU_ITEM_S_F(TYPE, S, V...) do{ \ if (_menuLineNr == _thisItemNr) { \ _skipStatic = false; \ - MenuItemBase::itemString = S; \ - _MENU_INNER_P(TYPE, ##V); \ + MenuItemBase::init(0, S); \ + _MENU_INNER_F(TYPE, ##V); \ + } \ + NEXT_ITEM(); \ +}while(0) + +// Items with a unique F-string +#define _MENU_ITEM_f_F(TYPE, f, V...) do{ \ + if (_menuLineNr == _thisItemNr) { \ + _skipStatic = false; \ + MenuItemBase::init(0, f); \ + _MENU_INNER_F(TYPE, ##V); \ } \ NEXT_ITEM(); \ }while(0) @@ -321,25 +342,25 @@ class MenuItem_bool : public MenuEditItemBase { // STATIC_ITEM draws a styled string with no highlight. // Parameters: label [, style [, char *value] ] -#define STATIC_ITEM_INNER_P(PLABEL, V...) do{ \ +#define STATIC_ITEM_INNER_F(FLABEL, V...) do{ \ if (_skipStatic && encoderLine <= _thisItemNr) { \ ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ ++encoderLine; \ } \ if (ui.should_draw()) \ - MenuItem_static::draw(_lcdLineNr, PLABEL, ##V); \ + MenuItem_static::draw(_lcdLineNr, FLABEL, ##V); \ } while(0) -#define STATIC_ITEM_P(PLABEL, V...) do{ \ +#define STATIC_ITEM_F(FLABEL, V...) do{ \ if (_menuLineNr == _thisItemNr) \ - STATIC_ITEM_INNER_P(PLABEL, ##V); \ + STATIC_ITEM_INNER_F(FLABEL, ##V); \ NEXT_ITEM(); \ } while(0) -#define STATIC_ITEM_N_P(PLABEL, N, V...) do{ \ +#define STATIC_ITEM_N_F(FLABEL, N, V...) do{ \ if (_menuLineNr == _thisItemNr) { \ MenuItemBase::init(N); \ - STATIC_ITEM_INNER_P(PLABEL, ##V); \ + STATIC_ITEM_INNER_F(FLABEL, ##V); \ } \ NEXT_ITEM(); \ }while(0) @@ -347,126 +368,167 @@ class MenuItem_bool : public MenuEditItemBase { // PSTRING_ITEM is like STATIC_ITEM but it takes // two PSTRs with the style as the last parameter. -#define PSTRING_ITEM_P(PLABEL, PVAL, STYL) do{ \ +#define PSTRING_ITEM_F(FLABEL, PVAL, STYL) do{ \ constexpr int m = 20; \ char msg[m+1]; \ msg[0] = ':'; msg[1] = ' '; \ strncpy_P(msg+2, PSTR(PVAL), m-2); \ if (msg[m-1] & 0x80) msg[m-1] = '\0'; \ - STATIC_ITEM_P(PLABEL, STYL, msg); \ + STATIC_ITEM_F(FLABEL, STYL, msg); \ }while(0) -#define PSTRING_ITEM(LABEL, V...) PSTRING_ITEM_P(GET_TEXT(LABEL), ##V) +#define PSTRING_ITEM(LABEL, V...) PSTRING_ITEM_F(GET_TEXT_F(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), N, ##V) +#define STATIC_ITEM(LABEL, V...) STATIC_ITEM_F(GET_TEXT_F(LABEL), ##V) +#define STATIC_ITEM_N(LABEL, N, V...) STATIC_ITEM_N_F(GET_TEXT_F(LABEL), N, ##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) +// Menu item with index and composed C-string substitution +#define MENU_ITEM_N_S_F(TYPE, N, S, FLABEL, V...) _MENU_ITEM_N_S_F(TYPE, N, S, false, FLABEL, ##V) +#define MENU_ITEM_N_S(TYPE, N, S, LABEL, V...) MENU_ITEM_N_S_F(TYPE, N, S, GET_TEXT_F(LABEL), ##V) -#define BACK_ITEM_P(PLABEL) MENU_ITEM_P(back, PLABEL) +// Menu item with composed C-string substitution +#define MENU_ITEM_S_F(TYPE, S, FLABEL, V...) _MENU_ITEM_S_F(TYPE, S, false, FLABEL, ##V) +#define MENU_ITEM_S(TYPE, S, LABEL, V...) MENU_ITEM_S_F(TYPE, S, GET_TEXT_F(LABEL), ##V) + +// Menu item substitution, indexed +#define MENU_ITEM_N_F(TYPE, N, FLABEL, V...) _MENU_ITEM_N_F(TYPE, N, false, FLABEL, ##V) +#define MENU_ITEM_N(TYPE, N, LABEL, V...) MENU_ITEM_N_F(TYPE, N, GET_TEXT_F(LABEL), ##V) + +// Basic menu items, no substitution +#define MENU_ITEM_F(TYPE, FLABEL, V...) _MENU_ITEM_F(TYPE, false, FLABEL, ##V) +#define MENU_ITEM(TYPE, LABEL, V...) MENU_ITEM_F(TYPE, GET_TEXT_F(LABEL), ##V) + +// Predefined menu item types // + +#define BACK_ITEM_F(FLABEL) MENU_ITEM_F(back, FLABEL) #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_N_S_F(N, S, FLABEL, ACTION) MENU_ITEM_N_S_F(function, N, S, FLABEL, ACTION) +#define ACTION_ITEM_N_S(N, S, LABEL, ACTION) ACTION_ITEM_N_S_F(N, S, GET_TEXT_F(LABEL), ACTION) +#define ACTION_ITEM_S_F(S, FLABEL, ACTION) MENU_ITEM_S_F(function, S, FLABEL, ACTION) +#define ACTION_ITEM_S(S, LABEL, ACTION) ACTION_ITEM_S_F(S, GET_TEXT_F(LABEL), ACTION) +#define ACTION_ITEM_N_F(N, FLABEL, ACTION) MENU_ITEM_N_F(function, N, FLABEL, ACTION) +#define ACTION_ITEM_N(N, LABEL, ACTION) ACTION_ITEM_N_F(N, GET_TEXT_F(LABEL), ACTION) +#define ACTION_ITEM_F(FLABEL, ACTION) MENU_ITEM_F(function, FLABEL, ACTION) +#define ACTION_ITEM(LABEL, ACTION) ACTION_ITEM_F(GET_TEXT_F(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 GCODES_ITEM_N_S_F(N, S, FLABEL, GCODES) MENU_ITEM_N_S_F(gcode, N, S, FLABEL, GCODES) +#define GCODES_ITEM_N_S(N, S, LABEL, GCODES) GCODES_ITEM_N_S_F(N, S, GET_TEXT_F(LABEL), GCODES) +#define GCODES_ITEM_S_F(S, FLABEL, GCODES) MENU_ITEM_S_F(gcode, S, FLABEL, GCODES) +#define GCODES_ITEM_S(S, LABEL, GCODES) GCODES_ITEM_S_F(S, GET_TEXT_F(LABEL), GCODES) +#define GCODES_ITEM_N_F(N, FLABEL, GCODES) MENU_ITEM_N_F(gcode, N, FLABEL, GCODES) +#define GCODES_ITEM_N(N, LABEL, GCODES) GCODES_ITEM_N_F(N, GET_TEXT_F(LABEL), GCODES) +#define GCODES_ITEM_F(FLABEL, GCODES) MENU_ITEM_F(gcode, FLABEL, GCODES) +#define GCODES_ITEM(LABEL, GCODES) GCODES_ITEM_F(GET_TEXT_F(LABEL), GCODES) -#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 SUBMENU_N_S_F(N, S, FLABEL, DEST) MENU_ITEM_N_S_F(submenu, N, S, FLABEL, DEST) +#define SUBMENU_N_S(N, S, LABEL, DEST) SUBMENU_N_S_F(N, S, GET_TEXT_F(LABEL), DEST) +#define SUBMENU_S_F(S, FLABEL, DEST) MENU_ITEM_S_F(submenu, S, FLABEL, DEST) +#define SUBMENU_S(S, LABEL, DEST) SUBMENU_S_F(S, GET_TEXT_F(LABEL), DEST) +#define SUBMENU_N_F(N, FLABEL, DEST) MENU_ITEM_N_F(submenu, N, FLABEL, DEST) +#define SUBMENU_N(N, LABEL, DEST) SUBMENU_N_F(N, GET_TEXT_F(LABEL), DEST) +#define SUBMENU_F(FLABEL, DEST) MENU_ITEM_F(submenu, FLABEL, DEST) +#define SUBMENU(LABEL, DEST) SUBMENU_F(GET_TEXT_F(LABEL), DEST) -#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 EDIT_ITEM_N_S_F(TYPE, N, S, FLABEL, V...) MENU_ITEM_N_S_F(TYPE, N, S, FLABEL, ##V) +#define EDIT_ITEM_N_S(TYPE, N, S, LABEL, V...) EDIT_ITEM_N_S_F(TYPE, N, S, GET_TEXT_F(LABEL), ##V) +#define EDIT_ITEM_S_F(TYPE, S, FLABEL, V...) MENU_ITEM_S_F(TYPE, S, FLABEL, ##V) +#define EDIT_ITEM_S(TYPE, S, LABEL, V...) EDIT_ITEM_S_F(TYPE, S, GET_TEXT_F(LABEL), ##V) +#define EDIT_ITEM_N_F(TYPE, N, FLABEL, V...) MENU_ITEM_N_F(TYPE, N, FLABEL, ##V) +#define EDIT_ITEM_N(TYPE, N, LABEL, V...) EDIT_ITEM_N_F(TYPE, N, GET_TEXT_F(LABEL), ##V) +#define EDIT_ITEM_F(TYPE, FLABEL, V...) MENU_ITEM_F(TYPE, FLABEL, ##V) +#define EDIT_ITEM(TYPE, LABEL, V...) EDIT_ITEM_F(TYPE, GET_TEXT_F(LABEL), ##V) -#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 EDIT_ITEM_FAST_N_S_F(TYPE, N, S, FLABEL, V...) _MENU_ITEM_N_S_F(TYPE, N, S, true, FLABEL, ##V) +#define EDIT_ITEM_FAST_N_S(TYPE, N, S, LABEL, V...) EDIT_ITEM_FAST_N_S_F(TYPE, N, S, true, GET_TEXT_F(LABEL), ##V) +#define EDIT_ITEM_FAST_S_F(TYPE, S, FLABEL, V...) _MENU_ITEM_S_F(TYPE, S, true, FLABEL, ##V) +#define EDIT_ITEM_FAST_S(TYPE, S, LABEL, V...) EDIT_ITEM_FAST_S_F(TYPE, S, GET_TEXT_F(LABEL), ##V) +#define EDIT_ITEM_FAST_N_F(TYPE, N, FLABEL, V...) _MENU_ITEM_N_F(TYPE, N, true, FLABEL, ##V) +#define EDIT_ITEM_FAST_N(TYPE, N, LABEL, V...) EDIT_ITEM_FAST_N_F(TYPE, N, GET_TEXT_F(LABEL), ##V) +#define EDIT_ITEM_FAST_F(TYPE, FLABEL, V...) _MENU_ITEM_F(TYPE, true, FLABEL, ##V) +#define EDIT_ITEM_FAST(TYPE, LABEL, V...) EDIT_ITEM_FAST_F(TYPE, GET_TEXT_F(LABEL), ##V) -#define _CONFIRM_ITEM_INNER_P(PLABEL, V...) do { \ +// F-string substitution instead of C-string // + +#define MENU_ITEM_N_f_F(TYPE, N, f, FLABEL, V...) _MENU_ITEM_N_f_F(TYPE, N, f, false, FLABEL, ##V) +#define MENU_ITEM_N_f(TYPE, N, f, LABEL, V...) MENU_ITEM_N_f_F(TYPE, N, f, GET_TEXT_F(LABEL), ##V) +#define MENU_ITEM_f_F(TYPE, f, FLABEL, V...) _MENU_ITEM_f_F(TYPE, f, false, FLABEL, ##V) +#define MENU_ITEM_f(TYPE, f, LABEL, V...) MENU_ITEM_f_F(TYPE, f, GET_TEXT_F(LABEL), ##V) + +#define ACTION_ITEM_N_f_F(N, f, FLABEL, ACTION) MENU_ITEM_N_f_F(function, N, f, FLABEL, ACTION) +#define ACTION_ITEM_N_f(N, f, LABEL, ACTION) ACTION_ITEM_N_f_F(N, f, GET_TEXT_F(LABEL), ACTION) +#define ACTION_ITEM_f_F(f, FLABEL, ACTION) MENU_ITEM_f_F(function, f, FLABEL, ACTION) +#define ACTION_ITEM_f(f, LABEL, ACTION) ACTION_ITEM_f_F(f, GET_TEXT_F(LABEL), ACTION) + +#define GCODES_ITEM_N_f_F(N, f, FLABEL, GCODES) MENU_ITEM_N_f_F(gcode, N, f, FLABEL, GCODES) +#define GCODES_ITEM_N_f(N, f, LABEL, GCODES) GCODES_ITEM_N_f_F(N, f, GET_TEXT_F(LABEL), GCODES) +#define GCODES_ITEM_f_F(f, FLABEL, GCODES) MENU_ITEM_f_F(gcode, f, FLABEL, GCODES) +#define GCODES_ITEM_f(f, LABEL, GCODES) GCODES_ITEM_f_F(f, GET_TEXT_F(LABEL), GCODES) + +#define SUBMENU_N_f_F(N, f, FLABEL, DEST) MENU_ITEM_N_f_F(submenu, N, f, FLABEL, DEST) +#define SUBMENU_N_f(N, f, LABEL, DEST) SUBMENU_N_f_F(N, f, GET_TEXT_F(LABEL), DEST) +#define SUBMENU_f_F(f, FLABEL, DEST) MENU_ITEM_f_F(submenu, f, FLABEL, DEST) +#define SUBMENU_f(f, LABEL, DEST) SUBMENU_f_F(f, GET_TEXT_F(LABEL), DEST) + +#define EDIT_ITEM_N_f_F(TYPE, N, f, FLABEL, V...) MENU_ITEM_N_f_F(TYPE, N, f, FLABEL, ##V) +#define EDIT_ITEM_N_f(TYPE, N, f, LABEL, V...) EDIT_ITEM_N_f_F(TYPE, N, f, GET_TEXT_F(LABEL), ##V) +#define EDIT_ITEM_f_F(TYPE, f, FLABEL, V...) MENU_ITEM_f_F(TYPE, f, FLABEL, ##V) +#define EDIT_ITEM_f(TYPE, f, LABEL, V...) EDIT_ITEM_f_F(TYPE, f, GET_TEXT_F(LABEL), ##V) + +#define EDIT_ITEM_FAST_N_f_F(TYPE, N, f, FLABEL, V...) _MENU_ITEM_N_f_F(TYPE, N, f, true, FLABEL, ##V) +#define EDIT_ITEM_FAST_N_f(TYPE, N, f, LABEL, V...) EDIT_ITEM_FAST_N_f_F(TYPE, N, f, true, GET_TEXT_F(LABEL), ##V) +#define EDIT_ITEM_FAST_f_F(TYPE, f, FLABEL, V...) _MENU_ITEM_f_F(TYPE, f, true, FLABEL, ##V) +#define EDIT_ITEM_FAST_f(TYPE, f, LABEL, V...) EDIT_ITEM_FAST_f_F(TYPE, f, GET_TEXT_F(LABEL), ##V) + +#define _CONFIRM_ITEM_INNER_F(FLABEL, V...) do { \ if (encoderLine == _thisItemNr && ui.use_click()) { \ ui.push_current_screen(); \ ui.goto_screen([]{MenuItem_confirm::select_screen(V);}); \ return; \ } \ if (ui.should_draw()) MenuItem_confirm::draw \ - (encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ##V); \ + (encoderLine == _thisItemNr, _lcdLineNr, FLABEL, ##V); \ }while(0) // Indexed items set a global index value and optional data -#define _CONFIRM_ITEM_P(PLABEL, V...) do { \ +#define _CONFIRM_ITEM_F(FLABEL, V...) do { \ if (_menuLineNr == _thisItemNr) { \ _skipStatic = false; \ - _CONFIRM_ITEM_INNER_P(PLABEL, ##V); \ + _CONFIRM_ITEM_INNER_F(FLABEL, ##V); \ } \ NEXT_ITEM(); \ }while(0) // Indexed items set a global index value -#define _CONFIRM_ITEM_N_S_P(N, S, V...) do{ \ +#define _CONFIRM_ITEM_N_S_F(N, S, V...) do{ \ if (_menuLineNr == _thisItemNr) { \ _skipStatic = false; \ MenuItemBase::init(N, S); \ - _CONFIRM_ITEM_INNER_P(TYPE, ##V); \ + _CONFIRM_ITEM_INNER_F(TYPE, ##V); \ } \ NEXT_ITEM(); \ }while(0) // Indexed items set a global index value -#define _CONFIRM_ITEM_N_P(N, V...) _CONFIRM_ITEM_N_S_P(N, nullptr, V) +#define _CONFIRM_ITEM_N_F(N, V...) _CONFIRM_ITEM_N_S_F(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) +#define CONFIRM_ITEM_F(FLABEL,A,B,V...) _CONFIRM_ITEM_F(FLABEL, GET_TEXT_F(A), GET_TEXT_F(B), ##V) +#define CONFIRM_ITEM(LABEL, V...) CONFIRM_ITEM_F(GET_TEXT_F(LABEL), ##V) -#define YESNO_ITEM_P(PLABEL, V...) CONFIRM_ITEM_P(PLABEL, MSG_YES, MSG_NO, ##V) -#define YESNO_ITEM(LABEL, V...) YESNO_ITEM_P(GET_TEXT(LABEL), ##V) +#define YESNO_ITEM_F(FLABEL, V...) CONFIRM_ITEM_F(FLABEL, MSG_YES, MSG_NO, ##V) +#define YESNO_ITEM(LABEL, V...) YESNO_ITEM_F(GET_TEXT_F(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 CONFIRM_ITEM_N_S_F(N,S,FLABEL,A,B,V...) _CONFIRM_ITEM_N_S_F(N, S, FLABEL, GET_TEXT_F(A), GET_TEXT_F(B), ##V) +#define CONFIRM_ITEM_N_S(N,S,LABEL,V...) CONFIRM_ITEM_N_S_F(N, S, GET_TEXT_F(LABEL), ##V) +#define CONFIRM_ITEM_N_F(N,FLABEL,A,B,V...) _CONFIRM_ITEM_N_F(N, FLABEL, GET_TEXT_F(A), GET_TEXT_F(B), ##V) +#define CONFIRM_ITEM_N(N,LABEL, V...) CONFIRM_ITEM_N_F(N, GET_TEXT_F(LABEL), ##V) -#define YESNO_ITEM_N_S_P(N,S,PLABEL, V...) _CONFIRM_ITEM_N_S_P(N, S, PLABEL, MSG_YES, MSG_NO, ##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, MSG_YES, MSG_NO, ##V) -#define YESNO_ITEM_N(N,LABEL, V...) YESNO_ITEM_N_P(N, GET_TEXT(LABEL), ##V) +#define YESNO_ITEM_N_S_F(N,S,FLABEL, V...) _CONFIRM_ITEM_N_S_F(N, S, FLABEL, MSG_YES, MSG_NO, ##V) +#define YESNO_ITEM_N_S(N,S,LABEL, V...) YESNO_ITEM_N_S_F(N, S, GET_TEXT_F(LABEL), ##V) +#define YESNO_ITEM_N_F(N,FLABEL, V...) CONFIRM_ITEM_N_F(N, FLABEL, MSG_YES, MSG_NO, ##V) +#define YESNO_ITEM_N(N,LABEL, V...) YESNO_ITEM_N_F(N, GET_TEXT_F(LABEL), ##V) -#if ENABLED(LEVEL_BED_CORNERS) +#if ENABLED(LCD_BED_TRAMMING) void _lcd_level_bed_corners(); #endif diff --git a/Marlin/src/lcd/menu/menu_language.cpp b/Marlin/src/lcd/menu/menu_language.cpp index 4c4b7880f2..2ea4359c6b 100644 --- a/Marlin/src/lcd/menu/menu_language.cpp +++ b/Marlin/src/lcd/menu/menu_language.cpp @@ -41,14 +41,14 @@ void menu_language() { START_MENU(); BACK_ITEM(MSG_MAIN); - MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE )::LANGUAGE, []{ set_lcd_language(0); }); - MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_2)::LANGUAGE, []{ set_lcd_language(1); }); + MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(1)), []{ set_lcd_language(0); }); + MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(2)), []{ set_lcd_language(1); }); #if NUM_LANGUAGES > 2 - MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_3)::LANGUAGE, []{ set_lcd_language(2); }); + MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(3)), []{ set_lcd_language(2); }); #if NUM_LANGUAGES > 3 - MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_4)::LANGUAGE, []{ set_lcd_language(3); }); + MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(4)), []{ set_lcd_language(3); }); #if NUM_LANGUAGES > 4 - MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_5)::LANGUAGE, []{ set_lcd_language(4); }); + MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(5)), []{ set_lcd_language(4); }); #endif #endif #endif diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index a156535895..518f1e0f50 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -124,13 +124,13 @@ void menu_configuration(); #define _DONE_SCRIPT "" #endif #define GCODE_LAMBDA_MAIN(N) []{ _lcd_custom_menu_main_gcode(F(MAIN_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); } - #define _CUSTOM_ITEM_MAIN(N) ACTION_ITEM_P(PSTR(MAIN_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_MAIN(N)); - #define _CUSTOM_ITEM_MAIN_CONFIRM(N) \ - SUBMENU_P(PSTR(MAIN_MENU_ITEM_##N##_DESC), []{ \ - MenuItem_confirm::confirm_screen( \ - GCODE_LAMBDA_MAIN(N), nullptr, \ - PSTR(MAIN_MENU_ITEM_##N##_DESC "?") \ - ); \ + #define _CUSTOM_ITEM_MAIN(N) ACTION_ITEM_F(F(MAIN_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_MAIN(N)); + #define _CUSTOM_ITEM_MAIN_CONFIRM(N) \ + SUBMENU_F(F(MAIN_MENU_ITEM_##N##_DESC), []{ \ + MenuItem_confirm::confirm_screen( \ + GCODE_LAMBDA_MAIN(N), nullptr, \ + F(MAIN_MENU_ITEM_##N##_DESC "?") \ + ); \ }) #define CUSTOM_ITEM_MAIN(N) do{ \ @@ -246,11 +246,11 @@ void menu_main() { if (card_detected) { if (!card_open) { - #if PIN_EXISTS(SD_DETECT) - GCODES_ITEM(MSG_CHANGE_MEDIA, PSTR("M21")); // M21 Change Media - #else // - or - - ACTION_ITEM(MSG_RELEASE_MEDIA, []{ // M22 Release Media - queue.inject(PSTR("M22")); + #if HAS_SD_DETECT + GCODES_ITEM(MSG_CHANGE_MEDIA, F("M21")); // M21 Change Media + #else // - or - + ACTION_ITEM(MSG_RELEASE_MEDIA, []{ // M22 Release Media + queue.inject(F("M22")); #if ENABLED(TFT_COLOR_UI) // Menu display issue on item removal with multi language selection menu if (encoderTopLine > 0) encoderTopLine--; @@ -258,14 +258,14 @@ void menu_main() { #endif }); #endif - SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY); // Media Menu (or Password First) + SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY); // Media Menu (or Password First) } } else { - #if PIN_EXISTS(SD_DETECT) - ACTION_ITEM(MSG_NO_MEDIA, nullptr); // "No Media" + #if HAS_SD_DETECT + ACTION_ITEM(MSG_NO_MEDIA, nullptr); // "No Media" #else - GCODES_ITEM(MSG_ATTACH_MEDIA, PSTR("M21")); // M21 Attach Media + GCODES_ITEM(MSG_ATTACH_MEDIA, F("M21")); // M21 Attach Media #endif } }; @@ -279,9 +279,9 @@ void menu_main() { #if MACHINE_CAN_STOP SUBMENU(MSG_STOP_PRINT, []{ MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_STOP), GET_TEXT(MSG_BACK), + GET_TEXT_F(MSG_BUTTON_STOP), GET_TEXT_F(MSG_BACK), ui.abort_print, nullptr, - GET_TEXT(MSG_STOP_PRINT), (const char *)nullptr, PSTR("?") + GET_TEXT_F(MSG_STOP_PRINT), (const char *)nullptr, F("?") ); }); #endif @@ -342,7 +342,7 @@ void menu_main() { #if ENABLED(CUSTOM_MENU_MAIN) if (TERN1(CUSTOM_MENU_MAIN_ONLY_IDLE, !busy)) { #ifdef CUSTOM_MENU_MAIN_TITLE - SUBMENU_P(PSTR(CUSTOM_MENU_MAIN_TITLE), custom_menus_main); + SUBMENU_F(F(CUSTOM_MENU_MAIN_TITLE), custom_menus_main); #else SUBMENU(MSG_CUSTOM_COMMANDS, custom_menus_main); #endif @@ -353,7 +353,7 @@ void menu_main() { #if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES) YESNO_ITEM(MSG_FILAMENTCHANGE, menu_change_filament, nullptr, - GET_TEXT(MSG_FILAMENTCHANGE), (const char *)nullptr, PSTR("?") + GET_TEXT_F(MSG_FILAMENTCHANGE), (const char *)nullptr, F("?") ); #else SUBMENU(MSG_FILAMENTCHANGE, menu_change_filament); @@ -377,13 +377,13 @@ void menu_main() { CONFIRM_ITEM(MSG_SWITCH_PS_OFF, MSG_YES, MSG_NO, ui.poweroff, nullptr, - GET_TEXT(MSG_SWITCH_PS_OFF), (const char *)nullptr, PSTR("?") + GET_TEXT_F(MSG_SWITCH_PS_OFF), (const char *)nullptr, F("?") ); #else ACTION_ITEM(MSG_SWITCH_PS_OFF, ui.poweroff); #endif else - GCODES_ITEM(MSG_SWITCH_PS_ON, PSTR("M80")); + GCODES_ITEM(MSG_SWITCH_PS_ON, F("M80")); #endif #if ENABLED(SDSUPPORT) && DISABLED(MEDIA_MENU_AT_TOP) @@ -398,24 +398,24 @@ void menu_main() { ui.return_to_status(); }; #if SERVICE_INTERVAL_1 > 0 - CONFIRM_ITEM_P(PSTR(SERVICE_NAME_1), + CONFIRM_ITEM_F(F(SERVICE_NAME_1), MSG_BUTTON_RESET, MSG_BUTTON_CANCEL, []{ _service_reset(1); }, nullptr, - GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_1), PSTR("?") + GET_TEXT_F(MSG_SERVICE_RESET), F(SERVICE_NAME_1), F("?") ); #endif #if SERVICE_INTERVAL_2 > 0 - CONFIRM_ITEM_P(PSTR(SERVICE_NAME_2), + CONFIRM_ITEM_F(F(SERVICE_NAME_2), MSG_BUTTON_RESET, MSG_BUTTON_CANCEL, []{ _service_reset(2); }, nullptr, - GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_2), PSTR("?") + GET_TEXT_F(MSG_SERVICE_RESET), F(SERVICE_NAME_2), F("?") ); #endif #if SERVICE_INTERVAL_3 > 0 - CONFIRM_ITEM_P(PSTR(SERVICE_NAME_3), + CONFIRM_ITEM_F(F(SERVICE_NAME_3), MSG_BUTTON_RESET, MSG_BUTTON_CANCEL, []{ _service_reset(3); }, nullptr, - GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_3), PSTR("?") + GET_TEXT_F(MSG_SERVICE_RESET), F(SERVICE_NAME_3), F("?") ); #endif #endif @@ -451,9 +451,9 @@ void menu_main() { #if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) SUBMENU(MSG_HOST_SHUTDOWN, []{ MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_PROCEED), GET_TEXT(MSG_BUTTON_CANCEL), + GET_TEXT_F(MSG_BUTTON_PROCEED), GET_TEXT_F(MSG_BUTTON_CANCEL), []{ ui.return_to_status(); hostui.shutdown(); }, nullptr, - GET_TEXT(MSG_HOST_SHUTDOWN), (const char *)nullptr, PSTR("?") + GET_TEXT_F(MSG_HOST_SHUTDOWN), (const char *)nullptr, F("?") ); }); #endif diff --git a/Marlin/src/lcd/menu/menu_media.cpp b/Marlin/src/lcd/menu/menu_media.cpp index db1baa9bee..20ef6e3d19 100644 --- a/Marlin/src/lcd/menu/menu_media.cpp +++ b/Marlin/src/lcd/menu/menu_media.cpp @@ -61,10 +61,10 @@ inline void sdcard_start_selected_file() { class MenuItem_sdfile : public MenuItem_sdbase { public: - static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) { - MenuItem_sdbase::draw(sel, row, pstr, theCard, false); + static inline void draw(const bool sel, const uint8_t row, FSTR_P const fstr, CardReader &theCard) { + MenuItem_sdbase::draw(sel, row, fstr, theCard, false); } - static void action(PGM_P const pstr, CardReader &) { + static void action(FSTR_P const fstr, CardReader &) { #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) // Save menu state for the selected file sd_encoder_position = ui.encoderPosition; @@ -72,30 +72,30 @@ class MenuItem_sdfile : public MenuItem_sdbase { sd_items = screen_items; #endif #if ENABLED(SD_MENU_CONFIRM_START) - MenuItem_submenu::action(pstr, []{ + MenuItem_submenu::action(fstr, []{ char * const longest = card.longest_filename(); char buffer[strlen(longest) + 2]; buffer[0] = ' '; strcpy(buffer + 1, longest); MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_PRINT), GET_TEXT(MSG_BUTTON_CANCEL), + GET_TEXT_F(MSG_BUTTON_PRINT), GET_TEXT_F(MSG_BUTTON_CANCEL), sdcard_start_selected_file, nullptr, - GET_TEXT(MSG_START_PRINT), buffer, PSTR("?") + GET_TEXT_F(MSG_START_PRINT), buffer, F("?") ); }); #else sdcard_start_selected_file(); - UNUSED(pstr); + UNUSED(fstr); #endif } }; class MenuItem_sdfolder : public MenuItem_sdbase { public: - static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) { - MenuItem_sdbase::draw(sel, row, pstr, theCard, true); + static inline void draw(const bool sel, const uint8_t row, FSTR_P const fstr, CardReader &theCard) { + MenuItem_sdbase::draw(sel, row, fstr, theCard, true); } - static void action(PGM_P const, CardReader &theCard) { + static void action(FSTR_P const, CardReader &theCard) { card.cd(theCard.filename); encoderTopLine = 0; ui.encoderPosition = 2 * (ENCODER_STEPS_PER_MENU_ITEM); @@ -119,15 +119,15 @@ void menu_media_filelist() { #if ENABLED(MULTI_VOLUME) ACTION_ITEM(MSG_BACK, []{ ui.goto_screen(menu_media); }); #else - BACK_ITEM_P(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT(MSG_MAIN) : GET_TEXT(MSG_BACK)); + BACK_ITEM_F(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT_F(MSG_MAIN) : GET_TEXT_F(MSG_BACK)); #endif if (card.flag.workDirIsRoot) { - #if !PIN_EXISTS(SD_DETECT) + #if !HAS_SD_DETECT ACTION_ITEM(MSG_REFRESH, []{ encoderTopLine = 0; card.mount(); }); #endif } else if (card.isMounted()) - ACTION_ITEM_P(PSTR(LCD_STR_FOLDER " .."), lcd_sd_updir); + ACTION_ITEM_F(F(LCD_STR_FOLDER " .."), lcd_sd_updir); if (ui.should_draw()) for (uint16_t i = 0; i < fileCnt; i++) { if (_menuLineNr == _thisItemNr) { @@ -146,7 +146,7 @@ void menu_media_filelist() { #if ENABLED(MULTI_VOLUME) void menu_media_select() { START_MENU(); - BACK_ITEM_P(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT(MSG_MAIN) : GET_TEXT(MSG_BACK)); + BACK_ITEM_F(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT_F(MSG_MAIN) : GET_TEXT_F(MSG_BACK)); #if ENABLED(VOLUME_SD_ONBOARD) ACTION_ITEM(MSG_SD_CARD, []{ card.changeMedia(&card.media_driver_sdcard); card.mount(); ui.goto_screen(menu_media_filelist); }); #endif diff --git a/Marlin/src/lcd/menu/menu_mixer.cpp b/Marlin/src/lcd/menu/menu_mixer.cpp index f91f62ef83..feb4c59f18 100644 --- a/Marlin/src/lcd/menu/menu_mixer.cpp +++ b/Marlin/src/lcd/menu/menu_mixer.cpp @@ -89,15 +89,15 @@ char tmp[18]; - PGM_P const slabel = GET_TEXT(MSG_START_Z); - SUBMENU_P(slabel, []{ _lcd_mixer_gradient_z_edit(false); }); + FSTR_P const slabel = GET_TEXT_F(MSG_START_Z); + SUBMENU_F(slabel, []{ _lcd_mixer_gradient_z_edit(false); }); MENU_ITEM_ADDON_START_RJ(11); sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.start_z), int(mixer.gradient.start_z * 10) % 10); lcd_put_u8str(tmp); MENU_ITEM_ADDON_END(); - PGM_P const elabel = GET_TEXT(MSG_END_Z); - SUBMENU_P(elabel, []{ _lcd_mixer_gradient_z_edit(true); }); + FSTR_P const elabel = GET_TEXT_F(MSG_END_Z); + SUBMENU_F(elabel, []{ _lcd_mixer_gradient_z_edit(true); }); MENU_ITEM_ADDON_START_RJ(11); sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.end_z), int(mixer.gradient.end_z * 10) % 10); lcd_put_u8str(tmp); @@ -257,7 +257,7 @@ void menu_mixer() { ui.return_to_status(); }, nullptr, - GET_TEXT(MSG_RESET_VTOOLS), (const char *)nullptr, PSTR("?") + GET_TEXT_F(MSG_RESET_VTOOLS), (const char *)nullptr, F("?") ); #if ENABLED(GRADIENT_MIX) diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 73101e7bcf..90bd015eff 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -35,15 +35,12 @@ #include "../../module/motion.h" #include "../../gcode/parser.h" // for inch support +#include "../../module/temperature.h" #if ENABLED(DELTA) #include "../../module/delta.h" #endif -#if ENABLED(PREVENT_COLD_EXTRUSION) - #include "../../module/temperature.h" -#endif - #if HAS_LEVELING #include "../../module/planner.h" #include "../../feature/bedlevel/bedlevel.h" @@ -57,7 +54,9 @@ // "Motion" > "Move Axis" submenu // -static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) { +// TODO: Use substitution here with MSG_MOVE_N + +static void _lcd_move_xyz(FSTR_P const name, const AxisEnum axis) { if (ui.use_click()) return ui.goto_previous_screen_no_defer(); if (ui.encoderPosition && !ui.manual_move.processing) { // Get motion limit from software endstops, if any @@ -90,30 +89,30 @@ static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) { MenuEditItemBase::draw_edit_screen(name, ui.manual_move.menu_scale >= 0.1f ? (LARGE_AREA_TEST ? ftostr51sign(pos) : ftostr41sign(pos)) : ftostr63(pos)); } } -void lcd_move_x() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_X), X_AXIS); } +void lcd_move_x() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_X), X_AXIS); } #if HAS_Y_AXIS - void lcd_move_y() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Y), Y_AXIS); } + void lcd_move_y() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_Y), Y_AXIS); } #endif #if HAS_Z_AXIS - void lcd_move_z() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Z), Z_AXIS); } + void lcd_move_z() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_Z), Z_AXIS); } #endif #if HAS_I_AXIS - void lcd_move_i() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_I), I_AXIS); } + void lcd_move_i() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_I), I_AXIS); } #endif #if HAS_J_AXIS - void lcd_move_j() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_J), J_AXIS); } + void lcd_move_j() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_J), J_AXIS); } #endif #if HAS_K_AXIS - void lcd_move_k() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_K), K_AXIS); } + void lcd_move_k() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_K), K_AXIS); } #endif #if HAS_U_AXIS - void lcd_move_u() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_U), U_AXIS); } + void lcd_move_u() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_U), U_AXIS); } #endif #if HAS_V_AXIS - void lcd_move_v() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_V), V_AXIS); } + void lcd_move_v() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_V), V_AXIS); } #endif #if HAS_W_AXIS - void lcd_move_w() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_W), W_AXIS); } + void lcd_move_w() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_W), W_AXIS); } #endif #if E_MANUAL @@ -132,7 +131,7 @@ void lcd_move_x() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_X), X_AXIS); } if (ui.should_draw()) { TERN_(MULTI_E_MANUAL, MenuItemBase::init(eindex)); MenuEditItemBase::draw_edit_screen( - GET_TEXT(TERN(MULTI_E_MANUAL, MSG_MOVE_EN, MSG_MOVE_E)), + GET_TEXT_F(TERN(MULTI_E_MANUAL, MSG_MOVE_EN, MSG_MOVE_E)), ftostr41sign(current_position.e PLUS_TERN0(IS_KINEMATIC, ui.manual_move.offset) MINUS_TERN0(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin) @@ -174,9 +173,8 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int START_MENU(); if (LCD_HEIGHT >= 4) { switch (axis) { - case X_AXIS: STATIC_ITEM(MSG_MOVE_X, SS_DEFAULT|SS_INVERT); break; - case Y_AXIS: STATIC_ITEM(MSG_MOVE_Y, SS_DEFAULT|SS_INVERT); break; - case Z_AXIS: STATIC_ITEM(MSG_MOVE_Z, SS_DEFAULT|SS_INVERT); break; + #define _CASE_MOVE(N) case N##_AXIS: STATIC_ITEM(MSG_MOVE_##N, SS_DEFAULT|SS_INVERT); break; + MAIN_AXIS_MAP(_CASE_MOVE) default: TERN_(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin = current_position.e); STATIC_ITEM(MSG_MOVE_E, SS_DEFAULT|SS_INVERT); @@ -196,22 +194,8 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int SUBMENU(MSG_MOVE_10MM, []{ _goto_manual_move(10); }); SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move( 1); }); SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move( 0.1f); }); - if (axis == Z_AXIS && (FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f) { - // Determine digits needed right of decimal - constexpr uint8_t digs = !UNEAR_ZERO((FINE_MANUAL_MOVE) * 1000 - int((FINE_MANUAL_MOVE) * 1000)) ? 4 : - !UNEAR_ZERO((FINE_MANUAL_MOVE) * 100 - int((FINE_MANUAL_MOVE) * 100)) ? 3 : 2; - PGM_P const label = GET_TEXT(MSG_MOVE_N_MM); - char tmp[strlen_P(label) + 10 + 1], numstr[10]; - sprintf_P(tmp, label, dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr)); - #if DISABLED(HAS_GRAPHICAL_TFT) - SUBMENU_P(NUL_STR, []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); }); - MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780)); - lcd_put_u8str(tmp); - MENU_ITEM_ADDON_END(); - #else - SUBMENU_P(tmp, []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); }); - #endif - } + if (axis == Z_AXIS && (FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f) + SUBMENU_f(F(STRINGIFY(FINE_MANUAL_MOVE)), MSG_MOVE_N_MM, []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); }); } END_MENU(); } @@ -223,23 +207,20 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int } inline void _menu_move_distance_e_maybe() { - #if ENABLED(PREVENT_COLD_EXTRUSION) - const bool too_cold = thermalManager.tooColdToExtrude(active_extruder); - if (too_cold) { - ui.goto_screen([]{ - MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_PROCEED), GET_TEXT(MSG_BACK), - _goto_menu_move_distance_e, nullptr, - GET_TEXT(MSG_HOTEND_TOO_COLD), (const char *)nullptr, PSTR("!") - ); - }); - return; - } - #endif - _goto_menu_move_distance_e(); + if (thermalManager.tooColdToExtrude(active_extruder)) { + ui.goto_screen([]{ + MenuItem_confirm::select_screen( + GET_TEXT_F(MSG_BUTTON_PROCEED), GET_TEXT_F(MSG_BACK), + _goto_menu_move_distance_e, nullptr, + GET_TEXT_F(MSG_HOTEND_TOO_COLD), (const char *)nullptr, F("!") + ); + }); + } + else + _goto_menu_move_distance_e(); } -#endif // E_MANUAL +#endif void menu_move() { START_MENU(); @@ -284,41 +265,41 @@ void menu_move() { #endif } else - GCODES_ITEM(MSG_AUTO_HOME, G28_STR); + GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR)); #if ANY(SWITCHING_EXTRUDER, SWITCHING_NOZZLE, MAGNETIC_SWITCHING_TOOLHEAD) #if EXTRUDERS >= 4 switch (active_extruder) { - case 0: GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); break; - case 1: GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); break; - case 2: GCODES_ITEM_N(3, MSG_SELECT_E, PSTR("T3")); break; - case 3: GCODES_ITEM_N(2, MSG_SELECT_E, PSTR("T2")); break; + case 0: GCODES_ITEM_N(1, MSG_SELECT_E, F("T1")); break; + case 1: GCODES_ITEM_N(0, MSG_SELECT_E, F("T0")); break; + case 2: GCODES_ITEM_N(3, MSG_SELECT_E, F("T3")); break; + case 3: GCODES_ITEM_N(2, MSG_SELECT_E, F("T2")); break; #if EXTRUDERS == 6 - case 4: GCODES_ITEM_N(5, MSG_SELECT_E, PSTR("T5")); break; - case 5: GCODES_ITEM_N(4, MSG_SELECT_E, PSTR("T4")); break; + case 4: GCODES_ITEM_N(5, MSG_SELECT_E, F("T5")); break; + case 5: GCODES_ITEM_N(4, MSG_SELECT_E, F("T4")); break; #endif } #elif EXTRUDERS == 3 if (active_extruder < 2) { if (active_extruder) - GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); + GCODES_ITEM_N(0, MSG_SELECT_E, F("T0")); else - GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); + GCODES_ITEM_N(1, MSG_SELECT_E, F("T1")); } #else if (active_extruder) - GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); + GCODES_ITEM_N(0, MSG_SELECT_E, F("T0")); else - GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); + GCODES_ITEM_N(1, MSG_SELECT_E, F("T1")); #endif #elif ENABLED(DUAL_X_CARRIAGE) if (active_extruder) - GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); + GCODES_ITEM_N(0, MSG_SELECT_E, F("T0")); else - GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); + GCODES_ITEM_N(1, MSG_SELECT_E, F("T1")); #endif @@ -338,7 +319,7 @@ void menu_move() { #elif MULTI_E_MANUAL - // Independent extruders with one E-stepper per hotend + // Independent extruders with one E stepper per hotend LOOP_L_N(n, E_MANUAL) SUBMENU_MOVE_E(n); #endif @@ -356,31 +337,31 @@ void menu_move() { START_MENU(); BACK_ITEM(MSG_MOTION); - GCODES_ITEM(MSG_AUTO_HOME, G28_STR); - GCODES_ITEM_N(X_AXIS, MSG_AUTO_HOME_A, PSTR("G28X")); + GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR)); + GCODES_ITEM_N(X_AXIS, MSG_AUTO_HOME_A, F("G28X")); #if HAS_Y_AXIS - GCODES_ITEM_N(Y_AXIS, MSG_AUTO_HOME_A, PSTR("G28Y")); + GCODES_ITEM_N(Y_AXIS, MSG_AUTO_HOME_A, F("G28Y")); #endif #if HAS_Z_AXIS - GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, PSTR("G28Z")); + GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, F("G28Z")); #endif #if HAS_I_AXIS - GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_I)); + GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, F("G28" STR_I)); #endif #if HAS_J_AXIS - GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_J)); + GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, F("G28" STR_J)); #endif #if HAS_K_AXIS - GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_K)); + GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, F("G28" STR_K)); #endif #if HAS_U_AXIS - GCODES_ITEM_N(U_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_U)); + GCODES_ITEM_N(U_AXIS, MSG_AUTO_HOME_A, F("G28" STR_U)); #endif #if HAS_V_AXIS - GCODES_ITEM_N(V_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_V)); + GCODES_ITEM_N(V_AXIS, MSG_AUTO_HOME_A, F("G28" STR_V)); #endif #if HAS_W_AXIS - GCODES_ITEM_N(W_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_W)); + GCODES_ITEM_N(W_AXIS, MSG_AUTO_HOME_A, F("G28" STR_W)); #endif END_MENU(); @@ -417,32 +398,32 @@ void menu_motion() { #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) SUBMENU(MSG_HOMING, menu_home); #else - GCODES_ITEM(MSG_AUTO_HOME, G28_STR); + GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR)); #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) - GCODES_ITEM_N(X_AXIS, MSG_AUTO_HOME_A, PSTR("G28X")); + GCODES_ITEM_N(X_AXIS, MSG_AUTO_HOME_A, F("G28X")); #if HAS_Y_AXIS - GCODES_ITEM_N(Y_AXIS, MSG_AUTO_HOME_A, PSTR("G28Y")); + GCODES_ITEM_N(Y_AXIS, MSG_AUTO_HOME_A, F("G28Y")); #endif #if HAS_Z_AXIS - GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, PSTR("G28Z")); + GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, F("G28Z")); #endif #if HAS_I_AXIS - GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_I)); + GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, F("G28" STR_I)); #endif #if HAS_J_AXIS - GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_J)); + GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, F("G28" STR_J)); #endif #if HAS_K_AXIS - GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_K)); + GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, F("G28" STR_K)); #endif #if HAS_U_AXIS - GCODES_ITEM_N(U_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_U)); + GCODES_ITEM_N(U_AXIS, MSG_AUTO_HOME_A, F("G28" STR_U)); #endif #if HAS_V_AXIS - GCODES_ITEM_N(V_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_V)); + GCODES_ITEM_N(V_AXIS, MSG_AUTO_HOME_A, F("G28" STR_V)); #endif #if HAS_W_AXIS - GCODES_ITEM_N(W_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_W)); + GCODES_ITEM_N(W_AXIS, MSG_AUTO_HOME_A, F("G28" STR_W)); #endif #endif #endif @@ -451,14 +432,14 @@ void menu_motion() { // Auto-calibration // #if ENABLED(CALIBRATION_GCODE) - GCODES_ITEM(MSG_AUTO_CALIBRATE, PSTR("G425")); + GCODES_ITEM(MSG_AUTO_CALIBRATE, F("G425")); #endif // // Auto Z-Align // #if EITHER(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION) - GCODES_ITEM(MSG_AUTO_Z_ALIGN, PSTR("G34")); + GCODES_ITEM(MSG_AUTO_Z_ALIGN, F("G34")); #endif // @@ -483,7 +464,7 @@ void menu_motion() { #elif HAS_LEVELING && DISABLED(SLIM_LCD_MENUS) #if DISABLED(PROBE_MANUALLY) - GCODES_ITEM(MSG_LEVEL_BED, PSTR("G29N")); + GCODES_ITEM(MSG_LEVEL_BED, F("G29N")); #endif if (all_axes_homed() && leveling_is_valid()) { @@ -498,18 +479,18 @@ void menu_motion() { #endif - #if ENABLED(LEVEL_BED_CORNERS) && DISABLED(LCD_BED_LEVELING) + #if ENABLED(LCD_BED_TRAMMING) && DISABLED(LCD_BED_LEVELING) SUBMENU(MSG_BED_TRAMMING, _lcd_level_bed_corners); #endif #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - GCODES_ITEM(MSG_M48_TEST, PSTR("G28O\nM48 P10")); + GCODES_ITEM(MSG_M48_TEST, F("G28O\nM48 P10")); #endif // // Disable Steppers // - GCODES_ITEM(MSG_DISABLE_STEPPERS, PSTR("M84")); + GCODES_ITEM(MSG_DISABLE_STEPPERS, F("M84")); END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_password.cpp b/Marlin/src/lcd/menu/menu_password.cpp index 32059103b3..89ea42d704 100644 --- a/Marlin/src/lcd/menu/menu_password.cpp +++ b/Marlin/src/lcd/menu/menu_password.cpp @@ -49,18 +49,18 @@ void Password::menu_password_entry() { START_MENU(); // "Login" or "New Code" - STATIC_ITEM_P(authenticating ? GET_TEXT(MSG_LOGIN_REQUIRED) : GET_TEXT(MSG_EDIT_PASSWORD), SS_CENTER|SS_INVERT); + STATIC_ITEM_F(authenticating ? GET_TEXT_F(MSG_LOGIN_REQUIRED) : GET_TEXT_F(MSG_EDIT_PASSWORD), SS_CENTER|SS_INVERT); - STATIC_ITEM_P(NUL_STR, SS_CENTER, string); + STATIC_ITEM_F(FPSTR(NUL_STR), SS_CENTER, string); #if HAS_MARLINUI_U8GLIB - STATIC_ITEM_P(NUL_STR, SS_CENTER, ""); + STATIC_ITEM_F(FPSTR(NUL_STR), SS_CENTER, ""); #endif // Make the digit edit item look like a sub-menu - PGM_P const label = GET_TEXT(MSG_ENTER_DIGIT); - EDIT_ITEM_P(uint8, label, &editable.uint8, 0, 9, digit_entered); - MENU_ITEM_ADDON_START(utf8_strlen_P(label) + 1); + FSTR_P const label = GET_TEXT_F(MSG_ENTER_DIGIT); + EDIT_ITEM_F(uint8, label, &editable.uint8, 0, 9, digit_entered); + MENU_ITEM_ADDON_START(utf8_strlen(label) + 1); lcd_put_wchar(' '); lcd_put_wchar('1' + digit_no); SETCURSOR_X(LCD_WIDTH - 2); diff --git a/Marlin/src/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp index 79db47005d..c7cbebaade 100644 --- a/Marlin/src/lcd/menu/menu_probe_offset.cpp +++ b/Marlin/src/lcd/menu/menu_probe_offset.cpp @@ -62,27 +62,14 @@ void probe_offset_wizard_menu() { if (LCD_HEIGHT >= 4) STATIC_ITEM(MSG_MOVE_NOZZLE_TO_BED, SS_CENTER|SS_INVERT); - STATIC_ITEM_P(PSTR("Z"), SS_CENTER, ftostr42_52(current_position.z)); + STATIC_ITEM_F(F("Z"), SS_CENTER, ftostr42_52(current_position.z)); STATIC_ITEM(MSG_ZPROBE_ZOFFSET, SS_LEFT, ftostr42_52(calculated_z_offset)); SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move_z( 1); }); SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move_z( 0.1f); }); - if ((FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f) { - char tmp[20], numstr[10]; - // Determine digits needed right of decimal - const uint8_t digs = !UNEAR_ZERO((FINE_MANUAL_MOVE) * 1000 - int((FINE_MANUAL_MOVE) * 1000)) ? 4 : - !UNEAR_ZERO((FINE_MANUAL_MOVE) * 100 - int((FINE_MANUAL_MOVE) * 100)) ? 3 : 2; - sprintf_P(tmp, GET_TEXT(MSG_MOVE_N_MM), dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr)); - #if DISABLED(HAS_GRAPHICAL_TFT) - SUBMENU_P(NUL_STR, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); - MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780)); - lcd_put_u8str(tmp); - MENU_ITEM_ADDON_END(); - #else - SUBMENU_P(tmp, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); - #endif - } + if ((FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f) + SUBMENU_f(F(STRINGIFY(FINE_MANUAL_MOVE)), MSG_MOVE_N_MM, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); ACTION_ITEM(MSG_BUTTON_DONE, []{ set_offset_and_go_back(calculated_z_offset); @@ -107,7 +94,7 @@ void probe_offset_wizard_menu() { void prepare_for_probe_offset_wizard() { #if defined(PROBE_OFFSET_WIZARD_XY_POS) || !HOMING_Z_WITH_PROBE - if (ui.should_draw()) MenuItem_static::draw(1, GET_TEXT(MSG_PROBE_WIZARD_PROBING)); + if (ui.should_draw()) MenuItem_static::draw(1, GET_TEXT_F(MSG_PROBE_WIZARD_PROBING)); if (ui.wait_for_move) return; @@ -133,7 +120,7 @@ void prepare_for_probe_offset_wizard() { ui.wait_for_move = true; current_position += probe.offset_xy; line_to_current_position(MMM_TO_MMS(XY_PROBE_FEEDRATE)); - ui.synchronize(GET_TEXT(MSG_PROBE_WIZARD_MOVING)); + ui.synchronize(GET_TEXT_F(MSG_PROBE_WIZARD_MOVING)); ui.wait_for_move = false; SET_SOFT_ENDSTOP_LOOSE(true); // Disable soft endstops for free Z movement diff --git a/Marlin/src/lcd/menu/menu_spindle_laser.cpp b/Marlin/src/lcd/menu/menu_spindle_laser.cpp index 306d3d6c57..9efd68ca00 100644 --- a/Marlin/src/lcd/menu/menu_spindle_laser.cpp +++ b/Marlin/src/lcd/menu/menu_spindle_laser.cpp @@ -64,7 +64,7 @@ #if ENABLED(SPINDLE_CHANGE_DIR) if (!is_enabled) { editable.state = is_rev; - ACTION_ITEM_P(is_rev ? GET_TEXT(MSG_CUTTER(REVERSE)) : GET_TEXT(MSG_CUTTER(FORWARD)), []{ cutter.set_reverse(!editable.state); }); + ACTION_ITEM_F(is_rev ? GET_TEXT_F(MSG_CUTTER(REVERSE)) : GET_TEXT_F(MSG_CUTTER(FORWARD)), []{ cutter.set_reverse(!editable.state); }); } #endif diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index fb539f006c..e493972a97 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -88,14 +88,14 @@ void Temperature::lcd_preheat(const uint8_t e, const int8_t indh, const int8_t i // 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); }); \ + ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_both(M, MenuItemBase::itemIndex); }); \ + ACTION_ITEM_N_f(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); }) + #define PREHEAT_ITEMS(M,E) ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_end(M, MenuItemBase::itemIndex); }) #endif @@ -112,16 +112,16 @@ void Temperature::lcd_preheat(const uint8_t e, const int8_t indh, const int8_t i #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); + ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M, []{ _preheat_both(editable.int8, 0); }); + ACTION_ITEM_f(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); + ACTION_ITEM_f(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, []() { + ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M_ALL, []() { const celsius_t t = ui.material_preset[editable.int8].hotend_temp; HOTEND_LOOP() thermalManager.setTargetHotend(t, e); TERN(HAS_HEATED_BED, _preheat_bed(editable.int8), ui.return_to_status()); @@ -130,7 +130,7 @@ void Temperature::lcd_preheat(const uint8_t e, const int8_t indh, const int8_t i #endif #if HAS_HEATED_BED - ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M_BEDONLY, []{ _preheat_bed(editable.int8); }); + ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M_BEDONLY, []{ _preheat_bed(editable.int8); }); #endif END_MENU(); @@ -269,9 +269,9 @@ void menu_temperature() { LOOP_L_N(m, PREHEAT_COUNT) { editable.int8 = m; #if HAS_MULTI_HOTEND || HAS_HEATED_BED - SUBMENU_S(ui.get_preheat_label(m), MSG_PREHEAT_M, menu_preheat_m); + SUBMENU_f(ui.get_preheat_label(m), MSG_PREHEAT_M, menu_preheat_m); #elif HAS_HOTEND - ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m); + ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m); #endif } #endif @@ -296,9 +296,9 @@ void menu_temperature() { LOOP_L_N(m, PREHEAT_COUNT) { editable.int8 = m; #if HAS_MULTI_HOTEND || HAS_HEATED_BED - SUBMENU_S(ui.get_preheat_label(m), MSG_PREHEAT_M, menu_preheat_m); + SUBMENU_f(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); + ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m); #endif } diff --git a/Marlin/src/lcd/menu/menu_tmc.cpp b/Marlin/src/lcd/menu/menu_tmc.cpp index 995bc3b195..c3503ede41 100644 --- a/Marlin/src/lcd/menu/menu_tmc.cpp +++ b/Marlin/src/lcd/menu/menu_tmc.cpp @@ -32,7 +32,7 @@ #include "../../module/stepper/indirection.h" #include "../../feature/tmc_util.h" -#define TMC_EDIT_STORED_I_RMS(ST,STR) EDIT_ITEM_P(uint16_4, PSTR(STR), &stepper##ST.val_mA, 100, 3000, []{ stepper##ST.refresh_stepper_current(); }) +#define TMC_EDIT_STORED_I_RMS(ST,STR) EDIT_ITEM_F(uint16_4, F(STR), &stepper##ST.val_mA, 100, 3000, []{ stepper##ST.refresh_stepper_current(); }) void menu_tmc_current() { START_MENU(); @@ -90,7 +90,7 @@ void menu_tmc_current() { #if ENABLED(HYBRID_THRESHOLD) - #define TMC_EDIT_STORED_HYBRID_THRS(ST, STR) EDIT_ITEM_P(uint8, PSTR(STR), &stepper##ST.stored.hybrid_thrs, 0, 255, []{ stepper##ST.refresh_hybrid_thrs(); }); + #define TMC_EDIT_STORED_HYBRID_THRS(ST, STR) EDIT_ITEM_F(uint8, F(STR), &stepper##ST.stored.hybrid_thrs, 0, 255, []{ stepper##ST.refresh_hybrid_thrs(); }); void menu_tmc_hybrid_thrs() { START_MENU(); @@ -118,7 +118,7 @@ void menu_tmc_current() { #if ENABLED(SENSORLESS_HOMING) - #define TMC_EDIT_STORED_SGT(ST) EDIT_ITEM_P(int4, PSTR(STR_##ST), &stepper##ST.stored.homing_thrs, stepper##ST.sgt_min, stepper##ST.sgt_max, []{ stepper##ST.refresh_homing_thrs(); }); + #define TMC_EDIT_STORED_SGT(ST) EDIT_ITEM_F(int4, F(STR_##ST), &stepper##ST.stored.homing_thrs, stepper##ST.sgt_min, stepper##ST.sgt_max, []{ stepper##ST.refresh_homing_thrs(); }); void menu_tmc_homing_thrs() { START_MENU(); @@ -144,7 +144,7 @@ void menu_tmc_current() { #if HAS_STEALTHCHOP - #define TMC_EDIT_STEP_MODE(ST, STR) EDIT_ITEM_P(bool, PSTR(STR), &stepper##ST.stored.stealthChop_enabled, []{ stepper##ST.refresh_stepping_mode(); }) + #define TMC_EDIT_STEP_MODE(ST, STR) EDIT_ITEM_F(bool, F(STR), &stepper##ST.stored.stealthChop_enabled, []{ stepper##ST.refresh_stepping_mode(); }) void menu_tmc_step_mode() { START_MENU(); diff --git a/Marlin/src/lcd/menu/menu_tramming.cpp b/Marlin/src/lcd/menu/menu_tramming.cpp index 0789044d7d..1dd8a1cab6 100644 --- a/Marlin/src/lcd/menu/menu_tramming.cpp +++ b/Marlin/src/lcd/menu/menu_tramming.cpp @@ -83,7 +83,7 @@ static void tramming_wizard_menu() { // Draw a menu item for each tramming point for (tram_index = 0; tram_index < G35_PROBE_COUNT; tram_index++) - SUBMENU_P((PGM_P)pgm_read_ptr(&tramming_point_name[tram_index]), _menu_single_probe); + SUBMENU_F(FPSTR(pgm_read_ptr(&tramming_point_name[tram_index])), _menu_single_probe); ACTION_ITEM(MSG_BUTTON_DONE, []{ probe.stow(); // Stow before exiting Tramming Wizard diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index 40513f71ab..b13c55f80a 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -50,7 +50,9 @@ #include "../dogm/marlinui_DOGM.h" #endif - void _lcd_babystep(const AxisEnum axis, PGM_P const msg) { + // TODO: Replace fmsg with MSG_BABYSTEP_N and index substitution + + void _lcd_babystep(const AxisEnum axis, FSTR_P const fmsg) { if (ui.use_click()) return ui.goto_previous_screen_no_defer(); if (ui.encoderPosition) { const int16_t steps = int16_t(ui.encoderPosition) * ( @@ -66,7 +68,7 @@ } if (ui.should_draw()) { const float mps = planner.mm_per_step[axis]; - MenuEditItemBase::draw_edit_screen(msg, BABYSTEP_TO_STR(mps * babystep.accum)); + MenuEditItemBase::draw_edit_screen(fmsg, BABYSTEP_TO_STR(mps * babystep.accum)); #if ENABLED(BABYSTEP_DISPLAY_TOTAL) const bool in_view = TERN1(HAS_MARLINUI_U8GLIB, PAGE_CONTAINS(LCD_PIXEL_HEIGHT - MENU_FONT_HEIGHT, LCD_PIXEL_HEIGHT - 1)); if (in_view) { @@ -94,12 +96,12 @@ } #if ENABLED(BABYSTEP_XY) - void _lcd_babystep_x() { _lcd_babystep(X_AXIS, GET_TEXT(MSG_BABYSTEP_X)); } - void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, GET_TEXT(MSG_BABYSTEP_Y)); } + void _lcd_babystep_x() { _lcd_babystep(X_AXIS, GET_TEXT_F(MSG_BABYSTEP_X)); } + void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, GET_TEXT_F(MSG_BABYSTEP_Y)); } #endif #if DISABLED(BABYSTEP_ZPROBE_OFFSET) - void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, GET_TEXT(MSG_BABYSTEP_Z)); } + void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, GET_TEXT_F(MSG_BABYSTEP_Z)); } void lcd_babystep_z() { _lcd_babystep_go(_lcd_babystep_z); } #endif @@ -223,13 +225,13 @@ void menu_tune() { // #if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEP_XY) - SUBMENU(MSG_BABYSTEP_X, []{ _lcd_babystep_go(_lcd_babystep_x); }); - SUBMENU(MSG_BABYSTEP_Y, []{ _lcd_babystep_go(_lcd_babystep_y); }); + SUBMENU_N(X_AXIS, MSG_BABYSTEP_N, []{ _lcd_babystep_go(_lcd_babystep_x); }); + SUBMENU_N(Y_AXIS, MSG_BABYSTEP_N, []{ _lcd_babystep_go(_lcd_babystep_y); }); #endif #if ENABLED(BABYSTEP_ZPROBE_OFFSET) SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); #else - SUBMENU(MSG_BABYSTEP_Z, lcd_babystep_z); + SUBMENU_N(Z_AXIS, MSG_BABYSTEP_N, lcd_babystep_z); #endif #endif diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index df60eaa6f5..62c1770bd4 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -67,7 +67,7 @@ inline float rounded_mesh_value() { * - Draw the graphical overlay, if enabled. * - Update the 'refresh' state according to the display type */ -void _lcd_mesh_fine_tune(PGM_P const msg) { +void _lcd_mesh_fine_tune(FSTR_P const fmsg) { constexpr float mesh_edit_step = 1.0f / 200.0f; ui.defer_status_screen(); if (bedlevel.encoder_diff) { @@ -82,7 +82,7 @@ void _lcd_mesh_fine_tune(PGM_P const msg) { if (ui.should_draw()) { const float rounded_f = rounded_mesh_value(); - MenuEditItemBase::draw_edit_screen(msg, ftostr43sign(rounded_f)); + MenuEditItemBase::draw_edit_screen(fmsg, ftostr43sign(rounded_f)); TERN_(MESH_EDIT_GFX_OVERLAY, ui.zoffset_overlay(rounded_f)); TERN_(HAS_GRAPHICAL_TFT, ui.refresh(LCDVIEW_NONE)); } @@ -95,7 +95,7 @@ void _lcd_mesh_fine_tune(PGM_P const msg) { void MarlinUI::ubl_mesh_edit_start(const_float_t initial) { TERN_(HAS_GRAPHICAL_TFT, clear_lcd()); mesh_edit_accumulator = initial; - goto_screen([]{ _lcd_mesh_fine_tune(GET_TEXT(MSG_MESH_EDIT_Z)); }); + goto_screen([]{ _lcd_mesh_fine_tune(GET_TEXT_F(MSG_MESH_EDIT_Z)); }); } // @@ -176,8 +176,8 @@ void _menu_ubl_height_adjust() { void _lcd_ubl_edit_mesh() { START_MENU(); BACK_ITEM(MSG_UBL_TOOLS); - GCODES_ITEM(MSG_UBL_FINE_TUNE_ALL, PSTR("G29P4RT")); - GCODES_ITEM(MSG_UBL_FINE_TUNE_CLOSEST, PSTR("G29P4T")); + GCODES_ITEM(MSG_UBL_FINE_TUNE_ALL, F("G29P4RT")); + GCODES_ITEM(MSG_UBL_FINE_TUNE_CLOSEST, F("G29P4T")); SUBMENU(MSG_UBL_MESH_HEIGHT_ADJUST, _menu_ubl_height_adjust); ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status); END_MENU(); @@ -211,10 +211,10 @@ void _lcd_ubl_edit_mesh() { #if HAS_PREHEAT #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\nG26CPI" STRINGIFY(M))); + GCODES_ITEM_N_f(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, F("G28\nG26CPI" 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\nG26CPB0I" STRINGIFY(M))); + GCODES_ITEM_N_f(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, F("G28\nG26CPB0I" STRINGIFY(M))); #endif REPEAT(PREHEAT_COUNT, VALIDATE_MESH_GCODE_ITEM) #endif @@ -255,7 +255,7 @@ void _lcd_ubl_grid_level() { void _lcd_ubl_mesh_leveling() { START_MENU(); BACK_ITEM(MSG_UBL_TOOLS); - GCODES_ITEM(MSG_UBL_3POINT_MESH_LEVELING, PSTR("G29J0")); + GCODES_ITEM(MSG_UBL_3POINT_MESH_LEVELING, F("G29J0")); SUBMENU(MSG_UBL_GRID_MESH_LEVELING, _lcd_ubl_grid_level); ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status); END_MENU(); @@ -284,8 +284,8 @@ void _menu_ubl_fillin() { START_MENU(); BACK_ITEM(MSG_UBL_BUILD_MESH_MENU); EDIT_ITEM(int3, MSG_UBL_FILLIN_AMOUNT, &ubl_fillin_amount, 0, 9, _lcd_ubl_fillin_amount_cmd); - GCODES_ITEM(MSG_UBL_SMART_FILLIN, PSTR("G29P3T0")); - GCODES_ITEM(MSG_UBL_MANUAL_FILLIN, PSTR("G29P2BT0")); + GCODES_ITEM(MSG_UBL_SMART_FILLIN, F("G29P3T0")); + GCODES_ITEM(MSG_UBL_MANUAL_FILLIN, F("G29P2BT0")); ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status); END_MENU(); } @@ -317,8 +317,8 @@ void _lcd_ubl_build_mesh() { #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( \ + #define BUILD_MESH_GCODE_ITEM(M) GCODES_ITEM_f(ui.get_preheat_label(M), MSG_UBL_BUILD_MESH_M, \ + F( \ "G28\n" \ PREHEAT_BED_GCODE(M) \ "M109I" STRINGIFY(M) "\n" \ @@ -342,11 +342,11 @@ void _lcd_ubl_build_mesh() { #endif // HAS_PREHEAT SUBMENU(MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_custom_mesh); - GCODES_ITEM(MSG_UBL_BUILD_COLD_MESH, PSTR("G29NP1")); + GCODES_ITEM(MSG_UBL_BUILD_COLD_MESH, F("G29NP1")); SUBMENU(MSG_UBL_FILLIN_MESH, _menu_ubl_fillin); - GCODES_ITEM(MSG_UBL_CONTINUE_MESH, PSTR("G29P1C")); + GCODES_ITEM(MSG_UBL_CONTINUE_MESH, F("G29P1C")); ACTION_ITEM(MSG_UBL_INVALIDATE_ALL, _lcd_ubl_invalidate); - GCODES_ITEM(MSG_UBL_INVALIDATE_CLOSEST, PSTR("G29I")); + GCODES_ITEM(MSG_UBL_INVALIDATE_CLOSEST, F("G29I")); ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status); END_MENU(); } @@ -354,14 +354,14 @@ void _lcd_ubl_build_mesh() { /** * UBL Load / Save Mesh Commands */ -inline void _lcd_ubl_load_save_cmd(const char loadsave, PGM_P const msg) { +inline void _lcd_ubl_load_save_cmd(const char loadsave, FSTR_P const fmsg) { 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); + sprintf_P(&ubl_lcd_gcode[strlen(ubl_lcd_gcode)], FTOP(fmsg), 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)); } +void _lcd_ubl_load_mesh_cmd() { _lcd_ubl_load_save_cmd('L', GET_TEXT_F(MSG_MESH_LOADED)); } +void _lcd_ubl_save_mesh_cmd() { _lcd_ubl_load_save_cmd('S', GET_TEXT_F(MSG_MESH_SAVED)); } /** * UBL Mesh Storage submenu @@ -531,9 +531,9 @@ void _ubl_goto_map_screen() { void _lcd_ubl_output_map() { START_MENU(); BACK_ITEM(MSG_UBL_LEVEL_BED); - GCODES_ITEM(MSG_UBL_OUTPUT_MAP_HOST, PSTR("G29T0")); - GCODES_ITEM(MSG_UBL_OUTPUT_MAP_CSV, PSTR("G29T1")); - GCODES_ITEM(MSG_UBL_OUTPUT_MAP_BACKUP, PSTR("G29S-1")); + GCODES_ITEM(MSG_UBL_OUTPUT_MAP_HOST, F("G29T0")); + GCODES_ITEM(MSG_UBL_OUTPUT_MAP_CSV, F("G29T1")); + GCODES_ITEM(MSG_UBL_OUTPUT_MAP_BACKUP, F("G29S-1")); END_MENU(); } @@ -550,7 +550,7 @@ void _menu_ubl_tools() { START_MENU(); BACK_ITEM(MSG_UBL_LEVEL_BED); SUBMENU(MSG_UBL_BUILD_MESH_MENU, _lcd_ubl_build_mesh); - GCODES_ITEM(MSG_UBL_MANUAL_MESH, PSTR("G29I999\nG29P2BT0")); + GCODES_ITEM(MSG_UBL_MANUAL_MESH, F("G29I999\nG29P2BT0")); #if ENABLED(G26_MESH_VALIDATION) SUBMENU(MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); #endif @@ -576,12 +576,12 @@ void _menu_ubl_tools() { void _lcd_ubl_step_by_step() { START_MENU(); BACK_ITEM(MSG_UBL_LEVEL_BED); - GCODES_ITEM(MSG_UBL_1_BUILD_COLD_MESH, PSTR("G29NP1")); - GCODES_ITEM(MSG_UBL_2_SMART_FILLIN, PSTR("G29P3T0")); + GCODES_ITEM(MSG_UBL_1_BUILD_COLD_MESH, F("G29NP1")); + GCODES_ITEM(MSG_UBL_2_SMART_FILLIN, F("G29P3T0")); SUBMENU(MSG_UBL_3_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - GCODES_ITEM(MSG_UBL_4_FINE_TUNE_ALL, PSTR("G29P4RT")); + GCODES_ITEM(MSG_UBL_4_FINE_TUNE_ALL, F("G29P4RT")); SUBMENU(MSG_UBL_5_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - GCODES_ITEM(MSG_UBL_6_FINE_TUNE_ALL, PSTR("G29P4RT")); + GCODES_ITEM(MSG_UBL_6_FINE_TUNE_ALL, F("G29P4RT")); ACTION_ITEM(MSG_UBL_7_SAVE_MESH, _lcd_ubl_save_mesh_cmd); END_MENU(); } @@ -650,9 +650,9 @@ void _lcd_ubl_level_bed() { START_MENU(); BACK_ITEM(MSG_MOTION); if (planner.leveling_active) - GCODES_ITEM(MSG_UBL_DEACTIVATE_MESH, PSTR("G29D")); + GCODES_ITEM(MSG_UBL_DEACTIVATE_MESH, F("G29D")); else - GCODES_ITEM(MSG_UBL_ACTIVATE_MESH, PSTR("G29A")); + GCODES_ITEM(MSG_UBL_ACTIVATE_MESH, F("G29A")); #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); }); @@ -667,7 +667,7 @@ void _lcd_ubl_level_bed() { SUBMENU(MSG_UBL_STORAGE_MESH_MENU, _lcd_ubl_storage_mesh); SUBMENU(MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map); SUBMENU(MSG_UBL_TOOLS, _menu_ubl_tools); - GCODES_ITEM(MSG_UBL_INFO_UBL, PSTR("G29W")); + GCODES_ITEM(MSG_UBL_INFO_UBL, F("G29W")); END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_x_twist.cpp b/Marlin/src/lcd/menu/menu_x_twist.cpp index ce46053dfc..e46745e8b7 100644 --- a/Marlin/src/lcd/menu/menu_x_twist.cpp +++ b/Marlin/src/lcd/menu/menu_x_twist.cpp @@ -51,7 +51,7 @@ void xatc_wizard_done() { ui.goto_screen(menu_advanced_settings); } if (ui.should_draw()) - MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT(MSG_XATC_DONE)); + MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT_F(MSG_XATC_DONE)); ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); } @@ -62,14 +62,14 @@ void xatc_wizard_goto_next_point(); // void xatc_wizard_update_z_offset() { MenuItem_confirm::select_screen( - GET_TEXT(MSG_YES), GET_TEXT(MSG_NO) + GET_TEXT_F(MSG_YES), GET_TEXT_F(MSG_NO) , []{ probe.offset.z = z_offset; ui.goto_screen(xatc_wizard_done); } , xatc_wizard_done - , GET_TEXT(MSG_XATC_UPDATE_Z_OFFSET) - , ftostr42_52(z_offset), PSTR("?") + , GET_TEXT_F(MSG_XATC_UPDATE_Z_OFFSET) + , ftostr42_52(z_offset), F("?") ); } @@ -93,26 +93,17 @@ void xatc_wizard_menu() { if (LCD_HEIGHT >= 4) STATIC_ITEM(MSG_MOVE_NOZZLE_TO_BED, SS_CENTER|SS_INVERT); - STATIC_ITEM_P(PSTR("Z="), SS_CENTER, ftostr42_52(current_position.z)); + STATIC_ITEM_F(F("Z="), SS_CENTER, ftostr42_52(current_position.z)); STATIC_ITEM(MSG_ZPROBE_ZOFFSET, SS_LEFT, ftostr42_52(calculated_z_offset)); SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move_z( 1); }); SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move_z( 0.1f); }); if ((FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f) { - char tmp[20], numstr[10]; // Determine digits needed right of decimal const uint8_t digs = !UNEAR_ZERO((FINE_MANUAL_MOVE) * 1000 - int((FINE_MANUAL_MOVE) * 1000)) ? 4 : !UNEAR_ZERO((FINE_MANUAL_MOVE) * 100 - int((FINE_MANUAL_MOVE) * 100)) ? 3 : 2; - sprintf_P(tmp, GET_TEXT(MSG_MOVE_N_MM), dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr)); - #if DISABLED(HAS_GRAPHICAL_TFT) - SUBMENU_P(NUL_STR, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); - MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780)); - lcd_put_u8str(tmp); - MENU_ITEM_ADDON_END(); - #else - SUBMENU_P(tmp, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); - #endif + SUBMENU_f(F(STRINGIFY(FINE_MANUAL_MOVE)), MSG_MOVE_N_MM, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); } ACTION_ITEM(MSG_BUTTON_DONE, xatc_wizard_set_offset_and_go_to_next_point); @@ -127,7 +118,7 @@ void xatc_wizard_moving() { if (ui.should_draw()) { char msg[10]; sprintf_P(msg, PSTR("%i / %u"), manual_probe_index + 1, XATC_MAX_POINTS); - MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_LEVEL_BED_NEXT_POINT), msg); + MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT), msg); } ui.refresh(LCDVIEW_CALL_NO_REDRAW); if (!ui.wait_for_move) ui.goto_screen(xatc_wizard_menu); @@ -180,7 +171,7 @@ void xatc_wizard_goto_next_point() { // void xatc_wizard_homing_done() { if (ui.should_draw()) { - MenuItem_static::draw(1, GET_TEXT(MSG_LEVEL_BED_WAITING)); + MenuItem_static::draw(1, GET_TEXT_F(MSG_LEVEL_BED_WAITING)); // Color UI needs a control to detect a touch #if BOTH(TOUCH_SCREEN, HAS_GRAPHICAL_TFT) diff --git a/Marlin/src/lcd/tft/tft.h b/Marlin/src/lcd/tft/tft.h index 435e7c30bf..67cec2ee1c 100644 --- a/Marlin/src/lcd/tft/tft.h +++ b/Marlin/src/lcd/tft/tft.h @@ -94,7 +94,7 @@ class TFT { static void canvas(uint16_t x, uint16_t y, uint16_t width, uint16_t height) { queue.canvas(x, y, width, height); } static void set_background(uint16_t color) { queue.set_background(color); } static void add_text(uint16_t x, uint16_t y, uint16_t color, TFT_String tft_string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, tft_string.string(), maxWidth); } - static void add_text(uint16_t x, uint16_t y, uint16_t color, const char *string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, (uint8_t *)string, maxWidth); } + static void add_text(uint16_t x, uint16_t y, uint16_t color, const char *string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, string, maxWidth); } static void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t *colors) { queue.add_image(x, y, image, colors); } static void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t color_main = COLOR_WHITE, uint16_t color_background = COLOR_BACKGROUND, uint16_t color_shadow = COLOR_BLACK) { queue.add_image(x, y, image, color_main, color_background, color_shadow); } static void add_bar(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.add_bar(x, y, width, height, color); } diff --git a/Marlin/src/lcd/tft/tft_queue.cpp b/Marlin/src/lcd/tft/tft_queue.cpp index 3f604005f9..25ab452cef 100644 --- a/Marlin/src/lcd/tft/tft_queue.cpp +++ b/Marlin/src/lcd/tft/tft_queue.cpp @@ -215,13 +215,13 @@ void TFT_Queue::handle_queue_overflow(uint16_t sizeNeeded) { } } -void TFT_Queue::add_text(uint16_t x, uint16_t y, uint16_t color, uint8_t *string, uint16_t maxWidth) { +void TFT_Queue::add_text(uint16_t x, uint16_t y, uint16_t color, const uint8_t *string, uint16_t maxWidth) { handle_queue_overflow(sizeof(parametersCanvasText_t) + maxWidth); parametersCanvas_t *task_parameters = (parametersCanvas_t *)(((uint8_t *)last_task) + sizeof(queueTask_t)); parametersCanvasText_t *parameters = (parametersCanvasText_t *)end_of_queue; last_parameter = end_of_queue; - uint8_t *pointer = string; + const uint8_t *pointer = string; parameters->type = CANVAS_ADD_TEXT; parameters->x = x; diff --git a/Marlin/src/lcd/tft/tft_queue.h b/Marlin/src/lcd/tft/tft_queue.h index 51387254c5..55d0a526b5 100644 --- a/Marlin/src/lcd/tft/tft_queue.h +++ b/Marlin/src/lcd/tft/tft_queue.h @@ -139,7 +139,10 @@ class TFT_Queue { static void fill(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color); static void canvas(uint16_t x, uint16_t y, uint16_t width, uint16_t height); static void set_background(uint16_t color); - static void add_text(uint16_t x, uint16_t y, uint16_t color, uint8_t *string, uint16_t maxWidth); + static void add_text(uint16_t x, uint16_t y, uint16_t color, const uint8_t *string, uint16_t maxWidth); + static void add_text(uint16_t x, uint16_t y, uint16_t color, const char *string, uint16_t maxWidth) { + add_text(x, y, color, (uint8_t *)string, maxWidth); + } static void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t *colors); static void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t color_main, uint16_t color_background, uint16_t color_shadow); diff --git a/Marlin/src/lcd/tft/tft_string.cpp b/Marlin/src/lcd/tft/tft_string.cpp index 008b5eba35..d8c419d1a0 100644 --- a/Marlin/src/lcd/tft/tft_string.cpp +++ b/Marlin/src/lcd/tft/tft_string.cpp @@ -35,7 +35,7 @@ glyph_t *TFT_String::glyphs[256]; font_t *TFT_String::font_header; -uint8_t TFT_String::data[]; +char TFT_String::data[]; uint16_t TFT_String::span; uint8_t TFT_String::length; @@ -84,24 +84,22 @@ void TFT_String::set() { length = 0; } -uint8_t read_byte(uint8_t *byte) { return *byte; } - /** * Add a string, applying substitutions for the following characters: * - * $ displays an inserted C-string given by the itemString parameter + * $ displays the string given by fstr or cstr * = displays '0'....'10' for indexes 0 - 10 * ~ displays '1'....'11' for indexes 0 - 10 * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) * @ displays an axis name such as XYZUVW, or E for an extruder */ -void TFT_String::add(uint8_t *string, int8_t index, uint8_t *itemString/*=nullptr*/) { +void TFT_String::add(const char *tpl, const int8_t index, const char *cstr/*=nullptr*/, FSTR_P const fstr/*=nullptr*/) { wchar_t wchar; - while (*string) { - string = get_utf8_value_cb(string, read_byte, &wchar); + while (*tpl) { + tpl = get_utf8_value_cb(tpl, read_byte_ram, &wchar); if (wchar > 255) wchar |= 0x0080; - uint8_t ch = uint8_t(wchar & 0x00FF); + const uint8_t ch = uint8_t(wchar & 0x00FF); if (ch == '=' || ch == '~' || ch == '*') { if (index >= 0) { @@ -111,10 +109,12 @@ void TFT_String::add(uint8_t *string, int8_t index, uint8_t *itemString/*=nullpt add_character('0' + inum); } else - add(index == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED)); + add(index == -2 ? GET_TEXT_F(MSG_CHAMBER) : GET_TEXT_F(MSG_BED)); } - else if (ch == '$' && itemString) - add(itemString); + else if (ch == '$' && fstr) + add(fstr); + else if (ch == '$' && cstr) + add(cstr); else if (ch == '@') add_character(AXIS_CHAR(index)); else @@ -123,19 +123,19 @@ void TFT_String::add(uint8_t *string, int8_t index, uint8_t *itemString/*=nullpt eol(); } -void TFT_String::add(uint8_t *string, uint8_t max_len) { +void TFT_String::add(const char *cstr, uint8_t max_len/*=MAX_STRING_LENGTH*/) { wchar_t wchar; - while (*string && max_len) { - string = get_utf8_value_cb(string, read_byte, &wchar); + while (*cstr && max_len) { + cstr = get_utf8_value_cb(cstr, read_byte_ram, &wchar); if (wchar > 255) wchar |= 0x0080; - uint8_t ch = uint8_t(wchar & 0x00FF); + const uint8_t ch = uint8_t(wchar & 0x00FF); add_character(ch); max_len--; } eol(); } -void TFT_String::add_character(uint8_t character) { +void TFT_String::add_character(const char character) { if (length < MAX_STRING_LENGTH) { data[length] = character; length++; @@ -143,7 +143,7 @@ void TFT_String::add_character(uint8_t character) { } } -void TFT_String::rtrim(uint8_t character) { +void TFT_String::rtrim(const char character) { while (length) { if (data[length - 1] == 0x20 || data[length - 1] == character) { length--; @@ -155,7 +155,7 @@ void TFT_String::rtrim(uint8_t character) { } } -void TFT_String::ltrim(uint8_t character) { +void TFT_String::ltrim(const char character) { uint16_t i, j; for (i = 0; (i < length) && (data[i] == 0x20 || data[i] == character); i++) { span -= glyph(data[i])->DWidth; @@ -166,7 +166,7 @@ void TFT_String::ltrim(uint8_t character) { eol(); } -void TFT_String::trim(uint8_t character) { +void TFT_String::trim(const char character) { rtrim(character); ltrim(character); } diff --git a/Marlin/src/lcd/tft/tft_string.h b/Marlin/src/lcd/tft/tft_string.h index e486c2ee91..5940a48ac9 100644 --- a/Marlin/src/lcd/tft/tft_string.h +++ b/Marlin/src/lcd/tft/tft_string.h @@ -21,6 +21,8 @@ */ #pragma once +// TODO: Make AVR-compatible with separate ROM / RAM string methods + #include extern const uint8_t ISO10646_1_5x7[]; @@ -67,14 +69,15 @@ class TFT_String { static glyph_t *glyphs[256]; static font_t *font_header; - static uint8_t data[MAX_STRING_LENGTH + 1]; + static char data[MAX_STRING_LENGTH + 1]; static uint16_t span; // in pixels - static uint8_t length; // in characters - static void add_character(uint8_t character); - static void eol() { data[length] = 0x00; } + static void add_character(const char character); + static void eol() { data[length] = '\0'; } public: + static uint8_t length; // in characters + static void set_font(const uint8_t *font); static void add_glyphs(const uint8_t *font); @@ -83,25 +86,69 @@ class TFT_String { static glyph_t *glyph(uint8_t character) { return glyphs[character] ?: glyphs[0x3F]; } /* Use '?' for unknown glyphs */ static glyph_t *glyph(uint8_t *character) { return glyph(*character); } + /** + * @brief Set the string empty + */ static void set(); - static void add(uint8_t character) { add_character(character); eol(); } - static void add(uint8_t *string, uint8_t max_len=MAX_STRING_LENGTH); - static void add(uint8_t *string, int8_t index, uint8_t *itemString=nullptr); - static void set(uint8_t *string) { set(); add(string); }; - static void set(uint8_t *string, int8_t index, const char *itemString=nullptr) { set(); add(string, index, (uint8_t *)itemString); }; - static void set(const char *string) { set((uint8_t *)string); } - static void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); } - static void add(const char *string) { add((uint8_t *)string); } - static void trim(uint8_t character=0x20); - static void rtrim(uint8_t character=0x20); - static void ltrim(uint8_t character=0x20); + /** + * @brief Append an ASCII character and EOL + * + * @param character The ASCII character + */ + static void add(const char character) { add_character(character); eol(); } + static void set(wchar_t character) { set(); add(character); } - static void truncate(uint8_t maxlen) { if (length > maxlen) { length = maxlen; eol(); } } + /** + * @brief Append / Set C-string + * + * @param cstr The string + * @param max_len Character limit + */ + static void add(const char *cstr, uint8_t max_len=MAX_STRING_LENGTH); + static void set(const char *cstr, uint8_t max_len=MAX_STRING_LENGTH) { set(); add(cstr, max_len); } + /** + * @brief Append / Set F-string + * + * @param fstr The string + * @param max_len Character limit + */ + static void add(FSTR_P const fstr, uint8_t max_len=MAX_STRING_LENGTH) { add(FTOP(fstr), max_len); } + static void set(FSTR_P const fstr, uint8_t max_len=MAX_STRING_LENGTH) { set(FTOP(fstr), max_len); } + + /** + * @brief Append / Set C-string with optional substitution + * + * @param tpl A string with optional substitution + * @param index An index + * @param cstr An SRAM C-string to use for $ substitution + * @param fstr A ROM F-string to use for $ substitution + */ + static void add(const char *tpl, const int8_t index, const char *cstr=nullptr, FSTR_P const fstr=nullptr); + static void set(const char *tpl, const int8_t index, const char *cstr=nullptr, FSTR_P const fstr=nullptr) { set(); add(tpl, index, cstr, fstr); } + + /** + * @brief Append / Set F-string with optional substitution + * + * @param ftpl A ROM F-string with optional substitution + * @param index An index + * @param cstr An SRAM C-string to use for $ substitution + * @param fstr A ROM F-string to use for $ substitution + */ + static void add(FSTR_P const ftpl, const int8_t index, const char *cstr=nullptr, FSTR_P const fstr=nullptr) { add(FTOP(ftpl), index, cstr, fstr); } + static void set(FSTR_P const ftpl, const int8_t index, const char *cstr=nullptr, FSTR_P const fstr=nullptr) { set(); add(ftpl, index, cstr, fstr); } + + // Common string ops + static void trim(const char character=' '); + static void rtrim(const char character=' '); + static void ltrim(const char character=' '); + static void truncate(const uint8_t maxlen) { if (length > maxlen) { length = maxlen; eol(); } } + + // Accessors + static char *string() { return data; } static uint16_t width() { return span; } - static uint8_t *string() { return data; } - static uint16_t center(uint16_t width) { return span > width ? 0 : (width - span) / 2; } + static uint16_t center(const uint16_t width) { return span > width ? 0 : (width - span) / 2; } }; extern TFT_String tft_string; diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index 57cd6e724e..a152907a9d 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -189,26 +189,26 @@ void Touch::touch(touch_control_t *control) { #if HAS_HOTEND if (heater >= 0) { // HotEnd #if HOTENDS == 1 - MenuItem_int3::action((const char *)GET_TEXT_F(MSG_NOZZLE), &thermalManager.temp_hotend[0].target, 0, thermalManager.hotend_max_target(0), []{ thermalManager.start_watching_hotend(0); }); + MenuItem_int3::action(GET_TEXT_F(MSG_NOZZLE), &thermalManager.temp_hotend[0].target, 0, thermalManager.hotend_max_target(0), []{ thermalManager.start_watching_hotend(0); }); #else MenuItemBase::itemIndex = heater; - MenuItem_int3::action((const char *)GET_TEXT_F(MSG_NOZZLE_N), &thermalManager.temp_hotend[heater].target, 0, thermalManager.hotend_max_target(heater), []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); }); + MenuItem_int3::action(GET_TEXT_F(MSG_NOZZLE_N), &thermalManager.temp_hotend[heater].target, 0, thermalManager.hotend_max_target(heater), []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); }); #endif } #endif #if HAS_HEATED_BED else if (heater == H_BED) { - MenuItem_int3::action((const char *)GET_TEXT_F(MSG_BED), &thermalManager.temp_bed.target, 0, BED_MAX_TARGET, thermalManager.start_watching_bed); + MenuItem_int3::action(GET_TEXT_F(MSG_BED), &thermalManager.temp_bed.target, 0, BED_MAX_TARGET, thermalManager.start_watching_bed); } #endif #if HAS_HEATED_CHAMBER else if (heater == H_CHAMBER) { - MenuItem_int3::action((const char *)GET_TEXT_F(MSG_CHAMBER), &thermalManager.temp_chamber.target, 0, CHAMBER_MAX_TARGET, thermalManager.start_watching_chamber); + MenuItem_int3::action(GET_TEXT_F(MSG_CHAMBER), &thermalManager.temp_chamber.target, 0, CHAMBER_MAX_TARGET, thermalManager.start_watching_chamber); } #endif #if HAS_COOLER else if (heater == H_COOLER) { - MenuItem_int3::action((const char *)GET_TEXT_F(MSG_COOLER), &thermalManager.temp_cooler.target, 0, COOLER_MAX_TARGET, thermalManager.start_watching_cooler); + MenuItem_int3::action(GET_TEXT_F(MSG_COOLER), &thermalManager.temp_cooler.target, 0, COOLER_MAX_TARGET, thermalManager.start_watching_cooler); } #endif @@ -218,19 +218,19 @@ void Touch::touch(touch_control_t *control) { static uint8_t fan, fan_speed; fan = 0; fan_speed = thermalManager.fan_speed[fan]; - MenuItem_percent::action((const char *)GET_TEXT_F(MSG_FIRST_FAN_SPEED), &fan_speed, 0, 255, []{ thermalManager.set_fan_speed(fan, fan_speed); }); + MenuItem_percent::action(GET_TEXT_F(MSG_FIRST_FAN_SPEED), &fan_speed, 0, 255, []{ thermalManager.set_fan_speed(fan, fan_speed); }); break; case FEEDRATE: ui.clear_lcd(); - MenuItem_int3::action((const char *)GET_TEXT_F(MSG_SPEED), &feedrate_percentage, 10, 999); + MenuItem_int3::action(GET_TEXT_F(MSG_SPEED), &feedrate_percentage, 10, 999); break; case FLOWRATE: ui.clear_lcd(); MenuItemBase::itemIndex = control->data; #if EXTRUDERS == 1 - MenuItem_int3::action((const char *)GET_TEXT_F(MSG_FLOW), &planner.flow_percentage[MenuItemBase::itemIndex], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); }); + MenuItem_int3::action(GET_TEXT_F(MSG_FLOW), &planner.flow_percentage[MenuItemBase::itemIndex], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); }); #else - MenuItem_int3::action((const char *)GET_TEXT_F(MSG_FLOW_N), &planner.flow_percentage[MenuItemBase::itemIndex], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); }); + MenuItem_int3::action(GET_TEXT_F(MSG_FLOW_N), &planner.flow_percentage[MenuItemBase::itemIndex], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); }); #endif break; diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index 3fbb26b69d..a1b6ee69e3 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -105,12 +105,12 @@ void MarlinUI::draw_kill_screen() { line++; menu_line(line++, COLOR_KILL_SCREEN_BG); - tft_string.set(GET_TEXT(MSG_HALTED)); + tft_string.set(GET_TEXT_F(MSG_HALTED)); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), 0, COLOR_MENU_TEXT, tft_string); menu_line(line++, COLOR_KILL_SCREEN_BG); - tft_string.set(GET_TEXT(MSG_PLEASE_RESET)); + tft_string.set(GET_TEXT_F(MSG_PLEASE_RESET)); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), 0, COLOR_MENU_TEXT, tft_string); @@ -181,13 +181,13 @@ void draw_heater_status(uint16_t x, uint16_t y, const int8_t Heater) { tft.add_image(8, 28, image, Color); - tft_string.set((uint8_t *)i16tostr3rj(currentTemperature)); + tft_string.set(i16tostr3rj(currentTemperature)); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); tft.add_text(tft_string.center(80) + 2, 82, Color, tft_string); if (targetTemperature >= 0) { - tft_string.set((uint8_t *)i16tostr3rj(targetTemperature)); + tft_string.set(i16tostr3rj(targetTemperature)); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); tft.add_text(tft_string.center(80) + 2, 8, Color, tft_string); @@ -211,7 +211,7 @@ void draw_fan_status(uint16_t x, uint16_t y, const bool blink) { tft.add_image(8, 20, image, COLOR_FAN); - tft_string.set((uint8_t *)ui8tostr4pctrj(thermalManager.fan_speed[0])); + tft_string.set(ui8tostr4pctrj(thermalManager.fan_speed[0])); tft_string.trim(); tft.add_text(tft_string.center(80) + 6, 82, COLOR_FAN, tft_string); } @@ -352,14 +352,14 @@ void MarlinUI::draw_status_screen() { } // 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*/) { +void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); TERN_(TOUCH_SCREEN, touch.clear()); uint16_t line = 1; menu_line(line++); - tft_string.set(pstr, itemIndex, itemString); + tft_string.set(fstr, itemIndex, itemStringC, itemStringF); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); @@ -421,7 +421,7 @@ void TFT::draw_edit_screen_buttons() { } // The Select Screen presents a prompt and two "buttons" -void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { +void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { uint16_t line = 1; if (!string) line++; @@ -473,7 +473,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const #endif menu_line(row); - tft_string.set(GET_TEXT(MSG_FILAMENT_CHANGE_NOZZLE)); + tft_string.set(GET_TEXT_F(MSG_FILAMENT_CHANGE_NOZZLE)); tft_string.add('E'); tft_string.add((char)('1' + extruder)); tft_string.add(' '); @@ -606,7 +606,7 @@ static void quick_feedback() { #define CUR_STEP_VALUE_WIDTH 104 static void drawCurStepValue() { - tft_string.set((uint8_t *)ftostr52sp(motionAxisState.currentStepSize)); + tft_string.set(ftostr52sp(motionAxisState.currentStepSize)); tft_string.add("mm"); tft.canvas(motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT); tft.set_background(COLOR_BACKGROUND); @@ -693,18 +693,18 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { drawAxisValue(axis); } else { - drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); + drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } #elif HAS_BED_PROBE // only change probe.offset.z probe.offset.z += diff; if (direction < 0 && current_position[axis] < Z_PROBE_OFFSET_RANGE_MIN) { current_position[axis] = Z_PROBE_OFFSET_RANGE_MIN; - drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); + drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } else if (direction > 0 && current_position[axis] > Z_PROBE_OFFSET_RANGE_MAX) { current_position[axis] = Z_PROBE_OFFSET_RANGE_MAX; - drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); + drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } else { drawMessage(""); // clear the error @@ -733,7 +733,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { #if IS_KINEMATIC UNUSED(limited); #else - PGM_P const msg = limited ? GET_TEXT(MSG_LCD_SOFT_ENDSTOPS) : NUL_STR; + FSTR_P const msg = limited ? GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS) : FPSTR(NUL_STR); drawMessage(msg); #endif @@ -766,7 +766,7 @@ static void z_minus() { moveAxis(Z_AXIS, -1); } static void do_home() { quick_feedback(); - drawMessage(GET_TEXT(MSG_LEVEL_BED_HOMING)); + drawMessage(GET_TEXT_F(MSG_LEVEL_BED_HOMING)); queue.inject_P(G28_STR); // Disable touch until home is done TERN_(TOUCH_SCREEN, touch.disable()); diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index b1a781fad1..15031d0da2 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -181,13 +181,13 @@ void draw_heater_status(uint16_t x, uint16_t y, const int8_t Heater) { tft.add_image(0, 18, image, Color); - tft_string.set((uint8_t *)i16tostr3rj(currentTemperature)); + tft_string.set(i16tostr3rj(currentTemperature)); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); tft.add_text(tft_string.center(64) + 2, 72, Color, tft_string); if (targetTemperature >= 0) { - tft_string.set((uint8_t *)i16tostr3rj(targetTemperature)); + tft_string.set(i16tostr3rj(targetTemperature)); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); tft.add_text(tft_string.center(64) + 2, 8, Color, tft_string); @@ -211,7 +211,7 @@ void draw_fan_status(uint16_t x, uint16_t y, const bool blink) { tft.add_image(0, 10, image, COLOR_FAN); - tft_string.set((uint8_t *)ui8tostr4pctrj(thermalManager.fan_speed[0])); + tft_string.set(ui8tostr4pctrj(thermalManager.fan_speed[0])); tft_string.trim(); tft.add_text(tft_string.center(64) + 6, 72, COLOR_FAN, tft_string); } @@ -347,14 +347,14 @@ void MarlinUI::draw_status_screen() { } // 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*/) { +void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); TERN_(TOUCH_SCREEN, touch.clear()); uint16_t line = 1; menu_line(line++); - tft_string.set(pstr, itemIndex, itemString); + tft_string.set(fstr, itemIndex, itemStringC, itemStringF); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); @@ -416,7 +416,7 @@ void TFT::draw_edit_screen_buttons() { } // The Select Screen presents a prompt and two "buttons" -void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { +void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { uint16_t line = 1; if (!string) line++; @@ -588,7 +588,7 @@ static void quick_feedback() { #define CUR_STEP_VALUE_WIDTH 38 static void drawCurStepValue() { - tft_string.set((uint8_t *)ftostr52sp(motionAxisState.currentStepSize)); + tft_string.set(ftostr52sp(motionAxisState.currentStepSize)); tft.canvas(motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, 20); tft.set_background(COLOR_BACKGROUND); tft.add_text(CUR_STEP_VALUE_WIDTH - tft_string.width(), 0, COLOR_AXIS_HOMED, tft_string); @@ -621,7 +621,7 @@ static void drawCurESelection() { tft.add_text(tft_string.width(), 0, E_BTN_COLOR, ui8tostr3rj(motionAxisState.e_selection)); } -static void drawMessage(const char *msg) { +static void drawMessage(PGM_P const msg) { tft.canvas(X_MARGIN, TFT_HEIGHT - Y_MARGIN - 29, (TFT_WIDTH / 2) - (BTN_WIDTH / 2) - X_MARGIN, 20); tft.set_background(COLOR_BACKGROUND); tft.add_text(0, 0, COLOR_YELLOW, msg); @@ -652,7 +652,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { #if ENABLED(PREVENT_COLD_EXTRUSION) if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { - drawMessage("Too cold"); + drawMessage(PSTR("Too cold")); return; } #endif @@ -675,7 +675,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { probe.offset.z = new_offs; else TERN(BABYSTEP_HOTEND_Z_OFFSET, hotend_offset[active_extruder].z = new_offs, NOOP); - drawMessage(""); // clear the error + drawMessage(NUL_STR); // clear the error drawAxisValue(axis); } else { @@ -693,7 +693,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); } else { - drawMessage(""); // clear the error + drawMessage(NUL_STR); // clear the error } drawAxisValue(axis); #endif diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 6f7327f1e8..5a964525ec 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -181,13 +181,13 @@ void draw_heater_status(uint16_t x, uint16_t y, const int8_t Heater) { tft.add_image(8, 28, image, Color); - tft_string.set((uint8_t *)i16tostr3rj(currentTemperature)); + tft_string.set(i16tostr3rj(currentTemperature)); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); tft.add_text(tft_string.center(80) + 2, 82, Color, tft_string); if (targetTemperature >= 0) { - tft_string.set((uint8_t *)i16tostr3rj(targetTemperature)); + tft_string.set(i16tostr3rj(targetTemperature)); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); tft.add_text(tft_string.center(80) + 2, 8, Color, tft_string); @@ -211,7 +211,7 @@ void draw_fan_status(uint16_t x, uint16_t y, const bool blink) { tft.add_image(8, 20, image, COLOR_FAN); - tft_string.set((uint8_t *)ui8tostr4pctrj(thermalManager.fan_speed[0])); + tft_string.set(ui8tostr4pctrj(thermalManager.fan_speed[0])); tft_string.trim(); tft.add_text(tft_string.center(80) + 6, 82, COLOR_FAN, tft_string); } @@ -352,14 +352,14 @@ void MarlinUI::draw_status_screen() { } // 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*/) { +void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); TERN_(TOUCH_SCREEN, touch.clear()); uint16_t line = 1; menu_line(line++); - tft_string.set(pstr, itemIndex, itemString); + tft_string.set(fstr, itemIndex, itemStringC, itemStringF); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); @@ -421,7 +421,7 @@ void TFT::draw_edit_screen_buttons() { } // The Select Screen presents a prompt and two "buttons" -void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { +void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { uint16_t line = 1; if (!string) line++; @@ -593,7 +593,7 @@ static void quick_feedback() { #define CUR_STEP_VALUE_WIDTH 104 static void drawCurStepValue() { - tft_string.set((uint8_t *)ftostr52sp(motionAxisState.currentStepSize)); + tft_string.set(ftostr52sp(motionAxisState.currentStepSize)); tft_string.add("mm"); tft.canvas(motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT); tft.set_background(COLOR_BACKGROUND); @@ -622,7 +622,7 @@ static void drawCurESelection() { tft.add_text(tft_string.width(), 0, E_BTN_COLOR, ui8tostr3rj(motionAxisState.e_selection)); } -static void drawMessage(const char *msg) { +static void drawMessage(PGM_P const msg) { tft.canvas(X_MARGIN, TFT_HEIGHT - Y_MARGIN - 34, TFT_HEIGHT / 2, 34); tft.set_background(COLOR_BACKGROUND); tft.add_text(0, 0, COLOR_YELLOW, msg); @@ -653,7 +653,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { #if ENABLED(PREVENT_COLD_EXTRUSION) if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { - drawMessage("Too cold"); + drawMessage(PSTR("Too cold")); return; } #endif @@ -676,7 +676,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { probe.offset.z = new_offs; else TERN(BABYSTEP_HOTEND_Z_OFFSET, hotend_offset[active_extruder].z = new_offs, NOOP); - drawMessage(""); // clear the error + drawMessage(NUL_STR); // clear the error drawAxisValue(axis); } else { @@ -694,7 +694,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); } else { - drawMessage(""); // clear the error + drawMessage(NUL_STR); // clear the error } drawAxisValue(axis); #endif diff --git a/Marlin/src/lcd/tft/ui_common.cpp b/Marlin/src/lcd/tft/ui_common.cpp index acc91f51fa..c9e069dbbd 100644 --- a/Marlin/src/lcd/tft/ui_common.cpp +++ b/Marlin/src/lcd/tft/ui_common.cpp @@ -96,16 +96,15 @@ void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row) { lcd_gotopixel(int(col) * (TFT_COL_WIDTH), int(row) * MENU_LINE_HEIGHT); } -int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { +int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length) { if (max_length < 1) return 0; - tft_string.set(); - tft_string.add(c); + tft_string.set(c); tft.add_text(MENU_TEXT_X_OFFSET, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); lcd_gotopixel((cursor.x + 1) * (TFT_COL_WIDTH) + tft_string.width(), cursor.y * MENU_LINE_HEIGHT); return tft_string.width(); } -int lcd_put_u8str_max_P(PGM_P utf8_pstr, pixel_len_t max_length) { +int lcd_put_u8str_max_P(PGM_P utf8_pstr, const pixel_len_t max_length) { if (max_length < 1) return 0; tft_string.set(utf8_pstr); tft_string.trim(); @@ -115,7 +114,7 @@ int lcd_put_u8str_max_P(PGM_P utf8_pstr, pixel_len_t max_length) { return tft_string.width(); } -int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) { +int lcd_put_u8str_max(const char * utf8_str, const pixel_len_t max_length) { return lcd_put_u8str_max_P(utf8_str, max_length); } @@ -130,10 +129,10 @@ void lcd_put_int(const int i) { // // 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) { +void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char) { menu_item(row, sel); - uint8_t *string = (uint8_t *)pstr; + const char *string = FTOP(fstr); MarlinImage image = noImage; switch (*string) { case 0x01: image = imgRefresh; break; // LCD_STR_REFRESH @@ -147,33 +146,34 @@ void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, co tft.add_image(MENU_ITEM_ICON_X, MENU_ITEM_ICON_Y, image, COLOR_MENU_TEXT, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND); } - tft_string.set(string, itemIndex, itemString); + tft_string.set(string, itemIndex, itemStringC, itemStringF); + tft.add_text(offset, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); } // 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) { +void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm) { menu_item(row, sel); - tft_string.set(pstr, itemIndex, itemString); + tft_string.set(fstr, itemIndex, itemStringC, itemStringF); tft.add_text(MENU_TEXT_X_OFFSET, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); - if (data) { - tft_string.set(data); + if (inStr) { + tft_string.set(inStr); tft.add_text(TFT_WIDTH - MENU_TEXT_X_OFFSET - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string); } } // Draw a static item with no left-right margin required. Centered by default. -void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { +void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { menu_item(row); - tft_string.set(pstr, itemIndex, itemString); + tft_string.set(fstr, itemIndex, itemStringC, itemStringF); if (vstr) tft_string.add(vstr); tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_YELLOW, tft_string); } #if ENABLED(SDSUPPORT) - void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) { + void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { menu_item(row, sel); if (isDir) tft.add_image(MENU_ITEM_ICON_X, MENU_ITEM_ICON_Y, imgDirectory, COLOR_MENU_TEXT, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND); constexpr uint8_t maxlen = (MENU_ITEM_HEIGHT) - (MENU_TEXT_Y_OFFSET) + 1; diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp index f7641ad723..1d69434067 100644 --- a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp +++ b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp @@ -38,7 +38,7 @@ L64XX_Marlin L64xxManager; #include "../../HAL/shared/Delay.h" static const char NUM_AXIS_LIST( - str_X[] PROGMEM = "X ", str_Y[] PROGMEM = "Y ", str_Z[] PROGMEM = "Z ", + str_X[] PROGMEM = "X ", str_Y[] PROGMEM = "Y ", str_Z[] PROGMEM = "Z ", str_I[] PROGMEM = STR_I " ", str_J[] PROGMEM = STR_J " ", str_K[] PROGMEM = STR_K " " ), str_X2[] PROGMEM = "X2", str_Y2[] PROGMEM = "Y2", diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.h b/Marlin/src/libs/L64XX/L64XX_Marlin.h index b71d97a0d6..e8d8498ac7 100644 --- a/Marlin/src/libs/L64XX/L64XX_Marlin.h +++ b/Marlin/src/libs/L64XX/L64XX_Marlin.h @@ -36,7 +36,7 @@ #define HAS_L64XX_EXTRUDER (AXIS_IS_L64XX(E0) || AXIS_IS_L64XX(E1) || AXIS_IS_L64XX(E2) || AXIS_IS_L64XX(E3) || AXIS_IS_L64XX(E4) || AXIS_IS_L64XX(E5) || AXIS_IS_L64XX(E6) || AXIS_IS_L64XX(E7)) #define _EN_ITEM(N) , E##N -enum L64XX_axis_t : uint8_t { NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM), MAX_L64XX }; +enum L64XX_axis_t : uint8_t { MAIN_AXIS_NAMES, X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM), MAX_L64XX }; #undef _EN_ITEM class L64XX_Marlin : public L64XXHelper { diff --git a/Marlin/src/module/delta.cpp b/Marlin/src/module/delta.cpp index 39eb15f896..8207dacaf7 100644 --- a/Marlin/src/module/delta.cpp +++ b/Marlin/src/module/delta.cpp @@ -60,6 +60,10 @@ 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; +#if HAS_DELTA_SENSORLESS_PROBING + abc_float_t offset_sensorless_adj{0}; + float largest_sensorless_adj = 0; +#endif float delta_safe_distance_from_top(); @@ -236,6 +240,9 @@ void home_delta() { TERN_(U_SENSORLESS, sensorless_t stealth_states_u = start_sensorless_homing_per_axis(U_AXIS)); TERN_(V_SENSORLESS, sensorless_t stealth_states_v = start_sensorless_homing_per_axis(V_AXIS)); TERN_(W_SENSORLESS, sensorless_t stealth_states_w = start_sensorless_homing_per_axis(W_AXIS)); + #if SENSORLESS_STALLGUARD_DELAY + safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle + #endif #endif // Move all carriages together linearly until an endstop is hit. @@ -255,6 +262,9 @@ void home_delta() { TERN_(U_SENSORLESS, end_sensorless_homing_per_axis(U_AXIS, stealth_states_u)); TERN_(V_SENSORLESS, end_sensorless_homing_per_axis(V_AXIS, stealth_states_v)); TERN_(W_SENSORLESS, end_sensorless_homing_per_axis(W_AXIS, stealth_states_w)); + #if SENSORLESS_STALLGUARD_DELAY + safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle + #endif #endif endstops.validate_homing_move(); diff --git a/Marlin/src/module/delta.h b/Marlin/src/module/delta.h index 7cd42805c9..f7067ef9c7 100644 --- a/Marlin/src/module/delta.h +++ b/Marlin/src/module/delta.h @@ -38,6 +38,10 @@ 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; +#if HAS_DELTA_SENSORLESS_PROBING + extern abc_float_t offset_sensorless_adj; + extern float largest_sensorless_adj; +#endif /** * Recalculate factors used for delta kinematics whenever @@ -45,6 +49,13 @@ extern abc_float_t delta_diagonal_rod_trim; */ void recalc_delta_settings(); +/** + * Get a safe radius for calibration + */ +#if HAS_DELTA_SENSORLESS_PROBING + static constexpr float sensorless_radius_factor = 0.7f; +#endif + /** * Delta Inverse Kinematics * diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index bebe09c99c..1ee4b92b5f 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -31,6 +31,9 @@ #include "temperature.h" #include "../lcd/marlinui.h" +#define DEBUG_OUT BOTH(USE_SENSORLESS, DEBUG_LEVELING_FEATURE) +#include "../core/debug_out.h" + #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) #include HAL_PATH(../HAL, endstop_interrupts.h) #endif @@ -1621,3 +1624,66 @@ void Endstops::update() { } #endif // PINS_DEBUGGING + +#if USE_SENSORLESS + /** + * Change TMC driver currents to N##_CURRENT_HOME, saving the current configuration of each. + */ + void Endstops::set_homing_current(const bool onoff) { + #define HAS_CURRENT_HOME(N) (defined(N##_CURRENT_HOME) && N##_CURRENT_HOME != N##_CURRENT) + #define HAS_DELTA_X_CURRENT (ENABLED(DELTA) && HAS_CURRENT_HOME(X)) + #define HAS_DELTA_Y_CURRENT (ENABLED(DELTA) && HAS_CURRENT_HOME(Y)) + #if HAS_DELTA_X_CURRENT || HAS_DELTA_Y_CURRENT || HAS_CURRENT_HOME(Z) + #if HAS_DELTA_X_CURRENT + static int16_t saved_current_x; + #endif + #if HAS_DELTA_Y_CURRENT + static int16_t saved_current_y; + #endif + #if HAS_CURRENT_HOME(Z) + static int16_t saved_current_z; + #endif + auto debug_current_on = [](PGM_P const s, const int16_t a, const int16_t b) { + if (DEBUGGING(LEVELING)) { DEBUG_ECHOPGM_P(s); DEBUG_ECHOLNPGM(" current: ", a, " -> ", b); } + }; + if (onoff) { + #if HAS_DELTA_X_CURRENT + saved_current_x = stepperX.getMilliamps(); + stepperX.rms_current(X_CURRENT_HOME); + debug_current_on(PSTR("X"), saved_current_x, X_CURRENT_HOME); + #endif + #if HAS_DELTA_Y_CURRENT + saved_current_y = stepperY.getMilliamps(); + stepperY.rms_current(Y_CURRENT_HOME); + debug_current_on(PSTR("Y"), saved_current_y, Y_CURRENT_HOME); + #endif + #if HAS_CURRENT_HOME(Z) + saved_current_z = stepperZ.getMilliamps(); + stepperZ.rms_current(Z_CURRENT_HOME); + debug_current_on(PSTR("Z"), saved_current_z, Z_CURRENT_HOME); + #endif + } + else { + #if HAS_DELTA_X_CURRENT + stepperX.rms_current(saved_current_x); + debug_current_on(PSTR("X"), X_CURRENT_HOME, saved_current_x); + #endif + #if HAS_DELTA_Y_CURRENT + stepperY.rms_current(saved_current_y); + debug_current_on(PSTR("Y"), Y_CURRENT_HOME, saved_current_y); + #endif + #if HAS_CURRENT_HOME(Z) + stepperZ.rms_current(saved_current_z); + debug_current_on(PSTR("Z"), Z_CURRENT_HOME, saved_current_z); + #endif + } + + TERN_(IMPROVE_HOMING_RELIABILITY, planner.enable_stall_prevention(onoff)); + + #if SENSORLESS_STALLGUARD_DELAY + safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle + #endif + + #endif // XYZ + } +#endif diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h index 101a001088..9e411adbda 100644 --- a/Marlin/src/module/endstops.h +++ b/Marlin/src/module/endstops.h @@ -247,6 +247,11 @@ class Endstops { static void clear_endstop_state(); static bool tmc_spi_homing_check(); #endif + public: + // Basic functions for Sensorless Homing + #if USE_SENSORLESS + static void set_homing_current(const bool onoff); + #endif }; extern Endstops endstops; diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index f5e035b74c..c294c5ef7f 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -738,10 +738,12 @@ void restore_feedrate_and_scaling() { #if HAS_SOFTWARE_ENDSTOPS // Software Endstops are based on the configured limits. + #define _AMIN(A) A##_MIN_POS + #define _AMAX(A) A##_MAX_POS soft_endstops_t soft_endstop = { true, false, - NUM_AXIS_ARRAY(X_MIN_POS, Y_MIN_POS, Z_MIN_POS, I_MIN_POS, J_MIN_POS, K_MIN_POS, U_MIN_POS, V_MIN_POS, W_MIN_POS), - NUM_AXIS_ARRAY(X_MAX_BED, Y_MAX_BED, Z_MAX_POS, I_MAX_POS, J_MAX_POS, K_MAX_POS, U_MAX_POS, V_MAX_POS, W_MAX_POS) + { MAPLIST(_AMIN, MAIN_AXIS_NAMES) }, + { MAPLIST(_AMAX, MAIN_AXIS_NAMES) }, }; /** @@ -958,8 +960,6 @@ void restore_feedrate_and_scaling() { #endif // !HAS_SOFTWARE_ENDSTOPS -#if !UBL_SEGMENTED - FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { const millis_t ms = millis(); if (ELAPSED(ms, next_idle_ms)) { @@ -1076,7 +1076,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { #else // !IS_KINEMATIC - #if ENABLED(SEGMENT_LEVELED_MOVES) + #if ENABLED(SEGMENT_LEVELED_MOVES) && DISABLED(AUTO_BED_LEVELING_UBL) /** * Prepare a segmented move on a CARTESIAN setup. @@ -1136,7 +1136,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { planner.buffer_line(destination, fr_mm_s, active_extruder, cartesian_segment_mm OPTARG(SCARA_FEEDRATE_SCALING, inv_duration)); } - #endif // SEGMENT_LEVELED_MOVES + #endif // SEGMENT_LEVELED_MOVES && !AUTO_BED_LEVELING_UBL /** * Prepare a linear move in a Cartesian setup. @@ -1151,8 +1151,12 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { #if HAS_MESH if (planner.leveling_active && planner.leveling_active_at_z(destination.z)) { #if ENABLED(AUTO_BED_LEVELING_UBL) - bedlevel.line_to_destination_cartesian(scaled_fr_mm_s, active_extruder); // UBL's motion routine needs to know about - return true; // all moves, including Z-only moves. + #if UBL_SEGMENTED + return bedlevel.line_to_destination_segmented(scaled_fr_mm_s); + #else + bedlevel.line_to_destination_cartesian(scaled_fr_mm_s, active_extruder); // UBL's motion routine needs to know about + return true; // all moves, including Z-only moves. + #endif #elif ENABLED(SEGMENT_LEVELED_MOVES) segmented_line_to_destination(scaled_fr_mm_s); return false; // caller will update current_position @@ -1178,7 +1182,6 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { } #endif // !IS_KINEMATIC -#endif // !UBL_SEGMENTED #if HAS_DUPLICATION_MODE bool extruder_duplication_enabled; @@ -1379,10 +1382,10 @@ void prepare_line_to_destination() { #if HAS_ENDSTOPS - linear_axis_bits_t axis_homed, axis_trusted; // = 0 + main_axes_bits_t axes_homed, axes_trusted; // = 0 - linear_axis_bits_t axes_should_home(linear_axis_bits_t axis_bits/*=linear_bits*/) { - auto set_should = [](linear_axis_bits_t &b, AxisEnum a) { + main_axes_bits_t axes_should_home(main_axes_bits_t axis_bits/*=main_axes_mask*/) { + auto set_should = [](main_axes_bits_t &b, AxisEnum a) { if (TEST(b, a) && TERN(HOME_AFTER_DEACTIVATE, axis_is_trusted, axis_was_homed)(a)) CBI(b, a); }; @@ -1395,23 +1398,12 @@ void prepare_line_to_destination() { return axis_bits; } - bool homing_needed_error(linear_axis_bits_t axis_bits/*=linear_bits*/) { + bool homing_needed_error(main_axes_bits_t axis_bits/*=main_axes_mask*/) { if ((axis_bits = axes_should_home(axis_bits))) { PGM_P home_first = GET_TEXT(MSG_HOME_FIRST); char msg[30]; - sprintf_P(msg, home_first, - NUM_AXIS_LIST( - TEST(axis_bits, X_AXIS) ? STR_A : "", - TEST(axis_bits, Y_AXIS) ? STR_B : "", - TEST(axis_bits, Z_AXIS) ? STR_C : "", - TEST(axis_bits, I_AXIS) ? STR_I : "", - TEST(axis_bits, J_AXIS) ? STR_J : "", - TEST(axis_bits, K_AXIS) ? STR_K : "", - TEST(axis_bits, U_AXIS) ? STR_U : "", - TEST(axis_bits, V_AXIS) ? STR_V : "", - TEST(axis_bits, W_AXIS) ? STR_W : "" - ) - ); + #define _AXIS_CHAR(N) TEST(axis_bits, _AXIS(N)) ? STR_##N : "" + sprintf_P(msg, home_first, MAPLIST(_AXIS_CHAR, MAIN_AXIS_NAMES)); SERIAL_ECHO_START(); SERIAL_ECHOLN(msg); ui.set_status(msg); @@ -1671,7 +1663,12 @@ void prepare_line_to_destination() { } // Disable stealthChop if used. Enable diag1 pin on driver. - TERN_(SENSORLESS_HOMING, stealth_states = start_sensorless_homing_per_axis(axis)); + #if ENABLED(SENSORLESS_HOMING) + stealth_states = start_sensorless_homing_per_axis(axis); + #if SENSORLESS_STALLGUARD_DELAY + safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle + #endif + #endif } #if EITHER(MORGAN_SCARA, MP_SCARA) @@ -1707,7 +1704,12 @@ void prepare_line_to_destination() { endstops.validate_homing_move(); // Re-enable stealthChop if used. Disable diag1 pin on driver. - TERN_(SENSORLESS_HOMING, end_sensorless_homing_per_axis(axis, stealth_states)); + #if ENABLED(SENSORLESS_HOMING) + end_sensorless_homing_per_axis(axis, stealth_states); + #if SENSORLESS_STALLGUARD_DELAY + safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle + #endif + #endif } } @@ -1877,17 +1879,8 @@ void prepare_line_to_destination() { || TERN0(A##_HOME_TO_MIN, A##_MIN_PIN > -1) \ || TERN0(A##_HOME_TO_MAX, A##_MAX_PIN > -1) \ )) - if (NUM_AXIS_GANG( - !_CAN_HOME(X), - && !_CAN_HOME(Y), - && !_CAN_HOME(Z), - && !_CAN_HOME(I), - && !_CAN_HOME(J), - && !_CAN_HOME(K), - && !_CAN_HOME(U), - && !_CAN_HOME(V), - && !_CAN_HOME(W)) - ) return; + #define _ANDCANT(N) && !_CAN_HOME(N) + if (true MAIN_AXIS_MAP(_ANDCANT)) return; #endif if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM(">>> homeaxis(", AS_CHAR(AXIS_CHAR(axis)), ")"); diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index 45dae5d609..ec47818877 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -407,38 +407,41 @@ void restore_feedrate_and_scaling(); /** * Homing and Trusted Axes */ -typedef IF<(NUM_AXES > 8), uint16_t, uint8_t>::type linear_axis_bits_t; -constexpr linear_axis_bits_t linear_bits = _BV(NUM_AXES) - 1; +typedef IF<(NUM_AXES > 8), uint16_t, uint8_t>::type main_axes_bits_t; +constexpr main_axes_bits_t main_axes_mask = _BV(NUM_AXES) - 1; + +typedef IF<(NUM_AXES + EXTRUDERS > 8), uint16_t, uint8_t>::type e_axis_bits_t; +constexpr e_axis_bits_t e_axis_mask = (_BV(EXTRUDERS) - 1) << NUM_AXES; void set_axis_is_at_home(const AxisEnum axis); #if HAS_ENDSTOPS /** - * axis_homed + * axes_homed * Flags that each linear axis was homed. * XYZ on cartesian, ABC on delta, ABZ on SCARA. * - * axis_trusted + * axes_trusted * Flags that the position is trusted in each linear axis. Set when homed. * Cleared whenever a stepper powers off, potentially losing its position. */ - extern linear_axis_bits_t axis_homed, axis_trusted; + extern main_axes_bits_t axes_homed, axes_trusted; void homeaxis(const AxisEnum axis); void set_axis_never_homed(const AxisEnum axis); - linear_axis_bits_t axes_should_home(linear_axis_bits_t axis_bits=linear_bits); - bool homing_needed_error(linear_axis_bits_t axis_bits=linear_bits); - inline void set_axis_unhomed(const AxisEnum axis) { CBI(axis_homed, axis); } - inline void set_axis_untrusted(const AxisEnum axis) { CBI(axis_trusted, axis); } - inline void set_all_unhomed() { axis_homed = axis_trusted = 0; } - inline void set_axis_homed(const AxisEnum axis) { SBI(axis_homed, axis); } - inline void set_axis_trusted(const AxisEnum axis) { SBI(axis_trusted, axis); } - inline void set_all_homed() { axis_homed = axis_trusted = linear_bits; } + main_axes_bits_t axes_should_home(main_axes_bits_t axes_mask=main_axes_mask); + bool homing_needed_error(main_axes_bits_t axes_mask=main_axes_mask); + inline void set_axis_unhomed(const AxisEnum axis) { CBI(axes_homed, axis); } + inline void set_axis_untrusted(const AxisEnum axis) { CBI(axes_trusted, axis); } + inline void set_all_unhomed() { axes_homed = axes_trusted = 0; } + inline void set_axis_homed(const AxisEnum axis) { SBI(axes_homed, axis); } + inline void set_axis_trusted(const AxisEnum axis) { SBI(axes_trusted, axis); } + inline void set_all_homed() { axes_homed = axes_trusted = main_axes_mask; } #else - constexpr linear_axis_bits_t axis_homed = linear_bits, axis_trusted = linear_bits; // Zero-endstop machines are always homed and trusted + constexpr main_axes_bits_t axes_homed = main_axes_mask, axes_trusted = main_axes_mask; // Zero-endstop machines are always homed and trusted inline void homeaxis(const AxisEnum axis) {} inline void set_axis_never_homed(const AxisEnum) {} - inline linear_axis_bits_t axes_should_home(linear_axis_bits_t=linear_bits) { return 0; } - inline bool homing_needed_error(linear_axis_bits_t=linear_bits) { return false; } + inline main_axes_bits_t axes_should_home(main_axes_bits_t=main_axes_mask) { return 0; } + inline bool homing_needed_error(main_axes_bits_t=main_axes_mask) { return false; } inline void set_axis_unhomed(const AxisEnum axis) {} inline void set_axis_untrusted(const AxisEnum axis) {} inline void set_all_unhomed() {} @@ -447,13 +450,13 @@ void set_axis_is_at_home(const AxisEnum axis); inline void set_all_homed() {} #endif -inline bool axis_was_homed(const AxisEnum axis) { return TEST(axis_homed, axis); } -inline bool axis_is_trusted(const AxisEnum axis) { return TEST(axis_trusted, axis); } +inline bool axis_was_homed(const AxisEnum axis) { return TEST(axes_homed, axis); } +inline bool axis_is_trusted(const AxisEnum axis) { return TEST(axes_trusted, axis); } inline bool axis_should_home(const AxisEnum axis) { return (axes_should_home() & _BV(axis)) != 0; } -inline bool no_axes_homed() { return !axis_homed; } -inline bool all_axes_homed() { return linear_bits == (axis_homed & linear_bits); } +inline bool no_axes_homed() { return !axes_homed; } +inline bool all_axes_homed() { return main_axes_mask == (axes_homed & main_axes_mask); } inline bool homing_needed() { return !all_axes_homed(); } -inline bool all_axes_trusted() { return linear_bits == (axis_trusted & linear_bits); } +inline bool all_axes_trusted() { return main_axes_mask == (axes_trusted & main_axes_mask); } void home_if_needed(const bool keeplev=false); diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index e11a760902..6aa363890e 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1663,10 +1663,7 @@ void Planner::quick_stop() { // forced to empty, there's no risk the ISR will touch this. delay_before_delivering = BLOCK_DELAY_FOR_1ST_MOVE; - #if HAS_WIRED_LCD - // Clear the accumulated runtime - clear_block_buffer_runtime(); - #endif + TERN_(HAS_WIRED_LCD, clear_block_buffer_runtime()); // Clear the accumulated runtime // Make sure to drop any attempt of queuing moves for 1 second cleaning_buffer_counter = TEMP_TIMER_FREQUENCY; diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index dbc8592179..bef381b5c7 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -163,7 +163,7 @@ enum BlockFlag : char { * A single entry in the planner buffer. * Tracks linear movement over multiple axes. * - * The "nominal" values are as-specified by gcode, and + * The "nominal" values are as-specified by G-code, and * may never actually be reached due to acceleration limits. */ typedef struct block_t { @@ -412,7 +412,7 @@ class Planner { /** * The current position of the tool in absolute steps - * Recalculated if any axis_steps_per_mm are changed by gcode + * Recalculated if any axis_steps_per_mm are changed by G-code */ static xyze_long_t position; diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index ea19128f34..8dfdd1ecd9 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -103,7 +103,7 @@ xyz_pos_t Probe::offset; // Initialized by settings.load() #endif #if ENABLED(SENSORLESS_PROBING) - Probe::sense_bool_t Probe::test_sensitivity; + Probe::sense_bool_t Probe::test_sensitivity = { true, true, true }; #endif #if ENABLED(Z_PROBE_SLED) @@ -277,14 +277,14 @@ xyz_pos_t Probe::offset; // Initialized by settings.load() #if ENABLED(PROBING_STEPPERS_OFF) && DISABLED(DELTA) static uint8_t old_trusted; if (dopause) { - old_trusted = axis_trusted; + old_trusted = axes_trusted; stepper.disable_axis(X_AXIS); stepper.disable_axis(Y_AXIS); } else { if (TEST(old_trusted, X_AXIS)) stepper.enable_axis(X_AXIS); if (TEST(old_trusted, Y_AXIS)) stepper.enable_axis(Y_AXIS); - axis_trusted = old_trusted; + axes_trusted = old_trusted; } #endif if (dopause) safe_delay(_MAX(DELAY_BEFORE_PROBING, 25)); @@ -534,12 +534,12 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) { #if ENABLED(SENSORLESS_PROBING) sensorless_t stealth_states { false }; #if HAS_DELTA_SENSORLESS_PROBING - if (test_sensitivity.x) stealth_states.x = tmc_enable_stallguard(stepperX); // Delta watches all DIAG pins for a stall + if (test_sensitivity.x) stealth_states.x = tmc_enable_stallguard(stepperX); // Delta watches all DIAG pins for a stall if (test_sensitivity.y) stealth_states.y = tmc_enable_stallguard(stepperY); #endif - if (test_sensitivity.z) stealth_states.z = tmc_enable_stallguard(stepperZ); // All machines will check Z-DIAG for stall + if (test_sensitivity.z) stealth_states.z = tmc_enable_stallguard(stepperZ); // All machines will check Z-DIAG for stall + endstops.set_homing_current(true); // The "homing" current also applies to probing endstops.enable(true); - set_homing_current(true); // The "homing" current also applies to probing #endif TERN_(HAS_QUIET_PROBING, set_probing_paused(true)); @@ -556,6 +556,11 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) { #endif ; + // Offset sensorless probing + #if HAS_DELTA_SENSORLESS_PROBING + if (probe_triggered) probe.refresh_largest_sensorless_adj(); + #endif + TERN_(HAS_QUIET_PROBING, set_probing_paused(false)); // Re-enable stealthChop if used. Disable diag1 pin on driver. @@ -566,7 +571,7 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) { if (test_sensitivity.y) tmc_disable_stallguard(stepperY, stealth_states.y); #endif if (test_sensitivity.z) tmc_disable_stallguard(stepperZ, stealth_states.z); - set_homing_current(false); + endstops.set_homing_current(false); #endif #if ENABLED(BLTOUCH) @@ -669,8 +674,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { if (try_to_probe(PSTR("FAST"), z_probe_low_point, z_probe_fast_mm_s, sanity_check, Z_CLEARANCE_BETWEEN_PROBES) ) return NAN; - const float first_probe_z = current_position.z; - + const float first_probe_z = DIFF_TERN(HAS_DELTA_SENSORLESS_PROBING, current_position.z, largest_sensorless_adj); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("1st Probe Z:", first_probe_z); // Raise to give the probe clearance @@ -712,7 +716,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { TERN_(MEASURE_BACKLASH_WHEN_PROBING, backlash.measure_with_probe()); - const float z = current_position.z; + const float z = DIFF_TERN(HAS_DELTA_SENSORLESS_PROBING, current_position.z, largest_sensorless_adj); #if EXTRA_PROBING > 0 // Insert Z measurement into probes[]. Keep it sorted ascending. @@ -763,7 +767,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { #elif TOTAL_PROBING == 2 - const float z2 = current_position.z; + const float z2 = DIFF_TERN(HAS_DELTA_SENSORLESS_PROBING, current_position.z, largest_sensorless_adj); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("2nd Probe Z:", z2, " Discrepancy:", first_probe_z - z2); @@ -846,7 +850,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai SERIAL_ERROR_MSG(STR_ERR_PROBING_FAILED); #endif } - + DEBUG_ECHOLNPGM("measured_z: ", measured_z); return measured_z; } @@ -899,58 +903,39 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai } /** - * Change the current in the TMC drivers to N##_CURRENT_HOME. And we save the current configuration of each TMC driver. + * Set the sensorless Z offset */ - void Probe::set_homing_current(const bool onoff) { - #define HAS_CURRENT_HOME(N) (defined(N##_CURRENT_HOME) && N##_CURRENT_HOME != N##_CURRENT) - #if HAS_CURRENT_HOME(X) || HAS_CURRENT_HOME(Y) || HAS_CURRENT_HOME(Z) || HAS_CURRENT_HOME(I) || HAS_CURRENT_HOME(J) || HAS_CURRENT_HOME(K) || HAS_CURRENT_HOME(U) || HAS_CURRENT_HOME(V) || HAS_CURRENT_HOME(W) - #if ENABLED(DELTA) - static int16_t saved_current_X, saved_current_Y; + void Probe::set_offset_sensorless_adj(const_float_t sz) { + #if ENABLED(SENSORLESS_PROBING) + DEBUG_SECTION(pso, "Probe::set_offset_sensorless_adj", true); + #if HAS_DELTA_SENSORLESS_PROBING + if (test_sensitivity.x) offset_sensorless_adj.a = sz; + if (test_sensitivity.y) offset_sensorless_adj.b = sz; #endif - #if HAS_CURRENT_HOME(Z) - static int16_t saved_current_Z; + if (test_sensitivity.z) offset_sensorless_adj.c = sz; + #endif + } + + /** + * Refresh largest_sensorless_adj based on triggered endstops + */ + void Probe::refresh_largest_sensorless_adj() { + #if ENABLED(SENSORLESS_PROBING) + DEBUG_SECTION(rso, "Probe::refresh_largest_sensorless_adj", true); + largest_sensorless_adj = -3; // A reference away from any real probe height + #if HAS_DELTA_SENSORLESS_PROBING + if (TEST(endstops.state(), X_MAX)) { + NOLESS(largest_sensorless_adj, offset_sensorless_adj.a); + DEBUG_ECHOLNPGM("Endstop_X: ", largest_sensorless_adj, " TowerX"); + } + if (TEST(endstops.state(), Y_MAX)) { + NOLESS(largest_sensorless_adj, offset_sensorless_adj.b); + DEBUG_ECHOLNPGM("Endstop_Y: ", largest_sensorless_adj, " TowerY"); + } #endif - #if ((ENABLED(DELTA) && (HAS_CURRENT_HOME(X) || HAS_CURRENT_HOME(Y))) || HAS_CURRENT_HOME(Z)) - auto debug_current_on = [](PGM_P const s, const int16_t a, const int16_t b) { - if (DEBUGGING(LEVELING)) { DEBUG_ECHOPGM_P(s); DEBUG_ECHOLNPGM(" current: ", a, " -> ", b); } - }; - #endif - if (onoff) { - #if ENABLED(DELTA) - #if HAS_CURRENT_HOME(X) - saved_current_X = stepperX.getMilliamps(); - stepperX.rms_current(X_CURRENT_HOME); - debug_current_on(PSTR("X"), saved_current_X, X_CURRENT_HOME); - #endif - #if HAS_CURRENT_HOME(Y) - saved_current_Y = stepperY.getMilliamps(); - stepperY.rms_current(Y_CURRENT_HOME); - debug_current_on(PSTR("Y"), saved_current_Y, Y_CURRENT_HOME); - #endif - #endif - #if HAS_CURRENT_HOME(Z) - saved_current_Z = stepperZ.getMilliamps(); - stepperZ.rms_current(Z_CURRENT_HOME); - debug_current_on(PSTR("Z"), saved_current_Z, Z_CURRENT_HOME); - #endif - TERN_(IMPROVE_HOMING_RELIABILITY, planner.enable_stall_prevention(true)); - } - else { - #if ENABLED(DELTA) - #if HAS_CURRENT_HOME(X) - stepperX.rms_current(saved_current_X); - debug_current_on(PSTR("X"), X_CURRENT_HOME, saved_current_X); - #endif - #if HAS_CURRENT_HOME(Y) - stepperY.rms_current(saved_current_Y); - debug_current_on(PSTR("Y"), Y_CURRENT_HOME, saved_current_Y); - #endif - #endif - #if HAS_CURRENT_HOME(Z) - stepperZ.rms_current(saved_current_Z); - debug_current_on(PSTR("Z"), Z_CURRENT_HOME, saved_current_Z); - #endif - TERN_(IMPROVE_HOMING_RELIABILITY, planner.enable_stall_prevention(false)); + if (TEST(endstops.state(), Z_MAX)) { + NOLESS(largest_sensorless_adj, offset_sensorless_adj.c); + DEBUG_ECHOLNPGM("Endstop_Z: ", largest_sensorless_adj, " TowerZ"); } #endif } diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 6185196320..ca596e8969 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -66,7 +66,13 @@ class Probe { public: #if ENABLED(SENSORLESS_PROBING) - typedef struct { bool x:1, y:1, z:1; } sense_bool_t; + typedef struct { + #if HAS_DELTA_SENSORLESS_PROBING + bool x:1, y:1, z:1; + #else + bool z; + #endif + } sense_bool_t; static sense_bool_t test_sensitivity; #endif @@ -299,7 +305,8 @@ public: #if USE_SENSORLESS static void enable_stallguard_diag1(); static void disable_stallguard_diag1(); - static void set_homing_current(const bool onoff); + static void set_offset_sensorless_adj(const_float_t sz); + static void refresh_largest_sensorless_adj(); #endif private: diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 99994b9f8f..149b1b6dc1 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -180,9 +180,9 @@ #define _EN_ITEM(N) , E##N #define _EN1_ITEM(N) , E##N:1 -typedef struct { uint16_t NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint16_t; -typedef struct { uint32_t NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint32_t; -typedef struct { int16_t NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4; } mot_stepper_int16_t; +typedef struct { uint16_t MAIN_AXIS_NAMES, X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint16_t; +typedef struct { uint32_t MAIN_AXIS_NAMES, X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint32_t; +typedef struct { int16_t MAIN_AXIS_NAMES, X2, Y2, Z2, Z3, Z4; } mot_stepper_int16_t; typedef struct { bool NUM_AXIS_LIST(X:1, Y:1, Z:1, I:1, J:1, K:1, U:1, V:1, W:1), X2:1, Y2:1, Z2:1, Z3:1, Z4:1 REPEAT(E_STEPPERS, _EN1_ITEM); } per_stepper_bool_t; #undef _EN_ITEM @@ -3319,6 +3319,7 @@ void MarlinSettings::reset() { #if ENABLED(MPC_INCLUDE_FAN) constexpr float _mpc_ambient_xfer_coeff_fan255[] = MPC_AMBIENT_XFER_COEFF_FAN255; #endif + constexpr float _filament_heat_capacity_permm[] = FILAMENT_HEAT_CAPACITY_PERMM; static_assert(COUNT(_mpc_heater_power) == HOTENDS, "MPC_HEATER_POWER must have HOTENDS items."); static_assert(COUNT(_mpc_block_heat_capacity) == HOTENDS, "MPC_BLOCK_HEAT_CAPACITY must have HOTENDS items."); @@ -3327,6 +3328,7 @@ void MarlinSettings::reset() { #if ENABLED(MPC_INCLUDE_FAN) static_assert(COUNT(_mpc_ambient_xfer_coeff_fan255) == HOTENDS, "MPC_AMBIENT_XFER_COEFF_FAN255 must have HOTENDS items."); #endif + static_assert(COUNT(_filament_heat_capacity_permm) == HOTENDS, "FILAMENT_HEAT_CAPACITY_PERMM must have HOTENDS items."); HOTEND_LOOP() { thermalManager.temp_hotend[e].constants.heater_power = _mpc_heater_power[e]; @@ -3336,6 +3338,7 @@ void MarlinSettings::reset() { #if ENABLED(MPC_INCLUDE_FAN) thermalManager.temp_hotend[e].constants.fan255_adjustment = _mpc_ambient_xfer_coeff_fan255[e] - _mpc_ambient_xfer_coeff[e]; #endif + thermalManager.temp_hotend[e].constants.filament_heat_capacity_permm = _filament_heat_capacity_permm[e]; } #endif diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 60eb635965..40cf7d02ea 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -498,11 +498,7 @@ xyze_int8_t Stepper::count_direction{0}; void Stepper::enable_axis(const AxisEnum axis) { #define _CASE_ENABLE(N) case N##_AXIS: ENABLE_AXIS_##N(); break; switch (axis) { - NUM_AXIS_CODE( - _CASE_ENABLE(X), _CASE_ENABLE(Y), _CASE_ENABLE(Z), - _CASE_ENABLE(I), _CASE_ENABLE(J), _CASE_ENABLE(K), - _CASE_ENABLE(U), _CASE_ENABLE(V), _CASE_ENABLE(W) - ); + MAIN_AXIS_MAP(_CASE_ENABLE) default: break; } mark_axis_enabled(axis); @@ -518,11 +514,7 @@ bool Stepper::disable_axis(const AxisEnum axis) { if (can_disable) { #define _CASE_DISABLE(N) case N##_AXIS: DISABLE_AXIS_##N(); break; switch (axis) { - NUM_AXIS_CODE( - _CASE_DISABLE(X), _CASE_DISABLE(Y), _CASE_DISABLE(Z), - _CASE_DISABLE(I), _CASE_DISABLE(J), _CASE_DISABLE(K), - _CASE_DISABLE(U), _CASE_DISABLE(V), _CASE_DISABLE(W) - ); + MAIN_AXIS_MAP(_CASE_DISABLE) default: break; } } @@ -619,7 +611,7 @@ void Stepper::set_directions() { #if DISABLED(LIN_ADVANCE) #if ENABLED(MIXING_EXTRUDER) // Because this is valid for the whole block we don't know - // what e-steppers will step. Likely all. Set all. + // what E steppers will step. Likely all. Set all. if (motor_direction(E_AXIS)) { MIXER_STEPPER_LOOP(j) REV_E_DIR(j); count_direction.e = -1; @@ -1906,9 +1898,7 @@ void Stepper::pulse_phase_isr() { #endif #endif - #if ENABLED(I2S_STEPPER_STREAM) - i2s_push_sample(); - #endif + TERN_(I2S_STEPPER_STREAM, i2s_push_sample()); // TODO: need to deal with MINIMUM_STEPPER_PULSE over i2s #if ISR_MULTI_STEPS diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 09117f44c6..3b899e93e2 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -214,7 +214,7 @@ // Directions are set up for MIXING_STEPPERS - like before. // Finding the right stepper may last up to MIXING_STEPPERS loops in get_next_stepper(). // These loops are a bit faster than advancing a bresenham counter. - // Always only one e-stepper is stepped. + // Always only one E stepper is stepped. #define MIN_ISR_LA_LOOP_CYCLES ((MIXING_STEPPERS) * (ISR_STEPPER_CYCLES)) #else #define MIN_ISR_LA_LOOP_CYCLES ISR_STEPPER_CYCLES @@ -246,7 +246,11 @@ #define MIN_STEP_ISR_FREQUENCY (MAX_STEP_ISR_FREQUENCY_1X / 2) #define ENABLE_COUNT (NUM_AXES + E_STEPPERS) -typedef IF<(ENABLE_COUNT > 8), uint16_t, uint8_t>::type ena_mask_t; +#if ENABLE_COUNT > 16 + typedef uint32_t ena_mask_t; +#else + typedef IF<(ENABLE_COUNT > 8), uint16_t, uint8_t>::type ena_mask_t; +#endif // Axis flags type, for enabled state or other simple state typedef struct { @@ -259,8 +263,6 @@ typedef struct { #endif }; }; - constexpr ena_mask_t linear_bits() { return _BV(NUM_AXES) - 1; } - constexpr ena_mask_t e_bits() { return (_BV(EXTRUDERS) - 1) << NUM_AXES; } } stepper_flags_t; // All the stepper enable pins diff --git a/Marlin/src/module/stepper/trinamic.cpp b/Marlin/src/module/stepper/trinamic.cpp index ee156a1986..7637351556 100644 --- a/Marlin/src/module/stepper/trinamic.cpp +++ b/Marlin/src/module/stepper/trinamic.cpp @@ -493,7 +493,7 @@ enum StealthIndex : uint8_t { #endif #define _EN_ITEM(N) , E##N - enum TMCAxis : uint8_t { NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W), X2, Y2, Z2, Z3, Z4 REPEAT(EXTRUDERS, _EN_ITEM), TOTAL }; + enum TMCAxis : uint8_t { MAIN_AXIS_NAMES, X2, Y2, Z2, Z3, Z4 REPEAT(EXTRUDERS, _EN_ITEM), TOTAL }; #undef _EN_ITEM void tmc_serial_begin() { @@ -1023,18 +1023,16 @@ void reset_trinamic_drivers() { // 2. For each axis in use, static_assert using a constexpr function, which counts the // number of matching/conflicting axis. If the value is not exactly 1, fail. +#define ALL_AXIS_NAMES X, X2, Y, Y2, Z, Z2, Z3, Z4, I, J, K, U, V, W, E0, E1, E2, E3, E4, E5, E6, E7 + #if ANY_AXIS_HAS(HW_SERIAL) // Hardware serial names are compared as strings, since actually resolving them cannot occur in a constexpr. // Using a fixed-length character array for the port name allows this to be constexpr compatible. struct SanityHwSerialDetails { const char port[20]; uint32_t address; }; #define TMC_HW_DETAIL_ARGS(A) TERN(A##_HAS_HW_SERIAL, STRINGIFY(A##_HARDWARE_SERIAL), ""), TERN0(A##_HAS_HW_SERIAL, A##_SLAVE_ADDRESS) - #define TMC_HW_DETAIL(A) { TMC_HW_DETAIL_ARGS(A) } + #define TMC_HW_DETAIL(A) { TMC_HW_DETAIL_ARGS(A) }, constexpr SanityHwSerialDetails sanity_tmc_hw_details[] = { - TMC_HW_DETAIL(X), TMC_HW_DETAIL(X2), - TMC_HW_DETAIL(Y), TMC_HW_DETAIL(Y2), - TMC_HW_DETAIL(Z), TMC_HW_DETAIL(Z2), TMC_HW_DETAIL(Z3), TMC_HW_DETAIL(Z4), - TMC_HW_DETAIL(I), TMC_HW_DETAIL(J), TMC_HW_DETAIL(K), TMC_HW_DETAIL(U), TMC_HW_DETAIL(V), TMC_HW_DETAIL(W), - TMC_HW_DETAIL(E0), TMC_HW_DETAIL(E1), TMC_HW_DETAIL(E2), TMC_HW_DETAIL(E3), TMC_HW_DETAIL(E4), TMC_HW_DETAIL(E5), TMC_HW_DETAIL(E6), TMC_HW_DETAIL(E7) + MAP(TMC_HW_DETAIL, ALL_AXIS_NAMES) }; // constexpr compatible string comparison @@ -1053,23 +1051,15 @@ void reset_trinamic_drivers() { #define TMC_HWSERIAL_CONFLICT_MSG(A) STRINGIFY(A) "_SLAVE_ADDRESS conflicts with another driver using the same " STRINGIFY(A) "_HARDWARE_SERIAL" #define SA_NO_TMC_HW_C(A) static_assert(1 >= count_tmc_hw_serial_matches(TMC_HW_DETAIL_ARGS(A), 0, COUNT(sanity_tmc_hw_details)), TMC_HWSERIAL_CONFLICT_MSG(A)); - SA_NO_TMC_HW_C(X); SA_NO_TMC_HW_C(X2); - SA_NO_TMC_HW_C(Y); SA_NO_TMC_HW_C(Y2); - SA_NO_TMC_HW_C(Z); SA_NO_TMC_HW_C(Z2); SA_NO_TMC_HW_C(Z3); SA_NO_TMC_HW_C(Z4); - SA_NO_TMC_HW_C(I); SA_NO_TMC_HW_C(J); SA_NO_TMC_HW_C(K); SA_NO_TMC_HW_C(U); SA_NO_TMC_HW_C(V); SA_NO_TMC_HW_C(W); - SA_NO_TMC_HW_C(E0); SA_NO_TMC_HW_C(E1); SA_NO_TMC_HW_C(E2); SA_NO_TMC_HW_C(E3); SA_NO_TMC_HW_C(E4); SA_NO_TMC_HW_C(E5); SA_NO_TMC_HW_C(E6); SA_NO_TMC_HW_C(E7); + MAP(SA_NO_TMC_HW_C, ALL_AXIS_NAMES) #endif #if ANY_AXIS_HAS(SW_SERIAL) struct SanitySwSerialDetails { int32_t txpin; int32_t rxpin; uint32_t address; }; #define TMC_SW_DETAIL_ARGS(A) TERN(A##_HAS_SW_SERIAL, A##_SERIAL_TX_PIN, -1), TERN(A##_HAS_SW_SERIAL, A##_SERIAL_RX_PIN, -1), TERN0(A##_HAS_SW_SERIAL, A##_SLAVE_ADDRESS) - #define TMC_SW_DETAIL(A) TMC_SW_DETAIL_ARGS(A) + #define TMC_SW_DETAIL(A) TMC_SW_DETAIL_ARGS(A), constexpr SanitySwSerialDetails sanity_tmc_sw_details[] = { - TMC_SW_DETAIL(X), TMC_SW_DETAIL(X2), - TMC_SW_DETAIL(Y), TMC_SW_DETAIL(Y2), - TMC_SW_DETAIL(Z), TMC_SW_DETAIL(Z2), TMC_SW_DETAIL(Z3), TMC_SW_DETAIL(Z4), - TMC_SW_DETAIL(I), TMC_SW_DETAIL(J), TMC_SW_DETAIL(K), TMC_SW_DETAIL(U), TMC_SW_DETAIL(V), TMC_SW_DETAIL(W), - TMC_SW_DETAIL(E0), TMC_SW_DETAIL(E1), TMC_SW_DETAIL(E2), TMC_SW_DETAIL(E3), TMC_SW_DETAIL(E4), TMC_SW_DETAIL(E5), TMC_SW_DETAIL(E6), TMC_SW_DETAIL(E7) + MAP(TMC_SW_DETAIL, ALL_AXIS_NAMES) }; constexpr bool sc_sw_done(size_t start, size_t end) { return start == end; } @@ -1083,11 +1073,7 @@ void reset_trinamic_drivers() { #define TMC_SWSERIAL_CONFLICT_MSG(A) STRINGIFY(A) "_SLAVE_ADDRESS conflicts with another driver using the same " STRINGIFY(A) "_SERIAL_RX_PIN or " STRINGIFY(A) "_SERIAL_TX_PIN" #define SA_NO_TMC_SW_C(A) static_assert(1 >= count_tmc_sw_serial_matches(TMC_SW_DETAIL_ARGS(A), 0, COUNT(sanity_tmc_sw_details)), TMC_SWSERIAL_CONFLICT_MSG(A)); - SA_NO_TMC_SW_C(X); SA_NO_TMC_SW_C(X2); - SA_NO_TMC_SW_C(Y); SA_NO_TMC_SW_C(Y2); - SA_NO_TMC_SW_C(Z); SA_NO_TMC_SW_C(Z2); SA_NO_TMC_SW_C(Z3); SA_NO_TMC_SW_C(Z4); - SA_NO_TMC_SW_C(I); SA_NO_TMC_SW_C(J); SA_NO_TMC_SW_C(K); SA_NO_TMC_SW_C(U); SA_NO_TMC_SW_C(V); SA_NO_TMC_SW_C(W); - SA_NO_TMC_SW_C(E0); SA_NO_TMC_SW_C(E1); SA_NO_TMC_SW_C(E2); SA_NO_TMC_SW_C(E3); SA_NO_TMC_SW_C(E4); SA_NO_TMC_SW_C(E5); SA_NO_TMC_SW_C(E6); SA_NO_TMC_SW_C(E7); + MAP(SA_NO_TMC_SW_C, ALL_AXIS_NAMES) #endif #endif // HAS_TRINAMIC_CONFIG diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index aa1cc04a3a..531c52c09d 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -71,6 +71,10 @@ #include "../libs/nozzle.h" #endif +#if LASER_SAFETY_TIMEOUT_MS > 0 + #include "../feature/spindle_laser.h" +#endif + // MAX TC related macros #define TEMP_SENSOR_IS_MAX(n, M) (ENABLED(TEMP_SENSOR_##n##_IS_MAX##M) || (ENABLED(TEMP_SENSOR_REDUNDANT_IS_MAX##M) && REDUNDANT_TEMP_MATCH(SOURCE, E##n))) #define TEMP_SENSOR_IS_ANY_MAX_TC(n) (ENABLED(TEMP_SENSOR_##n##_IS_MAX_TC) || (ENABLED(TEMP_SENSOR_REDUNDANT_IS_MAX_TC) && REDUNDANT_TEMP_MATCH(SOURCE, E##n))) @@ -994,7 +998,7 @@ volatile bool Temperature::raw_temps_ready = false; float asymp_temp = (t2 * t2 - t1 * t3) / (2 * t2 - t1 - t3), block_responsiveness = -log((t2 - asymp_temp) / (t1 - asymp_temp)) / (sample_distance * (sample_count >> 1)); - constants.ambient_xfer_coeff_fan0 = constants.heater_power * MPC_MAX / 255 / (asymp_temp - ambient_temp); + constants.ambient_xfer_coeff_fan0 = constants.heater_power * (MPC_MAX) / 255 / (asymp_temp - ambient_temp); constants.fan255_adjustment = 0.0f; constants.block_heat_capacity = constants.ambient_xfer_coeff_fan0 / block_responsiveness; constants.sensor_responsiveness = block_responsiveness / (1.0f - (ambient_temp - asymp_temp) * exp(-block_responsiveness * t1_time) / (t1 - asymp_temp)); @@ -1058,7 +1062,7 @@ volatile bool Temperature::raw_temps_ready = false; #endif // Calculate a new and better asymptotic temperature and re-evaluate the other constants - asymp_temp = ambient_temp + constants.heater_power / constants.ambient_xfer_coeff_fan0; + asymp_temp = ambient_temp + constants.heater_power * (MPC_MAX) / 255 / constants.ambient_xfer_coeff_fan0; block_responsiveness = -log((t2 - asymp_temp) / (t1 - asymp_temp)) / (sample_distance * (sample_count >> 1)); constants.block_heat_capacity = constants.ambient_xfer_coeff_fan0 / block_responsiveness; constants.sensor_responsiveness = block_responsiveness / (1.0f - (ambient_temp - asymp_temp) * exp(-block_responsiveness * t1_time) / (t1 - asymp_temp)); @@ -1442,7 +1446,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { if (fabs(e_speed) > planner.settings.max_feedrate_mm_s[E_AXIS]) mpc_e_position = e_position; else if (e_speed > 0.0f) { // Ignore retract/recover moves - ambient_xfer_coeff += e_speed * FILAMENT_HEAT_CAPACITY_PERMM; + ambient_xfer_coeff += e_speed * constants.filament_heat_capacity_permm; mpc_e_position = e_position; } } @@ -2705,13 +2709,15 @@ void Temperature::init() { #if HAS_HOTEND #define _TEMP_MIN_E(NR) do{ \ - const celsius_t tmin = _MAX(HEATER_##NR##_MINTEMP, TERN(TEMP_SENSOR_##NR##_IS_CUSTOM, 0, (int)pgm_read_word(&TEMPTABLE_##NR [TEMP_SENSOR_##NR##_MINTEMP_IND].celsius))); \ + const celsius_t tmin_tmp = TERN(TEMP_SENSOR_##NR##_IS_CUSTOM, 0, int16_t(pgm_read_word(&TEMPTABLE_##NR [TEMP_SENSOR_##NR##_MINTEMP_IND].celsius))), \ + tmin = _MAX(HEATER_##NR##_MINTEMP, tmin_tmp); \ 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{ \ - const celsius_t tmax = _MIN(HEATER_##NR##_MAXTEMP, TERN(TEMP_SENSOR_##NR##_IS_CUSTOM, 2000, (int)pgm_read_word(&TEMPTABLE_##NR [TEMP_SENSOR_##NR##_MAXTEMP_IND].celsius) - 1)); \ + const celsius_t tmax_tmp = TERN(TEMP_SENSOR_##NR##_IS_CUSTOM, 2000, int16_t(pgm_read_word(&TEMPTABLE_##NR [TEMP_SENSOR_##NR##_MAXTEMP_IND].celsius)) - 1), \ + tmax = _MIN(HEATER_##NR##_MAXTEMP, tmax_tmp); \ 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); \ @@ -3328,6 +3334,7 @@ public: /** * Handle various ~1kHz tasks associated with temperature + * - Check laser safety timeout * - Heater PWM (~1kHz with scaler) * - LCD Button polling (~500Hz) * - Start / Read one ADC sensor @@ -3337,6 +3344,14 @@ public: */ void Temperature::isr() { + // Shut down the laser if steppers are inactive for > LASER_SAFETY_TIMEOUT_MS ms + #if LASER_SAFETY_TIMEOUT_MS > 0 + if (cutter.last_power_applied && ELAPSED(millis(), gcode.previous_move_ms + (LASER_SAFETY_TIMEOUT_MS))) { + cutter.power = 0; // Prevent planner idle from re-enabling power + cutter.apply_power(0); + } + #endif + static int8_t temp_count = -1; static ADCSensorState adc_sensor_state = StartupDelay; static uint8_t pwm_count = _BV(SOFT_PWM_SCALE); diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 2cc2382174..c11c9d76de 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -96,13 +96,14 @@ hotend_pid_t; #if ENABLED(MPCTEMP) typedef struct { - float heater_power; // M306 P - float block_heat_capacity; // M306 C - float sensor_responsiveness; // M306 R - float ambient_xfer_coeff_fan0; // M306 A + float heater_power; // M306 P + float block_heat_capacity; // M306 C + float sensor_responsiveness; // M306 R + float ambient_xfer_coeff_fan0; // M306 A #if ENABLED(MPC_INCLUDE_FAN) - float fan255_adjustment; // M306 F + float fan255_adjustment; // M306 F #endif + float filament_heat_capacity_permm; // M306 H } MPC_t; #endif diff --git a/Marlin/src/pins/esp32/pins_E4D.h b/Marlin/src/pins/esp32/pins_E4D.h index 02a5fe4e33..d12b5276b7 100644 --- a/Marlin/src/pins/esp32/pins_E4D.h +++ b/Marlin/src/pins/esp32/pins_E4D.h @@ -31,28 +31,23 @@ #include "env_validate.h" #if EXTRUDERS > 1 || E_STEPPERS > 1 - #error "E4d@box only supports one E Stepper. Comment out this line to continue." + #error "E4d@box only supports 1 E stepper." #elif HAS_MULTI_HOTEND - #error "E4d@box only supports one hotend / E-stepper. Comment out this line to continue." + #error "E4d@box only supports 1 hotend / E stepper." #endif #define BOARD_INFO_NAME "E4d@box" #define BOARD_WEBSITE_URL "github.com/Exilaus/E4d@box" #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME -// -// Disable I2S stepper stream -// -#undef I2S_STEPPER_STREAM - // // Redefine I2S for ESP32 // #undef I2S_WS -#define I2S_WS 23 #undef I2S_BCK -#define I2S_BCK 22 #undef I2S_DATA +#define I2S_WS 23 +#define I2S_BCK 22 #define I2S_DATA 21 // diff --git a/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h b/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h index aff7f742ed..80923d972d 100644 --- a/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h +++ b/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h @@ -35,9 +35,11 @@ // I2S (steppers & other output-only pins) // #define I2S_STEPPER_STREAM -#define I2S_WS 17 -#define I2S_BCK 22 -#define I2S_DATA 21 +#if ENABLED(I2S_STEPPER_STREAM) + #define I2S_WS 17 + #define I2S_BCK 22 + #define I2S_DATA 21 +#endif // // Servos diff --git a/Marlin/src/pins/esp32/pins_ESP32.h b/Marlin/src/pins/esp32/pins_ESP32.h index 6578770ba0..266de7e9f6 100644 --- a/Marlin/src/pins/esp32/pins_ESP32.h +++ b/Marlin/src/pins/esp32/pins_ESP32.h @@ -33,9 +33,11 @@ // I2S (steppers & other output-only pins) // #define I2S_STEPPER_STREAM -#define I2S_WS 25 -#define I2S_BCK 26 -#define I2S_DATA 27 +#if ENABLED(I2S_STEPPER_STREAM) + #define I2S_WS 25 + #define I2S_BCK 26 + #define I2S_DATA 27 +#endif // // Limit Switches diff --git a/Marlin/src/pins/esp32/pins_ESPA_common.h b/Marlin/src/pins/esp32/pins_ESPA_common.h index 2fcacb3002..ca949cdf97 100644 --- a/Marlin/src/pins/esp32/pins_ESPA_common.h +++ b/Marlin/src/pins/esp32/pins_ESPA_common.h @@ -32,14 +32,6 @@ #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME #endif -// -// Disable I2S stepper stream, by default -// -#undef I2S_STEPPER_STREAM -#undef I2S_WS -#undef I2S_BCK -#undef I2S_DATA - // // Limit Switches // diff --git a/Marlin/src/pins/esp32/pins_FYSETC_E4.h b/Marlin/src/pins/esp32/pins_FYSETC_E4.h index e75b6ece28..7dc59979c8 100644 --- a/Marlin/src/pins/esp32/pins_FYSETC_E4.h +++ b/Marlin/src/pins/esp32/pins_FYSETC_E4.h @@ -31,9 +31,9 @@ #include "env_validate.h" #if EXTRUDERS > 1 || E_STEPPERS > 1 - #error "FYSETC E4 only supports one E Stepper. Comment out this line to continue." + #error "FYSETC E4 only supports 1 E stepper." #elif HAS_MULTI_HOTEND - #error "FYSETC E4 only supports one hotend / E-stepper. Comment out this line to continue." + #error "FYSETC E4 only supports 1 hotend / E stepper." #endif #define BOARD_INFO_NAME "FYSETC_E4" diff --git a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h index 68b8ed4ac8..3d5e3964f4 100644 --- a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h +++ b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h @@ -31,15 +31,17 @@ #include "env_validate.h" #if EXTRUDERS > 2 || E_STEPPERS > 2 - #error "MKS ESP Nano only supports two E Steppers. Comment out this line to continue." + #error "MKS TinyBee supports up to 2 E steppers." #elif HOTENDS > 2 - #error "MKS ESP Nano only supports two hotend / E-stepper. Comment out this line to continue." + #error "MKS TinyBee supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "MKS TinyBee" #define BOARD_WEBSITE_URL "https://github.com/makerbase-mks" #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME +// MAX_EXPANDER_BITS is defined for MKS TinyBee in HAL/ESP32/inc/Conditionals_adv.h + // // Servos // @@ -61,9 +63,6 @@ #define I2S_WS 26 #define I2S_BCK 25 #define I2S_DATA 27 - #if ENABLED(LIN_ADVANCE) - #error "I2S stream is currently incompatible with LIN_ADVANCE." - #endif #endif // @@ -116,17 +115,7 @@ // // ADC Reference Voltage // -#define ADC_REFERENCE_VOLTAGE 2.5 // 2.5V reference VDDA - -// -// MicroSD card -// -#define SD_MOSI_PIN 23 -#define SD_MISO_PIN 19 -#define SD_SCK_PIN 18 -#define SDSS 5 -#define SD_DETECT_PIN 34 // IO34 default is SD_DET signal (Jump to SDDET) -#define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers +#define ADC_REFERENCE_VOLTAGE 2.5 // 2.5V reference VDDA /** * ------ ------ @@ -157,56 +146,48 @@ #define EXP2_09_PIN 18 #define EXP2_10_PIN 19 -#if HAS_WIRED_LCD +// +// MicroSD card +// +//#define SD_MOSI_PIN EXP2_05_PIN // uses esp32 default 23 +//#define SD_MISO_PIN EXP2_10_PIN // uses esp32 default 19 +//#define SD_SCK_PIN EXP2_09_PIN // uses esp32 default 18 +#define SDSS EXP2_07_PIN +#define SD_DETECT_PIN EXP2_04_PIN // IO34 default is SD_DET signal (Jump to SDDET) +#define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers - #define BEEPER_PIN 149 - #define BTN_ENC 13 - #define LCD_PINS_ENABLE 21 - #define LCD_PINS_RS 4 - #define BTN_EN1 14 - #define BTN_EN2 12 +#if HAS_WIRED_LCD + #define BEEPER_PIN EXP1_10_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN #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 15 - #define DOGLCD_CS 16 - //#define DOGLCD_SCK 19 - //#define DOGLCD_MOSI 23 - - // Required for MKS_MINI_12864 with this board - //#define MKS_LCD12864B - - #elif ENABLED(MKS_MINI_12864_V3) - - #define LCD_PINS_DC EXP1_07_PIN + // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) + #define DOGLCD_CS EXP1_05_PIN + #define DOGLCD_A0 EXP1_04_PIN + #define LCD_RESET_PIN -1 + #elif ENABLED(FYSETC_MINI_12864_2_1) + // MKS_MINI_12864_V3, BTT_MINI_12864_V1, FYSETC_MINI_12864_2_1 #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 LCD_PINS_DC - #define LCD_BACKLIGHT_PIN -1 + #define DOGLCD_A0 EXP1_07_PIN #define LCD_RESET_PIN EXP1_06_PIN #define NEOPIXEL_PIN EXP1_05_PIN - #define DOGLCD_MOSI EXP2_05_PIN - #define DOGLCD_SCK EXP2_09_PIN #if SD_CONNECTION_IS(ONBOARD) #define FORCE_SOFT_SPI #endif - - #else // !MKS_MINI_12864 - - #define LCD_PINS_D4 0 + #else + #define LCD_PINS_D4 EXP1_06_PIN #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - #define LCD_PINS_D5 16 - #define LCD_PINS_D6 15 - #define LCD_PINS_D7 17 + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN #endif - #define BOARD_ST7920_DELAY_1 96 #define BOARD_ST7920_DELAY_2 48 #define BOARD_ST7920_DELAY_3 600 - - #endif // !MKS_MINI_12864 - + #endif #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPA.h b/Marlin/src/pins/esp32/pins_MRR_ESPA.h index cc67bc025c..e9e3db5758 100644 --- a/Marlin/src/pins/esp32/pins_MRR_ESPA.h +++ b/Marlin/src/pins/esp32/pins_MRR_ESPA.h @@ -31,9 +31,9 @@ #include "env_validate.h" #if EXTRUDERS > 1 || E_STEPPERS > 1 - #error "MRR ESPA only supports one E Stepper. Comment out this line to continue." + #error "MRR ESPA only supports 1 E stepper." #elif HAS_MULTI_HOTEND - #error "MRR ESPA only supports one hotend / E-stepper. Comment out this line to continue." + #error "MRR ESPA only supports 1 hotend / E stepper." #endif #define BOARD_INFO_NAME "MRR ESPA" diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPE.h b/Marlin/src/pins/esp32/pins_MRR_ESPE.h index 9b9b54e3ae..f372de9e01 100644 --- a/Marlin/src/pins/esp32/pins_MRR_ESPE.h +++ b/Marlin/src/pins/esp32/pins_MRR_ESPE.h @@ -32,9 +32,9 @@ #include "env_validate.h" #if EXTRUDERS > 2 || E_STEPPERS > 2 - #error "MRR ESPE only supports two E Steppers. Comment out this line to continue." + #error "MRR ESPE supports up to 2 E steppers." #elif HAS_MULTI_HOTEND - #error "MRR ESPE only supports one hotend / E-stepper. Comment out this line to continue." + #error "MRR ESPE only supports 1 hotend / E stepper." #endif #define BOARD_INFO_NAME "MRR ESPE" @@ -52,11 +52,10 @@ // Enable I2S stepper stream // #define I2S_STEPPER_STREAM -#define I2S_WS 26 -#define I2S_BCK 25 -#define I2S_DATA 27 -#if ENABLED(LIN_ADVANCE) - #error "I2S stream is currently incompatible with LIN_ADVANCE." +#if ENABLED(I2S_STEPPER_STREAM) + #define I2S_WS 26 + #define I2S_BCK 25 + #define I2S_DATA 27 #endif // 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 586fb14e8e..4ab5b10937 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -223,7 +223,9 @@ #elif ENABLED(ANET_FULL_GRAPHICS_LCD) - #error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_3.h' for details. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_3.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif /** * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. @@ -257,7 +259,9 @@ #elif ENABLED(WYH_L12864) - #error "CAUTION! WYH_L12864 requires wiring modifications. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! WYH_L12864 requires wiring modifications. See 'pins_BTT_SKR_V1_3.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif /** * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. @@ -310,7 +314,7 @@ #define TFT_RESET_PIN EXP1_07_PIN #define TFT_BACKLIGHT_PIN EXP1_08_PIN - #define TFT_RST_PIN EXP2_04_PIN + //#define TFT_RST_PIN EXP2_04_PIN #define TFT_MOSI_PIN EXP2_05_PIN #define TFT_SCK_PIN EXP2_09_PIN #define TFT_MISO_PIN EXP2_10_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 25c7ba69b6..b50e8e5780 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -286,7 +286,9 @@ #elif HAS_WIRED_LCD #if ENABLED(ANET_FULL_GRAPHICS_LCD_ALT_WIRING) - #error "CAUTION! ANET_FULL_GRAPHICS_LCD_ALT_WIRING requires wiring modifications. See 'pins_BTT_SKR_V1_4.h' for details. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! ANET_FULL_GRAPHICS_LCD_ALT_WIRING requires wiring modifications. See 'pins_BTT_SKR_V1_4.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif /** * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. @@ -318,7 +320,9 @@ #define BEEPER_PIN EXP1_03_PIN #elif ENABLED(ANET_FULL_GRAPHICS_LCD) - #error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_4.h' for details. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_4.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif /** * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. diff --git a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h index b08ac536b3..56d75a748c 100644 --- a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h @@ -307,7 +307,9 @@ #elif ENABLED(ZONESTAR_LCD) - #error "CAUTION! ZONESTAR_LCD on REARM requires wiring modifications. NB. ADCs are not 5V tolerant. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! ZONESTAR_LCD on REARM requires wiring modifications. NB. ADCs are not 5V tolerant. See 'pins_RAMPS_RE_ARM.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif #elif IS_TFTGLCD_PANEL diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h index 27b65c22cd..090a2e4051 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h @@ -204,7 +204,9 @@ #define EXP1_10_PIN P2_08 #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI - #error "Ender-3 V2 display requires a custom cable with TX = P0_15, RX = P0_16. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! Ender-3 V2 display requires a custom cable with TX = P0_15, RX = P0_16. See 'pins_BTT_SKR_E3_TURBO.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif /** * Ender 3 V2 display SKR E3 Turbo (EXP1) Ender 3 V2 display --> SKR E3 Turbo @@ -238,7 +240,9 @@ #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_E3_TURBO.h' for details. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_E3_TURBO.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif #define LCD_PINS_RS EXP1_05_PIN #define LCD_PINS_ENABLE EXP1_09_PIN diff --git a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h index 13ebbe1f28..4cff5d59e1 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -339,9 +339,10 @@ #define KILL_PIN -1 // NC #elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI + #define TFT_CS_PIN EXP1_04_PIN - #define TFT_A0_PIN EXP1_03_PIN #define TFT_DC_PIN EXP1_03_PIN + #define TFT_A0_PIN TFT_DC_PIN #define TFT_MISO_PIN EXP2_10_PIN #define TFT_BACKLIGHT_PIN EXP1_08_PIN #define TFT_RESET_PIN EXP1_07_PIN diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h index 6f9e5e8e6c..5f7a534d11 100644 --- a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h @@ -135,17 +135,20 @@ // // LCD / Controller // -#define BEEPER_PIN 6 +#if HAS_WIRED_LCD + #define BEEPER_PIN 6 -// Pins for DOGM SPI LCD Support -#define DOGLCD_A0 26 -#define DOGLCD_CS 24 -#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h -#define DOGLCD_SCK -1 + #define BTN_EN1 23 + #define BTN_EN2 25 + #define BTN_ENC 27 -#define BTN_EN1 23 -#define BTN_EN2 25 -#define BTN_ENC 27 + #if HAS_MARLINUI_U8GLIB + #define DOGLCD_A0 26 + #define DOGLCD_CS 24 + #define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h + #define DOGLCD_SCK -1 + #endif +#endif // Hardware buttons for manual movement of XYZ #define SHIFT_OUT_PIN 19 diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h index 137650eeed..0aa0b59ca9 100644 --- a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h @@ -140,18 +140,20 @@ // // LCD / Controller // -#define BEEPER_PIN 16 +#if HAS_WIRED_LCD + #define BEEPER_PIN 16 -// Pins for DOGM SPI LCD Support -#define DOGLCD_A0 39 -#define DOGLCD_CS 35 -#define DOGLCD_MOSI 48 -#define DOGLCD_SCK 49 + #define BTN_EN1 36 + #define BTN_EN2 34 + #define BTN_ENC 38 -// The encoder and click button -#define BTN_EN1 36 -#define BTN_EN2 34 -#define BTN_ENC 38 + #if HAS_MARLINUI_U8GLIB + #define DOGLCD_A0 39 + #define DOGLCD_CS 35 + #define DOGLCD_MOSI 48 + #define DOGLCD_SCK 49 + #endif +#endif // Hardware buttons for manual movement of XYZ #define SHIFT_OUT_PIN 42 diff --git a/Marlin/src/pins/mega/pins_MEGACONTROLLER.h b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h index dc9fa52af8..7ebef6e281 100644 --- a/Marlin/src/pins/mega/pins_MEGACONTROLLER.h +++ b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h @@ -26,7 +26,7 @@ */ #if HOTENDS > 2 || E_STEPPERS > 2 - #error "Mega Controller supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "Mega Controller supports up to 2 hotends / E steppers." #endif #include "env_validate.h" diff --git a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h index c44b1f449c..3bcece400f 100644 --- a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h +++ b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h @@ -149,8 +149,8 @@ #define MOSFET_1_PIN 6 // Plug EX1 Pin 1-2 -> PH3 #15 -> Logical 06 #define MOSFET_2_PIN 7 // Plug EX1 Pin 3-4 -> PH4 #16 -> Logical 07 -#define MOSFET_3_PIN 11 // Plug EX2 1-2 -> PB6 #24 -> Logical 11 -#define MOSFET_4_PIN 12 // Plug EX2 3-4 -> PB5 #25 -> Logical 12 +#define MOSFET_3_PIN 11 // Plug EX2 1-2 -> PB5 #24 -> Logical 11 +#define MOSFET_4_PIN 12 // Plug EX2 3-4 -> PB6 #25 -> Logical 12 #define MOSFET_5_PIN 45 // Plug HBD 1-2 -> PL4 #39 -> Logical 45 #define MOSFET_6_PIN 44 // Plug Extra 1-2 -> PL5 #40 -> Logical 44 (FET not soldered in all boards) diff --git a/Marlin/src/pins/mega/pins_MINITRONICS.h b/Marlin/src/pins/mega/pins_MINITRONICS.h index bbe746461e..ec712a3b90 100644 --- a/Marlin/src/pins/mega/pins_MINITRONICS.h +++ b/Marlin/src/pins/mega/pins_MINITRONICS.h @@ -34,7 +34,7 @@ #if NOT_TARGET(__AVR_ATmega1281__) #error "Oops! Select 'Minitronics' in 'Tools > Board.'" #elif HOTENDS > 2 || E_STEPPERS > 2 - #error "Minitronics supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "Minitronics supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "Minitronics v1.0/1.1" diff --git a/Marlin/src/pins/mega/pins_OVERLORD.h b/Marlin/src/pins/mega/pins_OVERLORD.h index 98f8da5719..f1062b413e 100644 --- a/Marlin/src/pins/mega/pins_OVERLORD.h +++ b/Marlin/src/pins/mega/pins_OVERLORD.h @@ -26,7 +26,7 @@ */ #if HOTENDS > 2 || E_STEPPERS > 2 - #error "Overlord Controller supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "Overlord supports up to 2 hotends / E steppers." #endif #include "env_validate.h" diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 82c91290c2..40b0c714c6 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -464,14 +464,14 @@ #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) - #include "sam/pins_ADSK.h" // SAM3X8E env:DUE env:DUE_debug -#elif MB(PRINTRBOARD_G2) - #include "sam/pins_PRINTRBOARD_G2.h" // SAM3X8C env:DUE_USB #elif MB(CNCONTROLS_15D) #include "sam/pins_CNCONTROLS_15D.h" // SAM3X8E env:DUE env:DUE_USB #elif MB(KRATOS32) #include "sam/pins_KRATOS32.h" // SAM3X8E env:DUE env:DUE_USB +#elif MB(PRINTRBOARD_G2) + #include "sam/pins_PRINTRBOARD_G2.h" // SAM3X8C env:DUE_USB +#elif MB(ADSK) + #include "sam/pins_ADSK.h" // SAM3X8C env:DUE env:DUE_debug // // STM32 ARM Cortex-M0 @@ -538,7 +538,7 @@ #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_USB env:STM32F103RE_btt env:STM32F103RE_btt_USB env:STM32F103RC_btt_maple env:STM32F103RC_btt_USB_maple env:STM32F103RE_btt_maple env:STM32F103RE_btt_USB_maple #elif MB(BTT_SKR_MINI_E3_V3_0) - #include "stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h" // STM32G0 env:STM32G0B1RE_btt + #include "stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h" // STM32G0 env:STM32G0B1RE_btt env:STM32G0B1RE_btt_xfer #elif MB(BTT_SKR_MINI_MZ_V1_0) #include "stm32f1/pins_BTT_SKR_MINI_MZ_V1_0.h" // STM32F1 env:STM32F103RC_btt env:STM32F103RC_btt_USB env:STM32F103RC_btt_maple env:STM32F103RC_btt_USB_maple #elif MB(BTT_SKR_E3_DIP) @@ -708,6 +708,10 @@ #include "stm32f7/pins_NUCLEO_F767ZI.h" // STM32F7 env:NUCLEO_F767ZI #elif MB(BTT_SKR_SE_BX) #include "stm32h7/pins_BTT_SKR_SE_BX.h" // STM32H7 env:BTT_SKR_SE_BX +#elif MB(BTT_SKR_V3_0) + #include "stm32h7/pins_BTT_SKR_V3_0.h" // STM32H7 env:STM32H743Vx_btt +#elif MB(BTT_SKR_V3_0_EZ) + #include "stm32h7/pins_BTT_SKR_V3_0_EZ.h" // STM32H7 env:STM32H743Vx_btt #elif MB(TEENSY41) #include "teensy4/pins_TEENSY41.h" // Teensy-4.x env:teensy41 #elif MB(T41U5XBB) @@ -841,8 +845,8 @@ #elif MB(RAMPS_LONGER3D_LK4PRO) #error "BOARD_RAMPS_LONGER3D_LK4PRO is now BOARD_LONGER3D_LKx_PRO. Please update your configuration." #elif MB(BTT_SKR_V2_0) - #error "BTT_SKR_V2_0 is now BTT_SKR_V2_0_REV_A or BTT_SKR_V2_0_REV_B. See https://bit.ly/3t5d9JQ for more information. Please update your configuration." - #elif MB(BOARD_TH3D_EZBOARD_LITE_V2) + #error "BOARD_BTT_SKR_V2_0 is now BOARD_BTT_SKR_V2_0_REV_A or BOARD_BTT_SKR_V2_0_REV_B. See https://bit.ly/3t5d9JQ for more information. Please update your configuration." + #elif MB(TH3D_EZBOARD_LITE_V2) #error "BOARD_TH3D_EZBOARD_LITE_V2 is now BOARD_TH3D_EZBOARD_V2. Please update your configuration." #elif defined(MOTHERBOARD) #error "Unknown MOTHERBOARD value set in Configuration.h." @@ -873,6 +877,7 @@ #undef BOARD_RAMPS_DAGOMA #undef BOARD_RAMPS_LONGER3D_LK4PRO #undef BOARD_BTT_SKR_V2_0 + #undef BOARD_TH3D_EZBOARD_LITE_V2 #endif diff --git a/Marlin/src/pins/ramps/pins_AZTEEG_X3.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h index ee8cafa897..44d8341c11 100644 --- a/Marlin/src/pins/ramps/pins_AZTEEG_X3.h +++ b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h @@ -29,7 +29,7 @@ #include "env_validate.h" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "Azteeg X3 supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "Azteeg X3 supports up to 2 hotends / E steppers." #endif #if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) diff --git a/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h index c2896146e6..5dc191cd20 100644 --- a/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h +++ b/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h @@ -29,7 +29,7 @@ #include "env_validate.h" #if HOTENDS > 5 || E_STEPPERS > 5 - #error "Azteeg X3 Pro supports up to 5 hotends / E-steppers. Comment out this line to continue." + #error "Azteeg X3 Pro supports up to 5 hotends / E steppers." #endif #define BOARD_INFO_NAME "Azteeg X3 Pro" @@ -158,7 +158,7 @@ #if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT) && defined(DOGLCD_A0) && DOGLCD_A0 == CASE_LIGHT_PIN #undef DOGLCD_A0 // Steal pin 44 for the case light; if you have a Viki2 and have connected it #define DOGLCD_A0 57 // following the Panucatt wiring diagram, you may need to tweak these pin assignments - // as the wiring diagram uses pin 44 for DOGLCD_A0 + // as the wiring diagram uses pin 44 for DOGLCD_A0. #endif // diff --git a/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h b/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h index 4d7a792635..fa622ffb15 100644 --- a/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h +++ b/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h @@ -26,7 +26,7 @@ */ #if HOTENDS > 2 || E_STEPPERS > 2 - #error "2PrintBeta Due supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "2PrintBeta Due supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "2PrintBeta Due" diff --git a/Marlin/src/pins/ramps/pins_BIQU_KFB_2.h b/Marlin/src/pins/ramps/pins_BIQU_KFB_2.h index b31df11563..58a62fb8bc 100644 --- a/Marlin/src/pins/ramps/pins_BIQU_KFB_2.h +++ b/Marlin/src/pins/ramps/pins_BIQU_KFB_2.h @@ -26,7 +26,7 @@ */ #if HOTENDS > 2 || E_STEPPERS > 2 - #error "KFB 2.0 supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "KFB 2.0 supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "KFB 2.0" diff --git a/Marlin/src/pins/ramps/pins_DAGOMA_F5.h b/Marlin/src/pins/ramps/pins_DAGOMA_F5.h index ced66d80b8..e1bd2ec4ed 100644 --- a/Marlin/src/pins/ramps/pins_DAGOMA_F5.h +++ b/Marlin/src/pins/ramps/pins_DAGOMA_F5.h @@ -22,7 +22,7 @@ #pragma once #if HOTENDS > 2 || E_STEPPERS > 2 - #error "Dagoma3D F5 supports only 2 hotends / E-steppers. Comment out this line to continue." + #error "Dagoma3D F5 supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "Dagoma3D F5" diff --git a/Marlin/src/pins/ramps/pins_FELIX2.h b/Marlin/src/pins/ramps/pins_FELIX2.h index bdf83c44ba..3e7849d71f 100644 --- a/Marlin/src/pins/ramps/pins_FELIX2.h +++ b/Marlin/src/pins/ramps/pins_FELIX2.h @@ -26,7 +26,7 @@ */ #if HOTENDS > 2 || E_STEPPERS > 2 - #error "Felix 2.0+ supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "Felix 2.0+ supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "Felix 2.0+" diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h index 845e2d65ec..a6791ff7c8 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h @@ -29,7 +29,7 @@ #include "env_validate.h" #if HOTENDS > 3 || E_STEPPERS > 3 - #error "Formbot supports up to 3 hotends / E-steppers. Comment out this line to continue." + #error "Formbot supports up to 3 hotends / E steppers." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h b/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h index 7a12831862..17d3abc71f 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h @@ -29,7 +29,7 @@ #include "env_validate.h" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "Formbot supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "Formbot supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "Formbot" diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h b/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h index 0a94a582d4..e23a63994f 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h @@ -29,7 +29,7 @@ #include "env_validate.h" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "Formbot supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "Formbot supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "Formbot" diff --git a/Marlin/src/pins/ramps/pins_K8600.h b/Marlin/src/pins/ramps/pins_K8600.h index 2dabd9d59b..a9613e8eb2 100644 --- a/Marlin/src/pins/ramps/pins_K8600.h +++ b/Marlin/src/pins/ramps/pins_K8600.h @@ -26,7 +26,7 @@ */ #if HAS_MULTI_HOTEND - #error "Only 1 hotend is supported for Vertex Nano." + #error "K8600 only supports 1 hotend / E stepper." #endif #define BOARD_INFO_NAME "K8600" diff --git a/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h b/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h index a7817c6f3a..af1d33c83c 100644 --- a/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h +++ b/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h @@ -29,7 +29,7 @@ #include "env_validate.h" #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "Longer3D LGT KIT V1.0 board only supports one hotend / E-stepper. Comment out this line to continue." + #error "Longer3D LGT KIT V1.0 only supports 1 hotend / E stepper." #endif #if SERIAL_PORT == 1 || SERIAL_PORT_2 == 1 || SERIAL_PORT_3 == 1 diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_10.h b/Marlin/src/pins/ramps/pins_MKS_BASE_10.h index c40cabe325..64efa46c05 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_10.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_10.h @@ -28,7 +28,7 @@ */ #if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS BASE 1.0 supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "MKS BASE 1.0 supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "MKS BASE 1.0" diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_14.h b/Marlin/src/pins/ramps/pins_MKS_BASE_14.h index 992ab92ee9..7e2a722cf2 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_14.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_14.h @@ -26,7 +26,7 @@ */ #if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS BASE 1.4 only supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "MKS BASE 1.4 supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "MKS BASE 1.4" diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_15.h b/Marlin/src/pins/ramps/pins_MKS_BASE_15.h index 2b0c2bb883..5fedd3f97c 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_15.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_15.h @@ -26,7 +26,7 @@ */ #if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS BASE 1.5 only supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "MKS BASE 1.5 supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "MKS BASE 1.5" diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h index 31a8fdab8d..63e0b51d3c 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h @@ -26,7 +26,7 @@ */ #if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS BASE 1.6 only supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "MKS BASE 1.6 supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "MKS BASE 1.6" diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h index 5f373f99d7..bb7b55893e 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h @@ -31,7 +31,7 @@ */ #if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS GEN 1.3/1.4 supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "MKS GEN 1.3/1.4 supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "MKS GEN >= v1.3" diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_L.h b/Marlin/src/pins/ramps/pins_MKS_GEN_L.h index 4dca1ca187..ca1f133816 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_L.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L.h @@ -26,7 +26,7 @@ */ #if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS GEN L supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "MKS GEN L supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "MKS GEN L" 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 20f3dece42..0378b166a2 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h @@ -26,7 +26,7 @@ */ #if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS GEN L V2 supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "MKS GEN L V2 supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "MKS GEN L V2" diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h index 24e04a39ff..d508cb453f 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h @@ -26,7 +26,7 @@ */ #if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS GEN L V2.1 supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "MKS GEN L V2.1 supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "MKS GEN L V2.1" diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index 4ab7f40073..199be4a1c9 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -592,7 +592,10 @@ #elif ENABLED(ZONESTAR_LCD) - #error "CAUTION! ZONESTAR_LCD on RAMPS requires wiring modifications. It plugs into AUX2 but GND and 5V need to be swapped. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! ZONESTAR_LCD on RAMPS requires wiring modifications. It plugs into AUX2 but GND and 5V need to be swapped. See 'pins_RAMPS.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif + #define LCD_PINS_RS AUX2_05_PIN #define LCD_PINS_ENABLE AUX2_07_PIN #define LCD_PINS_D4 AUX2_04_PIN @@ -859,7 +862,9 @@ #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." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_RAMPS.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif /** * FYSETC TFT-81050 display pinout diff --git a/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h b/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h index 679503e982..3d5f5d6f91 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h @@ -22,7 +22,7 @@ #pragma once #if HOTENDS > 2 || E_STEPPERS > 2 - #error "Creality3D RAMPS supports only 2 hotends / E-steppers. Comment out this line to continue." + #error "Creality RAMPS supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "Creality3D RAMPS" diff --git a/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h b/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h index 3583958906..8f9148b732 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h @@ -22,7 +22,7 @@ #pragma once #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "Ender-4 only supports one hotend / E-stepper. Comment out this line to continue." + #error "Ender-4 only supports 1 hotend / E stepper." #endif #define BOARD_INFO_NAME "Ender-4" diff --git a/Marlin/src/pins/ramps/pins_RL200.h b/Marlin/src/pins/ramps/pins_RL200.h index 52d0173c00..00fb39a439 100644 --- a/Marlin/src/pins/ramps/pins_RL200.h +++ b/Marlin/src/pins/ramps/pins_RL200.h @@ -30,9 +30,9 @@ #define DEFAULT_MACHINE_NAME "Rapide Lite 200" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "RL200v1 supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "RL200v1 supports up to 2 hotends / E steppers." #elif NUM_Z_STEPPERS != 2 - #error "RL200 uses dual Z stepper motors. Set NUM_Z_STEPPERS to 2 or comment out this line to continue." + #error "RL200 uses dual Z stepper motors. Z_DRIVER_TYPE and Z2_DRIVER_TYPE must be defined." #elif !(AXIS_DRIVER_TYPE_X(DRV8825) && AXIS_DRIVER_TYPE_Y(DRV8825) && AXIS_DRIVER_TYPE_Z(DRV8825) && AXIS_DRIVER_TYPE_Z2(DRV8825) && AXIS_DRIVER_TYPE_E0(DRV8825)) #error "You must set ([XYZ]|Z2|E0)_DRIVER_TYPE to DRV8825 in Configuration.h for RL200." #endif diff --git a/Marlin/src/pins/ramps/pins_RUMBA.h b/Marlin/src/pins/ramps/pins_RUMBA.h index 7d17bf2e12..eb049c48dd 100644 --- a/Marlin/src/pins/ramps/pins_RUMBA.h +++ b/Marlin/src/pins/ramps/pins_RUMBA.h @@ -29,7 +29,7 @@ #include "env_validate.h" #if HOTENDS > 3 || E_STEPPERS > 3 - #error "RUMBA supports up to 3 hotends / E-steppers. Comment out this line to continue." + #error "RUMBA supports up to 3 hotends / E steppers." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h b/Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h index 85defdf1bd..d25029a7a3 100644 --- a/Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h +++ b/Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h @@ -26,7 +26,7 @@ */ #if HOTENDS > 2 || E_STEPPERS > 2 - #error "Sainsmart 2-in-1 supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "Sainsmart 2-in-1 supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "Sainsmart" diff --git a/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h b/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h index b884fcbfc7..b11487b21d 100644 --- a/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h +++ b/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h @@ -29,7 +29,7 @@ #include "env_validate.h" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "Tenlog supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "Tenlog supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "Tenlog D3 Hero" @@ -148,6 +148,7 @@ // // Misc. Functions // +//#define PS_ON_PIN 40 // The M80/M81 PSU pin for boards v2.1-2.3 //#define CASE_LIGHT_PIN 5 #define SDSS 53 //#ifndef LED_PIN 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 ffe6d56eb8..04c6af67b0 100644 --- a/Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h +++ b/Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h @@ -29,7 +29,7 @@ #include "env_validate.h" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "TRONXY-V3-1.0 supports only 2 hotends/E-steppers. Comment out this line to continue." + #error "TRONXY-V3-1.0 supports up to 2 hotends/E steppers." #endif #define BOARD_INFO_NAME "TRONXY-V3-1.0" diff --git a/Marlin/src/pins/ramps/pins_TT_OSCAR.h b/Marlin/src/pins/ramps/pins_TT_OSCAR.h index 9d844ebcdc..f81cc6039a 100644 --- a/Marlin/src/pins/ramps/pins_TT_OSCAR.h +++ b/Marlin/src/pins/ramps/pins_TT_OSCAR.h @@ -24,7 +24,7 @@ #include "env_validate.h" #if HOTENDS > 5 || E_STEPPERS > 5 - #error "TTOSCAR supports up to 5 hotends / E-steppers. Comment out this line to continue." + #error "TTOSCAR supports up to 5 hotends / E steppers." #endif #define BOARD_INFO_NAME "TT OSCAR" diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V52.h b/Marlin/src/pins/ramps/pins_ZRIB_V52.h index 002b9dbef5..2df789cd6f 100644 --- a/Marlin/src/pins/ramps/pins_ZRIB_V52.h +++ b/Marlin/src/pins/ramps/pins_ZRIB_V52.h @@ -26,7 +26,7 @@ */ #if HOTENDS > 2 || E_STEPPERS > 2 - #error "ZRIB V5.2 only supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "ZRIB V5.2 supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "ZRIB V5.2" diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V53.h b/Marlin/src/pins/ramps/pins_ZRIB_V53.h index 3a2604586e..48808d9601 100644 --- a/Marlin/src/pins/ramps/pins_ZRIB_V53.h +++ b/Marlin/src/pins/ramps/pins_ZRIB_V53.h @@ -28,9 +28,9 @@ #include "env_validate.h" #if HOTENDS > 2 - #error "ZRIB V5.3 only supports up to 2 hotends. Comment out this line to continue." + #error "ZRIB V5.3 supports up to 2 hotends." #elif E_STEPPERS > 3 - #error "ZRIB V5.3 only supports up to 3 E-steppers. Comment out this line to continue." + #error "ZRIB V5.3 supports up to 3 E steppers." #endif #define BOARD_INFO_NAME "ZRIB V5.3" 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 feaa4ba98b..b68e3edb45 100644 --- a/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h +++ b/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h @@ -29,7 +29,7 @@ #include "env_validate.h" #if HOTENDS > 4 || E_STEPPERS > 4 - #error "Z-Bolt X Series board supports up to 4 hotends / E-steppers." + #error "Z-Bolt X Series supports up to 4 hotends / E steppers." #endif #define BOARD_INFO_NAME "Z-Bolt X Series" diff --git a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h index 30f209ad37..980a957a50 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h +++ b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h @@ -134,71 +134,98 @@ #define SDSS 4 #define LED_PIN 13 +/** ------ ------ + * 37 |10 9 | 35 (MISO) 50 |10 9 | 76 (SCK) + * 29 | 8 7 | 27 (EN2) 31 | 8 7 | 4 (SD_SS) + * 25 6 5 | 23 (EN1) 33 6 5 | 75 (MOSI) + * 16 | 4 3 | 17 (SDD) 49 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | -- + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_03_PIN 17 +#define EXP1_04_PIN 16 +#define EXP1_05_PIN 23 +#define EXP1_06_PIN 25 +#define EXP1_07_PIN 27 +#define EXP1_08_PIN 29 +#define EXP1_09_PIN 35 +#define EXP1_10_PIN 37 + +#define EXP2_03_PIN -1 +#define EXP2_04_PIN 49 +#define EXP2_05_PIN 75 +#define EXP2_06_PIN 33 +#define EXP2_07_PIN 4 +#define EXP2_08_PIN 31 +#define EXP2_09_PIN 76 +#define EXP2_10_PIN 74 + // // LCD / Controller // #if HAS_WIRED_LCD // ramps-fd lcd adaptor - #define BEEPER_PIN 37 - #define BTN_EN1 33 - #define BTN_EN2 31 - #define BTN_ENC 35 - #define SD_DETECT_PIN 49 + #define BEEPER_PIN EXP1_10_PIN + #define BTN_EN1 EXP2_06_PIN + #define BTN_EN2 EXP2_08_PIN + #define BTN_ENC EXP1_09_PIN + #define SD_DETECT_PIN EXP2_04_PIN #if IS_NEWPANEL - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN #endif #if ENABLED(FYSETC_MINI_12864) #define DOGLCD_CS LCD_PINS_ENABLE #define DOGLCD_A0 LCD_PINS_RS - #define DOGLCD_SCK 76 - #define DOGLCD_MOSI 75 + #define DOGLCD_SCK EXP2_09_PIN + #define DOGLCD_MOSI EXP2_05_PIN //#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 EXP1_05_PIN // Must be high or open for LCD to operate normally. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN 25 + #define RGB_LED_R_PIN EXP1_06_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN 27 + #define RGB_LED_G_PIN EXP1_07_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN 29 + #define RGB_LED_B_PIN EXP1_08_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN 25 + #define NEOPIXEL_PIN EXP1_06_PIN #endif #elif IS_NEWPANEL - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #define LCD_PINS_D7 29 + #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(MINIPANEL) - #define DOGLCD_CS 25 - #define DOGLCD_A0 27 + #define DOGLCD_CS EXP1_06_PIN + #define DOGLCD_A0 EXP1_07_PIN #endif #endif #if ANY(VIKI2, miniVIKI) - #define DOGLCD_A0 16 + #define DOGLCD_A0 EXP1_04_PIN #define KILL_PIN 51 - #define STAT_LED_BLUE_PIN 29 - #define STAT_LED_RED_PIN 23 - #define DOGLCD_CS 17 - #define DOGLCD_SCK 76 // SCK_PIN - Required for DUE Hardware SPI - #define DOGLCD_MOSI 75 // MOSI_PIN - #define DOGLCD_MISO 74 // MISO_PIN + #define STAT_LED_BLUE_PIN EXP1_08_PIN + #define STAT_LED_RED_PIN EXP1_05_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_SCK EXP2_09_PIN // SCK_PIN - Required for DUE Hardware SPI + #define DOGLCD_MOSI EXP2_05_PIN // MOSI_PIN + #define DOGLCD_MISO EXP2_10_PIN // MISO_PIN #endif #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h index 643c68ae4f..064ce2751a 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h @@ -18,19 +18,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Ported sys0724 & Vynt */ #pragma once /** * Arduino Mega? or Due with RuRAMPS4DUE pin assignments - * - * Applies to the following boards: - * RURAMPS4DUE (Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed) - * - * Differences between - * RADDS | RuRAMPS4DUE - * | + * Ported by sys0724 & Vynt */ #include "env_validate.h" @@ -153,7 +146,7 @@ // SPI for MAX Thermocouple /* #if DISABLED(SDSUPPORT) - #define TEMP_0_CS_PIN 53 + #define TEMP_0_CS_PIN EXP1_03_PIN #else #define TEMP_0_CS_PIN 49 #endif @@ -190,59 +183,87 @@ // 32Mb FLASH //#define SPI_FLASH_CS_PIN ? +/** + * ------ ------ + * (BEEPER) 62 |10 9 | 40 (BTN_ENC) (MISO) 74 |10 9 | 76 (SCK) + * (LCD_EN) 64 | 8 7 | 63 (LCD_RS) (BTN_EN1) 44 | 8 7 | 10 (SD_SS) + * (LCD_D4) 48 | 6 5 50 (LCD_D5) (BTN_EN2) 42 | 6 5 75 (MOSI) + * (LCD_D6) 52 | 4 3 | 53 (LCD_D7) (SD_DETECT) 51 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | -- + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_03_PIN 53 +#define EXP1_04_PIN 52 +#define EXP1_05_PIN 50 +#define EXP1_06_PIN 48 +#define EXP1_07_PIN 63 +#define EXP1_08_PIN 64 +#define EXP1_09_PIN 40 +#define EXP1_10_PIN 62 + +#define EXP2_03_PIN -1 // RESET +#define EXP2_04_PIN 51 +#define EXP2_05_PIN 75 // MOSI +#define EXP2_06_PIN 42 +#define EXP2_07_PIN 10 +#define EXP2_08_PIN 44 +#define EXP2_09_PIN 76 // SCK +#define EXP2_10_PIN 74 // MISO + // // LCD / Controller // #if HAS_WIRED_LCD #if ANY(RADDS_DISPLAY, IS_RRD_SC, IS_RRD_FG_SC) - #define BEEPER_PIN 62 - #define LCD_PINS_D4 48 - #define LCD_PINS_D5 50 - #define LCD_PINS_D6 52 - #define LCD_PINS_D7 53 - #define SD_DETECT_PIN 51 + #define BEEPER_PIN EXP1_10_PIN + #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN + #define SD_DETECT_PIN EXP2_04_PIN #endif #if EITHER(RADDS_DISPLAY, IS_RRD_SC) - #define LCD_PINS_RS 63 - #define LCD_PINS_ENABLE 64 + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN #elif IS_RRD_FG_SC - #define LCD_PINS_RS 52 - #define LCD_PINS_ENABLE 53 + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN #elif HAS_U8GLIB_I2C_OLED - #define BEEPER_PIN 62 - #define LCD_SDSS 10 - #define SD_DETECT_PIN 51 + #define BEEPER_PIN EXP1_10_PIN + #define LCD_SDSS EXP2_07_PIN + #define SD_DETECT_PIN EXP2_04_PIN #elif ENABLED(FYSETC_MINI_12864) - #define BEEPER_PIN 62 - #define DOGLCD_CS 64 - #define DOGLCD_A0 63 + #define BEEPER_PIN EXP1_10_PIN + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_A0 EXP1_07_PIN //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN 48 // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN 50 // D5 + #define RGB_LED_R_PIN EXP1_05_PIN // D5 #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN 52 // D6 + #define RGB_LED_G_PIN EXP1_04_PIN // D6 #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN 53 // D7 + #define RGB_LED_B_PIN EXP1_03_PIN // D7 #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN 50 // D5 + #define NEOPIXEL_PIN EXP1_05_PIN // D5 #endif #elif ENABLED(SPARK_FULL_GRAPHICS) @@ -259,9 +280,9 @@ #endif // SPARK_FULL_GRAPHICS #if IS_NEWPANEL - #define BTN_EN1 44 - #define BTN_EN2 42 - #define BTN_ENC 40 + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP1_09_PIN #endif #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h index ee741dcbf5..cc919d0a4f 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h @@ -173,74 +173,101 @@ // 32Mb FLASH //#define SPI_FLASH_CS_PIN ? +/** + * ------ ------ + * (BEEPER) 62 |10 9 | 40 (BTN_ENC) (MISO) 74 |10 9 | 76 (SCK) + * (LCD_EN) 64 | 8 7 | 63 (LCD_RS) (BTN_EN1) 44 | 8 7 | 10 (SD_SS) + * (LCD_D4) 48 | 6 5 50 (LCD_D5) (BTN_EN2) 42 | 6 5 75 (MOSI) + * (LCD_D6) 52 | 4 3 | 53 (LCD_D7) (SD_DETECT) 51 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | -- + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_03_PIN 53 +#define EXP1_04_PIN 52 +#define EXP1_05_PIN 50 +#define EXP1_06_PIN 48 +#define EXP1_07_PIN 63 +#define EXP1_08_PIN 64 +#define EXP1_09_PIN 40 +#define EXP1_10_PIN 62 + +#define EXP2_03_PIN -1 // RESET +#define EXP2_04_PIN 51 +#define EXP2_05_PIN 75 // MOSI +#define EXP2_06_PIN 42 +#define EXP2_07_PIN 10 +#define EXP2_08_PIN 44 +#define EXP2_09_PIN 76 // SCK +#define EXP2_10_PIN 74 // MISO + // // LCD / Controller // #if HAS_WIRED_LCD #if ANY(RADDS_DISPLAY, IS_RRD_SC, IS_RRD_FG_SC) - #define BEEPER_PIN 62 - #define LCD_PINS_D4 48 - #define LCD_PINS_D5 50 - #define LCD_PINS_D6 52 - #define LCD_PINS_D7 53 - #define SD_DETECT_PIN 51 + #define BEEPER_PIN EXP1_10_PIN + #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN + #define SD_DETECT_PIN EXP2_04_PIN #endif #if EITHER(RADDS_DISPLAY, IS_RRD_SC) - #define LCD_PINS_RS 63 - #define LCD_PINS_ENABLE 64 + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN #elif IS_RRD_FG_SC - #define LCD_PINS_RS 52 - #define LCD_PINS_ENABLE 53 + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN #elif HAS_U8GLIB_I2C_OLED - #define BEEPER_PIN 62 - #define LCD_SDSS 10 - #define SD_DETECT_PIN 51 + #define BEEPER_PIN EXP1_10_PIN + #define LCD_SDSS EXP2_07_PIN + #define SD_DETECT_PIN EXP2_04_PIN #elif ENABLED(FYSETC_MINI_12864) - #define BEEPER_PIN 62 - #define DOGLCD_CS 64 - #define DOGLCD_A0 63 + #define BEEPER_PIN EXP1_10_PIN + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_A0 EXP1_07_PIN //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN 48 // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN 50 // D5 + #define RGB_LED_R_PIN EXP1_05_PIN // D5 #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN 52 // D6 + #define RGB_LED_G_PIN EXP1_04_PIN // D6 #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN 53 // D7 + #define RGB_LED_B_PIN EXP1_03_PIN // D7 #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN 50 // D5 + #define NEOPIXEL_PIN EXP1_05_PIN // D5 #endif #elif ENABLED(MKS_MINI_12864) + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_05_PIN - #define DOGLCD_A0 52 - #define DOGLCD_CS 50 - - #define SD_DETECT_PIN 51 + #define SD_DETECT_PIN EXP2_04_PIN #endif #if IS_NEWPANEL - #define BTN_EN1 44 - #define BTN_EN2 42 - #define BTN_ENC 40 + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP1_09_PIN #endif #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) 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 7300919d9d..06788139f0 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h @@ -182,7 +182,9 @@ #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." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_DIP.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif #define LCD_PINS_RS PB9 #define LCD_PINS_ENABLE PB6 @@ -224,7 +226,9 @@ #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." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_SKR_E3_DIP.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif /** FYSETC TFT TFT81050 display pinout * 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 index e728af317d..fa7eb3dd11 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h @@ -150,7 +150,9 @@ * All pins are labeled as printed on DWIN PCB. Connect TX-TX, A-A and so on. */ - #error "Ender-3 V2 display requires a custom cable, see diagram above this line. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! Ender-3 V2 display requires a custom cable. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif #define BEEPER_PIN EXP1_9 #define BTN_EN1 EXP1_3 @@ -173,7 +175,9 @@ #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." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif #define LCD_PINS_RS PB9 #define LCD_PINS_ENABLE EXP1_9 @@ -201,7 +205,9 @@ #if ENABLED(TFTGLCD_PANEL_SPI) - #error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif /** * TFTGLCD_PANEL_SPI display pinout @@ -238,7 +244,9 @@ #elif ENABLED(FYSETC_MINI_12864_2_1) - #error "CAUTION! FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864_V1 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864_V1 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif /** * FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864_V1 display pinout @@ -308,7 +316,9 @@ #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." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif /** * FYSETC TFT TFT81050 display pinout diff --git a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h index ed3a653d21..9dec1e1279 100644 --- a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h +++ b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h @@ -24,7 +24,7 @@ #include "env_validate.h" #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "CCROBOT-ONLINE MEEB_3DP only supports one hotend / E-stepper. Comment out this line to continue." + #error "CCROBOT-ONLINE MEEB_3DP only supports 1 hotend / E stepper." #endif // https://github.com/ccrobot-online/MEEB_3DP diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h index 66ee8af61b..53953f9ebc 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h @@ -29,7 +29,7 @@ #include "env_validate.h" #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "Creality V24S1 only supports one hotend / E-stepper. Comment out this line to continue." + #error "Creality v24S1 only supports 1 hotend / E stepper." #endif #if BOTH(BLTOUCH, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h index 0425a45d1d..a0152a5221 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h @@ -28,7 +28,7 @@ #include "env_validate.h" #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "Creality V2.5.S1 only supports one hotend / E-stepper. Comment out this line to continue." + #error "Creality V2.5.S1 only supports 1 hotend / E stepper." #endif #define BOARD_INFO_NAME "Creality v2.5.S1" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index 5552d19ab9..cb11c3e53b 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -28,7 +28,7 @@ #include "env_validate.h" #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "Creality V4 only supports one hotend / E-stepper. Comment out this line to continue." + #error "Creality v4 only supports 1 hotend / E stepper." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h index 1c9a0a8f99..484ff65442 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h @@ -28,7 +28,7 @@ #include "env_validate.h" #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "CREALITY supports up to 1 hotends / E-steppers. Comment out this line to continue." + #error "Creality v4.2.10 only supports 1 hotend / E stepper." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h index ced64e2a89..4f57f8a805 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h @@ -26,7 +26,7 @@ */ #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "Creality v4.5.2 only supports one hotend / E-stepper. Comment out this line to continue." + #error "Creality v4.5.2 only supports 1 hotend / E stepper." #endif #define BOARD_INFO_NAME "Creality v4.5.2" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h index e7296d1ed0..6a0fa4f418 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h @@ -26,7 +26,7 @@ */ #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "Creality v4.5.3 only supports one hotend / E-stepper. Comment out this line to continue." + #error "Creality v4.5.3 only supports 1 hotend / E stepper." #endif #define BOARD_INFO_NAME "Creality v4.5.3" diff --git a/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h b/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h index 8d0093a4d9..08c9500fc5 100644 --- a/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h @@ -28,7 +28,7 @@ #include "env_validate.h" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "Eryone Ery32 mini supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "Eryone Ery32 mini supports up to 2 hotends / E steppers." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index 9efae6e3a8..dd621eb5c1 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -32,7 +32,7 @@ #if NOT_TARGET(__STM32F1__, STM32F1xx) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #elif HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "FLSUN HiSpeedV1 only supports one hotend / E-stepper. Comment out this line to continue." + #error "FLSUN HiSpeedV1 only supports 1 hotend / E stepper." #endif #define BOARD_INFO_NAME "FLSun HiSpeedV1" diff --git a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h index 86a8ed6b9a..d3cf3e5cf5 100644 --- a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h +++ b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h @@ -33,7 +33,7 @@ #include "env_validate.h" #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "JGAurora A5S A1 only supports one hotend / E-stepper. Comment out this line to continue." + #error "JGAurora A5S A1 only supports 1 hotend / E stepper." #endif #define BOARD_INFO_NAME "JGAurora A5S A1" diff --git a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h index 59d9b8d956..e6d3174653 100644 --- a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h +++ b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h @@ -28,7 +28,7 @@ #if NOT_TARGET(__STM32F1__, STM32F1xx) #error "Oops! Select a STM32F1 board in 'Tools > Board.'" #elif HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "Longer3D only supports one hotend / E-stepper. Comment out this line to continue." + #error "Longer3D only supports 1 hotend / E stepper." #endif #define BOARD_INFO_NAME "Longer3D" diff --git a/Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h b/Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h index 37c6770884..f157c8e455 100644 --- a/Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h @@ -28,7 +28,7 @@ #if NOT_TARGET(STM32F1, STM32F1xx) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #elif HOTENDS > 1 || E_STEPPERS > 1 - #error "MPX ARM Mini only supports one hotend / E-stepper. Comment out this line to continue." + #error "MPX ARM Mini only supports 1 hotend / E stepper." #endif #define BOARD_INFO_NAME "Mingda MPX ARM Mini" diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h index 6ab20681ad..2c147eb9f3 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h @@ -29,7 +29,7 @@ #if NOT_TARGET(STM32F1, STM32F1xx) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #elif HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS Robin supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "MKS Robin supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "MKS Robin" diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h index 6b05bb7a74..448e62ac8d 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h @@ -26,7 +26,7 @@ */ #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "MKS Robin E3 only supports one hotend / E-stepper. Comment out this line to continue." + #error "MKS Robin E3 only supports 1 hotend / E stepper." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h index 9d11af43ef..77c2b79215 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h @@ -26,7 +26,7 @@ */ #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "MKS Robin E3D only supports one hotend / E-stepper. Comment out this line to continue." + #error "MKS Robin E3D only supports 1 hotend / E stepper." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h index 930ef9722d..2ad68a0140 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h @@ -26,7 +26,7 @@ */ #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "MKS Robin E3D v1.1 only supports one hotend / E-stepper. Comment out this line to continue." + #error "MKS Robin E3D v1.1 only supports 1 hotend / E stepper." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index ef800b15c7..38f10f6713 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -28,7 +28,7 @@ #include "env_validate.h" #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "MKS Robin E3P only supports one hotend / E-stepper. Comment out this line to continue." + #error "MKS Robin E3P only supports 1 hotend / E stepper." #elif HAS_FSMC_TFT #error "MKS Robin E3P doesn't support FSMC-based TFT displays." #endif @@ -205,6 +205,34 @@ //#define LED_PIN PB2 +/** + * ------ ------ + * PC5 |10 9 | PE13 PA6 |10 9 | PA5 + * PD13 | 8 7 | PC6 PE8 | 8 7 | PE10 + * PE14 | 6 5 PE15 PE11 | 6 5 PA7 + * PD11 | 4 3 | PD10 PE12 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | 3.3V + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_03_PIN PD10 +#define EXP1_04_PIN PD11 +#define EXP1_05_PIN PE15 +#define EXP1_06_PIN PE14 +#define EXP1_07_PIN PC6 +#define EXP1_08_PIN PD13 +#define EXP1_09_PIN PE13 +#define EXP1_10_PIN PC5 + +#define EXP2_03_PIN -1 +#define EXP2_04_PIN PE12 +#define EXP2_05_PIN PA7 +#define EXP2_06_PIN PE11 +#define EXP2_07_PIN PE10 +#define EXP2_08_PIN PE8 +#define EXP2_09_PIN PA5 +#define EXP2_10_PIN PA6 + // // SD Card // @@ -219,11 +247,11 @@ #define ONBOARD_SD_CS_PIN PC11 #elif SD_CONNECTION_IS(LCD) #define ENABLE_SPI1 - #define SDSS PE10 - #define SD_SCK_PIN PA5 - #define SD_MISO_PIN PA6 - #define SD_MOSI_PIN PA7 - #define SD_DETECT_PIN PE12 + #define SDSS EXP2_07_PIN + #define SD_SCK_PIN EXP2_09_PIN + #define SD_MISO_PIN EXP2_10_PIN + #define SD_MOSI_PIN EXP2_05_PIN + #define SD_DETECT_PIN EXP2_04_PIN #endif // @@ -240,27 +268,26 @@ // Shared SPI TFT - #define LCD_BACKLIGHT_PIN PD13 + #define LCD_BACKLIGHT_PIN EXP1_08_PIN - #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 TOUCH_CS_PIN EXP1_06_PIN // SPI1_NSS + #define TOUCH_SCK_PIN EXP2_09_PIN // SPI1_SCK + #define TOUCH_MISO_PIN EXP2_10_PIN // SPI1_MISO + #define TOUCH_MOSI_PIN EXP2_05_PIN // SPI1_MOSI - #define BTN_EN1 PE8 - #define BTN_EN2 PE11 - #define BTN_ENC PE13 + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP1_09_PIN - #define TFT_CS_PIN PD11 - #define TFT_SCK_PIN PA5 - #define TFT_MISO_PIN PA6 - #define TFT_MOSI_PIN PA7 - #define TFT_DC_PIN PD10 - #define TFT_RST_PIN PC6 + #define TFT_CS_PIN EXP1_04_PIN + #define TFT_SCK_PIN EXP2_09_PIN + #define TFT_MISO_PIN EXP2_10_PIN + #define TFT_MOSI_PIN EXP2_05_PIN + #define TFT_DC_PIN EXP1_03_PIN #define TFT_A0_PIN TFT_DC_PIN - #define TFT_RESET_PIN PC6 - #define TFT_BACKLIGHT_PIN PD13 + #define TFT_RESET_PIN EXP1_07_PIN + #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 @@ -271,22 +298,22 @@ #if ENABLED(TFT_CLASSIC_UI) // Emulated DOGM SPI - #define LCD_PINS_ENABLE PD13 - #define LCD_PINS_RS PC6 - #define BTN_ENC PE13 - #define BTN_EN1 PE8 - #define BTN_EN2 PE11 + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN #elif ENABLED(TFT_COLOR_UI) #define TFT_BUFFER_SIZE 14400 #endif #if HAS_WIRED_LCD && !HAS_SPI_TFT - #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 BEEPER_PIN EXP1_10_PIN + #define BTN_ENC EXP1_09_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN #define LCD_BACKLIGHT_PIN -1 #if ENABLED(MKS_MINI_12864) @@ -296,18 +323,18 @@ #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 + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_05_PIN + #define DOGLCD_SCK EXP2_09_PIN + #define DOGLCD_MOSI EXP2_05_PIN #elif IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define PIN_SPI_SCK PA5 - #define PIN_TFT_MISO PA6 - #define PIN_TFT_MOSI PA7 - #define TFTGLCD_CS PE8 + #define PIN_SPI_SCK EXP2_09_PIN + #define PIN_TFT_MISO EXP2_10_PIN + #define PIN_TFT_MOSI EXP2_05_PIN + #define TFTGLCD_CS EXP2_08_PIN #endif #ifndef BEEPER_PIN @@ -315,14 +342,14 @@ #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define LCD_PINS_DC PC6 - #define DOGLCD_CS PD13 + #define LCD_PINS_DC EXP1_07_PIN + #define DOGLCD_CS EXP1_08_PIN #define DOGLCD_A0 DOGLCD_A0 #define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN PE14 - #define NEOPIXEL_PIN PE15 - #define DOGLCD_MOSI PA7 - #define DOGLCD_SCK PA5 + #define LCD_RESET_PIN EXP1_06_PIN + #define NEOPIXEL_PIN EXP1_05_PIN + #define DOGLCD_MOSI EXP2_05_PIN + #define DOGLCD_SCK EXP2_09_PIN #if SD_CONNECTION_IS(ONBOARD) #define FORCE_SOFT_SPI #endif @@ -330,11 +357,11 @@ #else // !MKS_MINI_12864 - #define LCD_PINS_D4 PE14 + #define LCD_PINS_D4 EXP1_06_PIN #if IS_ULTIPANEL - #define LCD_PINS_D5 PE15 - #define LCD_PINS_D6 PD11 - #define LCD_PINS_D7 PD10 + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder @@ -360,7 +387,7 @@ #endif #ifndef BEEPER_PIN - #define BEEPER_PIN PC5 + #define BEEPER_PIN EXP1_10_PIN #endif #if ENABLED(SPEAKER) && BEEPER_PIN == PC5 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h index 7a38507c76..13677b40a0 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h @@ -26,7 +26,7 @@ */ #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "MKS Robin E3 v1.1 only supports one hotend / E-stepper. Comment out this line to continue." + #error "MKS Robin E3 v1.1 only supports 1 hotend / E stepper." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h index 9f33d4392a..bc42bd02eb 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h @@ -24,7 +24,7 @@ #include "env_validate.h" #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "MKS Robin Lite only supports one hotend / E-stepper. Comment out this line to continue." + #error "MKS Robin Lite only supports 1 hotend / E stepper." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h index 416a061412..b1aaa53c94 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h @@ -28,7 +28,7 @@ #include "env_validate.h" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS Robin Lite3 supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "MKS Robin Lite3 supports up to 2 hotends / E steppers." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index dac09d037f..0bfc7f5c8d 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h @@ -28,7 +28,7 @@ #include "env_validate.h" #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "MKS Robin mini only supports one hotend / E-stepper. Comment out this line to continue." + #error "MKS Robin mini only supports 1 hotend / E stepper." #endif #define BOARD_INFO_NAME "MKS Robin Mini" diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index 49fe59577e..9ce5d270b5 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -28,7 +28,7 @@ #if NOT_TARGET(__STM32F1__, 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." + #error "MKS Robin nano supports up to 2 hotends / E steppers." #elif HAS_FSMC_TFT #error "MKS Robin nano v2 doesn't support FSMC-based TFT displays." #endif @@ -282,11 +282,10 @@ #define TFT_MISO_PIN PA6 #define TFT_MOSI_PIN PA7 #define TFT_DC_PIN PD10 - #define TFT_RST_PIN PC6 #define TFT_A0_PIN TFT_DC_PIN #define TFT_RESET_PIN PC6 - #define TFT_BACKLIGHT_PIN PD13 + #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h index 2040a4ba29..0eb7bbdffe 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h @@ -26,7 +26,7 @@ */ #if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS Robin nano supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "MKS Robin nano boards support up to 2 hotends / E steppers." #endif #define BOARD_NO_NATIVE_USB diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h index 53f207adb7..1db2d0c5dd 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h @@ -28,7 +28,7 @@ #include "env_validate.h" #if HOTENDS > 3 || E_STEPPERS > 3 - #error "MKS Robin pro supports up to 3 hotends / E-steppers. Comment out this line to continue." + #error "MKS Robin pro supports up to 3 hotends / E steppers." #endif #define BOARD_INFO_NAME "MKS Robin pro" diff --git a/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h b/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h index 98ef165e2d..ad28e5c47b 100644 --- a/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h +++ b/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h @@ -173,7 +173,9 @@ #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." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_PANDA_PI_V29.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif /** FYSETC TFT TFT81050 display pinout * diff --git a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h index 4ffa8da924..73f61c1aca 100644 --- a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h @@ -31,7 +31,7 @@ #include "env_validate.h" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "Trigorilla Pro supports up to 2 hotends / E-steppers. Comment out this line to continue." + #error "Trigorilla Pro supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "Trigorilla Pro" diff --git a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h index 09da5adf7c..01ca4560fe 100644 --- a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h +++ b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h @@ -24,7 +24,7 @@ #include "env_validate.h" #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "Anet ET4 only supports one hotend / E-stepper. Comment out this line to continue." + #error "Anet ET4 only supports 1 hotend / E stepper." #endif #ifndef BOARD_INFO_NAME @@ -64,7 +64,7 @@ // Z Probe // #if ENABLED(BLTOUCH) - #error "You will need to use 24V to 5V converter and remove one resistor and capacitor from the motherboard. See https://github.com/davidtgbe/Marlin/blob/bugfix-2.0.x/docs/Tutorials/bltouch-en.md for more information. Comment out this line to proceed at your own risk." + #error "You will need to use 24V to 5V converter and remove one resistor and capacitor from the motherboard. See https://bit.ly/3xg9cXO for more information. Comment out this line to proceed at your own risk." #define SERVO0_PIN PC3 #elif !defined(Z_MIN_PROBE_PIN) #define Z_MIN_PROBE_PIN PC3 diff --git a/Marlin/src/pins/stm32f4/pins_ARMED.h b/Marlin/src/pins/stm32f4/pins_ARMED.h index 6d5b87240d..d08d3fb66c 100644 --- a/Marlin/src/pins/stm32f4/pins_ARMED.h +++ b/Marlin/src/pins/stm32f4/pins_ARMED.h @@ -27,7 +27,7 @@ #include "env_validate.h" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "Arm'ed supports up to 2 hotends / E-steppers." + #error "Arm'ed supports up to 2 hotends / E steppers." #endif #ifndef ARMED_V1_0 diff --git a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h index 653735bd61..47d009c5a6 100644 --- a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h +++ b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h @@ -24,7 +24,7 @@ #include "env_validate.h" #if HOTENDS > 1 || E_STEPPERS > 1 - #error "Artillery Ruby supports up to 1 hotends / E-steppers." + #error "Artillery Ruby only supports 1 hotend / E stepper." #endif #define BOARD_INFO_NAME "Artillery Ruby" diff --git a/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h b/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h index 9da6e1a01b..c49abca9ef 100644 --- a/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h +++ b/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h @@ -31,7 +31,7 @@ #include "env_validate.h" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "Black STM32F4VET6 supports up to 2 hotends / E-steppers." + #error "Black STM32F4VET6 supports up to 2 hotends / E steppers." #endif #ifndef BOARD_INFO_NAME 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 99de2e43e7..531ab7a958 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h @@ -24,7 +24,7 @@ #include "env_validate.h" #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "BIGTREE BTT002 V1.0 only supports one hotend / E-stepper. Comment out this line to continue." + #error "BIGTREE BTT002 V1.0 only supports 1 hotend / E stepper." #endif #define BOARD_INFO_NAME "BTT BTT002 V1.0" diff --git a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h index 40f953a7e8..c7cd35c7ad 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h @@ -211,7 +211,9 @@ #if ENABLED(LCD_FOR_MELZI) - #error "CAUTION! LCD_FOR_MELZI requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! LCD_FOR_MELZI requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif /** LCD_FOR_MELZI display pinout * @@ -245,7 +247,9 @@ #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_E3_RRF.h' for details. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif #define LCD_PINS_RS PE10 #define LCD_PINS_ENABLE PE9 @@ -273,7 +277,9 @@ #if ENABLED(TFTGLCD_PANEL_SPI) - #error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif /** * TFTGLCD_PANEL_SPI display pinout @@ -327,7 +333,9 @@ #if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif /** FYSETC TFT TFT81050 display pinout * 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 68d92e1c30..b9525a9267 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -26,7 +26,7 @@ #if E_STEPPERS > MAX_E_STEPPERS #error "Marlin extruder/hotends limit! Increase MAX_E_STEPPERS to continue." #elif HOTENDS > 8 || E_STEPPERS > 8 - #error "BIGTREE GTR V1.0 supports up to 8 hotends / E-steppers." + #error "BIGTREE GTR V1.0 supports up to 8 hotends / E steppers." #endif #define BOARD_INFO_NAME "BTT GTR V1.0" 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 fb4b17b6fb..8a918835f7 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 @@ -22,7 +22,7 @@ #pragma once #if HOTENDS > 3 || E_STEPPERS > 3 - #error "BIGTREE SKR Pro V1.1 supports up to 3 hotends / E-steppers." + #error "BIGTREE SKR Pro V1.1 supports up to 3 hotends / E steppers." #endif #define BOARD_INFO_NAME "BTT SKR Pro V1.1" 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 index 615751b62d..c88483f73e 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_2.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_2.h @@ -22,7 +22,7 @@ #pragma once #if HOTENDS > 3 || E_STEPPERS > 3 - #error "BIGTREE SKR Pro V1.2 supports up to 3 hotends / E-steppers." + #error "BIGTREE SKR Pro V1.2 supports up to 3 hotends / E steppers." #endif #define BOARD_INFO_NAME "BTT SKR Pro V1.2" diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h index 5e424d4105..7c902b008c 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h @@ -456,7 +456,9 @@ #elif ENABLED(WYH_L12864) - #error "CAUTION! WYH_L12864 requires wiring modifications. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! WYH_L12864 requires wiring modifications. See 'pins_BTT_SKR_PRO_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif /** * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h index d526c75b63..4e311d4862 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h @@ -527,6 +527,11 @@ #endif #if HAS_SPI_TFT + + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP1_09_PIN + // // e.g., BTT_TFT35_SPI_V1_0 (480x320, 3.5", SPI Stock Display with Rotary Encoder in BIQU B1 SE) // @@ -542,9 +547,6 @@ #define TOUCH_SCK_PIN EXP1_06_PIN #define TOUCH_CS_PIN EXP1_07_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - #define BTN_ENC EXP1_09_PIN #endif // diff --git a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h index 3f5f7262b3..11b5dbbb6c 100644 --- a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h +++ b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h @@ -25,7 +25,7 @@ #include "env_validate.h" #if HOTENDS > 6 || E_STEPPERS > 6 - #error "FLYF407ZG supports up to 6 hotends / E-steppers." + #error "FLYF407ZG supports up to 6 hotends / E steppers." #endif #define BOARD_INFO_NAME "FLYF407ZG" diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h index 299cc15377..3ed18f9abc 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h @@ -24,7 +24,7 @@ #include "env_validate.h" #if HOTENDS > 3 || E_STEPPERS > 3 - #error "FYSETC S6 supports up to 3 hotends / E-steppers." + #error "FYSETC S6 supports up to 3 hotends / E steppers." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER.h b/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER.h index 67f276bd22..009bfb248d 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER.h @@ -117,7 +117,7 @@ #endif #if HOTENDS > 3 || E_STEPPERS > 3 - #error "FYSETC SPIDER supports up to 3 hotends / E-steppers." + #error "FYSETC SPIDER supports up to 3 hotends / E steppers." #else #include "pins_FYSETC_S6.h" #endif diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_K.h b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h index 099b3b79a4..6c6f8d25ea 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_K.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h @@ -25,7 +25,7 @@ #include "env_validate.h" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "LERDGE K supports up to 2 hotends / E-steppers." + #error "LERDGE K supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "Lerdge K" diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_S.h b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h index 0e8b6e09a8..376c2f3f27 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_S.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h @@ -25,7 +25,7 @@ #include "env_validate.h" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "LERDGE S supports up to 2 hotends / E-steppers." + #error "LERDGE S supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "Lerdge S" diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_X.h b/Marlin/src/pins/stm32f4/pins_LERDGE_X.h index 5048933146..6325697655 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_X.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_X.h @@ -25,7 +25,7 @@ #include "env_validate.h" #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "LERDGE X only supports one hotend / E-stepper. Comment out this line to continue." + #error "LERDGE X only supports 1 hotend / E stepper." #endif #define BOARD_INFO_NAME "Lerdge X" diff --git a/Marlin/src/pins/stm32f4/pins_MKS_EAGLE.h b/Marlin/src/pins/stm32f4/pins_MKS_EAGLE.h index 50f06b7e81..ecea8e182b 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_EAGLE.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_EAGLE.h @@ -25,7 +25,7 @@ #include "env_validate.h" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS Eagle supports up to 2 hotends / E-steppers." + #error "MKS Eagle supports up to 2 hotends / E steppers." #elif HAS_FSMC_TFT #error "MKS Eagle doesn't support FSMC-based TFT displays." #endif diff --git a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h index 124923fef8..e55f3170d0 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h @@ -25,7 +25,7 @@ #include "env_validate.h" #if HOTENDS > 3 || E_STEPPERS > 5 - #error "MKS Monster supports up to 3 hotends and 5 E-steppers." + #error "MKS Monster supports up to 3 hotends and 5 E steppers." #elif HAS_FSMC_TFT #error "MKS Monster doesn't support FSMC-based TFT displays." #endif @@ -289,16 +289,16 @@ #define TFT_MISO_PIN EXP2_10_PIN #define TFT_MOSI_PIN EXP2_05_PIN #define TFT_DC_PIN EXP1_03_PIN - #define TFT_RST_PIN EXP1_07_PIN #define TFT_A0_PIN TFT_DC_PIN #define TFT_RESET_PIN EXP1_07_PIN - #define TFT_BACKLIGHT_PIN EXP1_08_PIN + + #define LCD_BACKLIGHT_PIN EXP1_08_PIN + #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 - #define LCD_BACKLIGHT_PIN EXP1_08_PIN #ifndef TFT_WIDTH #define TFT_WIDTH 480 #endif diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h index 589300f341..2274d0c0df 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h @@ -24,7 +24,7 @@ #include "env_validate.h" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS_ROBIN2 supports up to 2 hotends / E-steppers." + #error "MKS_ROBIN2 supports up to 2 hotends / E steppers." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h index 02140865f9..32d8a47488 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h @@ -25,7 +25,7 @@ #include "env_validate.h" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS Robin Nano V3 supports up to 2 hotends / E-steppers." + #error "MKS Robin Nano V3 supports up to 2 hotends / E steppers." #elif HAS_FSMC_TFT #error "MKS Robin Nano V3 doesn't support FSMC-based TFT displays." #endif diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h index ead8799f5e..989010e47f 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h @@ -283,16 +283,16 @@ #define TFT_MISO_PIN EXP2_10_PIN #define TFT_MOSI_PIN EXP2_05_PIN #define TFT_DC_PIN EXP1_03_PIN - #define TFT_RST_PIN EXP1_07_PIN #define TFT_A0_PIN TFT_DC_PIN #define TFT_RESET_PIN EXP1_07_PIN - #define TFT_BACKLIGHT_PIN EXP1_08_PIN + + #define LCD_BACKLIGHT_PIN EXP1_08_PIN + #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 - #define LCD_BACKLIGHT_PIN EXP1_08_PIN #ifndef TFT_WIDTH #define TFT_WIDTH 480 #endif diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h index fde2682dc0..1627bb909b 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h @@ -25,7 +25,7 @@ #include "env_validate.h" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS Robin Nano V3 supports up to 1 hotends / E-steppers." + #error "MKS Robin Nano V3 supports up to 2 hotends / E steppers." #endif #define BOARD_INFO_NAME "MKS Robin PRO V2" @@ -305,16 +305,15 @@ #define TFT_MISO_PIN EXP2_10_PIN #define TFT_MOSI_PIN EXP2_05_PIN #define TFT_DC_PIN EXP1_03_PIN - #define TFT_RST_PIN EXP1_07_PIN #define TFT_A0_PIN TFT_DC_PIN #define TFT_RESET_PIN EXP1_07_PIN - #define TFT_BACKLIGHT_PIN EXP1_08_PIN + #define LCD_BACKLIGHT_PIN EXP1_08_PIN + #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 - #define LCD_BACKLIGHT_PIN EXP1_08_PIN #ifndef TFT_WIDTH #define TFT_WIDTH 480 #endif diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h index 873a4d4ad3..12871becbb 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h @@ -28,7 +28,7 @@ #include "env_validate.h" #if HOTENDS > 3 || E_STEPPERS > 3 - #error "RUMBA32 boards support up to 3 hotends / E-steppers." + #error "RUMBA32 boards support up to 3 hotends / E steppers." #endif #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f4/pins_VAKE403D.h b/Marlin/src/pins/stm32f4/pins_VAKE403D.h index 813944d3cb..66caec588f 100644 --- a/Marlin/src/pins/stm32f4/pins_VAKE403D.h +++ b/Marlin/src/pins/stm32f4/pins_VAKE403D.h @@ -25,7 +25,7 @@ #include "env_validate.h" #if HOTENDS > 2 || E_STEPPERS > 2 - #error "STM32F4 supports up to 2 hotends / E-steppers." + #error "STM32F4 VAkE supports up to 2 hotends / E steppers." #endif #define DEFAULT_MACHINE_NAME "STM32F446VET6" @@ -161,27 +161,61 @@ #define POWER_LOSS_PIN PA4 // ?? Power loss / nAC_FAULT #if ENABLED(SDSUPPORT) - #define SD_DETECT_PIN PB7 - #define SD_SS_PIN PB_15 // USD_CS -> CS for onboard SD + #define SD_DETECT_PIN EXP2_04_PIN + #define SD_SS_PIN PB15 // USD_CS -> CS for onboard SD #endif +/** + * ------ ------ + * PC9 |10 9 | PB12 ? |10 9 | ? + * PD7 | 8 7 | PC12 PD6 | 8 7 | ? + * PD1 | 6 5 PD2 PD0 | 6 5 ? + * PD3 | 4 3 | PD4 PB7 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | 3.3V + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_03_PIN PD4 +#define EXP1_04_PIN PD3 +#define EXP1_05_PIN PD2 +#define EXP1_06_PIN PD1 +#define EXP1_07_PIN PC12 +#define EXP1_08_PIN PD7 +#define EXP1_09_PIN PB12 +#define EXP1_10_PIN PC9 + +#define EXP2_03_PIN -1 +#define EXP2_04_PIN PB7 +//#define EXP2_05_PIN ? +#define EXP2_06_PIN PD0 +//#define EXP2_07_PIN ? +#define EXP2_08_PIN PD6 +//#define EXP2_09_PIN ? +//#define EXP2_10_PIN ? + // // LCD / Controller // #if HAS_WIRED_LCD + #if ENABLED(SDSUPPORT) #define SDSS PB6 // CS for SD card in LCD #endif - #define BEEPER_PIN PC9 - #define LCD_PINS_RS PC12 - #define LCD_PINS_ENABLE PD7 - #define LCD_PINS_D4 PD1 - #define LCD_PINS_D5 PD2 - #define LCD_PINS_D6 PD3 - #define LCD_PINS_D7 PD4 - #define BTN_EN1 PD6 - #define BTN_EN2 PD0 - #define BTN_ENC PB12 + + #define BEEPER_PIN EXP1_10_PIN + + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP1_09_PIN + + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_RS EXP1_07_PIN + + #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN + #endif // Alter timing for graphical display diff --git a/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h b/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h index 5bfc2551ac..c4feba692f 100644 --- a/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h +++ b/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h @@ -33,7 +33,7 @@ #endif #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "RemRam only supports one hotend / E-stepper. Comment out this line to continue." + #error "RemRam only supports 1 hotend / E stepper." #endif // diff --git a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h index 4fc3504ed1..769f10c8a4 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h @@ -170,7 +170,9 @@ * All pins are labeled as printed on DWIN PCB. Connect TX-TX, A-A and so on. */ - #error "DWIN_CREALITY_LCD requires a custom cable, see diagram above this line. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! DWIN_CREALITY_LCD requires a custom cable, see diagram above this line. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif #define BEEPER_PIN EXP1_09_PIN #define BTN_EN1 EXP1_03_PIN @@ -193,7 +195,9 @@ #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." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif #define LCD_PINS_RS PB9 #define LCD_PINS_ENABLE EXP1_09_PIN @@ -221,7 +225,9 @@ #if ENABLED(TFTGLCD_PANEL_SPI) - #error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif /** * TFTGLCD_PANEL_SPI display pinout @@ -258,7 +264,9 @@ #elif ENABLED(FYSETC_MINI_12864_2_1) - #error "CAUTION! FYSETC_MINI_12864_2_1 and clones require wiring modifications. See 'pins_BTT_SKR_MINI_E3_V3_0.h' for details. Comment out this line to continue." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! FYSETC_MINI_12864_2_1 and clones require wiring modifications. See 'pins_BTT_SKR_MINI_E3_V3_0.h' for details. Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning" + #endif /** * @@ -307,7 +315,9 @@ #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." + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif /** * FYSETC TFT TFT81050 display pinout diff --git a/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h b/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h index f48c007d8c..5a772eb21b 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h @@ -50,8 +50,6 @@ #define LED_PIN PA13 #define BEEPER_PIN PA14 -#define TFT_BACKLIGHT_PIN PB5 - #define POWER_MONITOR_PIN PB0 #define RPI_POWER_PIN PE5 diff --git a/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0.h b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0.h new file mode 100644 index 0000000000..d835486085 --- /dev/null +++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0.h @@ -0,0 +1,26 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#define BOARD_INFO_NAME "BTT SKR V3" + +#include "pins_BTT_SKR_V3_0_common.h" diff --git a/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_EZ.h b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_EZ.h new file mode 100644 index 0000000000..003f20f5cf --- /dev/null +++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_EZ.h @@ -0,0 +1,26 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#define BOARD_INFO_NAME "BTT SKR V3 EZ" + +#include "pins_BTT_SKR_V3_0_common.h" diff --git a/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h new file mode 100644 index 0000000000..02e195a185 --- /dev/null +++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h @@ -0,0 +1,569 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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 NOT_TARGET(STM32H7) + #error "Oops! Select an STM32H7 board in 'Tools > Board.'" +#endif + +// If you have the BigTreeTech driver expansion module, enable BTT_MOTOR_EXPANSION +// https://github.com/bigtreetech/BTT-Expansion-module/tree/master/BTT%20EXP-MOT +//#define BTT_MOTOR_EXPANSION + +#if BOTH(HAS_WIRED_LCD, BTT_MOTOR_EXPANSION) + #if EITHER(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY) + #define EXP_MOT_USE_EXP2_ONLY 1 + #else + #error "You can't use both an LCD and a Motor Expansion Module on EXP1/EXP2 at the same time." + #endif +#endif + +#define USES_DIAG_JUMPERS + +// Onboard I2C EEPROM +#if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM) + #undef NO_EEPROM_SELECTED + #define I2C_EEPROM + #define SOFT_I2C_EEPROM // Force the use of Software I2C + #define I2C_SCL_PIN PA14 + #define I2C_SDA_PIN PA13 + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif + +// +// Servos +// +#define SERVO0_PIN PE5 + +// +// Trinamic Stallguard pins +// +#define X_DIAG_PIN PC1 // X-STOP +#define Y_DIAG_PIN PC3 // Y-STOP +#define Z_DIAG_PIN PC0 // Z-STOP +#define E0_DIAG_PIN PC2 // E0DET +#define E1_DIAG_PIN PA0 // E1DET + +// +// Limit Switches +// +#ifdef X_STALL_SENSITIVITY + #define X_STOP_PIN X_DIAG_PIN + #if X_HOME_TO_MIN + #define X_MAX_PIN PC2 // E0DET + #else + #define X_MIN_PIN PC2 // E0DET + #endif +#elif ENABLED(X_DUAL_ENDSTOPS) + #ifndef X_MIN_PIN + #define X_MIN_PIN PC1 // X-STOP + #endif + #ifndef X_MAX_PIN + #define X_MAX_PIN PC2 // E0DET + #endif +#else + #define X_STOP_PIN PC1 // X-STOP +#endif + +#ifdef Y_STALL_SENSITIVITY + #define Y_STOP_PIN Y_DIAG_PIN + #if Y_HOME_TO_MIN + #define Y_MAX_PIN PA0 // E1DET + #else + #define Y_MIN_PIN PA0 // E1DET + #endif +#elif ENABLED(Y_DUAL_ENDSTOPS) + #ifndef Y_MIN_PIN + #define Y_MIN_PIN PC3 // Y-STOP + #endif + #ifndef Y_MAX_PIN + #define Y_MAX_PIN PA0 // E1DET + #endif +#else + #define Y_STOP_PIN PC3 // Y-STOP +#endif + +#ifdef Z_STALL_SENSITIVITY + #define Z_STOP_PIN Z_DIAG_PIN + #if Z_HOME_TO_MIN + #define Z_MAX_PIN PC15 // PWRDET + #else + #define Z_MIN_PIN PC15 // PWRDET + #endif +#elif ENABLED(Z_MULTI_ENDSTOPS) + #ifndef Z_MIN_PIN + #define Z_MIN_PIN PC0 // Z-STOP + #endif + #ifndef Z_MAX_PIN + #define Z_MAX_PIN PC15 // PWRDET + #endif +#else + #ifndef Z_STOP_PIN + #define Z_STOP_PIN PC0 // Z-STOP + #endif +#endif + +// +// Z Probe (when not Z_MIN_PIN) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN PC13 +#endif + +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) + #ifndef PROBE_ENABLE_PIN + #define PROBE_ENABLE_PIN SERVO0_PIN + #endif +#endif + +// +// Filament Runout Sensor +// +#define FIL_RUNOUT_PIN PC2 // E0DET +#define FIL_RUNOUT2_PIN PA0 // E1DET + +// +// Power Supply Control +// +#ifndef PS_ON_PIN + #define PS_ON_PIN PE4 // PS-ON +#endif + +// +// Power Loss Detection +// +#ifndef POWER_LOSS_PIN + #define POWER_LOSS_PIN PC15 // PWRDET +#endif + +// +// Steppers +// +#define X_STEP_PIN PD4 +#define X_DIR_PIN PD3 +#define X_ENABLE_PIN PD6 +#ifndef X_CS_PIN + #define X_CS_PIN PD5 +#endif + +#define Y_STEP_PIN PA15 +#define Y_DIR_PIN PA8 +#define Y_ENABLE_PIN PD1 +#ifndef Y_CS_PIN + #define Y_CS_PIN PD0 +#endif + +#define Z_STEP_PIN PE2 +#define Z_DIR_PIN PE3 +#define Z_ENABLE_PIN PE0 +#ifndef Z_CS_PIN + #define Z_CS_PIN PE1 +#endif + +#ifndef E0_STEP_PIN + #define E0_STEP_PIN PD15 +#endif +#ifndef E0_DIR_PIN + #define E0_DIR_PIN PD14 +#endif +#ifndef E0_ENABLE_PIN + #define E0_ENABLE_PIN PC7 +#endif +#ifndef E0_CS_PIN + #define E0_CS_PIN PC6 +#endif + +#ifndef E1_STEP_PIN + #define E1_STEP_PIN PD11 +#endif +#ifndef E1_DIR_PIN + #define E1_DIR_PIN PD10 +#endif +#ifndef E1_ENABLE_PIN + #define E1_ENABLE_PIN PD13 +#endif +#ifndef E1_CS_PIN + #define E1_CS_PIN PD12 +#endif + +// +// Temperature Sensors +// +#ifndef TEMP_0_PIN + #define TEMP_0_PIN PA2 // TH0 +#endif +#ifndef TEMP_1_PIN + #define TEMP_1_PIN PA3 // TH1 +#endif +#ifndef TEMP_BED_PIN + #define TEMP_BED_PIN PA1 // TB +#endif + +#if HOTENDS == 1 && DISABLED(HEATERS_PARALLEL) + #if TEMP_SENSOR_PROBE + #define TEMP_PROBE_PIN TEMP_1_PIN + #elif TEMP_SENSOR_CHAMBER + #define TEMP_CHAMBER_PIN TEMP_1_PIN + #endif +#endif + +// +// Heaters / Fans +// +#ifndef HEATER_0_PIN + #define HEATER_0_PIN PB3 // Heater0 +#endif +#ifndef HEATER_1_PIN + #define HEATER_1_PIN PB4 // Heater1 +#endif +#ifndef HEATER_BED_PIN + #define HEATER_BED_PIN PD7 // Hotbed +#endif +#ifndef FAN_PIN + #define FAN_PIN PB7 // Fan0 +#endif + +#if HAS_CUTTER + #ifndef SPINDLE_LASER_PWM_PIN + #define SPINDLE_LASER_PWM_PIN PB5 + #endif + #ifndef SPINDLE_LASER_ENA_PIN + #define SPINDLE_LASER_ENA_PIN PB6 + #endif +#else + #ifndef FAN1_PIN + #define FAN1_PIN PB6 // Fan1 + #endif + #ifndef FAN2_PIN + #define FAN2_PIN PB5 // Fan2 + #endif +#endif // SPINDLE_FEATURE || LASER_FEATURE + +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PE13 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PE15 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PE14 + #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 Serial1 + //#define X2_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Y2_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define Z2_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial1 + //#define E2_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 + //#define E4_HARDWARE_SERIAL Serial1 + + // + // Software serial + // + #define X_SERIAL_TX_PIN PD5 + #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN + + #define Y_SERIAL_TX_PIN PD0 + #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN + + #define Z_SERIAL_TX_PIN PE1 + #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN + + #define E0_SERIAL_TX_PIN PC6 + #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN + + #define E1_SERIAL_TX_PIN PD12 + #define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + +// +// SD Connection +// +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +/** + * ------ ------ + * (BEEPER) PC5 |10 9 | PB0 (BTN_ENC) (MISO) PA6 |10 9 | PA5 (SCK) + * (LCD_EN) PB1 | 8 7 | PE8 (LCD_RS) (BTN_EN1) PE7 | 8 7 | PA4 (SD_SS) + * (LCD_D4) PE9 | 6 5 PE10 (LCD_D5) (BTN_EN2) PB2 | 6 5 PA7 (MOSI) + * (LCD_D6) PE11 | 4 3 | PE12 (LCD_D7) (SD_DETECT) PC4 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | -- + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_03_PIN PE12 +#define EXP1_04_PIN PE11 +#define EXP1_05_PIN PE10 +#define EXP1_06_PIN PE9 +#define EXP1_07_PIN PE8 +#define EXP1_08_PIN PB1 +#define EXP1_09_PIN PB0 +#define EXP1_10_PIN PC5 + +#define EXP2_03_PIN -1 +#define EXP2_04_PIN PC4 +#define EXP2_05_PIN PA7 +#define EXP2_06_PIN PB2 +#define EXP2_07_PIN PA4 +#define EXP2_08_PIN PE7 +#define EXP2_09_PIN PA5 +#define EXP2_10_PIN PA6 + +// +// Onboard SD card +// Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2 +// +#if SD_CONNECTION_IS(LCD) + #define SDSS EXP2_07_PIN + #define SD_SS_PIN SDSS + #define SD_SCK_PIN EXP2_09_PIN + #define SD_MISO_PIN EXP2_10_PIN + #define SD_MOSI_PIN EXP2_05_PIN + #define SD_DETECT_PIN EXP2_04_PIN +#elif SD_CONNECTION_IS(ONBOARD) + #define SDIO_SUPPORT + #define SDIO_CLOCK 24000000 // 24MHz +#elif SD_CONNECTION_IS(CUSTOM_CABLE) + #error "No custom SD drive cable defined for this board." +#endif + +#if ENABLED(BTT_MOTOR_EXPANSION) + /** ----- ----- + * -- | . . | GND -- | . . | GND + * -- | . . | M1EN M2EN | . . | M3EN + * M1STP | . . M1DIR M1RX | . . M1DIAG + * M2DIR | . . | M2STP M2RX | . . | M2DIAG + * M3DIR | . . | M3STP M3RX | . . | M3DIAG + * ----- ----- + * EXP2 EXP1 + * + * NB In EXP_MOT_USE_EXP2_ONLY mode EXP1 is not used and M2EN and M3EN need to be jumpered to M1EN + */ + + // M1 on Driver Expansion Module + #define E2_STEP_PIN EXP2_05_PIN + #define E2_DIR_PIN EXP2_06_PIN + #define E2_ENABLE_PIN EXP2_04_PIN + #if !EXP_MOT_USE_EXP2_ONLY + #define E2_DIAG_PIN EXP1_06_PIN + #define E2_CS_PIN EXP1_05_PIN + #if HAS_TMC_UART + #define E2_SERIAL_TX_PIN EXP1_05_PIN + #define E2_SERIAL_RX_PIN EXP1_05_PIN + #endif + #endif + + // M2 on Driver Expansion Module + #define E3_STEP_PIN EXP2_08_PIN + #define E3_DIR_PIN EXP2_07_PIN + #if !EXP_MOT_USE_EXP2_ONLY + #define E3_ENABLE_PIN EXP1_03_PIN + #define E3_DIAG_PIN EXP1_08_PIN + #define E3_CS_PIN EXP1_07_PIN + #if HAS_TMC_UART + #define E3_SERIAL_TX_PIN EXP1_07_PIN + #define E3_SERIAL_RX_PIN EXP1_07_PIN + #endif + #else + #define E3_ENABLE_PIN EXP2_04_PIN + #endif + + // M3 on Driver Expansion Module + #define E4_STEP_PIN EXP2_10_PIN + #define E4_DIR_PIN EXP2_09_PIN + #if !EXP_MOT_USE_EXP2_ONLY + #define E4_ENABLE_PIN EXP1_04_PIN + #define E4_DIAG_PIN EXP1_10_PIN + #define E4_CS_PIN EXP1_09_PIN + #if HAS_TMC_UART + #define E4_SERIAL_TX_PIN EXP1_09_PIN + #define E4_SERIAL_RX_PIN EXP1_09_PIN + #endif + #else + #define E4_ENABLE_PIN EXP2_04_PIN + #endif + +#endif // BTT_MOTOR_EXPANSION + +// +// LCDs and Controllers +// +#if IS_TFTGLCD_PANEL + + #if ENABLED(TFTGLCD_PANEL_SPI) + #define TFTGLCD_CS EXP2_08_PIN + #endif + +#elif HAS_WIRED_LCD + + #define BEEPER_PIN EXP1_10_PIN + #define BTN_ENC EXP1_09_PIN + + #if ENABLED(CR10_STOCKDISPLAY) + + #define LCD_PINS_RS EXP1_04_PIN + + #define BTN_EN1 EXP1_08_PIN + #define BTN_EN2 EXP1_06_PIN + + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + + #elif ENABLED(MKS_MINI_12864) + + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_05_PIN + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + + #else + + #define LCD_PINS_RS EXP1_07_PIN + + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN + + #if ENABLED(FYSETC_MINI_12864) + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_A0 EXP1_07_PIN + //#define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN EXP1_06_PIN // 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 EXP1_05_PIN + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN EXP1_04_PIN + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN EXP1_03_PIN + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN EXP1_05_PIN + #endif + #endif // !FYSETC_MINI_12864 + + #if IS_ULTIPANEL + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + + #endif + + #endif + +#endif // HAS_WIRED_LCD + +// Alter timing for graphical display +#if IS_U8GLIB_ST7920 + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 120 + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 80 + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 580 + #endif +#endif + +#if HAS_SPI_TFT + // + // e.g., BTT_TFT35_SPI_V1_0 (480x320, 3.5", SPI Stock Display with Rotary Encoder in BIQU B1 SE) + // + #define TFT_CS_PIN EXP2_07_PIN + #define TFT_A0_PIN EXP2_04_PIN + #define TFT_SCK_PIN EXP2_09_PIN + #define TFT_MISO_PIN EXP2_10_PIN + #define TFT_MOSI_PIN EXP2_05_PIN + + #define TOUCH_INT_PIN EXP1_04_PIN + #define TOUCH_MISO_PIN EXP1_05_PIN + #define TOUCH_MOSI_PIN EXP1_08_PIN + #define TOUCH_SCK_PIN EXP1_06_PIN + #define TOUCH_CS_PIN EXP1_07_PIN + + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP1_09_PIN +#endif + +// +// NeoPixel LED +// +#ifndef NEOPIXEL_PIN + #define NEOPIXEL_PIN PE6 +#endif + +// +// WIFI +// + +/** + * ------- + * GND | 9 | | 8 | 3.3V + * (ESP-CS) PB12 | 10 | | 7 | PB15 (ESP-MOSI) + * 3.3V | 11 | | 6 | PB14 (ESP-MISO) + * (ESP-IO0) PB10 | 12 | | 5 | PB13 (ESP-CLK) + * (ESP-IO4) PB11 | 13 | | 4 | -- + * -- | 14 | | 3 | 3.3V (ESP-EN) + * (ESP-RX) PD8 | 15 | | 2 | -- + * (ESP-TX) PD9 | 16 | | 1 | PC14 (ESP-RST) + * ------- + * WIFI + */ +#define ESP_WIFI_MODULE_COM 3 // 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 PC14 +#define ESP_WIFI_MODULE_GPIO0_PIN PB10 +#define ESP_WIFI_MODULE_GPIO4_PIN PB11 diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index ec5f1a9709..5e03795692 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -171,7 +171,7 @@ CardReader::CardReader() { workDirDepth = 0; ZERO(workDirParents); - #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) + #if BOTH(SDSUPPORT, HAS_SD_DETECT) SET_INPUT_PULLUP(SD_DETECT_PIN); #endif @@ -456,10 +456,11 @@ void CardReader::mount() { if (flag.mounted) cdroot(); - #if ENABLED(USB_FLASH_DRIVE_SUPPORT) || PIN_EXISTS(SD_DETECT) - else if (marlin_state != MF_INITIALIZING) - LCD_ALERTMESSAGE(MSG_MEDIA_INIT_FAIL); - #endif + else { + #if EITHER(HAS_SD_DETECT, USB_FLASH_DRIVE_SUPPORT) + if (marlin_state != MF_INITIALIZING) LCD_ALERTMESSAGE(MSG_MEDIA_INIT_FAIL); + #endif + } ui.refresh(); } @@ -472,48 +473,60 @@ void CardReader::mount() { #endif void CardReader::manage_media() { - static uint8_t prev_stat = 2; // First call, no prior state + static uint8_t prev_stat = 2; // At boot we don't know if media is present or not uint8_t stat = uint8_t(IS_SD_INSERTED()); - if (stat == prev_stat) return; + if (stat == prev_stat) return; // Already checked and still no change? - DEBUG_SECTION(mm, "CardReader::manage_media", true); - DEBUG_ECHOLNPGM("SD Status ", prev_stat, " -> ", stat); - - flag.workDirIsRoot = true; // Return to root on mount/release + DEBUG_SECTION(cmm, "CardReader::manage_media()", true); + DEBUG_ECHOLNPGM("Media present: ", prev_stat, " -> ", stat); if (!ui.detected()) { DEBUG_ECHOLNPGM("SD: No UI Detected."); return; } - uint8_t old_stat = prev_stat; - prev_stat = stat; // Change now to prevent re-entry + flag.workDirIsRoot = true; // Return to root on mount/release/init + + const uint8_t old_stat = prev_stat; + prev_stat = stat; // Change now to prevent re-entry in safe_delay if (stat) { // Media Inserted safe_delay(500); // Some boards need a delay to get settled // Try to mount the media (only later with SD_IGNORE_AT_STARTUP) if (TERN1(SD_IGNORE_AT_STARTUP, old_stat != 2)) mount(); - if (!isMounted()) stat = 0; // Not mounted? + if (!isMounted()) { // Not mounted? + stat = 0; + #if HAS_SD_DETECT && DISABLED(SD_IGNORE_AT_STARTUP) + prev_stat = 0; + #endif + } TERN_(RESET_STEPPERS_ON_MEDIA_INSERT, reset_stepper_drivers()); // Workaround for Cheetah bug } else { - #if PIN_EXISTS(SD_DETECT) - release(); // Card is released - #endif + TERN_(HAS_SD_DETECT, release()); // Card is released } - ui.media_changed(old_stat, stat); // Update the UI + ui.media_changed(old_stat, stat); // Update the UI or flag an error if (!stat) return; // Exit if no media is present - TERN_(SDCARD_EEPROM_EMULATION, settings.first_load()); - - if (old_stat != 2) return; // First mount? + static bool did_first_insert = false; + if (did_first_insert) return; // Did a media insert already happen? + did_first_insert = true; // Definitely handling this media insert... DEBUG_ECHOLNPGM("First mount."); + // Load settings the first time media is inserted (not just during init) + TERN_(SDCARD_EEPROM_EMULATION, settings.first_load()); + + #if HAS_USB_FLASH_DRIVE + const millis_t ms = millis(); + DEBUG_ECHOLNPGM("USB mount waiting time = ", ms); + if (ms > 5000) return; // Too late to be considered "already inserted"? + #endif + bool do_auto = true; UNUSED(do_auto); // Check for PLR file. diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 483ab81395..d2f462c2a7 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -362,7 +362,7 @@ private: #if ENABLED(USB_FLASH_DRIVE_SUPPORT) #define IS_SD_INSERTED() DiskIODriver_USBFlash::isInserted() -#elif PIN_EXISTS(SD_DETECT) +#elif HAS_SD_DETECT #define IS_SD_INSERTED() (READ(SD_DETECT_PIN) == SD_DETECT_STATE) #else // No card detect line? Assume the card is inserted. diff --git a/README.md b/README.md index 3dba2df2b3..1361482807 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,16 @@ -# Marlin 3D Printer Firmware +

MarlinFirmware's logo

-![GitHub](https://img.shields.io/github/license/marlinfirmware/marlin.svg) -![GitHub contributors](https://img.shields.io/github/contributors/marlinfirmware/marlin.svg) -![GitHub Release Date](https://img.shields.io/github/release-date/marlinfirmware/marlin.svg) -[![Build Status](https://github.com/MarlinFirmware/Marlin/workflows/CI/badge.svg?branch=bugfix-2.0.x)](https://github.com/MarlinFirmware/Marlin/actions) +

Marlin 3D Printer Firmware

- +

+ GPL-V3.0 License + Contributors + Last Release Date + CI Status + GitHub Sponsors +
+ Follow MarlinFirmware on Twitter +

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! @@ -54,7 +59,7 @@ Marlin 2.0 introduces a layer of abstraction so that all the existing high-level ## Submitting Patches -Proposed patches should be submitted as a Pull Request against the ([bugfix-2.0.x](https://github.com/MarlinFirmware/Marlin/tree/bugfix-2.0.x)) branch. +Proposed patches should be submitted as a Pull Request against the ([bugfix-2.1.x](https://github.com/MarlinFirmware/Marlin/tree/bugfix-2.1.x)) branch. - This branch is for fixing bugs and integrating any new features for the duration of the Marlin 2.0.x life-cycle. - Follow the [Coding Standards](https://marlinfw.org/docs/development/coding_standards.html) to gain points with the maintainers. diff --git a/buildroot/bin/use_example_configs b/buildroot/bin/use_example_configs index 83c0f5485d..bfd4aa612f 100755 --- a/buildroot/bin/use_example_configs +++ b/buildroot/bin/use_example_configs @@ -1,8 +1,20 @@ #!/usr/bin/env bash +# +# use_example_configs [repo:]configpath +# +# Examples: +# use_example_configs Creality/CR-10/CrealityV1 +# use_example_configs release-2.0.9.4:Creality/CR-10/CrealityV1 +# +# If a configpath has spaces (or quotes) escape them or enquote the path +# + +CURR=$(git branch 2>/dev/null | grep ^* | sed 's/\* //g') +[[ $CURR == "bugfix-2.0.x" ]] && BRANCH=bugfix-2.0.x || BRANCH=bugfix-2.1.x IFS=: read -r PART1 PART2 <<< "$@" -[ -n "${PART2}" ] && { REPO="$PART1" ; RDIR="${PART2// /%20}" ; } \ - || { REPO=bugfix-2.0.x ; RDIR="${PART1// /%20}" ; } +[[ -n $PART2 ]] && { REPO="$PART1" ; RDIR="${PART2// /%20}" ; } \ + || { REPO=$BRANCH ; RDIR="${PART1// /%20}" ; } EXAMPLES="https://raw.githubusercontent.com/MarlinFirmware/Configurations/$REPO/config/examples" which curl >/dev/null && TOOL='curl -L -s -S -f -o wgot' @@ -12,6 +24,8 @@ restore_configs cd Marlin +echo "Fetching $RDIR configurations from $REPO..." + $TOOL "$EXAMPLES/$RDIR/Configuration.h" >/dev/null 2>&1 && mv wgot Configuration.h $TOOL "$EXAMPLES/$RDIR/Configuration_adv.h" >/dev/null 2>&1 && mv wgot Configuration_adv.h $TOOL "$EXAMPLES/$RDIR/_Bootscreen.h" >/dev/null 2>&1 && mv wgot _Bootscreen.h diff --git a/buildroot/share/PlatformIO/boards/marlin_STM32H743Vx.json b/buildroot/share/PlatformIO/boards/marlin_STM32H743Vx.json new file mode 100644 index 0000000000..3b8fa73060 --- /dev/null +++ b/buildroot/share/PlatformIO/boards/marlin_STM32H743Vx.json @@ -0,0 +1,61 @@ +{ + "build": { + "core": "stm32", + "cpu": "cortex-m7", + "extra_flags": "-DSTM32H7xx -DSTM32H743xx", + "f_cpu": "400000000L", + "mcu": "stm32h743vit6", + "product_line": "STM32H743xx", + "variant": "MARLIN_H743Vx" + }, + "connectivity": [ + "can", + "ethernet" + ], + "debug": { + "jlink_device": "STM32H743VI", + "openocd_target": "stm32h7x", + "svd_path": "STM32H7x3.svd", + "tools": { + "stlink": { + "server": { + "arguments": [ + "-f", + "scripts/interface/stlink.cfg", + "-c", + "transport select hla_swd", + "-f", + "scripts/target/stm32h7x.cfg", + "-c", + "reset_config none" + ], + "executable": "bin/openocd", + "package": "tool-openocd" + } + } + } + }, + "frameworks": [ + "arduino", + "stm32cube" + ], + "name": "STM32H743VI (1024k RAM. 2048k Flash)", + "upload": { + "disable_flushing": false, + "maximum_ram_size": 1048576, + "maximum_size": 2097152, + "protocol": "stlink", + "protocols": [ + "stlink", + "dfu", + "jlink", + "cmsis-dap" + ], + "offset_address": "0x8020000", + "require_upload_port": true, + "use_1200bps_touch": false, + "wait_for_upload_port": false + }, + "url": "https://www.st.com/en/microcontrollers-microprocessors/stm32h743vi.html", + "vendor": "ST" +} diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.h b/buildroot/share/PlatformIO/scripts/common-dependencies.h index 4aa97c41ad..da2d380a82 100644 --- a/buildroot/share/PlatformIO/scripts/common-dependencies.h +++ b/buildroot/share/PlatformIO/scripts/common-dependencies.h @@ -53,7 +53,7 @@ #if ENABLED(BACKLASH_GCODE) #define HAS_MENU_BACKLASH #endif - #if ENABLED(LEVEL_BED_CORNERS) + #if ENABLED(LCD_BED_TRAMMING) #define HAS_MENU_BED_CORNERS #endif #if ENABLED(CANCEL_OBJECTS) diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/PeripheralPins.c new file mode 100644 index 0000000000..49c4cbb87a --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/PeripheralPins.c @@ -0,0 +1,539 @@ +/* + ******************************************************************************* + * Copyright (c) 2020-2021, STMicroelectronics + * All rights reserved. + * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +/* + * Automatically generated from STM32H742V(G-I)Hx.xml, STM32H742V(G-I)Tx.xml + * STM32H743V(G-I)Hx.xml, STM32H743VGTx.xml + * STM32H743VITx.xml, STM32H750VBTx.xml + * STM32H753VIHx.xml, STM32H753VITx.xml + * CubeMX DB release 6.0.30 + */ +#if !defined(CUSTOM_PERIPHERAL_PINS) +#include "Arduino.h" +#include "PeripheralPins.h" + +/* ===== + * Notes: + * - The pins mentioned Px_y_ALTz are alternative possibilities which use other + * HW peripheral instances. You can use them the same way as any other "normal" + * pin (i.e. analogWrite(PA7_ALT1, 128);). + * + * - 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 +WEAK const PinMap PinMap_ADC[] = { + {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 16, 0)}, // ADC1_INP16 + {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 17, 0)}, // ADC1_INP17 + {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_INP14 + {PA_2_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC2_INP14 + {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_INP15 + {PA_3_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC2_INP15 + {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)}, // ADC1_INP18 + {PA_4_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)}, // ADC2_INP18 + {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 19, 0)}, // ADC1_INP19 + {PA_5_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 19, 0)}, // ADC2_INP19 + {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_INP3 + {PA_6_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_INP3 + {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_INP7 + {PA_7_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_INP7 + {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_INP9 + {PB_0_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC2_INP9 + {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_INP5 + {PB_1_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_INP5 + {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_INP10 + {PC_0_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_INP10 + {PC_0_ALT2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC3_INP10 + {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_INP11 + {PC_1_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_INP11 + {PC_1_ALT2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC3_INP11 + {PC_2_C, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC3_INP0 + {PC_3_C, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC3_INP1 + {PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_INP4 + {PC_4_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_INP4 + {PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_INP8 + {PC_5_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC2_INP8 + {NC, NP, 0} +}; +#endif + +//*** DAC *** + +#ifdef HAL_DAC_MODULE_ENABLED +WEAK const PinMap PinMap_DAC[] = { + {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC1_OUT1 + {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC1_OUT2 + {NC, NP, 0} +}; +#endif + +//*** I2C *** + +#ifdef HAL_I2C_MODULE_ENABLED +WEAK const PinMap PinMap_I2C_SDA[] = { + {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_7_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)}, + {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_9_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)}, + {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)}, + {PD_13, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_I2C_MODULE_ENABLED +WEAK 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_6_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)}, + {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_8_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)}, + {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PD_12, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)}, + {NC, NP, 0} +}; +#endif + +//*** TIM *** + +#ifdef HAL_TIM_MODULE_ENABLED +WEAK const PinMap PinMap_TIM[] = { + {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + {PA_0_ALT1, 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_ALT1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 + {PA_1_ALT2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 1)}, // TIM15_CH1N + {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 + {PA_2_ALT1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 + {PA_2_ALT2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 0)}, // TIM15_CH1 + {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + {PA_3_ALT1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 + {PA_3_ALT2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 2, 0)}, // TIM15_CH2 + {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + {PA_5_ALT1, 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_ALT1, 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_ALT1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + {PA_7_ALT2, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N + {PA_7_ALT3, 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_ALT1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + {PB_0_ALT2, 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_ALT1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + {PB_1_ALT2, 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_6_ALT1, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 1)}, // TIM16_CH1N + {PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 + {PB_7_ALT1, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 1)}, // TIM17_CH1N + {PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 + {PB_8_ALT1, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 0)}, // TIM16_CH1 + {PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + {PB_9_ALT1, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 0)}, // TIM17_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_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N + {PB_14_ALT2, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_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_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N + {PB_15_ALT2, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_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_ALT1, 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_ALT1, 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_ALT1, 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_ALT1, 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_4, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 1)}, // TIM15_CH1N + {PE_5, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 0)}, // TIM15_CH1 + {PE_6, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 2, 0)}, // TIM15_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 + {NC, NP, 0} +}; +#endif + +//*** UART *** + +#ifdef HAL_UART_MODULE_ENABLED +WEAK 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, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_LPUART)}, + {PA_9_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PA_12, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_UART4)}, + {PA_15, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)}, + {PB_4, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)}, + {PB_6, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART)}, + {PB_6_ALT1, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)}, + {PB_6_ALT2, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_9, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PB_13, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)}, + {PB_14, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)}, + {PC_6, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART6)}, + {PC_10, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PC_10_ALT1, 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_1, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {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)}, + {PE_1, UART8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)}, + {PE_8, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK 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_8, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)}, + {PA_10, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_LPUART)}, + {PA_10_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PA_11, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_UART4)}, + {PB_3, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)}, + {PB_5, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)}, + {PB_7, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART)}, + {PB_7_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_8, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PB_12, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)}, + {PB_15, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)}, + {PC_7, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART6)}, + {PC_11, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PC_11_ALT1, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PD_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {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)}, + {PE_0, UART8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)}, + {PE_7, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_RTS[] = { + {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_12, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_LPUART)}, + {PA_12_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PA_15, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PB_14, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PB_14_ALT1, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PC_8, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, + {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)}, + {PD_15, UART8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)}, + {PE_9, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_CTS[] = { + {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_11, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_LPUART)}, + {PA_11_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PB_15, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PC_9, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, + {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)}, + {PD_14, UART8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)}, + {PE_10, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)}, + {NC, NP, 0} +}; +#endif + +//*** SPI *** + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_MOSI[] = { + {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PA_7_ALT1, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)}, + {PB_2, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI3)}, + {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_5_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI3)}, + {PB_5_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)}, + {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_1, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_3_C, 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)}, + {PD_6, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI3)}, + {PD_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PE_6, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, + {PE_14, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_MISO[] = { + {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PA_6_ALT1, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)}, + {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_4_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PB_4_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)}, + {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_2_C, 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)}, + {PE_5, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, + {PE_13, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_SCLK[] = { + {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PA_5_ALT1, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)}, + {PA_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PA_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_3_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PB_3_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)}, + {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)}, + {PD_3, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PE_2, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, + {PE_12, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_SSEL[] = { + {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PA_4_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PA_4_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)}, + {PA_11, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PA_15_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PA_15_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI6)}, + {PB_4, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI2)}, + {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)}, + {PE_4, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, + {PE_11, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, + {NC, NP, 0} +}; +#endif + +//*** FDCAN *** + +#ifdef HAL_FDCAN_MODULE_ENABLED +WEAK const PinMap PinMap_CAN_RD[] = { + {PA_11, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)}, + {PB_5, FDCAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN2)}, + {PB_8, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)}, + {PB_12, FDCAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN2)}, + {PD_0, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_FDCAN_MODULE_ENABLED +WEAK const PinMap PinMap_CAN_TD[] = { + {PA_12, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)}, + {PB_6, FDCAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN2)}, + {PB_9, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)}, + {PB_13, FDCAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN2)}, + {PD_1, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)}, + {NC, NP, 0} +}; +#endif + +//*** ETHERNET *** + +#ifdef HAL_ETH_MODULE_ENABLED +WEAK 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 + {PA_1_ALT1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // 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 + {PA_7_ALT1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // 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_C, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD2 + {PC_3_C, 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 + {NC, NP, 0} +}; +#endif + +//*** QUADSPI *** + +#ifdef HAL_QSPI_MODULE_ENABLED +WEAK const PinMap PinMap_QUADSPI_DATA0[] = { + {PC_9, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK1_IO0 + {PD_11, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK1_IO0 + {PE_7, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_BK2_IO0 + {NC, NP, 0} +}; +#endif + +#ifdef HAL_QSPI_MODULE_ENABLED +WEAK const PinMap PinMap_QUADSPI_DATA1[] = { + {PC_10, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK1_IO1 + {PD_12, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK1_IO1 + {PE_8, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_BK2_IO1 + {NC, NP, 0} +}; +#endif + +#ifdef HAL_QSPI_MODULE_ENABLED +WEAK const PinMap PinMap_QUADSPI_DATA2[] = { + {PE_2, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK1_IO2 + {PE_9, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_BK2_IO2 + {NC, NP, 0} +}; +#endif + +#ifdef HAL_QSPI_MODULE_ENABLED +WEAK const PinMap PinMap_QUADSPI_DATA3[] = { + {PA_1, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK1_IO3 + {PD_13, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK1_IO3 + {PE_10, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_BK2_IO3 + {NC, NP, 0} +}; +#endif + +#ifdef HAL_QSPI_MODULE_ENABLED +WEAK const PinMap PinMap_QUADSPI_SCLK[] = { + {PB_2, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_CLK + {NC, NP, 0} +}; +#endif + +#ifdef HAL_QSPI_MODULE_ENABLED +WEAK const PinMap PinMap_QUADSPI_SSEL[] = { + {PB_6, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_BK1_NCS + {PB_10, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK1_NCS + {PC_11, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK2_NCS + {NC, NP, 0} +}; +#endif + +//*** USB *** + +#if defined(HAL_PCD_MODULE_ENABLED) || defined(HAL_HCD_MODULE_ENABLED) +WEAK const PinMap PinMap_USB_OTG_FS[] = { + {PA_8, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_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_OTG1_FS)}, // USB_OTG_FS_ID + {PA_11, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_FS)}, // USB_OTG_FS_DM + {PA_12, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_FS)}, // USB_OTG_FS_DP + {NC, NP, 0} +}; +#endif + +#if defined(HAL_PCD_MODULE_ENABLED) || defined(HAL_HCD_MODULE_ENABLED) +WEAK 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_OTG2_FS)}, // USB_OTG_HS_SOF + // {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF12_OTG2_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_OTG2_FS)}, // USB_OTG_HS_DM + {PB_15, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG2_FS)}, // USB_OTG_HS_DP +#else + {PA_3, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_D0 + {PA_5, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_CK + {PB_0, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_D1 + {PB_1, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_D2 + {PB_5, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_D7 + {PB_10, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_D3 + {PB_11, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_D4 + {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_D5 + {PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_D6 + {PC_0, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_STP + {PC_2_C, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_DIR + {PC_3_C, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_NXT +#endif /* USE_USB_HS_IN_FS */ + {NC, NP, 0} +}; +#endif + +//*** SD *** + +#ifdef HAL_SD_MODULE_ENABLED +WEAK const PinMap PinMap_SD[] = { + {PA_0, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_SDIO2)}, // SDMMC2_CMD + {PB_3, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_SDIO2)}, // SDMMC2_D2 + {PB_4, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_SDIO2)}, // SDMMC2_D3 + {PB_8, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF7_SDIO1)}, // SDMMC1_CKIN + {PB_8_ALT1, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO1)}, // SDMMC1_D4 + {PB_8_ALT2, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDIO2)}, // SDMMC2_D4 + {PB_9, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF7_SDIO1)}, // SDMMC1_CDIR + {PB_9_ALT1, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO1)}, // SDMMC1_D5 + {PB_9_ALT2, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDIO2)}, // SDMMC2_D5 + {PB_14, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_SDIO2)}, // SDMMC2_D0 + {PB_15, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_SDIO2)}, // SDMMC2_D1 + {PC_1, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_SDIO2)}, // SDMMC2_CK + {PC_6, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF8_SDIO1)}, // SDMMC1_D0DIR + {PC_6_ALT1, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO1)}, // SDMMC1_D6 + {PC_6_ALT2, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDIO2)}, // SDMMC2_D6 + {PC_7, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF8_SDIO1)}, // SDMMC1_D123DIR + {PC_7_ALT1, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO1)}, // SDMMC1_D7 + {PC_7_ALT2, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDIO2)}, // SDMMC2_D7 + {PC_8, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO1)}, // SDMMC1_D0 + {PC_9, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO1)}, // SDMMC1_D1 + {PC_10, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO1)}, // SDMMC1_D2 + {PC_11, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO1)}, // SDMMC1_D3 + {PC_12, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDIO1)}, // SDMMC1_CK + {PD_2, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDIO1)}, // SDMMC1_CMD + {PD_6, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF11_SDIO2)}, // SDMMC2_CK + {PD_7, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF11_SDIO2)}, // SDMMC2_CMD + {NC, NP, 0} +}; +#endif + +#endif /* !CUSTOM_PERIPHERAL_PINS */ diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/PinNamesVar.h new file mode 100644 index 0000000000..2128732a40 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/PinNamesVar.h @@ -0,0 +1,112 @@ +/* Dual pad pin name */ +PC_2_C = PC_2 | PDUAL, +PC_3_C = PC_3 | PDUAL, + +/* Alternate pin name */ +PA_0_ALT1 = PA_0 | ALT1, +PA_1_ALT1 = PA_1 | ALT1, +PA_1_ALT2 = PA_1 | ALT2, +PA_2_ALT1 = PA_2 | ALT1, +PA_2_ALT2 = PA_2 | ALT2, +PA_3_ALT1 = PA_3 | ALT1, +PA_3_ALT2 = PA_3 | ALT2, +PA_4_ALT1 = PA_4 | ALT1, +PA_4_ALT2 = PA_4 | ALT2, +PA_5_ALT1 = PA_5 | ALT1, +PA_6_ALT1 = PA_6 | ALT1, +PA_7_ALT1 = PA_7 | ALT1, +PA_7_ALT2 = PA_7 | ALT2, +PA_7_ALT3 = PA_7 | ALT3, +PA_9_ALT1 = PA_9 | ALT1, +PA_10_ALT1 = PA_10 | ALT1, +PA_11_ALT1 = PA_11 | ALT1, +PA_12_ALT1 = PA_12 | ALT1, +PA_15_ALT1 = PA_15 | ALT1, +PA_15_ALT2 = PA_15 | ALT2, +PB_0_ALT1 = PB_0 | ALT1, +PB_0_ALT2 = PB_0 | ALT2, +PB_1_ALT1 = PB_1 | ALT1, +PB_1_ALT2 = PB_1 | ALT2, +PB_3_ALT1 = PB_3 | ALT1, +PB_3_ALT2 = PB_3 | ALT2, +PB_4_ALT1 = PB_4 | ALT1, +PB_4_ALT2 = PB_4 | ALT2, +PB_5_ALT1 = PB_5 | ALT1, +PB_5_ALT2 = PB_5 | ALT2, +PB_6_ALT1 = PB_6 | ALT1, +PB_6_ALT2 = PB_6 | ALT2, +PB_7_ALT1 = PB_7 | ALT1, +PB_8_ALT1 = PB_8 | ALT1, +PB_8_ALT2 = PB_8 | ALT2, +PB_9_ALT1 = PB_9 | ALT1, +PB_9_ALT2 = PB_9 | ALT2, +PB_14_ALT1 = PB_14 | ALT1, +PB_14_ALT2 = PB_14 | ALT2, +PB_15_ALT1 = PB_15 | ALT1, +PB_15_ALT2 = PB_15 | ALT2, +PC_0_ALT1 = PC_0 | ALT1, +PC_0_ALT2 = PC_0 | ALT2, +PC_1_ALT1 = PC_1 | ALT1, +PC_1_ALT2 = PC_1 | ALT2, +PC_4_ALT1 = PC_4 | ALT1, +PC_5_ALT1 = PC_5 | ALT1, +PC_6_ALT1 = PC_6 | ALT1, +PC_6_ALT2 = PC_6 | ALT2, +PC_7_ALT1 = PC_7 | ALT1, +PC_7_ALT2 = PC_7 | ALT2, +PC_8_ALT1 = PC_8 | ALT1, +PC_9_ALT1 = PC_9 | ALT1, +PC_10_ALT1 = PC_10 | ALT1, +PC_11_ALT1 = PC_11 | ALT1, + +/* SYS_WKUP */ +#ifdef PWR_WAKEUP_PIN1 + SYS_WKUP1 = PA_0, /* SYS_WKUP0 */ +#endif +#ifdef PWR_WAKEUP_PIN2 + SYS_WKUP2 = PA_2, /* SYS_WKUP1 */ +#endif +#ifdef PWR_WAKEUP_PIN3 + SYS_WKUP3 = PC_13, /* SYS_WKUP2 */ +#endif +#ifdef PWR_WAKEUP_PIN4 + SYS_WKUP4 = NC, +#endif +#ifdef PWR_WAKEUP_PIN5 + SYS_WKUP5 = NC, +#endif +#ifdef PWR_WAKEUP_PIN6 + SYS_WKUP6 = PC_1, /* SYS_WKUP5 */ +#endif +#ifdef PWR_WAKEUP_PIN7 + SYS_WKUP7 = NC, +#endif +#ifdef PWR_WAKEUP_PIN8 + SYS_WKUP8 = NC, +#endif + +/* USB */ +#ifdef USBCON + USB_OTG_FS_DM = PA_11, + USB_OTG_FS_DP = PA_12, + USB_OTG_FS_ID = PA_10, + USB_OTG_FS_SOF = PA_8, + USB_OTG_FS_VBUS = PA_9, + USB_OTG_HS_DM = PB_14, + USB_OTG_HS_DP = PB_15, + USB_OTG_HS_ID = PB_12, + USB_OTG_HS_SOF = PA_4, + USB_OTG_HS_ULPI_CK = PA_5, + USB_OTG_HS_ULPI_D0 = PA_3, + USB_OTG_HS_ULPI_D1 = PB_0, + USB_OTG_HS_ULPI_D2 = PB_1, + USB_OTG_HS_ULPI_D3 = PB_10, + USB_OTG_HS_ULPI_D4 = PB_11, + USB_OTG_HS_ULPI_D5 = PB_12, + USB_OTG_HS_ULPI_D6 = PB_13, + USB_OTG_HS_ULPI_D7 = PB_5, + USB_OTG_HS_ULPI_DIR = PC_2_C, + USB_OTG_HS_ULPI_NXT = PC_3_C, + USB_OTG_HS_ULPI_STP = PC_0, + USB_OTG_HS_VBUS = PB_13, +#endif diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/ldscript.ld new file mode 100644 index 0000000000..7d248a2682 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/ldscript.ld @@ -0,0 +1,208 @@ +/* +****************************************************************************** +** +** File : LinkerScript.ld +** +** Author : Auto-generated by STM32CubeIDE +** +** Abstract : Linker script for STM32H743VI Device from STM32H7 series +** 2048Kbytes FLASH +** 128Kbytes DTCMRAM +** 64Kbytes ITCMRAM +** 512Kbytes RAM_D1 +** 288Kbytes RAM_D2 +** 64Kbytes RAM_D3 +** +** 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) 2019 STMicroelectronics

+** +** 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. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x24080000; /* end of "RAM_D1" Ram type memory */ + +_Min_Heap_Size = 0x200; /* required amount of heap */ +_Min_Stack_Size = 0x400; /* required amount of stack */ + +/* Memories definition */ +MEMORY +{ + DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K + RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K + RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K + RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K + FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET +} + +/* Sections */ +SECTIONS +{ + /* The startup code into "FLASH" Rom type memory */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data into "FLASH" Rom type memory */ + .text : + { + . = 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 into "FLASH" Rom type memory */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { + . = ALIGN(4); + *(.ARM.extab* .gnu.linkonce.armextab.*) + . = ALIGN(4); + } >FLASH + + .ARM : { + . = ALIGN(4); + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + . = ALIGN(4); + } >FLASH + + .preinit_array : + { + . = ALIGN(4); + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + . = ALIGN(4); + } >FLASH + + .init_array : + { + . = ALIGN(4); + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + . = ALIGN(4); + } >FLASH + + .fini_array : + { + . = ALIGN(4); + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + . = ALIGN(4); + } >FLASH + + /* Used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections into "RAM_D1" Ram type memory */ + .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_D1 AT> FLASH + + /* Uninitialized data section into "RAM_D1" Ram type memory */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss section */ + _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_D1 + + /* User_heap_stack section, used to check that there is enough "RAM_D1" Ram type memory left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM_D1 + + /* Remove information from the compiler libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/variant_MARLIN_STM32H743VX.cpp b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/variant_MARLIN_STM32H743VX.cpp new file mode 100644 index 0000000000..7813f8860e --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/variant_MARLIN_STM32H743VX.cpp @@ -0,0 +1,245 @@ +/* + ******************************************************************************* + * Copyright (c) 2020-2021, STMicroelectronics + * All rights reserved. + * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#if defined(STM32H743xx) +#include "pins_arduino.h" + +// Digital PinName array +const PinName digitalPin[] = { + PA_0, // D0/A0 + PA_1, // D1/A1 + PA_2, // D2/A2 + PA_3, // D3/A3 + PA_4, // D4/A4 + PA_5, // D5/A5 + PA_6, // D6/A6 + PA_7, // D7/A7 + PA_8, // D8 + PA_9, // D9 + PA_10, // D10 + PA_11, // D11 + PA_12, // D12 + PA_13, // D13 + PA_14, // D14 + PA_15, // D15 + PB_0, // D16/A8 + PB_1, // D17/A9 + PB_2, // D18 + PB_3, // D19 + PB_4, // D20 + PB_5, // D21 + PB_6, // D22 + PB_7, // D23 + PB_8, // D24 + PB_9, // D25 + PB_10, // D26 + PB_11, // D27 + PB_12, // D28 + PB_13, // D29 + PB_14, // D30 + PB_15, // D31 + PC_0, // D32/A10 + PC_1, // D33/A11 + PC_4, // D34/A12 + PC_5, // D35/A13 + PC_6, // D36 + PC_7, // D37 + PC_8, // D38 + PC_9, // D39 + PC_10, // D40 + PC_11, // D41 + PC_12, // D42 + PC_13, // D43 + PC_14, // D44 + PC_15, // D45 + PD_0, // D46 + PD_1, // D47 + PD_2, // D48 + PD_3, // D49 + PD_4, // D50 + PD_5, // D51 + PD_6, // D52 + PD_7, // D53 + PD_8, // D54 + PD_9, // D55 + PD_10, // D56 + PD_11, // D57 + PD_12, // D58 + PD_13, // D59 + PD_14, // D60 + PD_15, // D61 + PE_0, // D62 + PE_1, // D63 + PE_2, // D64 + PE_3, // D65 + PE_4, // D66 + PE_5, // D67 + PE_6, // D68 + PE_7, // D69 + PE_8, // D70 + PE_9, // D71 + PE_10, // D72 + PE_11, // D73 + PE_12, // D74 + PE_13, // D75 + PE_14, // D76 + PE_15, // D77 + PH_0, // D78 + PH_1, // D79 + PC_2_C, // D80/A14 + PC_3_C // D81/A15 +}; + +// Analog (Ax) pin number array +const uint32_t analogInputPin[] = { + 0, // A0, PA0 + 1, // A1, PA1 + 2, // A2, PA2 + 3, // A3, PA3 + 4, // A4, PA4 + 5, // A5, PA5 + 6, // A6, PA6 + 7, // A7, PA7 + 16, // A8, PB0 + 17, // A9, PB1 + 32, // A10, PC0 + 33, // A11, PC1 + 34, // A12, PC4 + 35, // A13, PC5 + 80, // A14, PC2_C + 81 // A15, PC3_C +}; + +/* + * @brief System Clock Configuration + * @param None + * @retval None + */ +WEAK void SystemClock_Config(void) +{ + RCC_OscInitTypeDef RCC_OscInitStruct = {0}; + RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {}; + + /** Supply configuration update enable + */ + HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY); + /** Configure the main internal regulator output voltage + */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE0); + + while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {} + /** Initializes the RCC Oscillators according to the specified parameters + * in the RCC_OscInitTypeDef structure. + */ + 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 = 5; // 25Mhz / 5 = 5Mhz + RCC_OscInitStruct.PLL.PLLN = 192; // 25Mhz / 5 * 192 = 960Mhz + RCC_OscInitStruct.PLL.PLLP = 2; // 960Mhz / 2 = 480Mhz + RCC_OscInitStruct.PLL.PLLQ = 20; // 960Mhz / 20 = 48Mhz for USB + RCC_OscInitStruct.PLL.PLLR = 20; // unused + RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_2; + RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE; + RCC_OscInitStruct.PLL.PLLFRACN = 0; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) + { + Error_Handler(); + } + /** Initializes the CPU, AHB and APB buses clocks + */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK + |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2 + |RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV2; + RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2; + RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2; + RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2; + RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2; + + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK) + { + Error_Handler(); + } + + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB | RCC_PERIPHCLK_QSPI + | RCC_PERIPHCLK_SDMMC | RCC_PERIPHCLK_ADC + | RCC_PERIPHCLK_LPUART1 | RCC_PERIPHCLK_USART16 + | RCC_PERIPHCLK_USART234578 | RCC_PERIPHCLK_I2C123 + | RCC_PERIPHCLK_I2C4 | RCC_PERIPHCLK_SPI123 + | RCC_PERIPHCLK_SPI45 | RCC_PERIPHCLK_SPI6; + + /* PLL1 qclk used for USB 48 Mhz */ + /* PLL1 qclk also used for FMC, QUADSPI, SDMMC, RNG, SAI */ + /* PLL2 pclk is needed for adc max 80 Mhz (p,q,r same) */ + /* PLL2 pclk also used for LP timers 2,3,4,5, SPI 1,2,3 */ + /* PLL2 qclk is needed for uart, can, spi4,5,6 80 Mhz */ + /* PLL3 r clk is needed for i2c 80 Mhz (p,q,r same) */ + PeriphClkInitStruct.PLL2.PLL2M = 15; // M DIV 15 vco 25 / 15 ~ 1.667 Mhz + PeriphClkInitStruct.PLL2.PLL2N = 96; // N MUL 96 + PeriphClkInitStruct.PLL2.PLL2P = 2; // P div 2 + PeriphClkInitStruct.PLL2.PLL2Q = 2; // Q div 2 + PeriphClkInitStruct.PLL2.PLL2R = 2; // R div 2 + // RCC_PLL1VCIRANGE_0 Clock range frequency between 1 and 2 MHz + PeriphClkInitStruct.PLL2.PLL2RGE = RCC_PLL2VCIRANGE_0; + PeriphClkInitStruct.PLL2.PLL2VCOSEL = RCC_PLL2VCOMEDIUM; + PeriphClkInitStruct.PLL2.PLL2FRACN = 0; + PeriphClkInitStruct.PLL3.PLL3M = 15; // M DIV 15 vco 25 / 15 ~ 1.667 Mhz + PeriphClkInitStruct.PLL3.PLL3N = 96; // N MUL 96 + PeriphClkInitStruct.PLL3.PLL3P = 2; // P div 2 + PeriphClkInitStruct.PLL3.PLL3Q = 2; // Q div 2 + PeriphClkInitStruct.PLL3.PLL3R = 2; // R div 2 + // RCC_PLL1VCIRANGE_0 Clock range frequency between 1 and 2 MHz + PeriphClkInitStruct.PLL3.PLL3RGE = RCC_PLL3VCIRANGE_0; + PeriphClkInitStruct.PLL3.PLL3VCOSEL = RCC_PLL3VCOMEDIUM; + PeriphClkInitStruct.PLL3.PLL3FRACN = 0; + // ADC from PLL2 pclk + PeriphClkInitStruct.AdcClockSelection = RCC_ADCCLKSOURCE_PLL2; + // USB from PLL1 qclk + PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL; + // QSPI from PLL1 qclk + PeriphClkInitStruct.QspiClockSelection = RCC_QSPICLKSOURCE_PLL; + // SDMMC from PLL1 qclk + PeriphClkInitStruct.SdmmcClockSelection = 0; + //PeriphClkInitStruct.SdmmcClockSelection = RCC_SDMMCCLKSOURCE_PLL; + // LPUART from PLL2 qclk + PeriphClkInitStruct.Lpuart1ClockSelection = 0; + //PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PLL2; + // USART from PLL2 qclk + PeriphClkInitStruct.Usart16ClockSelection = RCC_USART16CLKSOURCE_PLL2; + // USART from PLL2 qclk + PeriphClkInitStruct.Usart234578ClockSelection = 0; + //PeriphClkInitStruct.Usart234578ClockSelection = RCC_USART234578CLKSOURCE_PLL2; + // I2C123 from PLL3 rclk + PeriphClkInitStruct.I2c123ClockSelection = RCC_I2C123CLKSOURCE_PLL3; + // I2C4 from PLL3 rclk + PeriphClkInitStruct.I2c4ClockSelection = 0; + //PeriphClkInitStruct.I2c4ClockSelection = RCC_I2C4CLKSOURCE_PLL3; + // SPI123 from PLL2 pclk + PeriphClkInitStruct.Spi123ClockSelection = RCC_SPI123CLKSOURCE_PLL2; + // SPI45 from PLL2 qclk + PeriphClkInitStruct.Spi45ClockSelection = 0; + //PeriphClkInitStruct.Spi45ClockSelection = RCC_SPI45CLKSOURCE_PLL2; + // SPI6 from PLL2 qclk + PeriphClkInitStruct.Spi6ClockSelection = 0; + //PeriphClkInitStruct.Spi6ClockSelection = RCC_SPI6CLKSOURCE_PLL2; + + if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) { + Error_Handler(); + } +} + +#endif /* ARDUINO_GENERIC_* */ diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/variant_MARLIN_STM32H743VX.h b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/variant_MARLIN_STM32H743VX.h new file mode 100644 index 0000000000..35cf65dee9 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/variant_MARLIN_STM32H743VX.h @@ -0,0 +1,268 @@ +/* + ******************************************************************************* + * Copyright (c) 2020-2021, STMicroelectronics + * All rights reserved. + * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#pragma once + +/*---------------------------------------------------------------------------- + * STM32 pins number + *----------------------------------------------------------------------------*/ +#define PA0 PIN_A0 +#define PA1 PIN_A1 +#define PA2 PIN_A2 +#define PA3 PIN_A3 +#define PA4 PIN_A4 +#define PA5 PIN_A5 +#define PA6 PIN_A6 +#define PA7 PIN_A7 +#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 PIN_A8 +#define PB1 PIN_A9 +#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 PIN_A10 +#define PC1 PIN_A11 +#define PC4 PIN_A12 +#define PC5 PIN_A13 +#define PC6 36 +#define PC7 37 +#define PC8 38 +#define PC9 39 +#define PC10 40 +#define PC11 41 +#define PC12 42 +#define PC13 43 +#define PC14 44 +#define PC15 45 +#define PD0 46 +#define PD1 47 +#define PD2 48 +#define PD3 49 +#define PD4 50 +#define PD5 51 +#define PD6 52 +#define PD7 53 +#define PD8 54 +#define PD9 55 +#define PD10 56 +#define PD11 57 +#define PD12 58 +#define PD13 59 +#define PD14 60 +#define PD15 61 +#define PE0 62 +#define PE1 63 +#define PE2 64 +#define PE3 65 +#define PE4 66 +#define PE5 67 +#define PE6 68 +#define PE7 69 +#define PE8 70 +#define PE9 71 +#define PE10 72 +#define PE11 73 +#define PE12 74 +#define PE13 75 +#define PE14 76 +#define PE15 77 +#define PH0 78 +#define PH1 79 +#define PC2_C PIN_A14 +#define PC3_C PIN_A15 +#define PC2 PC2_C +#define PC3 PC3_C + +// Alternate pins number +#define PA0_ALT1 (PA0 | ALT1) +#define PA1_ALT1 (PA1 | ALT1) +#define PA1_ALT2 (PA1 | ALT2) +#define PA2_ALT1 (PA2 | ALT1) +#define PA2_ALT2 (PA2 | ALT2) +#define PA3_ALT1 (PA3 | ALT1) +#define PA3_ALT2 (PA3 | ALT2) +#define PA4_ALT1 (PA4 | ALT1) +#define PA4_ALT2 (PA4 | ALT2) +#define PA5_ALT1 (PA5 | ALT1) +#define PA6_ALT1 (PA6 | ALT1) +#define PA7_ALT1 (PA7 | ALT1) +#define PA7_ALT2 (PA7 | ALT2) +#define PA7_ALT3 (PA7 | ALT3) +#define PA9_ALT1 (PA9 | ALT1) +#define PA10_ALT1 (PA10 | ALT1) +#define PA11_ALT1 (PA11 | ALT1) +#define PA12_ALT1 (PA12 | ALT1) +#define PA15_ALT1 (PA15 | ALT1) +#define PA15_ALT2 (PA15 | ALT2) +#define PB0_ALT1 (PB0 | ALT1) +#define PB0_ALT2 (PB0 | ALT2) +#define PB1_ALT1 (PB1 | ALT1) +#define PB1_ALT2 (PB1 | ALT2) +#define PB3_ALT1 (PB3 | ALT1) +#define PB3_ALT2 (PB3 | ALT2) +#define PB4_ALT1 (PB4 | ALT1) +#define PB4_ALT2 (PB4 | ALT2) +#define PB5_ALT1 (PB5 | ALT1) +#define PB5_ALT2 (PB5 | ALT2) +#define PB6_ALT1 (PB6 | ALT1) +#define PB6_ALT2 (PB6 | ALT2) +#define PB7_ALT1 (PB7 | ALT1) +#define PB8_ALT1 (PB8 | ALT1) +#define PB8_ALT2 (PB8 | ALT2) +#define PB9_ALT1 (PB9 | ALT1) +#define PB9_ALT2 (PB9 | ALT2) +#define PB14_ALT1 (PB14 | ALT1) +#define PB14_ALT2 (PB14 | ALT2) +#define PB15_ALT1 (PB15 | ALT1) +#define PB15_ALT2 (PB15 | ALT2) +#define PC0_ALT1 (PC0 | ALT1) +#define PC0_ALT2 (PC0 | ALT2) +#define PC1_ALT1 (PC1 | ALT1) +#define PC1_ALT2 (PC1 | ALT2) +#define PC4_ALT1 (PC4 | ALT1) +#define PC5_ALT1 (PC5 | ALT1) +#define PC6_ALT1 (PC6 | ALT1) +#define PC6_ALT2 (PC6 | ALT2) +#define PC7_ALT1 (PC7 | ALT1) +#define PC7_ALT2 (PC7 | ALT2) +#define PC8_ALT1 (PC8 | ALT1) +#define PC9_ALT1 (PC9 | ALT1) +#define PC10_ALT1 (PC10 | ALT1) +#define PC11_ALT1 (PC11 | ALT1) + +#define NUM_DIGITAL_PINS 82 +#define NUM_DUALPAD_PINS 2 +#define NUM_ANALOG_INPUTS 16 + +// On-board LED pin number +#ifndef LED_BUILTIN + #define LED_BUILTIN PNUM_NOT_DEFINED +#endif + +// On-board user button +#ifndef USER_BTN + #define USER_BTN PNUM_NOT_DEFINED +#endif + +// SPI definitions +#ifndef PIN_SPI_SS + #define PIN_SPI_SS PA4 +#endif +#ifndef PIN_SPI_SS1 + #define PIN_SPI_SS1 PA15 +#endif +#ifndef PIN_SPI_SS2 + #define PIN_SPI_SS2 PNUM_NOT_DEFINED +#endif +#ifndef PIN_SPI_SS3 + #define PIN_SPI_SS3 PNUM_NOT_DEFINED +#endif +#ifndef PIN_SPI_MOSI + #define PIN_SPI_MOSI PA7 +#endif +#ifndef PIN_SPI_MISO + #define PIN_SPI_MISO PA6 +#endif +#ifndef PIN_SPI_SCK + #define PIN_SPI_SCK PA5 +#endif + +// I2C definitions +#ifndef PIN_WIRE_SDA + #define PIN_WIRE_SDA PB7 +#endif +#ifndef PIN_WIRE_SCL + #define PIN_WIRE_SCL PB6 +#endif + +// Timer Definitions +// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin +#ifndef TIMER_TONE + #define TIMER_TONE TIM6 +#endif +#ifndef TIMER_SERVO + #define TIMER_SERVO TIM7 +#endif + +// UART Definitions +#ifndef SERIAL_UART_INSTANCE + #define SERIAL_UART_INSTANCE 4 +#endif + +// Default pin used for generic 'Serial' instance +// Mandatory for Firmata +#ifndef PIN_SERIAL_RX + #define PIN_SERIAL_RX PA1 +#endif +#ifndef PIN_SERIAL_TX + #define PIN_SERIAL_TX PA0 +#endif + +// Extra HAL modules +#if !defined(HAL_DAC_MODULE_DISABLED) + #define HAL_DAC_MODULE_ENABLED +#endif +#if !defined(HAL_ETH_MODULE_DISABLED) + #define HAL_ETH_MODULE_ENABLED +#endif +#if !defined(HAL_QSPI_MODULE_DISABLED) + #define HAL_QSPI_MODULE_ENABLED +#endif +#if !defined(HAL_SD_MODULE_DISABLED) + #define HAL_SD_MODULE_ENABLED +#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. + #ifndef SERIAL_PORT_MONITOR + #define SERIAL_PORT_MONITOR Serial + #endif + #ifndef SERIAL_PORT_HARDWARE + #define SERIAL_PORT_HARDWARE Serial + #endif +#endif diff --git a/buildroot/share/fonts/genpages.c b/buildroot/share/fonts/genpages.c index dea5b05c5c..8009e553fa 100644 --- a/buildroot/share/fonts/genpages.c +++ b/buildroot/share/fonts/genpages.c @@ -66,7 +66,7 @@ wchar_t get_val_utf82uni(uint8_t *pstart) { */ uint8_t* get_utf8_value(uint8_t *pstart, wchar_t *pval) { uint32_t val = 0; - uint8_t *p = pstart; + const uint8_t *p = pstart; /*size_t maxlen = strlen(pstart);*/ assert(NULL != pstart); diff --git a/buildroot/share/git/mfconfig b/buildroot/share/git/mfconfig index d3e0b67b3e..7092bc8220 100755 --- a/buildroot/share/git/mfconfig +++ b/buildroot/share/git/mfconfig @@ -34,8 +34,8 @@ COMMIT_STEPS=0 #cd "$CONFIGREPO" 2>/dev/null || { echo "Can't find Configurations repo!" ; exit 1; } ACTION=${1:-init} -IMPORT=${2:-"import-2.0.x"} -EXPORT=${3:-"bugfix-2.0.x"} +IMPORT=${2:-"import-2.1.x"} +EXPORT=${3:-"bugfix-2.1.x"} echo -n "Doing grhh ... " ; grhh ; echo @@ -52,7 +52,7 @@ if [[ $ACTION == "manual" ]]; then git checkout $IMPORT || exit # Reset from the latest complete state - #git reset --hard bugfix-2.0.x + #git reset --hard bugfix-2.1.x cp "$MARLINREPO/Marlin/"Configuration*.h "$CDEF/" #git add . && git commit -m "Changes from Marlin ($(date '+%Y-%m-%d %H:%M'))." diff --git a/buildroot/share/git/mffp b/buildroot/share/git/mffp index ab4dd4c0b7..6fe52d47e5 100755 --- a/buildroot/share/git/mffp +++ b/buildroot/share/git/mffp @@ -3,7 +3,7 @@ # mffp [1|2] [ref] # # Push the given commit (or HEAD) upstream immediately. -# By default: `git push upstream HEAD:bugfix-2.0.x` +# By default: `git push upstream HEAD:bugfix-2.1.x` # usage() { echo "usage: `basename $0` [1|2] [ref]" 1>&2 ; } diff --git a/buildroot/share/git/mfinfo b/buildroot/share/git/mfinfo index 0c2113d922..3f183b8fd8 100755 --- a/buildroot/share/git/mfinfo +++ b/buildroot/share/git/mfinfo @@ -7,13 +7,13 @@ # - Remote (upstream) Org name (MarlinFirmware) # - Remote (origin) Org name (your Github username) # - Repo Name (Marlin, MarlinDocumentation) -# - PR Target branch (e.g., bugfix-2.0.x) +# - PR Target branch (e.g., bugfix-2.1.x) # - Branch Arg (the branch argument or current branch) # - Current Branch # # Example output # > mfinfo -q ongoing -# MarlinFirmware john.doe Marlin bugfix-2.0.x ongoing bugfix-2.0.x -q +# MarlinFirmware john.doe Marlin bugfix-2.1.x ongoing bugfix-2.1.x -q # CURR=$(git branch 2>/dev/null | grep ^* | sed 's/\* //g') @@ -55,7 +55,7 @@ while [[ $# -gt 0 ]]; do done case "$REPO" in - Marlin ) TARG=bugfix-2.0.x ; ((INDEX == 1)) && TARG=bugfix-1.1.x ; [[ $BRANCH =~ ^[12]$ ]] && USAGE=1 ;; + Marlin ) TARG=bugfix-2.1.x ; ((INDEX == 1)) && TARG=bugfix-1.1.x ; [[ $BRANCH =~ ^[12]$ ]] && USAGE=1 ;; Configurations ) TARG=import-2.0.x ;; MarlinDocumentation ) TARG=master ;; AutoBuildMarlin ) TARG=master ;; diff --git a/buildroot/share/git/mfprep b/buildroot/share/git/mfprep index 7245126de1..0c9e54fe8d 100755 --- a/buildroot/share/git/mfprep +++ b/buildroot/share/git/mfprep @@ -2,11 +2,11 @@ # # mfprep tag1 [tag2] # -# Find commits in bugfix-2.0.x that are not yet in 2.0.x. +# Find commits in bugfix-2.1.x that are not yet in 2.0.x. # # Specify a version tag to start from, and optional version tag to end at. -# For bugfix-2.0.x the tag will be prefixed by bf- to distinguish it from the version tag, -# so at every release be sure to create a bf- tag and publish it to origin. +# For bugfix-2.1.x the tag will be prefixed by dev- to distinguish it from the version tag, +# so at every release be sure to create a dev- tag and publish it to origin. # SED=$(which gsed sed | head -n1) @@ -18,32 +18,33 @@ DRYRUN=0 TAG1=$1 TAG2=${2:-"HEAD"} +DEST=2.1.x + # Validate that the required tags exist -MTAG=`git tag | grep -e "^bf-$TAG1\$"` -[[ -n $MTAG ]] || { echo "Can't find tag bf-$TAG1" ; exit 1 ; } +MTAG=`git tag | grep -e "^dev-$TAG1\$"` +[[ -n "$MTAG" ]] || { echo "Can't find tag dev-$TAG1" ; exit 1 ; } MTAG=`git tag | grep -e "^$TAG1\$"` -[[ -n $MTAG ]] || { echo "Can't find tag $TAG1" ; exit 1 ; } +[[ -n "$MTAG" ]] || { echo "Can't find tag $TAG1" ; exit 1 ; } -# Generate log of recent commits for bugfix-2.0.x and 2.0.x +# Generate log of recent commits for bugfix-2.1.x and DEST TMPDIR=`mktemp -d` LOGB="$TMPDIR/log-bf.txt" -LOG2="$TMPDIR/log-20x.txt" +LOG2="$TMPDIR/log-2x.txt" TMPF="$TMPDIR/tmp.txt" -SCRF="$TMPDIR/update-20x.sh" +SCRF="$TMPDIR/update-$DEST.sh" -git checkout bugfix-2.0.x -git log --pretty="[%h] %s" bf-$TAG1..$TAG2 | grep -v '\[cron\]' | $SED '1!G;h;$!d' >"$LOGB" +git checkout bugfix-2.1.x +git log --pretty="[%h] %s" dev-$TAG1..$TAG2 | grep -v '\[cron\]' | $SED '1!G;h;$!d' >"$LOGB" -git checkout 2.0.x -git log --pretty="[%h] %s" $TAG1..$TAG2 | $SED '1!G;h;$!d' >"$LOG2" || { echo "Can't find tag bf-$TAG1" ; exit 1 ; } +git checkout $DEST +git log --pretty="[%h] %s" $TAG1..$TAG2 | $SED '1!G;h;$!d' >"$LOG2" || { echo "Can't find tag dev-$TAG1" ; exit 1 ; } -# Go through commit text from 2.0.x removing all matches from the bugfix log +# Go through commit text from DEST removing all matches from the bugfix log cat "$LOG2" | while read line; do - #echo "... $line" - if [[ $line =~ \(((#[0-9]{5}),* *)((#[0-9]{5}),* *)?((#[0-9]{5}),* *)?\)$ ]]; then + if [[ $line =~ \(((#[0-9]{5}),* *)((#[0-9]{5}),* *)?((#[0-9]{5}),* *)?((#[0-9]{5}),* *)?((#[0-9]{5}),* *)?((#[0-9]{5}),* *)?\)$ ]]; then PATT="" for i in ${!BASH_REMATCH[@]}; do if ((i > 0 && (i % 2 == 0))); then @@ -54,16 +55,16 @@ cat "$LOG2" | while read line; do fi done #echo "... $PATT" - [[ -n $PATT ]] && { grep -vE "$PATT" "$LOGB" >"$TMPF" ; cp "$TMPF" "$LOGB" ; } + [[ -n "$PATT" ]] && { grep -vE "$PATT" "$LOGB" >"$TMPF" ; cp "$TMPF" "$LOGB" ; } else PATT=$( $SED -E 's/^\[[0-9a-f]{10}\]( . )?(.+)$/\2/' <<<"$line" ) - [[ -n $PATT ]] && { grep -v "$PATT" "$LOGB" >"$TMPF" ; cp "$TMPF" "$LOGB" ; } + [[ -n "$PATT" ]] && { grep -v "$PATT" "$LOGB" >"$TMPF" ; cp "$TMPF" "$LOGB" ; } fi done # Convert remaining commits into git commands -echo -e "#!/usr/bin/env bash\nset -e\ngit checkout 2.0.x\n" >"$TMPF" +echo -e "#!/usr/bin/env bash\nset -e\ngit checkout ${DEST}\n" >"$TMPF" cat "$LOGB" | while read line; do if [[ $line =~ ^\[([0-9a-f]{10})\]\ *(.*)$ ]]; then CID=${BASH_REMATCH[1]} @@ -74,6 +75,6 @@ cat "$LOGB" | while read line; do fi done mv "$TMPF" "$SCRF" -chmod ug+x "$SCRF" +chmod +x "$SCRF" ((DRYRUN)) && rm -r "$TMPDIR" || open "$TMPDIR" diff --git a/buildroot/share/pixmaps/logo/marlin-outrun-nf-500.png b/buildroot/share/pixmaps/logo/marlin-outrun-nf-500.png new file mode 100644 index 0000000000..e36a3eb5c2 Binary files /dev/null and b/buildroot/share/pixmaps/logo/marlin-outrun-nf-500.png differ diff --git a/buildroot/share/scripts/g29_auto.py b/buildroot/share/scripts/g29_auto.py index ca36346dd9..5cf27b9968 100755 --- a/buildroot/share/scripts/g29_auto.py +++ b/buildroot/share/scripts/g29_auto.py @@ -1,13 +1,13 @@ #!/usr/bin/env python -# This file is for preprocessing gcode and the new G29 Autobedleveling from Marlin -# It will analyse the first 2 Layer and return the maximum size for this part -# After this it will replace with g29_keyword = ';MarlinG29Script' with the new G29 LRFB -# the new file will be created in the same folder. +# This file is for preprocessing G-code and the new G29 Auto bed leveling from Marlin +# It will analyze the first 2 layers and return the maximum size for this part +# Then it will be replaced with g29_keyword = ';MarlinG29Script' with the new G29 LRFB. +# The new file will be created in the same folder. from __future__ import print_function -# your gcode-file/folder +# Your G-code file/folder folder = './' my_file = 'test.gcode' diff --git a/buildroot/tests/BIGTREE_GTR_V1_0 b/buildroot/tests/BIGTREE_GTR_V1_0 index c9e15e9c2e..d6eccaff07 100755 --- a/buildroot/tests/BIGTREE_GTR_V1_0 +++ b/buildroot/tests/BIGTREE_GTR_V1_0 @@ -37,7 +37,8 @@ opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 SERIAL_PORT -1 \ MPC_BLOCK_HEAT_CAPACITY '{ 16.7f, 16.7f, 16.7f }' \ MPC_SENSOR_RESPONSIVENESS '{ 0.22f, 0.22f, 0.22f }' \ MPC_AMBIENT_XFER_COEFF '{ 0.068f, 0.068f, 0.068f }' \ - MPC_AMBIENT_XFER_COEFF_FAN255 '{ 0.097f, 0.097f, 0.097f }' + MPC_AMBIENT_XFER_COEFF_FAN255 '{ 0.097f, 0.097f, 0.097f }' \ + FILAMENT_HEAT_CAPACITY_PERMM '{ 5.6e-3f, 3.6e-3f, 5.6e-3f }' opt_enable SWITCHING_TOOLHEAD TOOL_SENSOR MPCTEMP MPC_EDIT_MENU MPC_AUTOTUNE_MENU opt_disable PIDTEMP exec_test $1 $2 "BigTreeTech GTR | MPC | Switching Toolhead | Tool Sensors" "$3" diff --git a/buildroot/tests/BIGTREE_GTR_V1_0_usb_flash_drive b/buildroot/tests/BIGTREE_GTR_V1_0_usb_flash_drive index 34bf77be27..78aec13295 100755 --- a/buildroot/tests/BIGTREE_GTR_V1_0_usb_flash_drive +++ b/buildroot/tests/BIGTREE_GTR_V1_0_usb_flash_drive @@ -10,7 +10,7 @@ restore_configs opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 SERIAL_PORT 3 \ EXTRUDERS 8 TEMP_SENSOR_1 1 TEMP_SENSOR_2 1 TEMP_SENSOR_3 1 TEMP_SENSOR_4 1 TEMP_SENSOR_5 1 TEMP_SENSOR_6 1 TEMP_SENSOR_7 1 opt_enable SDSUPPORT USB_FLASH_DRIVE_SUPPORT USE_OTG_USB_HOST \ - REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER BLTOUCH LEVEL_BED_CORNERS LEVEL_CORNERS_USE_PROBE \ + REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER BLTOUCH LCD_BED_TRAMMING BED_TRAMMING_USE_PROBE \ NEOPIXEL_LED Z_SAFE_HOMING FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE # Not necessary to enable auto-fan for all extruders to hit problematic code paths opt_set E0_AUTO_FAN_PIN PC10 E1_AUTO_FAN_PIN PC11 E2_AUTO_FAN_PIN PC12 NEOPIXEL_PIN PF13 \ diff --git a/buildroot/tests/BIGTREE_SKR_PRO b/buildroot/tests/BIGTREE_SKR_PRO index 2503b28544..2f1075c7ef 100755 --- a/buildroot/tests/BIGTREE_SKR_PRO +++ b/buildroot/tests/BIGTREE_SKR_PRO @@ -26,7 +26,7 @@ opt_set MOTHERBOARD BOARD_BTT_SKR_PRO_V1_1 SERIAL_PORT -1 \ CUTTER_POWER_UNIT PERCENT \ SPINDLE_LASER_PWM_PIN HEATER_1_PIN SPINDLE_LASER_ENA_PIN HEATER_2_PIN \ TEMP_SENSOR_COOLER 1000 TEMP_COOLER_PIN PD13 -opt_enable LASER_FEATURE REPRAP_DISCOUNT_SMART_CONTROLLER +opt_enable LASER_FEATURE LASER_SAFETY_TIMEOUT_MS REPRAP_DISCOUNT_SMART_CONTROLLER exec_test $1 $2 "BigTreeTech SKR Pro | Laser (Percent) | Cooling | LCD" "$3" # clean up diff --git a/buildroot/tests/LPC1769 b/buildroot/tests/LPC1769 index 3fe99734ca..086dffffc9 100755 --- a/buildroot/tests/LPC1769 +++ b/buildroot/tests/LPC1769 @@ -21,7 +21,7 @@ opt_set MOTHERBOARD BOARD_SMOOTHIEBOARD \ opt_enable TFTGLCD_PANEL_SPI SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \ MAX31865_SENSOR_OHMS_0 MAX31865_CALIBRATION_OHMS_0 \ FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ - BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET LEVEL_CORNERS_USE_PROBE LEVEL_CORNERS_VERIFY_RAISED \ + BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BED_TRAMMING_USE_PROBE BED_TRAMMING_VERIFY_RAISED \ PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \ LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA EMERGENCY_PARSER diff --git a/buildroot/tests/STM32F103RE_creality b/buildroot/tests/STM32F103RE_creality index a5d2899dd5..5e6d5f044a 100755 --- a/buildroot/tests/STM32F103RE_creality +++ b/buildroot/tests/STM32F103RE_creality @@ -18,9 +18,14 @@ opt_disable DWIN_CREALITY_LCD opt_enable DWIN_CREALITY_LCD_JYERSUI AUTO_BED_LEVELING_BILINEAR PROBE_MANUALLY exec_test $1 $2 "Ender 3 v2 with JyersUI" "$3" -use_example_configs "Creality/Ender-3 V2/CrealityV422/MarlinUI" -opt_add SDCARD_EEPROM_EMULATION AUTO_BED_LEVELING_BILINEAR Z_SAFE_HOMING -exec_test $1 $2 "Ender 3 v2 with MarlinUI" "$3" +use_example_configs "Creality/Ender-3 S1" +opt_disable DWIN_CREALITY_LCD Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN AUTO_BED_LEVELING_BILINEAR CONFIGURATION_EMBEDDING CANCEL_OBJECTS FWRETRACT +opt_enable DWIN_LCD_PROUI INDIVIDUAL_AXIS_HOMING_SUBMENU LCD_SET_PROGRESS_MANUALLY STATUS_MESSAGE_SCROLLING \ + SOUND_MENU_ITEM PRINTCOUNTER NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE FILAMENT_RUNOUT_SENSOR \ + BLTOUCH Z_SAFE_HOMING AUTO_BED_LEVELING_UBL MESH_EDIT_MENU \ + LIMITED_MAX_FR_EDITING LIMITED_MAX_ACCEL_EDITING LIMITED_JERK_EDITING BAUD_RATE_GCODE +opt_set PREHEAT_3_LABEL '"CUSTOM"' PREHEAT_3_TEMP_HOTEND 240 PREHEAT_3_TEMP_BED 60 PREHEAT_3_FAN_SPEED 128 +exec_test $1 $2 "Ender-3 S1 with ProUI" "$3" restore_configs opt_set MOTHERBOARD BOARD_CREALITY_V452 SERIAL_PORT 1 diff --git a/buildroot/tests/STM32F401RC_creality b/buildroot/tests/STM32F401RC_creality index c7cd464df0..380711d061 100755 --- a/buildroot/tests/STM32F401RC_creality +++ b/buildroot/tests/STM32F401RC_creality @@ -6,15 +6,10 @@ # exit on first failure set -e -use_example_configs "Creality/Ender-3 S1" -opt_disable DWIN_CREALITY_LCD Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN AUTO_BED_LEVELING_BILINEAR CONFIGURATION_EMBEDDING CANCEL_OBJECTS FWRETRACT -opt_enable DWIN_LCD_PROUI INDIVIDUAL_AXIS_HOMING_SUBMENU LCD_SET_PROGRESS_MANUALLY STATUS_MESSAGE_SCROLLING \ - SOUND_MENU_ITEM PRINTCOUNTER NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE FILAMENT_RUNOUT_SENSOR \ - BLTOUCH Z_SAFE_HOMING AUTO_BED_LEVELING_UBL MESH_EDIT_MENU \ - LIMITED_MAX_FR_EDITING LIMITED_MAX_ACCEL_EDITING LIMITED_JERK_EDITING BAUD_RATE_GCODE -opt_set MOTHERBOARD BOARD_CREALITY_V24S1_301F4 \ - PREHEAT_3_LABEL '"CUSTOM"' PREHEAT_3_TEMP_HOTEND 240 PREHEAT_3_TEMP_BED 60 PREHEAT_3_FAN_SPEED 128 -exec_test $1 $2 "Ender-3 S1 with ProUI" "$3" +use_example_configs "Creality/Ender-3 V2/CrealityV422/MarlinUI" +opt_add SDCARD_EEPROM_EMULATION AUTO_BED_LEVELING_BILINEAR Z_SAFE_HOMING +opt_set MOTHERBOARD BOARD_CREALITY_V24S1_301F4 +exec_test $1 $2 "Ender 3 v2 with MarlinUI" "$3" # clean up restore_configs diff --git a/buildroot/tests/mega2560 b/buildroot/tests/mega2560 index 3677abf60e..fc24cf2125 100755 --- a/buildroot/tests/mega2560 +++ b/buildroot/tests/mega2560 @@ -179,8 +179,8 @@ opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 0 LCD_LANGUAGE en TEMP_SENSOR_C DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \ MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \ AXIS_RELATIVE_MODES '{ false, false, false }' -opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT \ - LASER_FEATURE AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN LASER_COOLANT_FLOW_METER MEATPACK_ON_SERIAL_PORT_1 +opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT MEATPACK_ON_SERIAL_PORT_1 \ + LASER_FEATURE LASER_SAFETY_TIMEOUT_MS LASER_COOLANT_FLOW_METER AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN exec_test $1 $2 "MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Flowmeter | 12864 LCD | meatpack | SERIAL_PORT_2 " "$3" # @@ -193,8 +193,8 @@ opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 0 LCD_LANGUAGE en TEMP_SENSOR_C DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \ MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \ AXIS_RELATIVE_MODES '{ false, false, false }' -opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT PRINTCOUNTER \ - LASER_FEATURE AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN LASER_COOLANT_FLOW_METER I2C_AMMETER +opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT PRINTCOUNTER I2C_AMMETER \ + LASER_FEATURE LASER_SAFETY_TIMEOUT_MS LASER_COOLANT_FLOW_METER AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN exec_test $1 $2 "MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Flowmeter | 44780 LCD " "$3" # diff --git a/buildroot/tests/rambo b/buildroot/tests/rambo index f8fef704f1..167f6d89aa 100755 --- a/buildroot/tests/rambo +++ b/buildroot/tests/rambo @@ -24,7 +24,7 @@ opt_enable USE_ZMAX_PLUG REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_P BLINKM PCA9533 PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \ NEOPIXEL_LED NEOPIXEL_PIN CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CASE_LIGHT_MENU \ PID_PARAMS_PER_HOTEND PID_AUTOTUNE_MENU PID_EDIT_MENU LCD_SHOW_E_TOTAL \ - PRINTCOUNTER SERVICE_NAME_1 SERVICE_INTERVAL_1 LEVEL_BED_CORNERS LEVEL_CENTER_TOO \ + PRINTCOUNTER SERVICE_NAME_1 SERVICE_INTERVAL_1 LCD_BED_TRAMMING BED_TRAMMING_INCLUDE_CENTER \ NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR FILAMENT_RUNOUT_DISTANCE_MM \ ADVANCED_PAUSE_FEATURE FILAMENT_LOAD_UNLOAD_GCODES FILAMENT_UNLOAD_ALL_EXTRUDERS \ PASSWORD_FEATURE PASSWORD_ON_STARTUP PASSWORD_ON_SD_PRINT_MENU PASSWORD_AFTER_SD_PRINT_END PASSWORD_AFTER_SD_PRINT_ABORT \ @@ -51,13 +51,13 @@ opt_set MOTHERBOARD BOARD_RAMBO \ DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \ MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \ AXIS_RELATIVE_MODES '{ false, false, false }' \ - LEVEL_CORNERS_LEVELING_ORDER '{ LF, RF }' \ + BED_TRAMMING_LEVELING_ORDER '{ LF, RF }' \ X2_DRIVER_TYPE A4988 Y2_DRIVER_TYPE A4988 opt_enable USE_XMAX_PLUG USE_YMAX_PLUG USE_ZMAX_PLUG \ REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER REVERSE_ENCODER_DIRECTION SDSUPPORT EEPROM_SETTINGS \ S_CURVE_ACCELERATION X_DUAL_ENDSTOPS Y_DUAL_ENDSTOPS \ ADAPTIVE_STEP_SMOOTHING CNC_COORDINATE_SYSTEMS GCODE_MOTION_MODES \ - LEVEL_BED_CORNERS LEVEL_CENTER_TOO + LCD_BED_TRAMMING BED_TRAMMING_INCLUDE_CENTER opt_disable MIN_SOFTWARE_ENDSTOP_Z MAX_SOFTWARE_ENDSTOPS exec_test $1 $2 "Rambo CNC Configuration" "$3" diff --git a/config/README.md b/config/README.md index 4bd6ab851e..b19527ccc3 100644 --- a/config/README.md +++ b/config/README.md @@ -2,8 +2,8 @@ Marlin configurations for specific machines are now maintained in their own repository at: -## https://github.com/MarlinFirmware/Configurations/tree/bugfix-2.0.x +## https://github.com/MarlinFirmware/Configurations/tree/bugfix-2.1.x -Configuration files for use with the nightly `bugfix-2.0.x` branch can be downloaded from: +Configuration files for use with the nightly `bugfix-2.1.x` branch can be downloaded from: -## https://github.com/MarlinFirmware/Configurations/archive/bugfix-2.0.x.zip +## https://github.com/MarlinFirmware/Configurations/archive/bugfix-2.1.x.zip diff --git a/ini/features.ini b/ini/features.ini index e33c6fecf7..355544029e 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -32,6 +32,7 @@ LIB_INTERNAL_MAX31865 = src_filter=+ NEOPIXEL_LED = adafruit/Adafruit NeoPixel@~1.8.0 src_filter=+ I2C_AMMETER = peterus/INA226Lib@1.1.2 + src_filter=+ USES_LIQUIDCRYSTAL = LiquidCrystal=https://github.com/MarlinFirmware/New-LiquidCrystal/archive/1.5.1.zip USES_LIQUIDCRYSTAL_I2C = marcoschwartz/LiquidCrystal_I2C@1.1.4 USES_LIQUIDTWI2 = LiquidTWI2@1.2.7 diff --git a/ini/native.ini b/ini/native.ini index b34945397e..e860a55958 100644 --- a/ini/native.ini +++ b/ini/native.ini @@ -41,7 +41,7 @@ debug_build_flags = -fstack-protector-strong -g -g3 -ggdb lib_compat_mode = off build_src_filter = ${common.default_src_filter} + lib_deps = ${common.lib_deps} - MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/0.0.2.zip + MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/refs/heads/bugfix-2.0.x.zip Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/marlin_sim_native.zip LiquidCrystal=https://github.com/p3p/LiquidCrystal/archive/master.zip extra_scripts = ${common.extra_scripts} diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index 6bf6a1cb85..7493e3682c 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -138,6 +138,7 @@ upload_protocol = jlink # [STM32F103Rx_creality_xfer] extends = STM32F103Rx_creality +build_flags = ${STM32F103Rx_creality.build_flags} -DXFER_BUILD extra_scripts = ${STM32F103Rx_creality.extra_scripts} pre:buildroot/share/scripts/upload.py upload_protocol = custom diff --git a/ini/stm32g0.ini b/ini/stm32g0.ini index e6094c1e31..b6074d3af8 100644 --- a/ini/stm32g0.ini +++ b/ini/stm32g0.ini @@ -36,3 +36,13 @@ build_flags = ${stm32_variant.build_flags} -DSTEP_TIMER_IRQ_PRIO=0 upload_protocol = stlink debug_tool = stlink + +# +# Custom upload to SD via Marlin with Binary Protocol +# +[env:STM32G0B1RE_btt_xfer] +extends = env:STM32G0B1RE_btt +build_flags = ${env:STM32G0B1RE_btt.build_flags} -DXFER_BUILD +extra_scripts = ${env:STM32G0B1RE_btt.extra_scripts} + pre:buildroot/share/scripts/upload.py +upload_protocol = custom diff --git a/ini/stm32h7.ini b/ini/stm32h7.ini index b0cb10866c..c5d7d6299a 100644 --- a/ini/stm32h7.ini +++ b/ini/stm32h7.ini @@ -38,3 +38,24 @@ build_flags = ${stm32_variant.build_flags} ${stm_flash_drive.build_flags} -DHAL_SD_MODULE_ENABLED upload_protocol = cmsis-dap debug_tool = cmsis-dap + +# +# BigTreeTech SKR V3.0 / V3.0 EZ (STM32H743VIT6 ARM Cortex-M7) +# +[env:STM32H743Vx_btt] +extends = stm32_variant +platform = ststm32@~14.1.0 +platform_packages = framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32/archive/main.zip +board = marlin_STM32H743Vx +board_build.offset = 0x20000 +board_upload.offset_address = 0x08020000 +build_flags = ${stm32_variant.build_flags} + -DPIN_SERIAL1_RX=PA_10 -DPIN_SERIAL1_TX=PA_9 + -DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8 + -DPIN_SERIAL4_RX=PA_1 -DPIN_SERIAL4_TX=PA_0 + -DSERIAL_RX_BUFFER_SIZE=1024 -DSERIAL_TX_BUFFER_SIZE=1024 + -DTIMER_SERVO=TIM5 -DTIMER_TONE=TIM2 + -DSTEP_TIMER_IRQ_PRIO=0 + -DD_CACHE_DISABLED +upload_protocol = cmsis-dap +debug_tool = cmsis-dap diff --git a/platformio.ini b/platformio.ini index b9b8973899..becf79099d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -102,6 +102,7 @@ default_src_filter = + - - + - - - - + - - - - -